aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/IClientAPI.cs
diff options
context:
space:
mode:
authorlbsa712007-10-31 07:28:23 +0000
committerlbsa712007-10-31 07:28:23 +0000
commit064404ab409ddd0a3b25027a98582696295c46fd (patch)
treebd84ec2e23930f76e7cc81c8529ef71936c86dd9 /OpenSim/Framework/IClientAPI.cs
parentmade illogical bitwise operations logical (diff)
downloadopensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.zip
opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.gz
opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.bz2
opensim-SC_OLD-064404ab409ddd0a3b25027a98582696295c46fd.tar.xz
* Moved OpenSim/Framework/General to OpenSim/Framework for great justice.
Diffstat (limited to 'OpenSim/Framework/IClientAPI.cs')
-rw-r--r--OpenSim/Framework/IClientAPI.cs447
1 files changed, 447 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
new file mode 100644
index 0000000..4482ae6
--- /dev/null
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -0,0 +1,447 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Net;
31using libsecondlife;
32using libsecondlife.Packets;
33
34namespace OpenSim.Framework
35{
36 // Base Args Interface
37 public interface IEventArgs
38 {
39 IScene Scene { get; set; }
40
41 IClientAPI Sender { get; set; }
42 }
43
44 public delegate void ViewerEffectEventHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock);
45
46 public delegate void ChatFromViewer(Object sender, ChatFromViewerArgs e);
47
48 public enum ChatTypeEnum
49 {
50 Whisper = 0,
51 Say = 1,
52 Shout = 2,
53 Broadcast = 0xFF
54 } ;
55
56 /// <summary>
57 /// ChatFromViewer Arguments
58 /// </summary>
59 public class ChatFromViewerArgs : EventArgs, IEventArgs
60 {
61 protected string m_message;
62 protected ChatTypeEnum m_type;
63 protected int m_channel;
64 protected LLVector3 m_position;
65 protected string m_from;
66
67 protected IClientAPI m_sender;
68 protected IScene m_scene;
69
70 /// <summary>
71 /// The message sent by the user
72 /// </summary>
73 public string Message
74 {
75 get { return m_message; }
76 set { m_message = value; }
77 }
78
79 /// <summary>
80 /// The type of message, eg say, shout, broadcast.
81 /// </summary>
82 public ChatTypeEnum Type
83 {
84 get { return m_type; }
85 set { m_type = value; }
86 }
87
88 /// <summary>
89 /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero.
90 /// </summary>
91 public int Channel
92 {
93 get { return m_channel; }
94 set { m_channel = value; }
95 }
96
97 /// <summary>
98 /// The position of the sender at the time of the message broadcast.
99 /// </summary>
100 public LLVector3 Position
101 {
102 get { return m_position; }
103 set { m_position = value; }
104 }
105
106 /// <summary>
107 /// The name of the sender (needed for scripts)
108 /// </summary>
109 public string From
110 {
111 get { return m_from; }
112 set { m_from = value; }
113 }
114
115 /// <summary>
116 /// The client responsible for sending the message, or null.
117 /// </summary>
118 public IClientAPI Sender
119 {
120 get { return m_sender; }
121 set { m_sender = value; }
122 }
123
124 public IScene Scene
125 {
126 get { return m_scene; }
127 set { m_scene = value; }
128 }
129
130 public ChatFromViewerArgs()
131 {
132 m_position = new LLVector3();
133 }
134 }
135
136 public class TextureRequestArgs : EventArgs
137 {
138 protected LLUUID m_requestedAssetID;
139 private sbyte m_discardLevel;
140 private uint m_packetNumber;
141
142 public uint PacketNumber
143 {
144 get { return m_packetNumber; }
145 set { m_packetNumber = value; }
146 }
147
148 public sbyte DiscardLevel
149 {
150 get { return m_discardLevel; }
151 set { m_discardLevel = value; }
152 }
153
154 public LLUUID RequestedAssetID
155 {
156 get { return m_requestedAssetID; }
157 set { m_requestedAssetID = value; }
158 }
159 }
160
161 public delegate void TextureRequest(Object sender, TextureRequestArgs e);
162
163 public delegate void ImprovedInstantMessage(
164 LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp,
165 string fromAgentName, string message, byte dialog); // Cut down from full list
166 public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos);
167
168 public delegate void ModifyTerrain(
169 float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient);
170
171 public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
172
173 public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq);
174
175 public delegate void LinkObjects(uint parent, List<uint> children);
176
177 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY);
178
179 public delegate void TeleportLocationRequest(
180 IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
181
182 public delegate void DisconnectUser();
183
184 public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID);
185
186 public delegate void GenericCall(IClientAPI remoteClient);
187
188 public delegate void GenericCall2();
189
190 public delegate void GenericCall3(Packet packet);
191
192 // really don't want to be passing packets in these events, so this is very temporary.
193 public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
194
195 public delegate void GenericCall5(IClientAPI remoteClient, bool status);
196
197 public delegate void GenericCall6(LLUUID uid);
198
199 public delegate void GenericCall7(uint localID, string message);
200
201 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
202
203 public delegate void ObjectExtraParams(uint localID, ushort type, bool inUse, byte[] data);
204
205 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
206
207 public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient);
208
209 public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
210
211 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
212
213 public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
214
215 public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
216
217 public delegate void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
218
219 public delegate void UpdatePrimGroupRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient);
220
221 public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags);
222
223 public delegate void StatusChange(bool status);
224
225 public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
226
227 public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation);
228
229 public delegate void AgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset);
230
231 public delegate void AgentSit(IClientAPI remoteClient, LLUUID agentID);
232
233 public delegate void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 grapPos, IClientAPI remoteClient);
234
235 public delegate void ParcelPropertiesRequest(
236 int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
237
238 public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
239
240 public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
241
242 public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
243
244 public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client);
245
246 public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client);
247
248 public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client);
249
250 public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client);
251
252 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape);
253
254 public delegate void CreateInventoryFolder(
255 IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
256
257 public delegate void CreateNewInventoryItem(
258 IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name,
259 sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask);
260
261 public delegate void FetchInventoryDescendents(
262 IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
263
264 public delegate void FetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID);
265
266 public delegate void RequestTaskInventory(IClientAPI remoteClient, uint localID);
267
268 public delegate void UpdateInventoryItemTransaction(
269 IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID);
270
271 public delegate void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID);
272
273 public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID);
274
275 public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID);
276
277 public delegate void UDPAssetUploadRequest(
278 IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal);
279
280 public delegate void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data);
281
282 public delegate void RequestXfer(IClientAPI remoteClient, ulong xferID, string fileName);
283
284 public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
285
286 public interface IClientAPI
287 {
288 event ImprovedInstantMessage OnInstantMessage;
289 event ChatFromViewer OnChatFromViewer;
290 event TextureRequest OnRequestTexture;
291 event RezObject OnRezObject;
292 event ModifyTerrain OnModifyTerrain;
293 event SetAppearance OnSetAppearance;
294 event StartAnim OnStartAnim;
295 event LinkObjects OnLinkObjects;
296 event RequestMapBlocks OnRequestMapBlocks;
297 event TeleportLocationRequest OnTeleportLocationRequest;
298 event DisconnectUser OnDisconnectUser;
299 event RequestAvatarProperties OnRequestAvatarProperties;
300
301 event GenericCall4 OnDeRezObject;
302 event GenericCall OnRegionHandShakeReply;
303 event GenericCall OnRequestWearables;
304 event GenericCall2 OnCompleteMovementToRegion;
305 event UpdateAgent OnAgentUpdate;
306 event AgentRequestSit OnAgentRequestSit;
307 event AgentSit OnAgentSit;
308 event GenericCall OnRequestAvatarsData;
309 event AddNewPrim OnAddPrim;
310 event ObjectDuplicate OnObjectDuplicate;
311 event UpdateVector OnGrabObject;
312 event ObjectSelect OnDeGrabObject;
313 event MoveObject OnGrabUpdate;
314
315 event UpdateShape OnUpdatePrimShape;
316 event ObjectExtraParams OnUpdateExtraParams;
317 event ObjectSelect OnObjectSelect;
318 event ObjectDeselect OnObjectDeselect;
319 event GenericCall7 OnObjectDescription;
320 event GenericCall7 OnObjectName;
321 event UpdatePrimFlags OnUpdatePrimFlags;
322 event UpdatePrimTexture OnUpdatePrimTexture;
323 event UpdateVector OnUpdatePrimGroupPosition;
324 event UpdateVector OnUpdatePrimSinglePosition;
325 event UpdatePrimRotation OnUpdatePrimGroupRotation;
326 event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
327 event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
328 event UpdateVector OnUpdatePrimScale;
329 event StatusChange OnChildAgentStatus;
330 event GenericCall2 OnStopMovement;
331 event GenericCall6 OnRemoveAvatar;
332
333 event CreateNewInventoryItem OnCreateNewInventoryItem;
334 event CreateInventoryFolder OnCreateNewInventoryFolder;
335 event FetchInventoryDescendents OnFetchInventoryDescendents;
336 event FetchInventory OnFetchInventory;
337 event RequestTaskInventory OnRequestTaskInventory;
338 event UpdateInventoryItemTransaction OnUpdateInventoryItem;
339 event UDPAssetUploadRequest OnAssetUploadRequest;
340 event XferReceive OnXferReceive;
341 event RequestXfer OnRequestXfer;
342 event ConfirmXfer OnConfirmXfer;
343 event RezScript OnRezScript;
344 event UpdateTaskInventory OnUpdateTaskInventory;
345 event RemoveTaskInventory OnRemoveTaskItem;
346
347 event UUIDNameRequest OnNameFromUUIDRequest;
348
349 event ParcelPropertiesRequest OnParcelPropertiesRequest;
350 event ParcelDivideRequest OnParcelDivideRequest;
351 event ParcelJoinRequest OnParcelJoinRequest;
352 event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
353 event ParcelSelectObjects OnParcelSelectObjects;
354 event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
355 event EstateOwnerMessageRequest OnEstateOwnerMessage;
356
357 LLVector3 StartPos { get; set; }
358
359 LLUUID AgentId { get; }
360
361 LLUUID SessionId { get; }
362
363 string FirstName { get; }
364
365 string LastName { get; }
366
367 uint CircuitCode { get; set; }
368
369 void OutPacket(Packet newPack);
370 void SendWearables(AvatarWearable[] wearables);
371 void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry);
372 void SendStartPingCheck(byte seq);
373 void SendKillObject(ulong regionHandle, uint localID);
374 void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId);
375 void SendRegionHandshake(RegionInfo regionInfo);
376 void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
377 void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
378
379 void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
380 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp);
381
382 void SendLayerData(float[] map);
383 void SendLayerData(int px, int py, float[] map);
384 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
385 void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint);
386 AgentCircuitData RequestClientInfo();
387
388 void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint newRegionExternalEndPoint,
389 string capsURL);
390
391 void SendMapBlock(List<MapBlockData> mapBlocks);
392 void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags);
393
394 void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID,
395 uint flags, string capsURL);
396
397 void SendTeleportCancel();
398 void SendTeleportLocationStart();
399 void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance);
400
401 void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID,
402 LLVector3 Pos, byte[] textureEntry, uint parentID);
403
404 void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
405 LLVector3 velocity, LLQuaternion rotation);
406
407 void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations);
408
409 void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
410
411 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
412 LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text,
413 uint parentID, byte[] particleSystem, LLQuaternion rotation);
414
415 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
416 LLQuaternion rotation);
417
418 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items);
419 void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
420 void SendInventoryItemUpdate(InventoryItemBase Item);
421 void SendRemoveInventoryItem(LLUUID itemID);
422 void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName);
423 void SendXferPacket(ulong xferID, uint packet, byte[] data);
424
425 void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID);
426 void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags);
427
428 void SendNameReply(LLUUID profileId, string firstname, string lastname);
429 void SendAlertMessage(string message);
430 void SendAgentAlertMessage(string message, bool modal);
431 void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url);
432 bool AddMoney(int debit);
433
434 void SendViewerTime(int phase);
435
436 void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout,
437 uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID);
438
439 void SetDebug(int newDebug);
440 void InPacket(Packet NewPack);
441 void Close();
442 event ViewerEffectEventHandler OnViewerEffect;
443 event Action<IClientAPI> OnLogout;
444 event Action<IClientAPI> OnConnectionClosed;
445 void SendLogoutPacket();
446 }
447} \ No newline at end of file