diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmessage/llinstantmessage.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llmessage/llinstantmessage.h')
-rw-r--r-- | linden/indra/llmessage/llinstantmessage.h | 327 |
1 files changed, 327 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llinstantmessage.h b/linden/indra/llmessage/llinstantmessage.h new file mode 100644 index 0000000..a7074a2 --- /dev/null +++ b/linden/indra/llmessage/llinstantmessage.h | |||
@@ -0,0 +1,327 @@ | |||
1 | /** | ||
2 | * @file llinstantmessage.h | ||
3 | * @brief Constants and declarations used by instant messages. | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLINSTANTMESSAGE_H | ||
29 | #define LL_LLINSTANTMESSAGE_H | ||
30 | |||
31 | #include "llhost.h" | ||
32 | #include "lluuid.h" | ||
33 | #include "llsd.h" | ||
34 | #include "llmemory.h" | ||
35 | #include "v3math.h" | ||
36 | |||
37 | class LLMessageSystem; | ||
38 | |||
39 | // The ImprovedInstantMessage only supports 8 bits in the "Dialog" | ||
40 | // field, so don't go past the byte boundary | ||
41 | enum EInstantMessage | ||
42 | { | ||
43 | // default. ID is meaningless, nothing in the binary bucket. | ||
44 | IM_NOTHING_SPECIAL = 0, | ||
45 | |||
46 | // pops a messagebox with a single OK button | ||
47 | IM_MESSAGEBOX = 1, | ||
48 | |||
49 | // pops a countdown messagebox with a single OK button | ||
50 | // IM_MESSAGEBOX_COUNTDOWN = 2, | ||
51 | |||
52 | // You've been invited to join a group. | ||
53 | // ID is the group id. | ||
54 | |||
55 | // The binary bucket contains a null terminated string | ||
56 | // representation of the officer/member status and join cost for | ||
57 | // the invitee. (bug # 7672) The format is 1 byte for | ||
58 | // officer/member (O for officer, M for member), and as many bytes | ||
59 | // as necessary for cost. | ||
60 | IM_GROUP_INVITATION = 3, | ||
61 | |||
62 | // Inventory offer. | ||
63 | // ID is the transaction id | ||
64 | // Binary bucket is a list of inventory uuid and type. | ||
65 | IM_INVENTORY_OFFERED = 4, | ||
66 | IM_INVENTORY_ACCEPTED = 5, | ||
67 | IM_INVENTORY_DECLINED = 6, | ||
68 | |||
69 | // Group vote | ||
70 | // Name is name of person who called vote. | ||
71 | // ID is vote ID used for internal tracking | ||
72 | IM_GROUP_VOTE = 7, | ||
73 | |||
74 | // Group message | ||
75 | // This means that the message is meant for everyone in the | ||
76 | // agent's group. This will result in a database query to find all | ||
77 | // participants and start an im session. | ||
78 | IM_GROUP_MESSAGE_DEPRECATED = 8, | ||
79 | |||
80 | // Task inventory offer. | ||
81 | // ID is the transaction id | ||
82 | // Binary bucket is a (mostly) complete packed inventory item | ||
83 | IM_TASK_INVENTORY_OFFERED = 9, | ||
84 | IM_TASK_INVENTORY_ACCEPTED = 10, | ||
85 | IM_TASK_INVENTORY_DECLINED = 11, | ||
86 | |||
87 | // Copied as pending, type LL_NOTHING_SPECIAL, for new users | ||
88 | // used by offline tools | ||
89 | IM_NEW_USER_DEFAULT = 12, | ||
90 | |||
91 | // | ||
92 | // session based messaging - the way that people usually actually | ||
93 | // communicate with each other. | ||
94 | // | ||
95 | |||
96 | // Start a session, or add users to a session. | ||
97 | IM_SESSION_ADD = 13, | ||
98 | |||
99 | // Start a session, but don't prune offline users | ||
100 | IM_SESSION_OFFLINE_ADD = 14, | ||
101 | |||
102 | // start a session with your gruop | ||
103 | IM_SESSION_GROUP_START = 15, | ||
104 | |||
105 | // start a session without a calling card (finder or objects) | ||
106 | IM_SESSION_CARDLESS_START = 16, | ||
107 | |||
108 | // send a message to a session. | ||
109 | IM_SESSION_SEND = 17, | ||
110 | |||
111 | // leave a session | ||
112 | IM_SESSION_DROP = 18, | ||
113 | |||
114 | // an instant message from an object - for differentiation on the | ||
115 | // viewer, since you can't IM an object yet. | ||
116 | IM_FROM_TASK = 19, | ||
117 | |||
118 | // sent an IM to a busy user, this is the auto response | ||
119 | IM_BUSY_AUTO_RESPONSE = 20, | ||
120 | |||
121 | // Shows the message in the console and chat history | ||
122 | IM_CONSOLE_AND_CHAT_HISTORY = 21, | ||
123 | |||
124 | // IM Types used for luring your friends | ||
125 | IM_LURE_USER = 22, | ||
126 | IM_LURE_ACCEPTED = 23, | ||
127 | IM_LURE_DECLINED = 24, | ||
128 | IM_GODLIKE_LURE_USER = 25, | ||
129 | IM_YET_TO_BE_USED = 26, | ||
130 | |||
131 | // IM that notifie of a new group election. | ||
132 | // Name is name of person who called vote. | ||
133 | // ID is election ID used for internal tracking | ||
134 | IM_GROUP_ELECTION_DEPRECATED = 27, | ||
135 | |||
136 | // IM to tell the user to go to an URL. Put a text message in the | ||
137 | // message field, and put the url with a trailing \0 in the binary | ||
138 | // bucket. | ||
139 | IM_GOTO_URL = 28, | ||
140 | |||
141 | // IM for help from the GAURDIAN_ANGELS | ||
142 | // Binary bucket contains the name of the session. | ||
143 | IM_SESSION_911_START = 29, | ||
144 | |||
145 | // IM sent automatically on call for help, | ||
146 | // sends a lure to each Helper reached | ||
147 | IM_LURE_911 = 30, | ||
148 | |||
149 | // a message generated by a script which we don't want to | ||
150 | // be sent through e-mail. Similar to IM_FROM_TASK, but | ||
151 | // it is shown as an alert on the viewer. | ||
152 | IM_FROM_TASK_AS_ALERT = 31, | ||
153 | |||
154 | // IM from group officer to all group members. | ||
155 | IM_GROUP_NOTICE = 32, | ||
156 | IM_GROUP_NOTICE_INVENTORY_ACCEPTED = 33, | ||
157 | IM_GROUP_NOTICE_INVENTORY_DECLINED = 34, | ||
158 | |||
159 | IM_GROUP_INVITATION_ACCEPT = 35, | ||
160 | IM_GROUP_INVITATION_DECLINE = 36, | ||
161 | |||
162 | IM_GROUP_NOTICE_REQUESTED = 37, | ||
163 | |||
164 | IM_FRIENDSHIP_OFFERED = 38, | ||
165 | IM_FRIENDSHIP_ACCEPTED = 39, | ||
166 | IM_FRIENDSHIP_DECLINED = 40, | ||
167 | |||
168 | IM_TYPING_START = 41, | ||
169 | IM_TYPING_STOP = 42, | ||
170 | |||
171 | IM_COUNT | ||
172 | }; | ||
173 | |||
174 | |||
175 | // Hooks for quickly hacking in experimental admin debug messages | ||
176 | // without needing to recompile the viewer | ||
177 | // *NOTE: This functionality has been moved to be a string based | ||
178 | // operation so that we don't even have to do a full recompile. This | ||
179 | // enumeration will be phased out soon. | ||
180 | enum EGodlikeRequest | ||
181 | { | ||
182 | GOD_WANTS_NOTHING, | ||
183 | |||
184 | // for requesting physics information about an object | ||
185 | GOD_WANTS_HAVOK_INFO, | ||
186 | |||
187 | // two unused requests that can be appropriated for debug | ||
188 | // purposes (no viewer recompile necessary) | ||
189 | GOD_WANTS_FOO, | ||
190 | GOD_WANTS_BAR, | ||
191 | |||
192 | // to dump simulator terrain data to terrain.raw file | ||
193 | GOD_WANTS_TERRAIN_SAVE, | ||
194 | // to load simulator terrain data from terrain.raw file | ||
195 | GOD_WANTS_TERRAIN_LOAD, | ||
196 | |||
197 | GOD_WANTS_TOGGLE_AVATAR_GEOMETRY, // HACK for testing new avatar geom | ||
198 | |||
199 | // real-time telehub operations | ||
200 | GOD_WANTS_TELEHUB_INFO, | ||
201 | GOD_WANTS_CONNECT_TELEHUB, | ||
202 | GOD_WANTS_DELETE_TELEHUB, | ||
203 | GOD_WANTS_ADD_TELEHUB_SPAWNPOINT, | ||
204 | GOD_WANTS_REMOVE_TELEHUB_SPAWNPOINT, | ||
205 | |||
206 | }; | ||
207 | |||
208 | enum EIMSource | ||
209 | { | ||
210 | IM_FROM_VIEWER, | ||
211 | IM_FROM_DATASERVER, | ||
212 | IM_FROM_SIM | ||
213 | }; | ||
214 | |||
215 | extern const U8 IM_ONLINE; | ||
216 | extern const U8 IM_OFFLINE; | ||
217 | |||
218 | extern const S32 VOTE_YES; | ||
219 | extern const S32 VOTE_NO; | ||
220 | extern const S32 VOTE_ABSTAIN; | ||
221 | |||
222 | extern const S32 VOTE_MAJORITY; | ||
223 | extern const S32 VOTE_SUPER_MAJORITY; | ||
224 | extern const S32 VOTE_UNANIMOUS; | ||
225 | |||
226 | extern const char EMPTY_BINARY_BUCKET[]; | ||
227 | extern const S32 EMPTY_BINARY_BUCKET_SIZE; | ||
228 | |||
229 | extern const U32 NO_TIMESTAMP; | ||
230 | extern const char SYSTEM_FROM[]; | ||
231 | |||
232 | // Number of retry attempts on sending the im. | ||
233 | extern const S32 IM_TTL; | ||
234 | |||
235 | |||
236 | class LLIMInfo : public LLRefCount | ||
237 | { | ||
238 | protected: | ||
239 | LLIMInfo(); | ||
240 | ~LLIMInfo(); | ||
241 | |||
242 | public: | ||
243 | LLIMInfo(LLMessageSystem* msg, | ||
244 | EIMSource source = IM_FROM_SIM, | ||
245 | S32 ttl = IM_TTL); | ||
246 | |||
247 | LLIMInfo( | ||
248 | const LLUUID& from_id, | ||
249 | BOOL from_group, | ||
250 | const LLUUID& to_id, | ||
251 | EInstantMessage im_type, | ||
252 | const std::string& name, | ||
253 | const std::string& message, | ||
254 | const LLUUID& id, | ||
255 | U32 parent_estate_id, | ||
256 | const LLUUID& region_id, | ||
257 | const LLVector3& position, | ||
258 | LLSD data, | ||
259 | U8 offline, | ||
260 | U32 timestamp, | ||
261 | EIMSource source, | ||
262 | S32 ttl = IM_TTL); | ||
263 | |||
264 | void packInstantMessage(LLMessageSystem* msg) const; | ||
265 | void packMessageBlock(LLMessageSystem* msg) const; | ||
266 | void unpackMessageBlock(LLMessageSystem* msg); | ||
267 | LLPointer<LLIMInfo> clone(); | ||
268 | public: | ||
269 | LLUUID mFromID; | ||
270 | BOOL mFromGroup; | ||
271 | LLUUID mToID; | ||
272 | U32 mParentEstateID; | ||
273 | LLUUID mRegionID; | ||
274 | LLVector3 mPosition; | ||
275 | U8 mOffline; | ||
276 | bool mViewerThinksToIsOnline; | ||
277 | EInstantMessage mIMType; | ||
278 | LLUUID mID; | ||
279 | U32 mTimeStamp; | ||
280 | std::string mName; | ||
281 | std::string mMessage; | ||
282 | LLSD mData; | ||
283 | |||
284 | EIMSource mSource; | ||
285 | S32 mTTL; | ||
286 | }; | ||
287 | |||
288 | |||
289 | void pack_instant_message( | ||
290 | LLMessageSystem* msgsystem, | ||
291 | const LLUUID& from_id, | ||
292 | BOOL from_group, | ||
293 | const LLUUID& session_id, | ||
294 | const LLUUID& to_id, | ||
295 | const char* name, | ||
296 | const char* message, | ||
297 | U8 offline = IM_ONLINE, | ||
298 | EInstantMessage dialog = IM_NOTHING_SPECIAL, | ||
299 | const LLUUID& id = LLUUID::null, | ||
300 | U32 parent_estate_id = 0, | ||
301 | const LLUUID& region_id = LLUUID::null, | ||
302 | const LLVector3& position = LLVector3::zero, | ||
303 | U32 timestamp = NO_TIMESTAMP, | ||
304 | const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET, | ||
305 | S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE); | ||
306 | |||
307 | void pack_instant_message_block( | ||
308 | LLMessageSystem* msgsystem, | ||
309 | const LLUUID& from_id, | ||
310 | BOOL from_group, | ||
311 | const LLUUID& session_id, | ||
312 | const LLUUID& to_id, | ||
313 | const char* name, | ||
314 | const char* message, | ||
315 | U8 offline = IM_ONLINE, | ||
316 | EInstantMessage dialog = IM_NOTHING_SPECIAL, | ||
317 | const LLUUID& id = LLUUID::null, | ||
318 | U32 parent_estate_id = 0, | ||
319 | const LLUUID& region_id = LLUUID::null, | ||
320 | const LLVector3& position = LLVector3::zero, | ||
321 | U32 timestamp = NO_TIMESTAMP, | ||
322 | const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET, | ||
323 | S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE); | ||
324 | |||
325 | |||
326 | #endif // LL_LLINSTANTMESSAGE_H | ||
327 | |||