aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs3230
1 files changed, 1332 insertions, 1898 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index fe37a08..60dab5f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -58,526 +58,180 @@ namespace OpenSim.Region.ClientStack.LindenUDP
58 /// </summary> 58 /// </summary>
59 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector 59 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
60 { 60 {
61 // LLClientView Only
62 public delegate void BinaryGenericMessage(Object sender, string method, byte[][] args);
63
64 /// <summary>Used to adjust Sun Orbit values so Linden based viewers properly position sun</summary>
65 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f;
66
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 67 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
68 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
62 69
63 /* static variables */ 70 private readonly LLUDPServer m_udpServer;
64 public static SynchronizeClientHandler SynchronizeClient; 71 private readonly LLUDPClient m_udpClient;
65 /* private variables */
66 private readonly UUID m_sessionId; 72 private readonly UUID m_sessionId;
67 private readonly UUID m_secureSessionId = UUID.Zero; 73 private readonly UUID m_secureSessionId;
68 74 private readonly UUID m_agentId;
69 private int m_debugPacketLevel; 75 private readonly uint m_circuitCode;
76 private readonly byte[] m_channelVersion = Utils.EmptyBytes;
77 private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
78 private readonly IGroupsModule m_GroupsModule;
70 79
71 //private readonly IAssetCache m_assetCache;
72 private int m_cachedTextureSerial; 80 private int m_cachedTextureSerial;
73 private Timer m_clientPingTimer;
74
75 private Timer m_avatarTerseUpdateTimer; 81 private Timer m_avatarTerseUpdateTimer;
76 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); 82 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
77
78 private Timer m_primTerseUpdateTimer; 83 private Timer m_primTerseUpdateTimer;
79 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); 84 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
80 private Timer m_primFullUpdateTimer; 85 private Timer m_primFullUpdateTimer;
81 private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = 86 private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = new List<ObjectUpdatePacket.ObjectDataBlock>();
82 new List<ObjectUpdatePacket.ObjectDataBlock>();
83
84 private bool m_clientBlocked;
85
86 private int m_probesWithNoIngressPackets;
87
88 private readonly UUID m_agentId;
89 private readonly uint m_circuitCode;
90 private int m_moneyBalance; 87 private int m_moneyBalance;
91 private readonly ILLPacketHandler m_PacketHandler;
92
93 private int m_animationSequenceNumber = 1; 88 private int m_animationSequenceNumber = 1;
94
95 private readonly byte[] m_channelVersion = Utils.StringToBytes("OpenSimulator Server"); // Dummy value needed by libSL
96
97 private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
98
99 private bool m_SendLogoutPacketWhenClosing = true; 89 private bool m_SendLogoutPacketWhenClosing = true;
100 90 private AgentUpdateArgs lastarg;
101 private int m_inPacketsChecked; 91 private bool m_IsActive = true;
102
103 // Used to adjust Sun Orbit values so Linden based viewers properly position sun
104 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f;
105
106
107 /* protected variables */
108
109 protected static Dictionary<PacketType, PacketMethod> PacketHandlers =
110 new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
111 92
112 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); 93 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>();
113 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers 94 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
114
115 protected IScene m_scene; 95 protected IScene m_scene;
116
117 protected LLPacketServer m_networkServer;
118
119 protected LLImageManager m_imageManager; 96 protected LLImageManager m_imageManager;
120
121 /* public variables */
122 protected string m_firstName; 97 protected string m_firstName;
123 protected string m_lastName; 98 protected string m_lastName;
124 protected Thread m_clientThread; 99 protected Thread m_clientThread;
125 protected Vector3 m_startpos; 100 protected Vector3 m_startpos;
126 protected EndPoint m_userEndPoint; 101 protected EndPoint m_userEndPoint;
127 protected EndPoint m_proxyEndPoint;
128 protected UUID m_activeGroupID = UUID.Zero; 102 protected UUID m_activeGroupID = UUID.Zero;
129 protected string m_activeGroupName = String.Empty; 103 protected string m_activeGroupName = String.Empty;
130 protected ulong m_activeGroupPowers; 104 protected ulong m_activeGroupPowers;
131 protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); 105 protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>();
132 protected int m_avatarTerseUpdateRate = 50; 106 protected int m_terrainCheckerCount;
133 protected int m_avatarTerseUpdatesPerPacket = 5;
134 107
135 // LL uses these limits, apparently. Compressed terse would be 108 // LL uses these limits, apparently. Compressed terse would be 23, but we don't have that yet
136 // 23, but we don't have that yet
137 //
138 protected int m_primTerseUpdatesPerPacket = 10; 109 protected int m_primTerseUpdatesPerPacket = 10;
139 protected int m_primFullUpdatesPerPacket = 14; 110 protected int m_primFullUpdatesPerPacket = 14;
140
141 protected int m_primTerseUpdateRate = 10; 111 protected int m_primTerseUpdateRate = 10;
142 protected int m_primFullUpdateRate = 14; 112 protected int m_primFullUpdateRate = 14;
143
144 protected int m_textureSendLimit = 20; 113 protected int m_textureSendLimit = 20;
145 protected int m_textureDataLimit = 10; 114 protected int m_textureDataLimit = 10;
146 115 protected int m_avatarTerseUpdateRate = 50;
116 protected int m_avatarTerseUpdatesPerPacket = 5;
147 protected int m_packetMTU = 1400; 117 protected int m_packetMTU = 1400;
148
149 protected IAssetService m_assetService; 118 protected IAssetService m_assetService;
150 119
151 // LLClientView Only 120 #region Properties
152 public delegate void BinaryGenericMessage(Object sender, string method, byte[][] args);
153
154 /* Instantiated Designated Event Delegates */
155 //- used so we don't create new objects for each incoming packet and then toss it out later */
156
157 private GenericMessage handlerGenericMessage;
158 private RequestAvatarProperties handlerRequestAvatarProperties; //OnRequestAvatarProperties;
159 private UpdateAvatarProperties handlerUpdateAvatarProperties; // OnUpdateAvatarProperties;
160 private ChatMessage handlerChatFromClient; //OnChatFromClient;
161 private ChatMessage handlerChatFromClient2; //OnChatFromClient;
162 private ImprovedInstantMessage handlerInstantMessage; //OnInstantMessage;
163 private FriendActionDelegate handlerApproveFriendRequest; //OnApproveFriendRequest;
164 private FriendshipTermination handlerTerminateFriendship; //OnTerminateFriendship;
165 private RezObject handlerRezObject; //OnRezObject;
166 private DeRezObject handlerDeRezObject; //OnDeRezObject;
167 private ModifyTerrain handlerModifyTerrain;
168 private BakeTerrain handlerBakeTerrain;
169 private EstateChangeInfo handlerEstateChangeInfo;
170 private Action<IClientAPI> handlerRegionHandShakeReply; //OnRegionHandShakeReply;
171 private GenericCall2 handlerRequestWearables; //OnRequestWearables;
172 private Action<IClientAPI> handlerRequestAvatarsData; //OnRequestAvatarsData;
173 private SetAppearance handlerSetAppearance; //OnSetAppearance;
174 private AvatarNowWearing handlerAvatarNowWearing; //OnAvatarNowWearing;
175 private RezSingleAttachmentFromInv handlerRezSingleAttachment; //OnRezSingleAttachmentFromInv;
176 private RezMultipleAttachmentsFromInv handlerRezMultipleAttachments; //OnRezMultipleAttachmentsFromInv;
177 private UUIDNameRequest handlerDetachAttachmentIntoInv; // Detach attachment!
178 private ObjectAttach handlerObjectAttach; //OnObjectAttach;
179 private SetAlwaysRun handlerSetAlwaysRun; //OnSetAlwaysRun;
180 private GenericCall2 handlerCompleteMovementToRegion; //OnCompleteMovementToRegion;
181 private UpdateAgent handlerAgentUpdate; //OnAgentUpdate;
182 private StartAnim handlerStartAnim;
183 private StopAnim handlerStopAnim;
184 private AgentRequestSit handlerAgentRequestSit; //OnAgentRequestSit;
185 private AgentSit handlerAgentSit; //OnAgentSit;
186 private AvatarPickerRequest handlerAvatarPickerRequest; //OnAvatarPickerRequest;
187 private FetchInventory handlerAgentDataUpdateRequest; //OnAgentDataUpdateRequest;
188 private TeleportLocationRequest handlerSetStartLocationRequest; //OnSetStartLocationRequest;
189 private TeleportLandmarkRequest handlerTeleportLandmarkRequest; //OnTeleportLandmarkRequest;
190 private LinkObjects handlerLinkObjects; //OnLinkObjects;
191 private DelinkObjects handlerDelinkObjects; //OnDelinkObjects;
192 private AddNewPrim handlerAddPrim; //OnAddPrim;
193 private UpdateShape handlerUpdatePrimShape; //null;
194 private ObjectExtraParams handlerUpdateExtraParams; //OnUpdateExtraParams;
195 private ObjectDuplicate handlerObjectDuplicate;
196 private ObjectDuplicateOnRay handlerObjectDuplicateOnRay;
197 private ObjectRequest handlerObjectRequest;
198 private ObjectSelect handlerObjectSelect;
199 private ObjectDeselect handlerObjectDeselect;
200 private ObjectIncludeInSearch handlerObjectIncludeInSearch;
201 private UpdatePrimFlags handlerUpdatePrimFlags; //OnUpdatePrimFlags;
202 private UpdatePrimTexture handlerUpdatePrimTexture;
203 private GrabObject handlerGrabObject; //OnGrabObject;
204 private MoveObject handlerGrabUpdate; //OnGrabUpdate;
205 private DeGrabObject handlerDeGrabObject; //OnDeGrabObject;
206 private SpinStart handlerSpinStart; //OnSpinStart;
207 private SpinObject handlerSpinUpdate; //OnSpinUpdate;
208 private SpinStop handlerSpinStop; //OnSpinStop;
209 private GenericCall7 handlerObjectDescription;
210 private GenericCall7 handlerObjectName;
211 private GenericCall7 handlerObjectClickAction;
212 private GenericCall7 handlerObjectMaterial;
213 private ObjectPermissions handlerObjectPermissions;
214 private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily; //OnRequestObjectPropertiesFamily;
215 //private TextureRequest handlerTextureRequest;
216 private UDPAssetUploadRequest handlerAssetUploadRequest; //OnAssetUploadRequest;
217 private RequestXfer handlerRequestXfer; //OnRequestXfer;
218 private XferReceive handlerXferReceive; //OnXferReceive;
219 private ConfirmXfer handlerConfirmXfer; //OnConfirmXfer;
220 private AbortXfer handlerAbortXfer;
221 private CreateInventoryFolder handlerCreateInventoryFolder; //OnCreateNewInventoryFolder;
222 private UpdateInventoryFolder handlerUpdateInventoryFolder;
223 private MoveInventoryFolder handlerMoveInventoryFolder;
224 private CreateNewInventoryItem handlerCreateNewInventoryItem; //OnCreateNewInventoryItem;
225 private FetchInventory handlerFetchInventory;
226 private FetchInventoryDescendents handlerFetchInventoryDescendents; //OnFetchInventoryDescendents;
227 private PurgeInventoryDescendents handlerPurgeInventoryDescendents; //OnPurgeInventoryDescendents;
228 private UpdateInventoryItem handlerUpdateInventoryItem;
229 private CopyInventoryItem handlerCopyInventoryItem;
230 private MoveInventoryItem handlerMoveInventoryItem;
231 private RemoveInventoryItem handlerRemoveInventoryItem;
232 private RemoveInventoryFolder handlerRemoveInventoryFolder;
233 private RequestTaskInventory handlerRequestTaskInventory; //OnRequestTaskInventory;
234 private UpdateTaskInventory handlerUpdateTaskInventory; //OnUpdateTaskInventory;
235 private MoveTaskInventory handlerMoveTaskItem;
236 private RemoveTaskInventory handlerRemoveTaskItem; //OnRemoveTaskItem;
237 private RezScript handlerRezScript; //OnRezScript;
238 private RequestMapBlocks handlerRequestMapBlocks; //OnRequestMapBlocks;
239 private RequestMapName handlerMapNameRequest; //OnMapNameRequest;
240 private TeleportLocationRequest handlerTeleportLocationRequest; //OnTeleportLocationRequest;
241 private MoneyBalanceRequest handlerMoneyBalanceRequest; //OnMoneyBalanceRequest;
242 private UUIDNameRequest handlerNameRequest;
243 private ParcelAccessListRequest handlerParcelAccessListRequest; //OnParcelAccessListRequest;
244 private ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest; //OnParcelAccessListUpdateRequest;
245 private ParcelPropertiesRequest handlerParcelPropertiesRequest; //OnParcelPropertiesRequest;
246 private ParcelDivideRequest handlerParcelDivideRequest; //OnParcelDivideRequest;
247 private ParcelJoinRequest handlerParcelJoinRequest; //OnParcelJoinRequest;
248 private ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest; //OnParcelPropertiesUpdateRequest;
249 private ParcelSelectObjects handlerParcelSelectObjects; //OnParcelSelectObjects;
250 private ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest; //OnParcelObjectOwnerRequest;
251 private ParcelAbandonRequest handlerParcelAbandonRequest;
252 private ParcelGodForceOwner handlerParcelGodForceOwner;
253 private ParcelReclaim handlerParcelReclaim;
254 private RequestTerrain handlerRequestTerrain;
255 private RequestTerrain handlerUploadTerrain;
256 private ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest;
257 private RegionInfoRequest handlerRegionInfoRequest; //OnRegionInfoRequest;
258 private EstateCovenantRequest handlerEstateCovenantRequest; //OnEstateCovenantRequest;
259 private RequestGodlikePowers handlerReqGodlikePowers; //OnRequestGodlikePowers;
260 private GodKickUser handlerGodKickUser; //OnGodKickUser;
261 private ViewerEffectEventHandler handlerViewerEffect; //OnViewerEffect;
262 private Action<IClientAPI> handlerLogout; //OnLogout;
263 private MoneyTransferRequest handlerMoneyTransferRequest; //OnMoneyTransferRequest;
264 private ParcelBuy handlerParcelBuy;
265 private EconomyDataRequest handlerEconomoyDataRequest;
266
267 private UpdateVector handlerUpdatePrimSinglePosition; //OnUpdatePrimSinglePosition;
268 private UpdatePrimSingleRotation handlerUpdatePrimSingleRotation; //OnUpdatePrimSingleRotation;
269 private UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition; //OnUpdatePrimSingleRotation;
270 private UpdateVector handlerUpdatePrimScale; //OnUpdatePrimScale;
271 private UpdateVector handlerUpdatePrimGroupScale; //OnUpdateGroupScale;
272 private UpdateVector handlerUpdateVector; //OnUpdatePrimGroupPosition;
273 private UpdatePrimRotation handlerUpdatePrimRotation; //OnUpdatePrimGroupRotation;
274 // private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; //OnUpdatePrimGroupMouseRotation;
275 // private RequestAsset handlerRequestAsset; // OnRequestAsset;
276 private UUIDNameRequest handlerTeleportHomeRequest;
277
278 private RegionHandleRequest handlerRegionHandleRequest; // OnRegionHandleRequest
279 private ParcelInfoRequest handlerParcelInfoRequest; // OnParcelInfoRequest
280
281 private ScriptAnswer handlerScriptAnswer;
282 private RequestPayPrice handlerRequestPayPrice;
283 private ObjectSaleInfo handlerObjectSaleInfo;
284 private ObjectBuy handlerObjectBuy;
285 //private BuyObjectInventory handlerBuyObjectInventory;
286 private ObjectDeselect handlerObjectDetach;
287 private ObjectDrop handlerObjectDrop;
288 private AgentSit handlerOnUndo;
289
290 private ForceReleaseControls handlerForceReleaseControls;
291
292 private GodLandStatRequest handlerLandStatRequest;
293
294 private UUIDNameRequest handlerUUIDGroupNameRequest;
295
296 private ParcelDeedToGroup handlerParcelDeedToGroup;
297
298 private RequestObjectPropertiesFamily handlerObjectGroupRequest;
299 private ScriptReset handlerScriptReset;
300 private GetScriptRunning handlerGetScriptRunning;
301 private SetScriptRunning handlerSetScriptRunning;
302 private UpdateVector handlerAutoPilotGo;
303 //Gesture
304 private ActivateGesture handlerActivateGesture;
305 private DeactivateGesture handlerDeactivateGesture;
306 //Sound
307 private SoundTrigger handlerSoundTrigger;
308 private ObjectOwner handlerObjectOwner;
309
310 private DirPlacesQuery handlerDirPlacesQuery;
311 private DirFindQuery handlerDirFindQuery;
312 private DirLandQuery handlerDirLandQuery;
313 private DirPopularQuery handlerDirPopularQuery;
314 private DirClassifiedQuery handlerDirClassifiedQuery;
315 private ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime;
316
317 private MapItemRequest handlerMapItemRequest;
318
319 private StartLure handlerStartLure;
320 private TeleportLureRequest handlerTeleportLureRequest;
321
322 private NetworkStats handlerNetworkStatsUpdate;
323
324 private ClassifiedInfoRequest handlerClassifiedInfoRequest;
325 private ClassifiedInfoUpdate handlerClassifiedInfoUpdate;
326 private ClassifiedDelete handlerClassifiedDelete;
327 private ClassifiedDelete handlerClassifiedGodDelete;
328
329 private EventNotificationAddRequest handlerEventNotificationAddRequest;
330 private EventNotificationRemoveRequest handlerEventNotificationRemoveRequest;
331 private EventGodDelete handlerEventGodDelete;
332
333 private ParcelDwellRequest handlerParcelDwellRequest;
334
335 private UserInfoRequest handlerUserInfoRequest;
336 private UpdateUserInfo handlerUpdateUserInfo;
337
338 private RetrieveInstantMessages handlerRetrieveInstantMessages;
339
340 private PickDelete handlerPickDelete;
341 private PickGodDelete handlerPickGodDelete;
342 private PickInfoUpdate handlerPickInfoUpdate;
343 private AvatarNotesUpdate handlerAvatarNotesUpdate;
344
345 private MuteListRequest handlerMuteListRequest;
346
347 //private AvatarInterestUpdate handlerAvatarInterestUpdate;
348
349 private PlacesQuery handlerPlacesQuery;
350
351 private readonly IGroupsModule m_GroupsModule;
352
353 private AgentUpdateArgs lastarg = null;
354
355 //private TerrainUnacked handlerUnackedTerrain = null;
356
357 //**
358
359 /* Properties */
360
361 public UUID SecureSessionId
362 {
363 get { return m_secureSessionId; }
364 }
365
366 public IScene Scene
367 {
368 get { return m_scene; }
369 }
370
371 public UUID SessionId
372 {
373 get { return m_sessionId; }
374 }
375 121
122 public UUID SecureSessionId { get { return m_secureSessionId; } }
123 public IScene Scene { get { return m_scene; } }
124 public UUID SessionId { get { return m_sessionId; } }
376 public Vector3 StartPos 125 public Vector3 StartPos
377 { 126 {
378 get { return m_startpos; } 127 get { return m_startpos; }
379 set { m_startpos = value; } 128 set { m_startpos = value; }
380 } 129 }
381 130 public UUID AgentId { get { return m_agentId; } }
382 public UUID AgentId 131 public UUID ActiveGroupId { get { return m_activeGroupID; } }
383 { 132 public string ActiveGroupName { get { return m_activeGroupName; } }
384 get { return m_agentId; } 133 public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } }
385 } 134 public bool IsGroupMember(UUID groupID) { return m_groupPowers.ContainsKey(groupID); }
386
387 public UUID ActiveGroupId
388 {
389 get { return m_activeGroupID; }
390 }
391
392 public string ActiveGroupName
393 {
394 get { return m_activeGroupName; }
395 }
396
397 public ulong ActiveGroupPowers
398 {
399 get { return m_activeGroupPowers; }
400 }
401
402 public bool IsGroupMember(UUID groupID)
403 {
404 return m_groupPowers.ContainsKey(groupID);
405 }
406
407 public ulong GetGroupPowers(UUID groupID)
408 {
409 if (groupID == m_activeGroupID)
410 return m_activeGroupPowers;
411
412 if (m_groupPowers.ContainsKey(groupID))
413 return m_groupPowers[groupID];
414
415 return 0;
416 }
417
418 /// <summary>
419 /// This is a utility method used by single states to not duplicate kicks and blue card of death messages.
420 /// </summary>
421 public bool ChildAgentStatus()
422 {
423 return m_scene.PresenceChildStatus(AgentId);
424 }
425
426 /// <summary> 135 /// <summary>
427 /// First name of the agent/avatar represented by the client 136 /// First name of the agent/avatar represented by the client
428 /// </summary> 137 /// </summary>
429 public string FirstName 138 public string FirstName { get { return m_firstName; } }
430 {
431 get { return m_firstName; }
432 }
433
434 /// <summary> 139 /// <summary>
435 /// Last name of the agent/avatar represented by the client 140 /// Last name of the agent/avatar represented by the client
436 /// </summary> 141 /// </summary>
437 public string LastName 142 public string LastName { get { return m_lastName; } }
438 {
439 get { return m_lastName; }
440 }
441
442 /// <summary> 143 /// <summary>
443 /// Full name of the client (first name and last name) 144 /// Full name of the client (first name and last name)
444 /// </summary> 145 /// </summary>
445 public string Name 146 public string Name { get { return FirstName + " " + LastName; } }
446 { 147 public uint CircuitCode { get { return m_circuitCode; } }
447 get { return FirstName + " " + LastName; } 148 public int MoneyBalance { get { return m_moneyBalance; } }
448 } 149 public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } }
449
450 public uint CircuitCode
451 {
452 get { return m_circuitCode; }
453 }
454
455 public int MoneyBalance
456 {
457 get { return m_moneyBalance; }
458 }
459
460 public int NextAnimationSequenceNumber
461 {
462 get { return m_animationSequenceNumber++; }
463 }
464
465 public ILLPacketHandler PacketHandler
466 {
467 get { return m_PacketHandler; }
468 }
469
470 bool m_IsActive = true;
471
472 public bool IsActive 150 public bool IsActive
473 { 151 {
474 get { return m_IsActive; } 152 get { return m_IsActive; }
475 set { m_IsActive = value; } 153 set { m_IsActive = value; }
476 } 154 }
155 public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } }
477 156
478 public bool SendLogoutPacketWhenClosing 157 #endregion Properties
479 {
480 set { m_SendLogoutPacketWhenClosing = value; }
481 }
482
483 /* METHODS */
484 158
485 /// <summary> 159 /// <summary>
486 /// Constructor 160 /// Constructor
487 /// </summary> 161 /// </summary>
488 public LLClientView( 162 public LLClientView(EndPoint remoteEP, IScene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
489 EndPoint remoteEP, IScene scene, LLPacketServer packServer, 163 UUID agentId, UUID sessionId, uint circuitCode)
490 AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP,
491 ClientStackUserSettings userSettings)
492 { 164 {
493 // Should be called first? 165 RegisterInterface<IClientIM>(this);
494 RegisterInterfaces(); 166 RegisterInterface<IClientChat>(this);
495 167 RegisterInterface<IClientIPEndpoint>(this);
496 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 168
497 m_moneyBalance = 1000;
498
499 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion());
500
501 InitDefaultAnimations(); 169 InitDefaultAnimations();
502 170
503 m_scene = scene; 171 m_scene = scene;
504 //m_assetCache = assetCache;
505
506 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 172 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
507 173 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
508 m_networkServer = packServer; 174 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
509 175 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion());
510 m_agentId = agentId; 176 m_agentId = agentId;
511 m_sessionId = sessionId; 177 m_sessionId = sessionId;
178 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
512 m_circuitCode = circuitCode; 179 m_circuitCode = circuitCode;
513
514 m_userEndPoint = remoteEP; 180 m_userEndPoint = remoteEP;
515 m_proxyEndPoint = proxyEP;
516
517 m_firstName = sessionInfo.LoginInfo.First; 181 m_firstName = sessionInfo.LoginInfo.First;
518 m_lastName = sessionInfo.LoginInfo.Last; 182 m_lastName = sessionInfo.LoginInfo.Last;
519 m_startpos = sessionInfo.LoginInfo.StartPos; 183 m_startpos = sessionInfo.LoginInfo.StartPos;
184 m_moneyBalance = 1000;
520 185
521 if (sessionInfo.LoginInfo.SecureSession != UUID.Zero) 186 m_udpServer = udpServer;
522 { 187 m_udpClient = udpClient;
523 m_secureSessionId = sessionInfo.LoginInfo.SecureSession; 188 m_udpClient.OnQueueEmpty += HandleQueueEmpty;
524 } 189 m_udpClient.OnPacketStats += PopulateStats;
525
526 // While working on this, the BlockingQueue had me fooled for a bit.
527 // The Blocking queue causes the thread to stop until there's something
528 // in it to process. It's an on-purpose threadlock though because
529 // without it, the clientloop will suck up all sim resources.
530
531 m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings);
532 m_PacketHandler.SynchronizeClient = SynchronizeClient;
533 m_PacketHandler.OnPacketStats += PopulateStats;
534 m_PacketHandler.OnQueueEmpty += HandleQueueEmpty;
535
536 if (scene.Config != null)
537 {
538 IConfig clientConfig = scene.Config.Configs["LLClient"];
539 if (clientConfig != null)
540 {
541 m_PacketHandler.ReliableIsImportant =
542 clientConfig.GetBoolean("ReliableIsImportant",
543 false);
544 m_PacketHandler.MaxReliableResends = clientConfig.GetInt("MaxReliableResends",
545 m_PacketHandler.MaxReliableResends);
546 m_primTerseUpdatesPerPacket = clientConfig.GetInt("TerseUpdatesPerPacket",
547 m_primTerseUpdatesPerPacket);
548 m_primFullUpdatesPerPacket = clientConfig.GetInt("FullUpdatesPerPacket",
549 m_primFullUpdatesPerPacket);
550
551 m_primTerseUpdateRate = clientConfig.GetInt("TerseUpdateRate",
552 m_primTerseUpdateRate);
553 m_primFullUpdateRate = clientConfig.GetInt("FullUpdateRate",
554 m_primFullUpdateRate);
555
556 m_textureSendLimit = clientConfig.GetInt("TextureSendLimit",
557 m_textureSendLimit);
558
559 m_textureDataLimit = clientConfig.GetInt("TextureDataLimit",
560 m_textureDataLimit);
561
562 m_packetMTU = clientConfig.GetInt("PacketMTU", 1400);
563 }
564 }
565 190
566 RegisterLocalPacketHandlers(); 191 RegisterLocalPacketHandlers();
567 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
568 } 192 }
569 193
570 public void SetDebugPacketLevel(int newDebugPacketLevel) 194 public void SetDebugPacketLevel(int newDebug)
571 { 195 {
572 m_debugPacketLevel = newDebugPacketLevel;
573 } 196 }
574 197
575 # region Client Methods 198 #region Client Methods
576 199
577 private void CloseCleanup(bool shutdownCircuit) 200 /// <summary>
201 /// Close down the client view. This *must* be the last method called, since the last #
202 /// statement of CloseCleanup() aborts the thread.
203 /// </summary>
204 /// <param name="shutdownCircuit"></param>
205 public void Close(bool shutdownCircuit)
578 { 206 {
207 m_log.DebugFormat(
208 "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}",
209 shutdownCircuit, Name, m_scene.RegionInfo.RegionName);
579 210
580 211 if (m_imageManager != null)
212 m_imageManager.Close();
213
214 if (m_udpServer != null)
215 m_udpServer.Flush();
216
217 // raise an event on the packet server to Shutdown the circuit
218 // Now, if we raise the event then the packet server will call this method itself, so don't try cleanup
219 // here otherwise we'll end up calling it twice.
220 // FIXME: In truth, I might be wrong but this whole business of calling this method twice (with different args) looks
221 // horribly tangly. Hopefully it should be possible to greatly simplify it.
222 if (shutdownCircuit)
223 {
224 if (OnConnectionClosed != null)
225 OnConnectionClosed(this);
226 }
227 else
228 {
229 CloseCleanup(shutdownCircuit);
230 }
231 }
232
233 private void CloseCleanup(bool shutdownCircuit)
234 {
581 m_scene.RemoveClient(AgentId); 235 m_scene.RemoveClient(AgentId);
582 236
583 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 237 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
@@ -590,9 +244,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
590 Thread.Sleep(2000); 244 Thread.Sleep(2000);
591 245
592 // Shut down timers. Thread Context of this method is murky. Lock all timers 246 // Shut down timers. Thread Context of this method is murky. Lock all timers
593 if (m_clientPingTimer.Enabled)
594 lock (m_clientPingTimer)
595 m_clientPingTimer.Stop();
596 if (m_avatarTerseUpdateTimer.Enabled) 247 if (m_avatarTerseUpdateTimer.Enabled)
597 lock (m_avatarTerseUpdateTimer) 248 lock (m_avatarTerseUpdateTimer)
598 m_avatarTerseUpdateTimer.Stop(); 249 m_avatarTerseUpdateTimer.Stop();
@@ -625,43 +276,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
625 // of the client thread regardless of where Close() is called. 276 // of the client thread regardless of where Close() is called.
626 KillEndDone(); 277 KillEndDone();
627 } 278 }
628
629 Terminate();
630 }
631 279
632 /// <summary> 280 IsActive = false;
633 /// Close down the client view. This *must* be the last method called, since the last #
634 /// statement of CloseCleanup() aborts the thread.
635 /// </summary>
636 /// <param name="shutdownCircuit"></param>
637 public void Close(bool shutdownCircuit)
638 {
639 m_clientPingTimer.Enabled = false;
640 281
641 m_log.DebugFormat( 282 m_avatarTerseUpdateTimer.Close();
642 "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}", 283 m_primTerseUpdateTimer.Close();
643 shutdownCircuit, Name, m_scene.RegionInfo.RegionName); 284 m_primFullUpdateTimer.Close();
644 285
645 if (m_imageManager != null) 286 //m_udpServer.OnPacketStats -= PopulateStats;
646 m_imageManager.Close(); 287 m_udpClient.Shutdown();
647 288
648 if (m_PacketHandler != null) 289 // wait for thread stoped
649 m_PacketHandler.Flush(); 290 // m_clientThread.Join();
650 291
651 // raise an event on the packet server to Shutdown the circuit 292 // delete circuit code
652 // Now, if we raise the event then the packet server will call this method itself, so don't try cleanup 293 //m_networkServer.CloseClient(this);
653 // here otherwise we'll end up calling it twice.
654 // FIXME: In truth, I might be wrong but this whole business of calling this method twice (with different args) looks
655 // horribly tangly. Hopefully it should be possible to greatly simplify it.
656 if (shutdownCircuit)
657 {
658 if (OnConnectionClosed != null)
659 OnConnectionClosed(this);
660 }
661 else
662 {
663 CloseCleanup(shutdownCircuit);
664 }
665 } 294 }
666 295
667 public void Kick(string message) 296 public void Kick(string message)
@@ -683,10 +312,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
683 public void Stop() 312 public void Stop()
684 { 313 {
685 // Shut down timers. Thread Context is Murky, lock all timers! 314 // Shut down timers. Thread Context is Murky, lock all timers!
686 if (m_clientPingTimer.Enabled)
687 lock (m_clientPingTimer)
688 m_clientPingTimer.Stop();
689
690 if (m_avatarTerseUpdateTimer.Enabled) 315 if (m_avatarTerseUpdateTimer.Enabled)
691 lock (m_avatarTerseUpdateTimer) 316 lock (m_avatarTerseUpdateTimer)
692 m_avatarTerseUpdateTimer.Stop(); 317 m_avatarTerseUpdateTimer.Stop();
@@ -700,54 +325,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
700 m_primFullUpdateTimer.Stop(); 325 m_primFullUpdateTimer.Stop();
701 } 326 }
702 327
703 public void Restart() 328 #endregion Client Methods
704 {
705 // re-construct
706 m_PacketHandler.Clear();
707
708 m_clientPingTimer = new Timer(5000);
709 m_clientPingTimer.Elapsed += CheckClientConnectivity;
710 m_clientPingTimer.Enabled = true;
711
712 m_avatarTerseUpdateTimer = new Timer(m_avatarTerseUpdateRate);
713 m_avatarTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessAvatarTerseUpdates);
714 m_avatarTerseUpdateTimer.AutoReset = false;
715
716 m_primTerseUpdateTimer = new Timer(m_primTerseUpdateRate);
717 m_primTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimTerseUpdates);
718 m_primTerseUpdateTimer.AutoReset = false;
719
720 m_primFullUpdateTimer = new Timer(m_primFullUpdateRate);
721 m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates);
722 m_primFullUpdateTimer.AutoReset = false;
723 }
724
725 private void Terminate()
726 {
727 IsActive = false;
728
729 m_clientPingTimer.Close();
730 m_avatarTerseUpdateTimer.Close();
731 m_primTerseUpdateTimer.Close();
732 m_primFullUpdateTimer.Close();
733
734 m_PacketHandler.OnPacketStats -= PopulateStats;
735 m_PacketHandler.Dispose();
736
737 // wait for thread stoped
738 // m_clientThread.Join();
739
740 // delete circuit code
741 //m_networkServer.CloseClient(this);
742 }
743
744 #endregion
745 329
746 # region Packet Handling 330 #region Packet Handling
747 331
748 public void PopulateStats(int inPackets, int outPackets, int unAckedBytes) 332 public void PopulateStats(int inPackets, int outPackets, int unAckedBytes)
749 { 333 {
750 handlerNetworkStatsUpdate = OnNetworkStatsUpdate; 334 NetworkStats handlerNetworkStatsUpdate = OnNetworkStatsUpdate;
751 if (handlerNetworkStatsUpdate != null) 335 if (handlerNetworkStatsUpdate != null)
752 { 336 {
753 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes); 337 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes);
@@ -828,7 +412,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
828 return result; 412 return result;
829 } 413 }
830 414
831 protected void DebugPacket(string direction, Packet packet) 415 /*protected void DebugPacket(string direction, Packet packet)
832 { 416 {
833 string info; 417 string info;
834 418
@@ -854,88 +438,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
854 } 438 }
855 439
856 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info); 440 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
857 } 441 }*/
858 442
859 /// <summary> 443 #endregion Packet Handling
860 /// Main packet processing loop for the UDP component of the client session. Both incoming and outgoing
861 /// packets are processed here.
862 /// </summary>
863 protected virtual void ClientLoop()
864 {
865 m_log.DebugFormat(
866 "[CLIENT]: Entered main packet processing loop for {0} in {1}", Name, Scene.RegionInfo.RegionName);
867
868 while (IsActive)
869 {
870 LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue();
871
872 if (nextPacket == null) {
873 m_log.DebugFormat("[CLIENT]: PacketQueue return null LLQueItem");
874 continue;
875 }
876
877 if (nextPacket.Incoming)
878 {
879 if (m_debugPacketLevel > 0)
880 DebugPacket("IN", nextPacket.Packet);
881 m_PacketHandler.ProcessInPacket(nextPacket);
882 }
883 else
884 {
885 if (m_debugPacketLevel > 0)
886 DebugPacket("OUT", nextPacket.Packet);
887 m_PacketHandler.ProcessOutPacket(nextPacket);
888 }
889 }
890 }
891
892 # endregion
893
894 protected int m_terrainCheckerCount;
895
896 /// <summary>
897 /// Event handler for check client timer
898 /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings
899 /// in succession then close down the connection.
900 /// </summary>
901 /// <param name="sender"></param>
902 /// <param name="e"></param>
903 protected void CheckClientConnectivity(object sender, ElapsedEventArgs e)
904 {
905 if (m_PacketHandler.PacketsReceived == m_inPacketsChecked)
906 {
907 // no packet came in since the last time we checked...
908
909 m_probesWithNoIngressPackets++;
910 if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) // agent active
911 || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) // agent paused
912 {
913 m_clientPingTimer.Enabled = false;
914
915 m_log.WarnFormat(
916 "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection",
917 Name, AgentId);
918
919 if (OnConnectionClosed != null)
920 {
921 OnConnectionClosed(this);
922 }
923 }
924 else
925 {
926 // this will normally trigger at least one packet (ping response)
927 SendStartPingCheck(0);
928 }
929 }
930 else
931 {
932 // Something received in the meantime - we can reset the counters
933 m_probesWithNoIngressPackets = 0;
934 // ... and store the current number of packets received to find out if another one got in on the next cycle
935 m_inPacketsChecked = m_PacketHandler.PacketsReceived;
936 }
937
938 }
939 444
940 # region Setup 445 # region Setup
941 446
@@ -945,13 +450,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
945 /// </summary> 450 /// </summary>
946 protected virtual void InitNewClient() 451 protected virtual void InitNewClient()
947 { 452 {
948 //this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
949
950 // Ping the client regularly to check that it's still there
951 m_clientPingTimer = new Timer(5000);
952 m_clientPingTimer.Elapsed += CheckClientConnectivity;
953 m_clientPingTimer.Enabled = true;
954
955 m_avatarTerseUpdateTimer = new Timer(m_avatarTerseUpdateRate); 453 m_avatarTerseUpdateTimer = new Timer(m_avatarTerseUpdateRate);
956 m_avatarTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessAvatarTerseUpdates); 454 m_avatarTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessAvatarTerseUpdates);
957 m_avatarTerseUpdateTimer.AutoReset = false; 455 m_avatarTerseUpdateTimer.AutoReset = false;
@@ -971,27 +469,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
971 469
972 public virtual void Start() 470 public virtual void Start()
973 { 471 {
974 m_clientThread = new Thread(RunUserSession); 472 // This sets up all the timers
975 m_clientThread.Name = "ClientThread"; 473 InitNewClient();
976 m_clientThread.IsBackground = true;
977 m_clientThread.Start();
978 ThreadTracker.Add(m_clientThread);
979 } 474 }
980 475
981 /// <summary> 476 /// <summary>
982 /// Run a user session. This method lies at the base of the entire client thread. 477 /// Run a user session. This method lies at the base of the entire client thread.
983 /// </summary> 478 /// </summary>
984 protected virtual void RunUserSession() 479 protected void RunUserSession()
985 { 480 {
986 //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US)
987 //otherwise it will override this and use the system default
988 Culture.SetCurrentCulture();
989
990 try 481 try
991 { 482 {
992 // This sets up all the timers 483
993 InitNewClient();
994 ClientLoop();
995 } 484 }
996 catch (Exception e) 485 catch (Exception e)
997 { 486 {
@@ -1015,11 +504,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1015 + "Any further actions taken will not be processed.\n" 504 + "Any further actions taken will not be processed.\n"
1016 + "Please relog", true); 505 + "Please relog", true);
1017 506
1018 LLQueItem item = new LLQueItem(); 507 m_udpServer.SendPacket(m_agentId, packet, ThrottleOutPacketType.Unknown, false);
1019 item.Packet = packet;
1020 item.Sequence = packet.Header.Sequence;
1021
1022 m_PacketHandler.ProcessOutPacket(item);
1023 508
1024 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to 509 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to
1025 // listeners yet, though. 510 // listeners yet, though.
@@ -1037,7 +522,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1037 522
1038 # endregion 523 # endregion
1039 524
1040 // Previously ClientView.API partial class 525 #region Events
526
1041 public event GenericMessage OnGenericMessage; 527 public event GenericMessage OnGenericMessage;
1042 public event BinaryGenericMessage OnBinaryGenericMessage; 528 public event BinaryGenericMessage OnBinaryGenericMessage;
1043 public event Action<IClientAPI> OnLogout; 529 public event Action<IClientAPI> OnLogout;
@@ -1197,13 +683,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1197 public event GetScriptRunning OnGetScriptRunning; 683 public event GetScriptRunning OnGetScriptRunning;
1198 public event SetScriptRunning OnSetScriptRunning; 684 public event SetScriptRunning OnSetScriptRunning;
1199 public event UpdateVector OnAutoPilotGo; 685 public event UpdateVector OnAutoPilotGo;
1200
1201 public event TerrainUnacked OnUnackedTerrain; 686 public event TerrainUnacked OnUnackedTerrain;
1202
1203 public event ActivateGesture OnActivateGesture; 687 public event ActivateGesture OnActivateGesture;
1204 public event DeactivateGesture OnDeactivateGesture; 688 public event DeactivateGesture OnDeactivateGesture;
1205 public event ObjectOwner OnObjectOwner; 689 public event ObjectOwner OnObjectOwner;
1206
1207 public event DirPlacesQuery OnDirPlacesQuery; 690 public event DirPlacesQuery OnDirPlacesQuery;
1208 public event DirFindQuery OnDirFindQuery; 691 public event DirFindQuery OnDirFindQuery;
1209 public event DirLandQuery OnDirLandQuery; 692 public event DirLandQuery OnDirLandQuery;
@@ -1211,45 +694,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1211 public event DirClassifiedQuery OnDirClassifiedQuery; 694 public event DirClassifiedQuery OnDirClassifiedQuery;
1212 public event EventInfoRequest OnEventInfoRequest; 695 public event EventInfoRequest OnEventInfoRequest;
1213 public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime; 696 public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
1214
1215 public event MapItemRequest OnMapItemRequest; 697 public event MapItemRequest OnMapItemRequest;
1216
1217 public event OfferCallingCard OnOfferCallingCard; 698 public event OfferCallingCard OnOfferCallingCard;
1218 public event AcceptCallingCard OnAcceptCallingCard; 699 public event AcceptCallingCard OnAcceptCallingCard;
1219 public event DeclineCallingCard OnDeclineCallingCard; 700 public event DeclineCallingCard OnDeclineCallingCard;
1220 public event SoundTrigger OnSoundTrigger; 701 public event SoundTrigger OnSoundTrigger;
1221
1222 public event StartLure OnStartLure; 702 public event StartLure OnStartLure;
1223 public event TeleportLureRequest OnTeleportLureRequest; 703 public event TeleportLureRequest OnTeleportLureRequest;
1224 public event NetworkStats OnNetworkStatsUpdate; 704 public event NetworkStats OnNetworkStatsUpdate;
1225
1226 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 705 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
1227 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 706 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
1228 public event ClassifiedDelete OnClassifiedDelete; 707 public event ClassifiedDelete OnClassifiedDelete;
1229 public event ClassifiedDelete OnClassifiedGodDelete; 708 public event ClassifiedDelete OnClassifiedGodDelete;
1230
1231 public event EventNotificationAddRequest OnEventNotificationAddRequest; 709 public event EventNotificationAddRequest OnEventNotificationAddRequest;
1232 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 710 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
1233 public event EventGodDelete OnEventGodDelete; 711 public event EventGodDelete OnEventGodDelete;
1234
1235 public event ParcelDwellRequest OnParcelDwellRequest; 712 public event ParcelDwellRequest OnParcelDwellRequest;
1236
1237 public event UserInfoRequest OnUserInfoRequest; 713 public event UserInfoRequest OnUserInfoRequest;
1238 public event UpdateUserInfo OnUpdateUserInfo; 714 public event UpdateUserInfo OnUpdateUserInfo;
1239
1240 public event RetrieveInstantMessages OnRetrieveInstantMessages; 715 public event RetrieveInstantMessages OnRetrieveInstantMessages;
1241
1242 public event PickDelete OnPickDelete; 716 public event PickDelete OnPickDelete;
1243 public event PickGodDelete OnPickGodDelete; 717 public event PickGodDelete OnPickGodDelete;
1244 public event PickInfoUpdate OnPickInfoUpdate; 718 public event PickInfoUpdate OnPickInfoUpdate;
1245 public event AvatarNotesUpdate OnAvatarNotesUpdate; 719 public event AvatarNotesUpdate OnAvatarNotesUpdate;
1246
1247 public event MuteListRequest OnMuteListRequest; 720 public event MuteListRequest OnMuteListRequest;
1248 721 public event AvatarInterestUpdate OnAvatarInterestUpdate;
1249 //public event AvatarInterestUpdate OnAvatarInterestUpdate;
1250
1251 public event PlacesQuery OnPlacesQuery; 722 public event PlacesQuery OnPlacesQuery;
1252 723
724 #endregion Events
725
1253 public void ActivateGesture(UUID assetId, UUID gestureId) 726 public void ActivateGesture(UUID assetId, UUID gestureId)
1254 { 727 {
1255 } 728 }
@@ -1850,8 +1323,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1850 public void SendStartPingCheck(byte seq) 1323 public void SendStartPingCheck(byte seq)
1851 { 1324 {
1852 StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck); 1325 StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck);
1853 pc.PingID.PingID = seq;
1854 pc.Header.Reliable = false; 1326 pc.Header.Reliable = false;
1327
1328 OutgoingPacket oldestPacket = m_udpClient.NeedAcks.GetOldest();
1329
1330 pc.PingID.PingID = seq;
1331 pc.PingID.OldestUnacked = (oldestPacket != null) ? oldestPacket.SequenceNumber : 0;
1332
1855 OutPacket(pc, ThrottleOutPacketType.Unknown); 1333 OutPacket(pc, ThrottleOutPacketType.Unknown);
1856 } 1334 }
1857 1335
@@ -1927,12 +1405,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1927 descend.ItemData[i].AssetID = item.AssetID; 1405 descend.ItemData[i].AssetID = item.AssetID;
1928 descend.ItemData[i].CreatorID = item.CreatorIdAsUuid; 1406 descend.ItemData[i].CreatorID = item.CreatorIdAsUuid;
1929 descend.ItemData[i].BaseMask = item.BasePermissions; 1407 descend.ItemData[i].BaseMask = item.BasePermissions;
1930 descend.ItemData[i].Description = LLUtil.StringToPacketBytes(item.Description); 1408 descend.ItemData[i].Description = Util.StringToBytes256(item.Description);
1931 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions; 1409 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
1932 descend.ItemData[i].OwnerMask = item.CurrentPermissions; 1410 descend.ItemData[i].OwnerMask = item.CurrentPermissions;
1933 descend.ItemData[i].FolderID = item.Folder; 1411 descend.ItemData[i].FolderID = item.Folder;
1934 descend.ItemData[i].InvType = (sbyte)item.InvType; 1412 descend.ItemData[i].InvType = (sbyte)item.InvType;
1935 descend.ItemData[i].Name = LLUtil.StringToPacketBytes(item.Name); 1413 descend.ItemData[i].Name = Util.StringToBytes256(item.Name);
1936 descend.ItemData[i].NextOwnerMask = item.NextPermissions; 1414 descend.ItemData[i].NextOwnerMask = item.NextPermissions;
1937 descend.ItemData[i].OwnerID = item.Owner; 1415 descend.ItemData[i].OwnerID = item.Owner;
1938 descend.ItemData[i].Type = (sbyte)item.AssetType; 1416 descend.ItemData[i].Type = (sbyte)item.AssetType;
@@ -2013,7 +1491,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2013 { 1491 {
2014 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); 1492 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
2015 descend.FolderData[i].FolderID = folder.ID; 1493 descend.FolderData[i].FolderID = folder.ID;
2016 descend.FolderData[i].Name = LLUtil.StringToPacketBytes(folder.Name); 1494 descend.FolderData[i].Name = Util.StringToBytes256(folder.Name);
2017 descend.FolderData[i].ParentID = folder.ParentID; 1495 descend.FolderData[i].ParentID = folder.ParentID;
2018 descend.FolderData[i].Type = (sbyte)folder.Type; 1496 descend.FolderData[i].Type = (sbyte)folder.Type;
2019 1497
@@ -2128,11 +1606,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2128 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions; 1606 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
2129 inventoryReply.InventoryData[0].CreationDate = item.CreationDate; 1607 inventoryReply.InventoryData[0].CreationDate = item.CreationDate;
2130 1608
2131 inventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(item.Description); 1609 inventoryReply.InventoryData[0].Description = Util.StringToBytes256(item.Description);
2132 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions; 1610 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions;
2133 inventoryReply.InventoryData[0].FolderID = item.Folder; 1611 inventoryReply.InventoryData[0].FolderID = item.Folder;
2134 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType; 1612 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType;
2135 inventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(item.Name); 1613 inventoryReply.InventoryData[0].Name = Util.StringToBytes256(item.Name);
2136 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions; 1614 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions;
2137 inventoryReply.InventoryData[0].OwnerID = item.Owner; 1615 inventoryReply.InventoryData[0].OwnerID = item.Owner;
2138 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions; 1616 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions;
@@ -2257,7 +1735,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2257 folderBlock.FolderID = folder.ID; 1735 folderBlock.FolderID = folder.ID;
2258 folderBlock.ParentID = folder.ParentID; 1736 folderBlock.ParentID = folder.ParentID;
2259 folderBlock.Type = -1; 1737 folderBlock.Type = -1;
2260 folderBlock.Name = LLUtil.StringToPacketBytes(folder.Name); 1738 folderBlock.Name = Util.StringToBytes256(folder.Name);
2261 1739
2262 return folderBlock; 1740 return folderBlock;
2263 } 1741 }
@@ -2275,11 +1753,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2275 itemBlock.AssetID = item.AssetID; 1753 itemBlock.AssetID = item.AssetID;
2276 itemBlock.CreatorID = item.CreatorIdAsUuid; 1754 itemBlock.CreatorID = item.CreatorIdAsUuid;
2277 itemBlock.BaseMask = item.BasePermissions; 1755 itemBlock.BaseMask = item.BasePermissions;
2278 itemBlock.Description = LLUtil.StringToPacketBytes(item.Description); 1756 itemBlock.Description = Util.StringToBytes256(item.Description);
2279 itemBlock.EveryoneMask = item.EveryOnePermissions; 1757 itemBlock.EveryoneMask = item.EveryOnePermissions;
2280 itemBlock.FolderID = item.Folder; 1758 itemBlock.FolderID = item.Folder;
2281 itemBlock.InvType = (sbyte)item.InvType; 1759 itemBlock.InvType = (sbyte)item.InvType;
2282 itemBlock.Name = LLUtil.StringToPacketBytes(item.Name); 1760 itemBlock.Name = Util.StringToBytes256(item.Name);
2283 itemBlock.NextOwnerMask = item.NextPermissions; 1761 itemBlock.NextOwnerMask = item.NextPermissions;
2284 itemBlock.OwnerID = item.Owner; 1762 itemBlock.OwnerID = item.Owner;
2285 itemBlock.OwnerMask = item.CurrentPermissions; 1763 itemBlock.OwnerMask = item.CurrentPermissions;
@@ -2339,11 +1817,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2339 bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid; 1817 bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid;
2340 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions; 1818 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
2341 bulkUpdate.ItemData[0].CreationDate = item.CreationDate; 1819 bulkUpdate.ItemData[0].CreationDate = item.CreationDate;
2342 bulkUpdate.ItemData[0].Description = LLUtil.StringToPacketBytes(item.Description); 1820 bulkUpdate.ItemData[0].Description = Util.StringToBytes256(item.Description);
2343 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions; 1821 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions;
2344 bulkUpdate.ItemData[0].FolderID = item.Folder; 1822 bulkUpdate.ItemData[0].FolderID = item.Folder;
2345 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType; 1823 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType;
2346 bulkUpdate.ItemData[0].Name = LLUtil.StringToPacketBytes(item.Name); 1824 bulkUpdate.ItemData[0].Name = Util.StringToBytes256(item.Name);
2347 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions; 1825 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions;
2348 bulkUpdate.ItemData[0].OwnerID = item.Owner; 1826 bulkUpdate.ItemData[0].OwnerID = item.Owner;
2349 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions; 1827 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions;
@@ -2386,11 +1864,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2386 InventoryReply.InventoryData[0].AssetID = Item.AssetID; 1864 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
2387 InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid; 1865 InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid;
2388 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions; 1866 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
2389 InventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(Item.Description); 1867 InventoryReply.InventoryData[0].Description = Util.StringToBytes256(Item.Description);
2390 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions; 1868 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
2391 InventoryReply.InventoryData[0].FolderID = Item.Folder; 1869 InventoryReply.InventoryData[0].FolderID = Item.Folder;
2392 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType; 1870 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType;
2393 InventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(Item.Name); 1871 InventoryReply.InventoryData[0].Name = Util.StringToBytes256(Item.Name);
2394 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions; 1872 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions;
2395 InventoryReply.InventoryData[0].OwnerID = Item.Owner; 1873 InventoryReply.InventoryData[0].OwnerID = Item.Owner;
2396 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions; 1874 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions;
@@ -2557,7 +2035,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2557 /// <param name="message"></param> 2035 /// <param name="message"></param>
2558 /// <param name="modal"></param> 2036 /// <param name="modal"></param>
2559 /// <returns></returns> 2037 /// <returns></returns>
2560 protected AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) 2038 public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal)
2561 { 2039 {
2562 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); 2040 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage);
2563 alertPack.AgentData.AgentID = AgentId; 2041 alertPack.AgentData.AgentID = AgentId;
@@ -2768,7 +2246,953 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2768 OutPacket(avatarReply, ThrottleOutPacketType.Task); 2246 OutPacket(avatarReply, ThrottleOutPacketType.Task);
2769 } 2247 }
2770 2248
2771 #endregion 2249 /// <summary>
2250 /// Send the client an Estate message blue box pop-down with a single OK button
2251 /// </summary>
2252 /// <param name="FromAvatarID"></param>
2253 /// <param name="fromSessionID"></param>
2254 /// <param name="FromAvatarName"></param>
2255 /// <param name="Message"></param>
2256 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
2257 {
2258 if (!ChildAgentStatus())
2259 SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3()));
2260
2261 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
2262 }
2263
2264 public void SendLogoutPacket()
2265 {
2266 // I know this is a bit of a hack, however there are times when you don't
2267 // want to send this, but still need to do the rest of the shutdown process
2268 // this method gets called from the packet server.. which makes it practically
2269 // impossible to do any other way.
2270
2271 if (m_SendLogoutPacketWhenClosing)
2272 {
2273 LogoutReplyPacket logReply = (LogoutReplyPacket)PacketPool.Instance.GetPacket(PacketType.LogoutReply);
2274 // TODO: don't create new blocks if recycling an old packet
2275 logReply.AgentData.AgentID = AgentId;
2276 logReply.AgentData.SessionID = SessionId;
2277 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
2278 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
2279 logReply.InventoryData[0].ItemID = UUID.Zero;
2280
2281 OutPacket(logReply, ThrottleOutPacketType.Task);
2282 }
2283 }
2284
2285 public void SendHealth(float health)
2286 {
2287 HealthMessagePacket healthpacket = (HealthMessagePacket)PacketPool.Instance.GetPacket(PacketType.HealthMessage);
2288 healthpacket.HealthData.Health = health;
2289 OutPacket(healthpacket, ThrottleOutPacketType.Task);
2290 }
2291
2292 public void SendAgentOnline(UUID[] agentIDs)
2293 {
2294 OnlineNotificationPacket onp = new OnlineNotificationPacket();
2295 OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
2296 for (int i = 0; i < agentIDs.Length; i++)
2297 {
2298 OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
2299 onpbl.AgentID = agentIDs[i];
2300 onpb[i] = onpbl;
2301 }
2302 onp.AgentBlock = onpb;
2303 onp.Header.Reliable = true;
2304 OutPacket(onp, ThrottleOutPacketType.Task);
2305 }
2306
2307 public void SendAgentOffline(UUID[] agentIDs)
2308 {
2309 OfflineNotificationPacket offp = new OfflineNotificationPacket();
2310 OfflineNotificationPacket.AgentBlockBlock[] offpb = new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length];
2311 for (int i = 0; i < agentIDs.Length; i++)
2312 {
2313 OfflineNotificationPacket.AgentBlockBlock onpbl = new OfflineNotificationPacket.AgentBlockBlock();
2314 onpbl.AgentID = agentIDs[i];
2315 offpb[i] = onpbl;
2316 }
2317 offp.AgentBlock = offpb;
2318 offp.Header.Reliable = true;
2319 OutPacket(offp, ThrottleOutPacketType.Task);
2320 }
2321
2322 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
2323 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
2324 {
2325 AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
2326 avatarSitResponse.SitObject.ID = TargetID;
2327 if (CameraAtOffset != Vector3.Zero)
2328 {
2329 avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset;
2330 avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset;
2331 }
2332 avatarSitResponse.SitTransform.ForceMouselook = ForceMouseLook;
2333 avatarSitResponse.SitTransform.AutoPilot = autopilot;
2334 avatarSitResponse.SitTransform.SitPosition = OffsetPos;
2335 avatarSitResponse.SitTransform.SitRotation = SitOrientation;
2336
2337 OutPacket(avatarSitResponse, ThrottleOutPacketType.Task);
2338 }
2339
2340 public void SendAdminResponse(UUID Token, uint AdminLevel)
2341 {
2342 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
2343 GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
2344 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
2345
2346 adb.AgentID = AgentId;
2347 adb.SessionID = SessionId; // More security
2348 gdb.GodLevel = (byte)AdminLevel;
2349 gdb.Token = Token;
2350 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
2351 respondPacket.GrantData = gdb;
2352 respondPacket.AgentData = adb;
2353 OutPacket(respondPacket, ThrottleOutPacketType.Task);
2354 }
2355
2356 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
2357 {
2358 m_groupPowers.Clear();
2359
2360 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
2361 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
2362 for (int i = 0; i < GroupMembership.Length; i++)
2363 {
2364 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
2365
2366 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
2367 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
2368 Group.Contribution = GroupMembership[i].Contribution;
2369 Group.GroupID = GroupMembership[i].GroupID;
2370 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
2371 Group.GroupName = Utils.StringToBytes(GroupMembership[i].GroupName);
2372 Group.GroupPowers = GroupMembership[i].GroupPowers;
2373 Groups[i] = Group;
2374
2375
2376 }
2377 Groupupdate.GroupData = Groups;
2378 Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock();
2379 Groupupdate.AgentData.AgentID = AgentId;
2380 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
2381
2382 try
2383 {
2384 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
2385 if (eq != null)
2386 {
2387 eq.GroupMembership(Groupupdate, this.AgentId);
2388 }
2389 }
2390 catch (Exception ex)
2391 {
2392 m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString());
2393 m_log.Warn("sending group membership data via UDP");
2394 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
2395 }
2396 }
2397
2398
2399 public void SendGroupNameReply(UUID groupLLUID, string GroupName)
2400 {
2401 UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket();
2402 UUIDGroupNameReplyPacket.UUIDNameBlockBlock[] uidnameblock = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock[1];
2403 UUIDGroupNameReplyPacket.UUIDNameBlockBlock uidnamebloc = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock();
2404 uidnamebloc.ID = groupLLUID;
2405 uidnamebloc.GroupName = Utils.StringToBytes(GroupName);
2406 uidnameblock[0] = uidnamebloc;
2407 pack.UUIDNameBlock = uidnameblock;
2408 OutPacket(pack, ThrottleOutPacketType.Task);
2409 }
2410
2411 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
2412 {
2413 LandStatReplyPacket lsrp = new LandStatReplyPacket();
2414 // LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
2415 LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
2416 //LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
2417 // lsrepdb.
2418 lsrp.RequestData.ReportType = reportType;
2419 lsrp.RequestData.RequestFlags = requestFlags;
2420 lsrp.RequestData.TotalObjectCount = resultCount;
2421 for (int i = 0; i < lsrpia.Length; i++)
2422 {
2423 LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
2424 lsrepdb.LocationX = lsrpia[i].LocationX;
2425 lsrepdb.LocationY = lsrpia[i].LocationY;
2426 lsrepdb.LocationZ = lsrpia[i].LocationZ;
2427 lsrepdb.Score = lsrpia[i].Score;
2428 lsrepdb.TaskID = lsrpia[i].TaskID;
2429 lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID;
2430 lsrepdb.TaskName = Utils.StringToBytes(lsrpia[i].TaskName);
2431 lsrepdb.OwnerName = Utils.StringToBytes(lsrpia[i].OwnerName);
2432 lsrepdba[i] = lsrepdb;
2433 }
2434 lsrp.ReportData = lsrepdba;
2435 OutPacket(lsrp, ThrottleOutPacketType.Task);
2436 }
2437
2438 public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
2439 {
2440 ScriptRunningReplyPacket scriptRunningReply = new ScriptRunningReplyPacket();
2441 scriptRunningReply.Script.ObjectID = objectID;
2442 scriptRunningReply.Script.ItemID = itemID;
2443 scriptRunningReply.Script.Running = running;
2444
2445 OutPacket(scriptRunningReply, ThrottleOutPacketType.Task);
2446 }
2447
2448 public void SendAsset(AssetRequestToClient req)
2449 {
2450 //m_log.Debug("sending asset " + req.RequestAssetID);
2451 TransferInfoPacket Transfer = new TransferInfoPacket();
2452 Transfer.TransferInfo.ChannelType = 2;
2453 Transfer.TransferInfo.Status = 0;
2454 Transfer.TransferInfo.TargetType = 0;
2455 if (req.AssetRequestSource == 2)
2456 {
2457 Transfer.TransferInfo.Params = new byte[20];
2458 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
2459 int assType = req.AssetInf.Type;
2460 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
2461 }
2462 else if (req.AssetRequestSource == 3)
2463 {
2464 Transfer.TransferInfo.Params = req.Params;
2465 // Transfer.TransferInfo.Params = new byte[100];
2466 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
2467 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
2468 }
2469 Transfer.TransferInfo.Size = req.AssetInf.Data.Length;
2470 Transfer.TransferInfo.TransferID = req.TransferRequestID;
2471 Transfer.Header.Zerocoded = true;
2472 OutPacket(Transfer, ThrottleOutPacketType.Asset);
2473
2474 if (req.NumPackets == 1)
2475 {
2476 TransferPacketPacket TransferPacket = new TransferPacketPacket();
2477 TransferPacket.TransferData.Packet = 0;
2478 TransferPacket.TransferData.ChannelType = 2;
2479 TransferPacket.TransferData.TransferID = req.TransferRequestID;
2480 TransferPacket.TransferData.Data = req.AssetInf.Data;
2481 TransferPacket.TransferData.Status = 1;
2482 TransferPacket.Header.Zerocoded = true;
2483 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
2484 }
2485 else
2486 {
2487 int processedLength = 0;
2488 int maxChunkSize = Settings.MAX_PACKET_SIZE - 100;
2489 int packetNumber = 0;
2490
2491 while (processedLength < req.AssetInf.Data.Length)
2492 {
2493 TransferPacketPacket TransferPacket = new TransferPacketPacket();
2494 TransferPacket.TransferData.Packet = packetNumber;
2495 TransferPacket.TransferData.ChannelType = 2;
2496 TransferPacket.TransferData.TransferID = req.TransferRequestID;
2497
2498 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
2499 byte[] chunk = new byte[chunkSize];
2500 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
2501
2502 TransferPacket.TransferData.Data = chunk;
2503
2504 // 0 indicates more packets to come, 1 indicates last packet
2505 if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
2506 {
2507 TransferPacket.TransferData.Status = 0;
2508 }
2509 else
2510 {
2511 TransferPacket.TransferData.Status = 1;
2512 }
2513 TransferPacket.Header.Zerocoded = true;
2514 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
2515
2516 processedLength += chunkSize;
2517 packetNumber++;
2518 }
2519 }
2520 }
2521
2522 public void SendTexture(AssetBase TextureAsset)
2523 {
2524
2525 }
2526
2527 public void SendRegionHandle(UUID regionID, ulong handle)
2528 {
2529 RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
2530 reply.ReplyBlock.RegionID = regionID;
2531 reply.ReplyBlock.RegionHandle = handle;
2532 OutPacket(reply, ThrottleOutPacketType.Land);
2533 }
2534
2535 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
2536 {
2537 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
2538 reply.AgentData.AgentID = m_agentId;
2539 reply.Data.ParcelID = parcelID;
2540 reply.Data.OwnerID = land.OwnerID;
2541 reply.Data.Name = Utils.StringToBytes(land.Name);
2542 reply.Data.Desc = Utils.StringToBytes(land.Description);
2543 reply.Data.ActualArea = land.Area;
2544 reply.Data.BillableArea = land.Area; // TODO: what is this?
2545
2546 // Bit 0: Mature, bit 7: on sale, other bits: no idea
2547 reply.Data.Flags = (byte)(
2548 ((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
2549 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
2550
2551 Vector3 pos = land.UserLocation;
2552 if (pos.Equals(Vector3.Zero))
2553 {
2554 pos = (land.AABBMax + land.AABBMin) * 0.5f;
2555 }
2556 reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
2557 reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
2558 reply.Data.GlobalZ = pos.Z;
2559 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
2560 reply.Data.SnapshotID = land.SnapshotID;
2561 reply.Data.Dwell = land.Dwell;
2562 reply.Data.SalePrice = land.SalePrice;
2563 reply.Data.AuctionID = (int)land.AuctionID;
2564
2565 OutPacket(reply, ThrottleOutPacketType.Land);
2566 }
2567
2568 public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
2569 {
2570 ScriptTeleportRequestPacket packet = (ScriptTeleportRequestPacket)PacketPool.Instance.GetPacket(PacketType.ScriptTeleportRequest);
2571
2572 packet.Data.ObjectName = Utils.StringToBytes(objName);
2573 packet.Data.SimName = Utils.StringToBytes(simName);
2574 packet.Data.SimPosition = pos;
2575 packet.Data.LookAt = lookAt;
2576
2577 OutPacket(packet, ThrottleOutPacketType.Task);
2578 }
2579
2580 public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
2581 {
2582 DirPlacesReplyPacket packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply);
2583
2584 packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock();
2585
2586 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
2587 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
2588
2589 packet.QueryReplies =
2590 new DirPlacesReplyPacket.QueryRepliesBlock[data.Length];
2591
2592 packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[
2593 data.Length];
2594
2595 packet.AgentData.AgentID = AgentId;
2596
2597 packet.QueryData[0].QueryID = queryID;
2598
2599 int i = 0;
2600 foreach (DirPlacesReplyData d in data)
2601 {
2602 packet.QueryReplies[i] =
2603 new DirPlacesReplyPacket.QueryRepliesBlock();
2604 packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock();
2605 packet.QueryReplies[i].ParcelID = d.parcelID;
2606 packet.QueryReplies[i].Name = Utils.StringToBytes(d.name);
2607 packet.QueryReplies[i].ForSale = d.forSale;
2608 packet.QueryReplies[i].Auction = d.auction;
2609 packet.QueryReplies[i].Dwell = d.dwell;
2610 packet.StatusData[i].Status = d.Status;
2611 i++;
2612 }
2613
2614 OutPacket(packet, ThrottleOutPacketType.Task);
2615 }
2616
2617 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
2618 {
2619 DirPeopleReplyPacket packet = (DirPeopleReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPeopleReply);
2620
2621 packet.AgentData = new DirPeopleReplyPacket.AgentDataBlock();
2622 packet.AgentData.AgentID = AgentId;
2623
2624 packet.QueryData = new DirPeopleReplyPacket.QueryDataBlock();
2625 packet.QueryData.QueryID = queryID;
2626
2627 packet.QueryReplies = new DirPeopleReplyPacket.QueryRepliesBlock[
2628 data.Length];
2629
2630 int i = 0;
2631 foreach (DirPeopleReplyData d in data)
2632 {
2633 packet.QueryReplies[i] = new DirPeopleReplyPacket.QueryRepliesBlock();
2634 packet.QueryReplies[i].AgentID = d.agentID;
2635 packet.QueryReplies[i].FirstName =
2636 Utils.StringToBytes(d.firstName);
2637 packet.QueryReplies[i].LastName =
2638 Utils.StringToBytes(d.lastName);
2639 packet.QueryReplies[i].Group =
2640 Utils.StringToBytes(d.group);
2641 packet.QueryReplies[i].Online = d.online;
2642 packet.QueryReplies[i].Reputation = d.reputation;
2643 i++;
2644 }
2645
2646 OutPacket(packet, ThrottleOutPacketType.Task);
2647 }
2648
2649 public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
2650 {
2651 DirEventsReplyPacket packet = (DirEventsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirEventsReply);
2652
2653 packet.AgentData = new DirEventsReplyPacket.AgentDataBlock();
2654 packet.AgentData.AgentID = AgentId;
2655
2656 packet.QueryData = new DirEventsReplyPacket.QueryDataBlock();
2657 packet.QueryData.QueryID = queryID;
2658
2659 packet.QueryReplies = new DirEventsReplyPacket.QueryRepliesBlock[
2660 data.Length];
2661
2662 packet.StatusData = new DirEventsReplyPacket.StatusDataBlock[
2663 data.Length];
2664
2665 int i = 0;
2666 foreach (DirEventsReplyData d in data)
2667 {
2668 packet.QueryReplies[i] = new DirEventsReplyPacket.QueryRepliesBlock();
2669 packet.StatusData[i] = new DirEventsReplyPacket.StatusDataBlock();
2670 packet.QueryReplies[i].OwnerID = d.ownerID;
2671 packet.QueryReplies[i].Name =
2672 Utils.StringToBytes(d.name);
2673 packet.QueryReplies[i].EventID = d.eventID;
2674 packet.QueryReplies[i].Date =
2675 Utils.StringToBytes(d.date);
2676 packet.QueryReplies[i].UnixTime = d.unixTime;
2677 packet.QueryReplies[i].EventFlags = d.eventFlags;
2678 packet.StatusData[i].Status = d.Status;
2679 i++;
2680 }
2681
2682 OutPacket(packet, ThrottleOutPacketType.Task);
2683 }
2684
2685 public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
2686 {
2687 DirGroupsReplyPacket packet = (DirGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirGroupsReply);
2688
2689 packet.AgentData = new DirGroupsReplyPacket.AgentDataBlock();
2690 packet.AgentData.AgentID = AgentId;
2691
2692 packet.QueryData = new DirGroupsReplyPacket.QueryDataBlock();
2693 packet.QueryData.QueryID = queryID;
2694
2695 packet.QueryReplies = new DirGroupsReplyPacket.QueryRepliesBlock[
2696 data.Length];
2697
2698 int i = 0;
2699 foreach (DirGroupsReplyData d in data)
2700 {
2701 packet.QueryReplies[i] = new DirGroupsReplyPacket.QueryRepliesBlock();
2702 packet.QueryReplies[i].GroupID = d.groupID;
2703 packet.QueryReplies[i].GroupName =
2704 Utils.StringToBytes(d.groupName);
2705 packet.QueryReplies[i].Members = d.members;
2706 packet.QueryReplies[i].SearchOrder = d.searchOrder;
2707 i++;
2708 }
2709
2710 OutPacket(packet, ThrottleOutPacketType.Task);
2711 }
2712
2713 public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
2714 {
2715 DirClassifiedReplyPacket packet = (DirClassifiedReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirClassifiedReply);
2716
2717 packet.AgentData = new DirClassifiedReplyPacket.AgentDataBlock();
2718 packet.AgentData.AgentID = AgentId;
2719
2720 packet.QueryData = new DirClassifiedReplyPacket.QueryDataBlock();
2721 packet.QueryData.QueryID = queryID;
2722
2723 packet.QueryReplies = new DirClassifiedReplyPacket.QueryRepliesBlock[
2724 data.Length];
2725 packet.StatusData = new DirClassifiedReplyPacket.StatusDataBlock[
2726 data.Length];
2727
2728 int i = 0;
2729 foreach (DirClassifiedReplyData d in data)
2730 {
2731 packet.QueryReplies[i] = new DirClassifiedReplyPacket.QueryRepliesBlock();
2732 packet.StatusData[i] = new DirClassifiedReplyPacket.StatusDataBlock();
2733 packet.QueryReplies[i].ClassifiedID = d.classifiedID;
2734 packet.QueryReplies[i].Name =
2735 Utils.StringToBytes(d.name);
2736 packet.QueryReplies[i].ClassifiedFlags = d.classifiedFlags;
2737 packet.QueryReplies[i].CreationDate = d.creationDate;
2738 packet.QueryReplies[i].ExpirationDate = d.expirationDate;
2739 packet.QueryReplies[i].PriceForListing = d.price;
2740 packet.StatusData[i].Status = d.Status;
2741 i++;
2742 }
2743
2744 OutPacket(packet, ThrottleOutPacketType.Task);
2745 }
2746
2747 public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
2748 {
2749 DirLandReplyPacket packet = (DirLandReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirLandReply);
2750
2751 packet.AgentData = new DirLandReplyPacket.AgentDataBlock();
2752 packet.AgentData.AgentID = AgentId;
2753
2754 packet.QueryData = new DirLandReplyPacket.QueryDataBlock();
2755 packet.QueryData.QueryID = queryID;
2756
2757 packet.QueryReplies = new DirLandReplyPacket.QueryRepliesBlock[
2758 data.Length];
2759
2760 int i = 0;
2761 foreach (DirLandReplyData d in data)
2762 {
2763 packet.QueryReplies[i] = new DirLandReplyPacket.QueryRepliesBlock();
2764 packet.QueryReplies[i].ParcelID = d.parcelID;
2765 packet.QueryReplies[i].Name =
2766 Utils.StringToBytes(d.name);
2767 packet.QueryReplies[i].Auction = d.auction;
2768 packet.QueryReplies[i].ForSale = d.forSale;
2769 packet.QueryReplies[i].SalePrice = d.salePrice;
2770 packet.QueryReplies[i].ActualArea = d.actualArea;
2771 i++;
2772 }
2773
2774 OutPacket(packet, ThrottleOutPacketType.Task);
2775 }
2776
2777 public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
2778 {
2779 DirPopularReplyPacket packet = (DirPopularReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPopularReply);
2780
2781 packet.AgentData = new DirPopularReplyPacket.AgentDataBlock();
2782 packet.AgentData.AgentID = AgentId;
2783
2784 packet.QueryData = new DirPopularReplyPacket.QueryDataBlock();
2785 packet.QueryData.QueryID = queryID;
2786
2787 packet.QueryReplies = new DirPopularReplyPacket.QueryRepliesBlock[
2788 data.Length];
2789
2790 int i = 0;
2791 foreach (DirPopularReplyData d in data)
2792 {
2793 packet.QueryReplies[i] = new DirPopularReplyPacket.QueryRepliesBlock();
2794 packet.QueryReplies[i].ParcelID = d.parcelID;
2795 packet.QueryReplies[i].Name =
2796 Utils.StringToBytes(d.name);
2797 packet.QueryReplies[i].Dwell = d.dwell;
2798 i++;
2799 }
2800
2801 OutPacket(packet, ThrottleOutPacketType.Task);
2802 }
2803
2804 public void SendEventInfoReply(EventData data)
2805 {
2806 EventInfoReplyPacket packet = (EventInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.EventInfoReply);
2807
2808 packet.AgentData = new EventInfoReplyPacket.AgentDataBlock();
2809 packet.AgentData.AgentID = AgentId;
2810
2811 packet.EventData = new EventInfoReplyPacket.EventDataBlock();
2812 packet.EventData.EventID = data.eventID;
2813 packet.EventData.Creator = Utils.StringToBytes(data.creator);
2814 packet.EventData.Name = Utils.StringToBytes(data.name);
2815 packet.EventData.Category = Utils.StringToBytes(data.category);
2816 packet.EventData.Desc = Utils.StringToBytes(data.description);
2817 packet.EventData.Date = Utils.StringToBytes(data.date);
2818 packet.EventData.DateUTC = data.dateUTC;
2819 packet.EventData.Duration = data.duration;
2820 packet.EventData.Cover = data.cover;
2821 packet.EventData.Amount = data.amount;
2822 packet.EventData.SimName = Utils.StringToBytes(data.simName);
2823 packet.EventData.GlobalPos = new Vector3d(data.globalPos);
2824 packet.EventData.EventFlags = data.eventFlags;
2825
2826 OutPacket(packet, ThrottleOutPacketType.Task);
2827 }
2828
2829 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
2830 {
2831 MapItemReplyPacket mirplk = new MapItemReplyPacket();
2832 mirplk.AgentData.AgentID = AgentId;
2833 mirplk.RequestData.ItemType = mapitemtype;
2834 mirplk.Data = new MapItemReplyPacket.DataBlock[replies.Length];
2835 for (int i = 0; i < replies.Length; i++)
2836 {
2837 MapItemReplyPacket.DataBlock mrdata = new MapItemReplyPacket.DataBlock();
2838 mrdata.X = replies[i].x;
2839 mrdata.Y = replies[i].y;
2840 mrdata.ID = replies[i].id;
2841 mrdata.Extra = replies[i].Extra;
2842 mrdata.Extra2 = replies[i].Extra2;
2843 mrdata.Name = Utils.StringToBytes(replies[i].name);
2844 mirplk.Data[i] = mrdata;
2845 }
2846 //m_log.Debug(mirplk.ToString());
2847 OutPacket(mirplk, ThrottleOutPacketType.Task);
2848
2849 }
2850
2851 public void SendOfferCallingCard(UUID srcID, UUID transactionID)
2852 {
2853 // a bit special, as this uses AgentID to store the source instead
2854 // of the destination. The destination (the receiver) goes into destID
2855 OfferCallingCardPacket p = (OfferCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.OfferCallingCard);
2856 p.AgentData.AgentID = srcID;
2857 p.AgentData.SessionID = UUID.Zero;
2858 p.AgentBlock.DestID = AgentId;
2859 p.AgentBlock.TransactionID = transactionID;
2860 OutPacket(p, ThrottleOutPacketType.Task);
2861 }
2862
2863 public void SendAcceptCallingCard(UUID transactionID)
2864 {
2865 AcceptCallingCardPacket p = (AcceptCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.AcceptCallingCard);
2866 p.AgentData.AgentID = AgentId;
2867 p.AgentData.SessionID = UUID.Zero;
2868 p.FolderData = new AcceptCallingCardPacket.FolderDataBlock[1];
2869 p.FolderData[0] = new AcceptCallingCardPacket.FolderDataBlock();
2870 p.FolderData[0].FolderID = UUID.Zero;
2871 OutPacket(p, ThrottleOutPacketType.Task);
2872 }
2873
2874 public void SendDeclineCallingCard(UUID transactionID)
2875 {
2876 DeclineCallingCardPacket p = (DeclineCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.DeclineCallingCard);
2877 p.AgentData.AgentID = AgentId;
2878 p.AgentData.SessionID = UUID.Zero;
2879 p.TransactionBlock.TransactionID = transactionID;
2880 OutPacket(p, ThrottleOutPacketType.Task);
2881 }
2882
2883 public void SendTerminateFriend(UUID exFriendID)
2884 {
2885 TerminateFriendshipPacket p = (TerminateFriendshipPacket)PacketPool.Instance.GetPacket(PacketType.TerminateFriendship);
2886 p.AgentData.AgentID = AgentId;
2887 p.AgentData.SessionID = SessionId;
2888 p.ExBlock.OtherID = exFriendID;
2889 OutPacket(p, ThrottleOutPacketType.Task);
2890 }
2891
2892 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
2893 {
2894 AvatarGroupsReplyPacket p = (AvatarGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarGroupsReply);
2895
2896 p.AgentData = new AvatarGroupsReplyPacket.AgentDataBlock();
2897 p.AgentData.AgentID = AgentId;
2898 p.AgentData.AvatarID = avatarID;
2899
2900 p.GroupData = new AvatarGroupsReplyPacket.GroupDataBlock[data.Length];
2901 int i = 0;
2902 foreach (GroupMembershipData m in data)
2903 {
2904 p.GroupData[i] = new AvatarGroupsReplyPacket.GroupDataBlock();
2905 p.GroupData[i].GroupPowers = m.GroupPowers;
2906 p.GroupData[i].AcceptNotices = m.AcceptNotices;
2907 p.GroupData[i].GroupTitle = Utils.StringToBytes(m.GroupTitle);
2908 p.GroupData[i].GroupID = m.GroupID;
2909 p.GroupData[i].GroupName = Utils.StringToBytes(m.GroupName);
2910 p.GroupData[i].GroupInsigniaID = m.GroupPicture;
2911 i++;
2912 }
2913
2914 p.NewGroupData = new AvatarGroupsReplyPacket.NewGroupDataBlock();
2915 p.NewGroupData.ListInProfile = true;
2916
2917 OutPacket(p, ThrottleOutPacketType.Task);
2918 }
2919
2920 public void SendJoinGroupReply(UUID groupID, bool success)
2921 {
2922 JoinGroupReplyPacket p = (JoinGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.JoinGroupReply);
2923
2924 p.AgentData = new JoinGroupReplyPacket.AgentDataBlock();
2925 p.AgentData.AgentID = AgentId;
2926
2927 p.GroupData = new JoinGroupReplyPacket.GroupDataBlock();
2928 p.GroupData.GroupID = groupID;
2929 p.GroupData.Success = success;
2930
2931 OutPacket(p, ThrottleOutPacketType.Task);
2932 }
2933
2934 public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
2935 {
2936 EjectGroupMemberReplyPacket p = (EjectGroupMemberReplyPacket)PacketPool.Instance.GetPacket(PacketType.EjectGroupMemberReply);
2937
2938 p.AgentData = new EjectGroupMemberReplyPacket.AgentDataBlock();
2939 p.AgentData.AgentID = agentID;
2940
2941 p.GroupData = new EjectGroupMemberReplyPacket.GroupDataBlock();
2942 p.GroupData.GroupID = groupID;
2943
2944 p.EjectData = new EjectGroupMemberReplyPacket.EjectDataBlock();
2945 p.EjectData.Success = success;
2946
2947 OutPacket(p, ThrottleOutPacketType.Task);
2948 }
2949
2950 public void SendLeaveGroupReply(UUID groupID, bool success)
2951 {
2952 LeaveGroupReplyPacket p = (LeaveGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.LeaveGroupReply);
2953
2954 p.AgentData = new LeaveGroupReplyPacket.AgentDataBlock();
2955 p.AgentData.AgentID = AgentId;
2956
2957 p.GroupData = new LeaveGroupReplyPacket.GroupDataBlock();
2958 p.GroupData.GroupID = groupID;
2959 p.GroupData.Success = success;
2960
2961 OutPacket(p, ThrottleOutPacketType.Task);
2962 }
2963
2964 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
2965 {
2966 if (classifiedID.Length != name.Length)
2967 return;
2968
2969 AvatarClassifiedReplyPacket ac =
2970 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
2971 PacketType.AvatarClassifiedReply);
2972
2973 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
2974 ac.AgentData.AgentID = AgentId;
2975 ac.AgentData.TargetID = targetID;
2976
2977 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifiedID.Length];
2978 int i;
2979 for (i = 0; i < classifiedID.Length; i++)
2980 {
2981 ac.Data[i].ClassifiedID = classifiedID[i];
2982 ac.Data[i].Name = Utils.StringToBytes(name[i]);
2983 }
2984
2985 OutPacket(ac, ThrottleOutPacketType.Task);
2986 }
2987
2988 public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
2989 {
2990 ClassifiedInfoReplyPacket cr =
2991 (ClassifiedInfoReplyPacket)PacketPool.Instance.GetPacket(
2992 PacketType.ClassifiedInfoReply);
2993
2994 cr.AgentData = new ClassifiedInfoReplyPacket.AgentDataBlock();
2995 cr.AgentData.AgentID = AgentId;
2996
2997 cr.Data = new ClassifiedInfoReplyPacket.DataBlock();
2998 cr.Data.ClassifiedID = classifiedID;
2999 cr.Data.CreatorID = creatorID;
3000 cr.Data.CreationDate = creationDate;
3001 cr.Data.ExpirationDate = expirationDate;
3002 cr.Data.Category = category;
3003 cr.Data.Name = Utils.StringToBytes(name);
3004 cr.Data.Desc = Utils.StringToBytes(description);
3005 cr.Data.ParcelID = parcelID;
3006 cr.Data.ParentEstate = parentEstate;
3007 cr.Data.SnapshotID = snapshotID;
3008 cr.Data.SimName = Utils.StringToBytes(simName);
3009 cr.Data.PosGlobal = new Vector3d(globalPos);
3010 cr.Data.ParcelName = Utils.StringToBytes(parcelName);
3011 cr.Data.ClassifiedFlags = classifiedFlags;
3012 cr.Data.PriceForListing = price;
3013
3014 OutPacket(cr, ThrottleOutPacketType.Task);
3015 }
3016
3017 public void SendAgentDropGroup(UUID groupID)
3018 {
3019 AgentDropGroupPacket dg =
3020 (AgentDropGroupPacket)PacketPool.Instance.GetPacket(
3021 PacketType.AgentDropGroup);
3022
3023 dg.AgentData = new AgentDropGroupPacket.AgentDataBlock();
3024 dg.AgentData.AgentID = AgentId;
3025 dg.AgentData.GroupID = groupID;
3026
3027 OutPacket(dg, ThrottleOutPacketType.Task);
3028 }
3029
3030 public void SendAvatarNotesReply(UUID targetID, string text)
3031 {
3032 AvatarNotesReplyPacket an =
3033 (AvatarNotesReplyPacket)PacketPool.Instance.GetPacket(
3034 PacketType.AvatarNotesReply);
3035
3036 an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock();
3037 an.AgentData.AgentID = AgentId;
3038
3039 an.Data = new AvatarNotesReplyPacket.DataBlock();
3040 an.Data.TargetID = targetID;
3041 an.Data.Notes = Utils.StringToBytes(text);
3042
3043 OutPacket(an, ThrottleOutPacketType.Task);
3044 }
3045
3046 public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
3047 {
3048 AvatarPicksReplyPacket ap =
3049 (AvatarPicksReplyPacket)PacketPool.Instance.GetPacket(
3050 PacketType.AvatarPicksReply);
3051
3052 ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock();
3053 ap.AgentData.AgentID = AgentId;
3054 ap.AgentData.TargetID = targetID;
3055
3056 ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count];
3057
3058 int i = 0;
3059 foreach (KeyValuePair<UUID, string> pick in picks)
3060 {
3061 ap.Data[i] = new AvatarPicksReplyPacket.DataBlock();
3062 ap.Data[i].PickID = pick.Key;
3063 ap.Data[i].PickName = Utils.StringToBytes(pick.Value);
3064 i++;
3065 }
3066
3067 OutPacket(ap, ThrottleOutPacketType.Task);
3068 }
3069
3070 public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
3071 {
3072 AvatarClassifiedReplyPacket ac =
3073 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
3074 PacketType.AvatarClassifiedReply);
3075
3076 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
3077 ac.AgentData.AgentID = AgentId;
3078 ac.AgentData.TargetID = targetID;
3079
3080 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count];
3081
3082 int i = 0;
3083 foreach (KeyValuePair<UUID, string> classified in classifieds)
3084 {
3085 ac.Data[i] = new AvatarClassifiedReplyPacket.DataBlock();
3086 ac.Data[i].ClassifiedID = classified.Key;
3087 ac.Data[i].Name = Utils.StringToBytes(classified.Value);
3088 i++;
3089 }
3090
3091 OutPacket(ac, ThrottleOutPacketType.Task);
3092 }
3093
3094 public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
3095 {
3096 ParcelDwellReplyPacket pd =
3097 (ParcelDwellReplyPacket)PacketPool.Instance.GetPacket(
3098 PacketType.ParcelDwellReply);
3099
3100 pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock();
3101 pd.AgentData.AgentID = AgentId;
3102
3103 pd.Data = new ParcelDwellReplyPacket.DataBlock();
3104 pd.Data.LocalID = localID;
3105 pd.Data.ParcelID = parcelID;
3106 pd.Data.Dwell = dwell;
3107
3108 OutPacket(pd, ThrottleOutPacketType.Land);
3109 }
3110
3111 public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
3112 {
3113 UserInfoReplyPacket ur =
3114 (UserInfoReplyPacket)PacketPool.Instance.GetPacket(
3115 PacketType.UserInfoReply);
3116
3117 string Visible = "hidden";
3118 if (visible)
3119 Visible = "default";
3120
3121 ur.AgentData = new UserInfoReplyPacket.AgentDataBlock();
3122 ur.AgentData.AgentID = AgentId;
3123
3124 ur.UserData = new UserInfoReplyPacket.UserDataBlock();
3125 ur.UserData.IMViaEMail = imViaEmail;
3126 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible);
3127 ur.UserData.EMail = Utils.StringToBytes(email);
3128
3129 OutPacket(ur, ThrottleOutPacketType.Task);
3130 }
3131
3132 public void SendCreateGroupReply(UUID groupID, bool success, string message)
3133 {
3134 CreateGroupReplyPacket createGroupReply = (CreateGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.CreateGroupReply);
3135
3136 createGroupReply.AgentData =
3137 new CreateGroupReplyPacket.AgentDataBlock();
3138 createGroupReply.ReplyData =
3139 new CreateGroupReplyPacket.ReplyDataBlock();
3140
3141 createGroupReply.AgentData.AgentID = AgentId;
3142 createGroupReply.ReplyData.GroupID = groupID;
3143
3144 createGroupReply.ReplyData.Success = success;
3145 createGroupReply.ReplyData.Message = Utils.StringToBytes(message);
3146 OutPacket(createGroupReply, ThrottleOutPacketType.Task);
3147 }
3148
3149 public void SendUseCachedMuteList()
3150 {
3151 UseCachedMuteListPacket useCachedMuteList = (UseCachedMuteListPacket)PacketPool.Instance.GetPacket(PacketType.UseCachedMuteList);
3152
3153 useCachedMuteList.AgentData = new UseCachedMuteListPacket.AgentDataBlock();
3154 useCachedMuteList.AgentData.AgentID = AgentId;
3155
3156 OutPacket(useCachedMuteList, ThrottleOutPacketType.Task);
3157 }
3158
3159 public void SendMuteListUpdate(string filename)
3160 {
3161 MuteListUpdatePacket muteListUpdate = (MuteListUpdatePacket)PacketPool.Instance.GetPacket(PacketType.MuteListUpdate);
3162
3163 muteListUpdate.MuteData = new MuteListUpdatePacket.MuteDataBlock();
3164 muteListUpdate.MuteData.AgentID = AgentId;
3165 muteListUpdate.MuteData.Filename = Utils.StringToBytes(filename);
3166
3167 OutPacket(muteListUpdate, ThrottleOutPacketType.Task);
3168 }
3169
3170 public void SendPickInfoReply(UUID pickID, UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
3171 {
3172 PickInfoReplyPacket pickInfoReply = (PickInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.PickInfoReply);
3173
3174 pickInfoReply.AgentData = new PickInfoReplyPacket.AgentDataBlock();
3175 pickInfoReply.AgentData.AgentID = AgentId;
3176
3177 pickInfoReply.Data = new PickInfoReplyPacket.DataBlock();
3178 pickInfoReply.Data.PickID = pickID;
3179 pickInfoReply.Data.CreatorID = creatorID;
3180 pickInfoReply.Data.TopPick = topPick;
3181 pickInfoReply.Data.ParcelID = parcelID;
3182 pickInfoReply.Data.Name = Utils.StringToBytes(name);
3183 pickInfoReply.Data.Desc = Utils.StringToBytes(desc);
3184 pickInfoReply.Data.SnapshotID = snapshotID;
3185 pickInfoReply.Data.User = Utils.StringToBytes(user);
3186 pickInfoReply.Data.OriginalName = Utils.StringToBytes(originalName);
3187 pickInfoReply.Data.SimName = Utils.StringToBytes(simName);
3188 pickInfoReply.Data.PosGlobal = new Vector3d(posGlobal);
3189 pickInfoReply.Data.SortOrder = sortOrder;
3190 pickInfoReply.Data.Enabled = enabled;
3191
3192 OutPacket(pickInfoReply, ThrottleOutPacketType.Task);
3193 }
3194
3195 #endregion Scene/Avatar to Client
2772 3196
2773 // Gesture 3197 // Gesture
2774 3198
@@ -3064,7 +3488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3064 objectData.FullID = objectID; 3488 objectData.FullID = objectID;
3065 objectData.OwnerID = ownerID; 3489 objectData.OwnerID = ownerID;
3066 3490
3067 objectData.Text = LLUtil.StringToPacketBytes(text); 3491 objectData.Text = Util.StringToBytes256(text);
3068 objectData.TextColor[0] = color[0]; 3492 objectData.TextColor[0] = color[0];
3069 objectData.TextColor[1] = color[1]; 3493 objectData.TextColor[1] = color[1];
3070 objectData.TextColor[2] = color[2]; 3494 objectData.TextColor[2] = color[2];
@@ -3209,7 +3633,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3209 } 3633 }
3210 3634
3211 outPacket.Header.Zerocoded = true; 3635 outPacket.Header.Zerocoded = true;
3212 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); 3636 OutPacket(outPacket, ThrottleOutPacketType.Task);
3213 3637
3214 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) 3638 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled)
3215 stopTimer = true; 3639 stopTimer = true;
@@ -3311,7 +3735,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3311 3735
3312 outPacket.Header.Reliable = false; 3736 outPacket.Header.Reliable = false;
3313 outPacket.Header.Zerocoded = true; 3737 outPacket.Header.Zerocoded = true;
3314 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); 3738 OutPacket(outPacket, ThrottleOutPacketType.Task);
3315 3739
3316 if (m_primTerseUpdates.Count == 0) 3740 if (m_primTerseUpdates.Count == 0)
3317 stopTimer = true; 3741 stopTimer = true;
@@ -3464,8 +3888,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3464 objPropDB.SalePrice = SalePrice; 3888 objPropDB.SalePrice = SalePrice;
3465 objPropDB.Category = Category; 3889 objPropDB.Category = Category;
3466 objPropDB.LastOwnerID = LastOwnerID; 3890 objPropDB.LastOwnerID = LastOwnerID;
3467 objPropDB.Name = LLUtil.StringToPacketBytes(ObjectName); 3891 objPropDB.Name = Util.StringToBytes256(ObjectName);
3468 objPropDB.Description = LLUtil.StringToPacketBytes(Description); 3892 objPropDB.Description = Util.StringToBytes256(Description);
3469 objPropFamilyPack.ObjectData = objPropDB; 3893 objPropFamilyPack.ObjectData = objPropDB;
3470 objPropFamilyPack.Header.Zerocoded = true; 3894 objPropFamilyPack.Header.Zerocoded = true;
3471 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task); 3895 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
@@ -3499,11 +3923,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3499 proper.ObjectData[0].OwnerID = UUID.Zero; 3923 proper.ObjectData[0].OwnerID = UUID.Zero;
3500 else 3924 else
3501 proper.ObjectData[0].OwnerID = OwnerUUID; 3925 proper.ObjectData[0].OwnerID = OwnerUUID;
3502 proper.ObjectData[0].TouchName = LLUtil.StringToPacketBytes(TouchTitle); 3926 proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle);
3503 proper.ObjectData[0].TextureID = TextureID; 3927 proper.ObjectData[0].TextureID = TextureID;
3504 proper.ObjectData[0].SitName = LLUtil.StringToPacketBytes(SitTitle); 3928 proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle);
3505 proper.ObjectData[0].Name = LLUtil.StringToPacketBytes(ItemName); 3929 proper.ObjectData[0].Name = Util.StringToBytes256(ItemName);
3506 proper.ObjectData[0].Description = LLUtil.StringToPacketBytes(ItemDescription); 3930 proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription);
3507 proper.ObjectData[0].OwnerMask = OwnerMask; 3931 proper.ObjectData[0].OwnerMask = OwnerMask;
3508 proper.ObjectData[0].NextOwnerMask = NextOwnerMask; 3932 proper.ObjectData[0].NextOwnerMask = NextOwnerMask;
3509 proper.ObjectData[0].GroupMask = GroupMask; 3933 proper.ObjectData[0].GroupMask = GroupMask;
@@ -3744,11 +4168,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3744 4168
3745 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 4169 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale;
3746 updatePacket.ParcelData.MediaID = landData.MediaID; 4170 updatePacket.ParcelData.MediaID = landData.MediaID;
3747 updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL); 4171 updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL);
3748 updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL); 4172 updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL);
3749 updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name); 4173 updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name);
3750 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 4174 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime;
3751 updatePacket.ParcelData.OtherCount = 0; //unemplemented 4175 updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented
3752 updatePacket.ParcelData.OtherPrims = landData.OtherPrims; 4176 updatePacket.ParcelData.OtherPrims = landData.OtherPrims;
3753 updatePacket.ParcelData.OwnerID = landData.OwnerID; 4177 updatePacket.ParcelData.OwnerID = landData.OwnerID;
3754 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; 4178 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims;
@@ -3756,22 +4180,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3756 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; 4180 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor;
3757 updatePacket.ParcelData.PassHours = landData.PassHours; 4181 updatePacket.ParcelData.PassHours = landData.PassHours;
3758 updatePacket.ParcelData.PassPrice = landData.PassPrice; 4182 updatePacket.ParcelData.PassPrice = landData.PassPrice;
3759 updatePacket.ParcelData.PublicCount = 0; //unemplemented 4183 updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented
3760 4184
3761 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)RegionFlags.DenyAnonymous) > 4185 updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0;
3762 0); 4186 updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0;
3763 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)RegionFlags.DenyIdentified) > 4187 updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
3764 0); 4188 updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
3765 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)RegionFlags.DenyTransacted) >
3766 0);
3767 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)RegionFlags.RestrictPushObject) >
3768 0);
3769 4189
3770 updatePacket.ParcelData.RentPrice = 0; 4190 updatePacket.ParcelData.RentPrice = 0;
3771 updatePacket.ParcelData.RequestResult = request_result; 4191 updatePacket.ParcelData.RequestResult = request_result;
3772 updatePacket.ParcelData.SalePrice = landData.SalePrice; 4192 updatePacket.ParcelData.SalePrice = landData.SalePrice;
3773 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; 4193 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims;
3774 updatePacket.ParcelData.SelfCount = 0; //unemplemented 4194 updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented
3775 updatePacket.ParcelData.SequenceID = sequence_id; 4195 updatePacket.ParcelData.SequenceID = sequence_id;
3776 if (landData.SimwideArea > 0) 4196 if (landData.SimwideArea > 0)
3777 { 4197 {
@@ -4264,6 +4684,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4264 OutPacket(packet, ThrottleOutPacketType.Task); 4684 OutPacket(packet, ThrottleOutPacketType.Task);
4265 } 4685 }
4266 4686
4687 public ulong GetGroupPowers(UUID groupID)
4688 {
4689 if (groupID == m_activeGroupID)
4690 return m_activeGroupPowers;
4691
4692 if (m_groupPowers.ContainsKey(groupID))
4693 return m_groupPowers[groupID];
4694
4695 return 0;
4696 }
4697
4698 /// <summary>
4699 /// This is a utility method used by single states to not duplicate kicks and blue card of death messages.
4700 /// </summary>
4701 public bool ChildAgentStatus()
4702 {
4703 return m_scene.PresenceChildStatus(AgentId);
4704 }
4705
4267 #endregion 4706 #endregion
4268 4707
4269 /// <summary> 4708 /// <summary>
@@ -4282,6 +4721,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4282 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); 4721 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
4283 } 4722 }
4284 4723
4724 #region Packet Handlers
4725
4285 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) 4726 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
4286 { 4727 {
4287 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack; 4728 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack;
@@ -4289,7 +4730,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4289 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId && 4730 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId &&
4290 money.AgentData.SessionID == sender.SessionId) 4731 money.AgentData.SessionID == sender.SessionId)
4291 { 4732 {
4292 handlerMoneyTransferRequest = OnMoneyTransferRequest; 4733 MoneyTransferRequest handlerMoneyTransferRequest = OnMoneyTransferRequest;
4293 if (handlerMoneyTransferRequest != null) 4734 if (handlerMoneyTransferRequest != null)
4294 { 4735 {
4295 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID, 4736 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
@@ -4308,7 +4749,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4308 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack; 4749 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack;
4309 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId) 4750 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
4310 { 4751 {
4311 handlerParcelBuy = OnParcelBuy; 4752 ParcelBuy handlerParcelBuy = OnParcelBuy;
4312 if (handlerParcelBuy != null) 4753 if (handlerParcelBuy != null)
4313 { 4754 {
4314 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final, 4755 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final,
@@ -4329,7 +4770,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4329 4770
4330 for (int i = 0; i < upack.UUIDNameBlock.Length; i++) 4771 for (int i = 0; i < upack.UUIDNameBlock.Length; i++)
4331 { 4772 {
4332 handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest; 4773 UUIDNameRequest handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest;
4333 if (handlerUUIDGroupNameRequest != null) 4774 if (handlerUUIDGroupNameRequest != null)
4334 { 4775 {
4335 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this); 4776 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this);
@@ -4345,7 +4786,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4345 if (m_genericPacketHandlers.Count == 0) return false; 4786 if (m_genericPacketHandlers.Count == 0) return false;
4346 if (gmpack.AgentData.SessionID != SessionId) return false; 4787 if (gmpack.AgentData.SessionID != SessionId) return false;
4347 4788
4348 handlerGenericMessage = null; 4789 GenericMessage handlerGenericMessage = null;
4349 4790
4350 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); 4791 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim();
4351 4792
@@ -4386,7 +4827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4386 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack; 4827 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack;
4387 if (ogpack.AgentData.SessionID != SessionId) return false; 4828 if (ogpack.AgentData.SessionID != SessionId) return false;
4388 4829
4389 handlerObjectGroupRequest = OnObjectGroupRequest; 4830 RequestObjectPropertiesFamily handlerObjectGroupRequest = OnObjectGroupRequest;
4390 if (handlerObjectGroupRequest != null) 4831 if (handlerObjectGroupRequest != null)
4391 { 4832 {
4392 for (int i = 0; i < ogpack.ObjectData.Length; i++) 4833 for (int i = 0; i < ogpack.ObjectData.Length; i++)
@@ -4401,7 +4842,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4401 { 4842 {
4402 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; 4843 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
4403 if (viewer.AgentData.SessionID != SessionId) return false; 4844 if (viewer.AgentData.SessionID != SessionId) return false;
4404 handlerViewerEffect = OnViewerEffect; 4845 ViewerEffectEventHandler handlerViewerEffect = OnViewerEffect;
4405 if (handlerViewerEffect != null) 4846 if (handlerViewerEffect != null)
4406 { 4847 {
4407 int length = viewer.Effect.Length; 4848 int length = viewer.Effect.Length;
@@ -4425,6 +4866,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4425 return true; 4866 return true;
4426 } 4867 }
4427 4868
4869 #endregion Packet Handlers
4870
4428 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) 4871 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
4429 { 4872 {
4430 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); 4873 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
@@ -4490,7 +4933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4490 { 4933 {
4491 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName); 4934 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName);
4492 4935
4493 handlerLogout = OnLogout; 4936 Action<IClientAPI> handlerLogout = OnLogout;
4494 4937
4495 if (handlerLogout != null) 4938 if (handlerLogout != null)
4496 { 4939 {
@@ -4572,7 +5015,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4572 case 1: 5015 case 1:
4573 Vector3 pos1 = new Vector3(block.Data, 0); 5016 Vector3 pos1 = new Vector3(block.Data, 0);
4574 5017
4575 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 5018 UpdateVector handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
4576 if (handlerUpdatePrimSinglePosition != null) 5019 if (handlerUpdatePrimSinglePosition != null)
4577 { 5020 {
4578 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); 5021 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
@@ -4582,7 +5025,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4582 case 2: 5025 case 2:
4583 Quaternion rot1 = new Quaternion(block.Data, 0, true); 5026 Quaternion rot1 = new Quaternion(block.Data, 0, true);
4584 5027
4585 handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; 5028 UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
4586 if (handlerUpdatePrimSingleRotation != null) 5029 if (handlerUpdatePrimSingleRotation != null)
4587 { 5030 {
4588 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W); 5031 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W);
@@ -4593,7 +5036,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4593 Vector3 rotPos = new Vector3(block.Data, 0); 5036 Vector3 rotPos = new Vector3(block.Data, 0);
4594 Quaternion rot2 = new Quaternion(block.Data, 12, true); 5037 Quaternion rot2 = new Quaternion(block.Data, 12, true);
4595 5038
4596 handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; 5039 UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition;
4597 if (handlerUpdatePrimSingleRotationPosition != null) 5040 if (handlerUpdatePrimSingleRotationPosition != null)
4598 { 5041 {
4599 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z); 5042 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z);
@@ -4605,7 +5048,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4605 case 20: 5048 case 20:
4606 Vector3 scale4 = new Vector3(block.Data, 0); 5049 Vector3 scale4 = new Vector3(block.Data, 0);
4607 5050
4608 handlerUpdatePrimScale = OnUpdatePrimScale; 5051 UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale;
4609 if (handlerUpdatePrimScale != null) 5052 if (handlerUpdatePrimScale != null)
4610 { 5053 {
4611// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z); 5054// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z);
@@ -4633,7 +5076,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4633 case 9: 5076 case 9:
4634 Vector3 pos2 = new Vector3(block.Data, 0); 5077 Vector3 pos2 = new Vector3(block.Data, 0);
4635 5078
4636 handlerUpdateVector = OnUpdatePrimGroupPosition; 5079 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition;
4637 5080
4638 if (handlerUpdateVector != null) 5081 if (handlerUpdateVector != null)
4639 { 5082 {
@@ -4644,7 +5087,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4644 case 10: 5087 case 10:
4645 Quaternion rot3 = new Quaternion(block.Data, 0, true); 5088 Quaternion rot3 = new Quaternion(block.Data, 0, true);
4646 5089
4647 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 5090 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
4648 if (handlerUpdatePrimRotation != null) 5091 if (handlerUpdatePrimRotation != null)
4649 { 5092 {
4650 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); 5093 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W);
@@ -4667,7 +5110,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4667 case 28: 5110 case 28:
4668 Vector3 scale7 = new Vector3(block.Data, 0); 5111 Vector3 scale7 = new Vector3(block.Data, 0);
4669 5112
4670 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 5113 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
4671 if (handlerUpdatePrimGroupScale != null) 5114 if (handlerUpdatePrimGroupScale != null)
4672 { 5115 {
4673// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); 5116// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z);
@@ -4787,45 +5230,40 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4787 } 5230 }
4788 5231
4789 /// <summary> 5232 /// <summary>
4790 /// returns a byte array of the client set throttles Gets multiplied by the multiplier 5233 /// Sets the throttles from values supplied by the client
4791 ///
4792 /// </summary> 5234 /// </summary>
4793 /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> 5235 /// <param name="throttles"></param>
4794 /// <returns></returns> 5236 public void SetChildAgentThrottle(byte[] throttles)
4795 public byte[] GetThrottlesPacked(float multiplier)
4796 { 5237 {
4797 return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); 5238 m_udpClient.SetThrottles(throttles);
4798 } 5239 }
5240
4799 /// <summary> 5241 /// <summary>
4800 /// sets the throttles from values supplied by the client 5242 /// Get the current throttles for this client as a packed byte array
4801 /// </summary> 5243 /// </summary>
4802 /// <param name="throttles"></param> 5244 /// <param name="multiplier">Unused</param>
4803 public void SetChildAgentThrottle(byte[] throttles) 5245 /// <returns></returns>
5246 public byte[] GetThrottlesPacked(float multiplier)
4804 { 5247 {
4805 m_PacketHandler.PacketQueue.SetThrottleFromClient(throttles); 5248 return m_udpClient.GetThrottlesPacked();
4806 } 5249 }
4807 5250
4808 /// <summary> 5251 /// <summary>
4809 /// Method gets called when a new packet has arrived from the UDP 5252 /// Cruft?
4810 /// server. This happens after it's been decoded into a libsl object.
4811 /// </summary> 5253 /// </summary>
4812 /// <param name="NewPack">object containing the packet.</param>
4813 public virtual void InPacket(object NewPack) 5254 public virtual void InPacket(object NewPack)
4814 { 5255 {
4815 // Cast NewPack to Packet. 5256 throw new NotImplementedException();
4816 m_PacketHandler.InPacket((Packet) NewPack);
4817 } 5257 }
4818 5258
4819 /// <summary> 5259 /// <summary>
4820 /// This is the starting point for sending a simulator packet out to the client. 5260 /// This is the starting point for sending a simulator packet out to the client
4821 ///
4822 /// Please do not call this from outside the LindenUDP client stack.
4823 /// </summary> 5261 /// </summary>
4824 /// <param name="NewPack"></param> 5262 /// <param name="packet">Packet to send</param>
4825 /// <param name="throttlePacketType">Corresponds to the type of data that is going out. Enum</param> 5263 /// <param name="throttlePacketType">Throttling category for the packet</param>
4826 public void OutPacket(Packet NewPack, ThrottleOutPacketType throttlePacketType) 5264 private void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType)
4827 { 5265 {
4828 m_PacketHandler.OutPacket(NewPack, throttlePacketType); 5266 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true);
4829 } 5267 }
4830 5268
4831 public bool AddMoney(int debit) 5269 public bool AddMoney(int debit)
@@ -4869,7 +5307,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4869 return; 5307 return;
4870 } 5308 }
4871 5309
4872 handlerAutoPilotGo = OnAutoPilotGo; 5310 UpdateVector handlerAutoPilotGo = OnAutoPilotGo;
4873 if (handlerAutoPilotGo != null) 5311 if (handlerAutoPilotGo != null)
4874 { 5312 {
4875 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this); 5313 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this);
@@ -4921,7 +5359,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4921 } 5359 }
4922 #endregion 5360 #endregion
4923 5361
4924 handlerRequestAvatarProperties = OnRequestAvatarProperties; 5362 RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties;
4925 if (handlerRequestAvatarProperties != null) 5363 if (handlerRequestAvatarProperties != null)
4926 { 5364 {
4927 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); 5365 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
@@ -4962,7 +5400,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4962 args.Sender = this; 5400 args.Sender = this;
4963 args.SenderUUID = this.AgentId; 5401 args.SenderUUID = this.AgentId;
4964 5402
4965 handlerChatFromClient = OnChatFromClient; 5403 ChatMessage handlerChatFromClient = OnChatFromClient;
4966 if (handlerChatFromClient != null) 5404 if (handlerChatFromClient != null)
4967 handlerChatFromClient(this, args); 5405 handlerChatFromClient(this, args);
4968 } 5406 }
@@ -4980,7 +5418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4980 } 5418 }
4981 #endregion 5419 #endregion
4982 5420
4983 handlerUpdateAvatarProperties = OnUpdateAvatarProperties; 5421 UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties;
4984 if (handlerUpdateAvatarProperties != null) 5422 if (handlerUpdateAvatarProperties != null)
4985 { 5423 {
4986 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData; 5424 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
@@ -5020,7 +5458,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5020 args.Position = new Vector3(); 5458 args.Position = new Vector3();
5021 args.Scene = Scene; 5459 args.Scene = Scene;
5022 args.Sender = this; 5460 args.Sender = this;
5023 handlerChatFromClient2 = OnChatFromClient; 5461 ChatMessage handlerChatFromClient2 = OnChatFromClient;
5024 if (handlerChatFromClient2 != null) 5462 if (handlerChatFromClient2 != null)
5025 handlerChatFromClient2(this, args); 5463 handlerChatFromClient2(this, args);
5026 } 5464 }
@@ -5041,7 +5479,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5041 5479
5042 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 5480 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
5043 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message); 5481 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message);
5044 handlerInstantMessage = OnInstantMessage; 5482 ImprovedInstantMessage handlerInstantMessage = OnInstantMessage;
5045 5483
5046 if (handlerInstantMessage != null) 5484 if (handlerInstantMessage != null)
5047 { 5485 {
@@ -5084,7 +5522,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5084 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID); 5522 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID);
5085 } 5523 }
5086 5524
5087 handlerApproveFriendRequest = OnApproveFriendRequest; 5525 FriendActionDelegate handlerApproveFriendRequest = OnApproveFriendRequest;
5088 if (handlerApproveFriendRequest != null) 5526 if (handlerApproveFriendRequest != null)
5089 { 5527 {
5090 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders); 5528 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders);
@@ -5127,7 +5565,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5127 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; 5565 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
5128 UUID exFriendID = tfriendpack.ExBlock.OtherID; 5566 UUID exFriendID = tfriendpack.ExBlock.OtherID;
5129 5567
5130 handlerTerminateFriendship = OnTerminateFriendship; 5568 FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship;
5131 if (handlerTerminateFriendship != null) 5569 if (handlerTerminateFriendship != null)
5132 { 5570 {
5133 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 5571 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
@@ -5146,7 +5584,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5146 } 5584 }
5147 #endregion 5585 #endregion
5148 5586
5149 handlerRezObject = OnRezObject; 5587 RezObject handlerRezObject = OnRezObject;
5150 if (handlerRezObject != null) 5588 if (handlerRezObject != null)
5151 { 5589 {
5152 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, 5590 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
@@ -5169,7 +5607,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5169 } 5607 }
5170 #endregion 5608 #endregion
5171 5609
5172 handlerDeRezObject = OnDeRezObject; 5610 DeRezObject handlerDeRezObject = OnDeRezObject;
5173 if (handlerDeRezObject != null) 5611 if (handlerDeRezObject != null)
5174 { 5612 {
5175 List<uint> deRezIDs = new List<uint>(); 5613 List<uint> deRezIDs = new List<uint>();
@@ -5208,7 +5646,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5208 { 5646 {
5209 for (int i = 0; i < modify.ParcelData.Length; i++) 5647 for (int i = 0; i < modify.ParcelData.Length; i++)
5210 { 5648 {
5211 handlerModifyTerrain = OnModifyTerrain; 5649 ModifyTerrain handlerModifyTerrain = OnModifyTerrain;
5212 if (handlerModifyTerrain != null) 5650 if (handlerModifyTerrain != null)
5213 { 5651 {
5214 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, 5652 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
@@ -5225,7 +5663,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5225 5663
5226 case PacketType.RegionHandshakeReply: 5664 case PacketType.RegionHandshakeReply:
5227 5665
5228 handlerRegionHandShakeReply = OnRegionHandShakeReply; 5666 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
5229 if (handlerRegionHandShakeReply != null) 5667 if (handlerRegionHandShakeReply != null)
5230 { 5668 {
5231 handlerRegionHandShakeReply(this); 5669 handlerRegionHandShakeReply(this);
@@ -5234,14 +5672,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5234 break; 5672 break;
5235 5673
5236 case PacketType.AgentWearablesRequest: 5674 case PacketType.AgentWearablesRequest:
5237 handlerRequestWearables = OnRequestWearables; 5675 GenericCall2 handlerRequestWearables = OnRequestWearables;
5238 5676
5239 if (handlerRequestWearables != null) 5677 if (handlerRequestWearables != null)
5240 { 5678 {
5241 handlerRequestWearables(); 5679 handlerRequestWearables();
5242 } 5680 }
5243 5681
5244 handlerRequestAvatarsData = OnRequestAvatarsData; 5682 Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData;
5245 5683
5246 if (handlerRequestAvatarsData != null) 5684 if (handlerRequestAvatarsData != null)
5247 { 5685 {
@@ -5262,7 +5700,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5262 } 5700 }
5263 #endregion 5701 #endregion
5264 5702
5265 handlerSetAppearance = OnSetAppearance; 5703 SetAppearance handlerSetAppearance = OnSetAppearance;
5266 if (handlerSetAppearance != null) 5704 if (handlerSetAppearance != null)
5267 { 5705 {
5268 // Temporarily protect ourselves from the mantis #951 failure. 5706 // Temporarily protect ourselves from the mantis #951 failure.
@@ -5313,7 +5751,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5313 wearingArgs.NowWearing.Add(wearable); 5751 wearingArgs.NowWearing.Add(wearable);
5314 } 5752 }
5315 5753
5316 handlerAvatarNowWearing = OnAvatarNowWearing; 5754 AvatarNowWearing handlerAvatarNowWearing = OnAvatarNowWearing;
5317 if (handlerAvatarNowWearing != null) 5755 if (handlerAvatarNowWearing != null)
5318 { 5756 {
5319 handlerAvatarNowWearing(this, wearingArgs); 5757 handlerAvatarNowWearing(this, wearingArgs);
@@ -5322,7 +5760,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5322 break; 5760 break;
5323 5761
5324 case PacketType.RezSingleAttachmentFromInv: 5762 case PacketType.RezSingleAttachmentFromInv:
5325 handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; 5763 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
5326 if (handlerRezSingleAttachment != null) 5764 if (handlerRezSingleAttachment != null)
5327 { 5765 {
5328 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack; 5766 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack;
@@ -5343,7 +5781,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5343 break; 5781 break;
5344 5782
5345 case PacketType.RezMultipleAttachmentsFromInv: 5783 case PacketType.RezMultipleAttachmentsFromInv:
5346 handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; 5784 RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv;
5347 if (handlerRezMultipleAttachments != null) 5785 if (handlerRezMultipleAttachments != null)
5348 { 5786 {
5349 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; 5787 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack;
@@ -5354,7 +5792,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5354 break; 5792 break;
5355 5793
5356 case PacketType.DetachAttachmentIntoInv: 5794 case PacketType.DetachAttachmentIntoInv:
5357 handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; 5795 UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
5358 if (handlerDetachAttachmentIntoInv != null) 5796 if (handlerDetachAttachmentIntoInv != null)
5359 { 5797 {
5360 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; 5798 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
@@ -5384,7 +5822,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5384 } 5822 }
5385 #endregion 5823 #endregion
5386 5824
5387 handlerObjectAttach = OnObjectAttach; 5825 ObjectAttach handlerObjectAttach = OnObjectAttach;
5388 5826
5389 if (handlerObjectAttach != null) 5827 if (handlerObjectAttach != null)
5390 { 5828 {
@@ -5411,7 +5849,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5411 for (int j = 0; j < dett.ObjectData.Length; j++) 5849 for (int j = 0; j < dett.ObjectData.Length; j++)
5412 { 5850 {
5413 uint obj = dett.ObjectData[j].ObjectLocalID; 5851 uint obj = dett.ObjectData[j].ObjectLocalID;
5414 handlerObjectDetach = OnObjectDetach; 5852 ObjectDeselect handlerObjectDetach = OnObjectDetach;
5415 if (handlerObjectDetach != null) 5853 if (handlerObjectDetach != null)
5416 { 5854 {
5417 handlerObjectDetach(obj, this); 5855 handlerObjectDetach(obj, this);
@@ -5435,7 +5873,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5435 for (int j = 0; j < dropp.ObjectData.Length; j++) 5873 for (int j = 0; j < dropp.ObjectData.Length; j++)
5436 { 5874 {
5437 uint obj = dropp.ObjectData[j].ObjectLocalID; 5875 uint obj = dropp.ObjectData[j].ObjectLocalID;
5438 handlerObjectDrop = OnObjectDrop; 5876 ObjectDrop handlerObjectDrop = OnObjectDrop;
5439 if (handlerObjectDrop != null) 5877 if (handlerObjectDrop != null)
5440 { 5878 {
5441 handlerObjectDrop(obj, this); 5879 handlerObjectDrop(obj, this);
@@ -5455,14 +5893,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5455 } 5893 }
5456 #endregion 5894 #endregion
5457 5895
5458 handlerSetAlwaysRun = OnSetAlwaysRun; 5896 SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun;
5459 if (handlerSetAlwaysRun != null) 5897 if (handlerSetAlwaysRun != null)
5460 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); 5898 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun);
5461 5899
5462 break; 5900 break;
5463 5901
5464 case PacketType.CompleteAgentMovement: 5902 case PacketType.CompleteAgentMovement:
5465 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 5903 GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
5466 if (handlerCompleteMovementToRegion != null) 5904 if (handlerCompleteMovementToRegion != null)
5467 { 5905 {
5468 handlerCompleteMovementToRegion(); 5906 handlerCompleteMovementToRegion();
@@ -5531,7 +5969,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5531 arg.HeadRotation = x.HeadRotation; 5969 arg.HeadRotation = x.HeadRotation;
5532 arg.SessionID = x.SessionID; 5970 arg.SessionID = x.SessionID;
5533 arg.State = x.State; 5971 arg.State = x.State;
5534 handlerAgentUpdate = OnAgentUpdate; 5972 UpdateAgent handlerAgentUpdate = OnAgentUpdate;
5535 lastarg = arg; // save this set of arguments for nexttime 5973 lastarg = arg; // save this set of arguments for nexttime
5536 if (handlerAgentUpdate != null) 5974 if (handlerAgentUpdate != null)
5537 OnAgentUpdate(this, arg); 5975 OnAgentUpdate(this, arg);
@@ -5554,8 +5992,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5554 } 5992 }
5555 #endregion 5993 #endregion
5556 5994
5557 handlerStartAnim = null; 5995 StartAnim handlerStartAnim = null;
5558 handlerStopAnim = null; 5996 StopAnim handlerStopAnim = null;
5559 5997
5560 for (int i = 0; i < AgentAni.AnimationList.Length; i++) 5998 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
5561 { 5999 {
@@ -5592,7 +6030,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5592 } 6030 }
5593 #endregion 6031 #endregion
5594 6032
5595 handlerAgentRequestSit = OnAgentRequestSit; 6033 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
5596 if (handlerAgentRequestSit != null) 6034 if (handlerAgentRequestSit != null)
5597 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, 6035 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
5598 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); 6036 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
@@ -5613,7 +6051,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5613 } 6051 }
5614 #endregion 6052 #endregion
5615 6053
5616 handlerAgentSit = OnAgentSit; 6054 AgentSit handlerAgentSit = OnAgentSit;
5617 if (handlerAgentSit != null) 6055 if (handlerAgentSit != null)
5618 { 6056 {
5619 OnAgentSit(this, agentSit.AgentData.AgentID); 6057 OnAgentSit(this, agentSit.AgentData.AgentID);
@@ -5631,7 +6069,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5631 } 6069 }
5632 #endregion 6070 #endregion
5633 6071
5634 handlerSoundTrigger = OnSoundTrigger; 6072 SoundTrigger handlerSoundTrigger = OnSoundTrigger;
5635 if (handlerSoundTrigger != null) 6073 if (handlerSoundTrigger != null)
5636 { 6074 {
5637 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, 6075 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID,
@@ -5658,7 +6096,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5658 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; 6096 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
5659 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); 6097 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name));
5660 6098
5661 handlerAvatarPickerRequest = OnAvatarPickerRequest; 6099 AvatarPickerRequest handlerAvatarPickerRequest = OnAvatarPickerRequest;
5662 if (handlerAvatarPickerRequest != null) 6100 if (handlerAvatarPickerRequest != null)
5663 { 6101 {
5664 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, 6102 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID,
@@ -5678,7 +6116,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5678 } 6116 }
5679 #endregion 6117 #endregion
5680 6118
5681 handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest; 6119 FetchInventory handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest;
5682 6120
5683 if (handlerAgentDataUpdateRequest != null) 6121 if (handlerAgentDataUpdateRequest != null)
5684 { 6122 {
@@ -5688,7 +6126,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5688 break; 6126 break;
5689 6127
5690 case PacketType.UserInfoRequest: 6128 case PacketType.UserInfoRequest:
5691 handlerUserInfoRequest = OnUserInfoRequest; 6129 UserInfoRequest handlerUserInfoRequest = OnUserInfoRequest;
5692 if (handlerUserInfoRequest != null) 6130 if (handlerUserInfoRequest != null)
5693 { 6131 {
5694 handlerUserInfoRequest(this); 6132 handlerUserInfoRequest(this);
@@ -5711,7 +6149,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5711 } 6149 }
5712 #endregion 6150 #endregion
5713 6151
5714 handlerUpdateUserInfo = OnUpdateUserInfo; 6152 UpdateUserInfo handlerUpdateUserInfo = OnUpdateUserInfo;
5715 if (handlerUpdateUserInfo != null) 6153 if (handlerUpdateUserInfo != null)
5716 { 6154 {
5717 bool visible = true; 6155 bool visible = true;
@@ -5740,7 +6178,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5740 6178
5741 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) 6179 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
5742 { 6180 {
5743 handlerSetStartLocationRequest = OnSetStartLocationRequest; 6181 TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest;
5744 if (handlerSetStartLocationRequest != null) 6182 if (handlerSetStartLocationRequest != null)
5745 { 6183 {
5746 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos, 6184 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos,
@@ -5762,23 +6200,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5762 } 6200 }
5763 #endregion 6201 #endregion
5764 6202
5765 m_PacketHandler.PacketQueue.SetThrottleFromClient(atpack.Throttle.Throttles); 6203 m_udpClient.SetThrottles(atpack.Throttle.Throttles);
5766 break; 6204 break;
5767 6205
5768 case PacketType.AgentPause: 6206 case PacketType.AgentPause:
5769 m_probesWithNoIngressPackets = 0; 6207 m_udpClient.IsPaused = true;
5770 m_clientBlocked = true;
5771 break; 6208 break;
5772 6209
5773 case PacketType.AgentResume: 6210 case PacketType.AgentResume:
5774 m_probesWithNoIngressPackets = 0; 6211 m_udpClient.IsPaused = false;
5775 m_clientBlocked = false; 6212 SendStartPingCheck(m_udpClient.CurrentPingSequence++);
5776 SendStartPingCheck(0);
5777 6213
5778 break; 6214 break;
5779 6215
5780 case PacketType.ForceScriptControlRelease: 6216 case PacketType.ForceScriptControlRelease:
5781 handlerForceReleaseControls = OnForceReleaseControls; 6217 ForceReleaseControls handlerForceReleaseControls = OnForceReleaseControls;
5782 if (handlerForceReleaseControls != null) 6218 if (handlerForceReleaseControls != null)
5783 { 6219 {
5784 handlerForceReleaseControls(this, AgentId); 6220 handlerForceReleaseControls(this, AgentId);
@@ -5812,7 +6248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5812 childrenprims.Add(link.ObjectData[i].ObjectLocalID); 6248 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
5813 } 6249 }
5814 } 6250 }
5815 handlerLinkObjects = OnLinkObjects; 6251 LinkObjects handlerLinkObjects = OnLinkObjects;
5816 if (handlerLinkObjects != null) 6252 if (handlerLinkObjects != null)
5817 { 6253 {
5818 handlerLinkObjects(this, parentprimid, childrenprims); 6254 handlerLinkObjects(this, parentprimid, childrenprims);
@@ -5840,7 +6276,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5840 { 6276 {
5841 prims.Add(delink.ObjectData[i].ObjectLocalID); 6277 prims.Add(delink.ObjectData[i].ObjectLocalID);
5842 } 6278 }
5843 handlerDelinkObjects = OnDelinkObjects; 6279 DelinkObjects handlerDelinkObjects = OnDelinkObjects;
5844 if (handlerDelinkObjects != null) 6280 if (handlerDelinkObjects != null)
5845 { 6281 {
5846 handlerDelinkObjects(prims); 6282 handlerDelinkObjects(prims);
@@ -5872,7 +6308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5872 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the 6308 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the
5873 //object from rezing initially 6309 //object from rezing initially
5874 6310
5875 handlerAddPrim = OnAddPrim; 6311 AddNewPrim handlerAddPrim = OnAddPrim;
5876 if (handlerAddPrim != null) 6312 if (handlerAddPrim != null)
5877 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); 6313 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
5878 } 6314 }
@@ -5890,7 +6326,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5890 } 6326 }
5891 #endregion 6327 #endregion
5892 6328
5893 handlerUpdatePrimShape = null; 6329 UpdateShape handlerUpdatePrimShape = null;
5894 for (int i = 0; i < shapePacket.ObjectData.Length; i++) 6330 for (int i = 0; i < shapePacket.ObjectData.Length; i++)
5895 { 6331 {
5896 handlerUpdatePrimShape = OnUpdatePrimShape; 6332 handlerUpdatePrimShape = OnUpdatePrimShape;
@@ -5935,7 +6371,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5935 } 6371 }
5936 #endregion 6372 #endregion
5937 6373
5938 handlerUpdateExtraParams = OnUpdateExtraParams; 6374 ObjectExtraParams handlerUpdateExtraParams = OnUpdateExtraParams;
5939 if (handlerUpdateExtraParams != null) 6375 if (handlerUpdateExtraParams != null)
5940 { 6376 {
5941 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++) 6377 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++)
@@ -5960,7 +6396,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5960 6396
5961 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; 6397 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
5962 6398
5963 handlerObjectDuplicate = null; 6399 ObjectDuplicate handlerObjectDuplicate = null;
5964 6400
5965 for (int i = 0; i < dupe.ObjectData.Length; i++) 6401 for (int i = 0; i < dupe.ObjectData.Length; i++)
5966 { 6402 {
@@ -5987,7 +6423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5987 } 6423 }
5988 #endregion 6424 #endregion
5989 6425
5990 handlerObjectRequest = null; 6426 ObjectRequest handlerObjectRequest = null;
5991 6427
5992 for (int i = 0; i < incomingRequest.ObjectData.Length; i++) 6428 for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
5993 { 6429 {
@@ -6010,7 +6446,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6010 } 6446 }
6011 #endregion 6447 #endregion
6012 6448
6013 handlerObjectSelect = null; 6449 ObjectSelect handlerObjectSelect = null;
6014 6450
6015 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 6451 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
6016 { 6452 {
@@ -6033,7 +6469,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6033 } 6469 }
6034 #endregion 6470 #endregion
6035 6471
6036 handlerObjectDeselect = null; 6472 ObjectDeselect handlerObjectDeselect = null;
6037 6473
6038 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) 6474 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++)
6039 { 6475 {
@@ -6060,7 +6496,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6060 6496
6061 for (int i = 0; i < position.ObjectData.Length; i++) 6497 for (int i = 0; i < position.ObjectData.Length; i++)
6062 { 6498 {
6063 handlerUpdateVector = OnUpdatePrimGroupPosition; 6499 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition;
6064 if (handlerUpdateVector != null) 6500 if (handlerUpdateVector != null)
6065 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this); 6501 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this);
6066 } 6502 }
@@ -6081,7 +6517,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6081 6517
6082 for (int i = 0; i < scale.ObjectData.Length; i++) 6518 for (int i = 0; i < scale.ObjectData.Length; i++)
6083 { 6519 {
6084 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 6520 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
6085 if (handlerUpdatePrimGroupScale != null) 6521 if (handlerUpdatePrimGroupScale != null)
6086 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this); 6522 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this);
6087 } 6523 }
@@ -6102,7 +6538,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6102 6538
6103 for (int i = 0; i < rotation.ObjectData.Length; i++) 6539 for (int i = 0; i < rotation.ObjectData.Length; i++)
6104 { 6540 {
6105 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 6541 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
6106 if (handlerUpdatePrimRotation != null) 6542 if (handlerUpdatePrimRotation != null)
6107 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this); 6543 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this);
6108 } 6544 }
@@ -6120,7 +6556,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6120 } 6556 }
6121 #endregion 6557 #endregion
6122 6558
6123 handlerUpdatePrimFlags = OnUpdatePrimFlags; 6559 UpdatePrimFlags handlerUpdatePrimFlags = OnUpdatePrimFlags;
6124 6560
6125 if (handlerUpdatePrimFlags != null) 6561 if (handlerUpdatePrimFlags != null)
6126 { 6562 {
@@ -6137,7 +6573,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6137 case PacketType.ObjectImage: 6573 case PacketType.ObjectImage:
6138 ObjectImagePacket imagePack = (ObjectImagePacket)Pack; 6574 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
6139 6575
6140 handlerUpdatePrimTexture = null; 6576 UpdatePrimTexture handlerUpdatePrimTexture = null;
6141 for (int i = 0; i < imagePack.ObjectData.Length; i++) 6577 for (int i = 0; i < imagePack.ObjectData.Length; i++)
6142 { 6578 {
6143 handlerUpdatePrimTexture = OnUpdatePrimTexture; 6579 handlerUpdatePrimTexture = OnUpdatePrimTexture;
@@ -6160,7 +6596,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6160 } 6596 }
6161 #endregion 6597 #endregion
6162 6598
6163 handlerGrabObject = OnGrabObject; 6599 GrabObject handlerGrabObject = OnGrabObject;
6164 6600
6165 if (handlerGrabObject != null) 6601 if (handlerGrabObject != null)
6166 { 6602 {
@@ -6194,7 +6630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6194 } 6630 }
6195 #endregion 6631 #endregion
6196 6632
6197 handlerGrabUpdate = OnGrabUpdate; 6633 MoveObject handlerGrabUpdate = OnGrabUpdate;
6198 6634
6199 if (handlerGrabUpdate != null) 6635 if (handlerGrabUpdate != null)
6200 { 6636 {
@@ -6229,7 +6665,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6229 } 6665 }
6230 #endregion 6666 #endregion
6231 6667
6232 handlerDeGrabObject = OnDeGrabObject; 6668 DeGrabObject handlerDeGrabObject = OnDeGrabObject;
6233 if (handlerDeGrabObject != null) 6669 if (handlerDeGrabObject != null)
6234 { 6670 {
6235 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); 6671 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
@@ -6263,7 +6699,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6263 } 6699 }
6264 #endregion 6700 #endregion
6265 6701
6266 handlerSpinStart = OnSpinStart; 6702 SpinStart handlerSpinStart = OnSpinStart;
6267 if (handlerSpinStart != null) 6703 if (handlerSpinStart != null)
6268 { 6704 {
6269 handlerSpinStart(spinStart.ObjectData.ObjectID, this); 6705 handlerSpinStart(spinStart.ObjectData.ObjectID, this);
@@ -6287,7 +6723,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6287 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle); 6723 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle);
6288 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle); 6724 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle);
6289 6725
6290 handlerSpinUpdate = OnSpinUpdate; 6726 SpinObject handlerSpinUpdate = OnSpinUpdate;
6291 if (handlerSpinUpdate != null) 6727 if (handlerSpinUpdate != null)
6292 { 6728 {
6293 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this); 6729 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this);
@@ -6306,7 +6742,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6306 } 6742 }
6307 #endregion 6743 #endregion
6308 6744
6309 handlerSpinStop = OnSpinStop; 6745 SpinStop handlerSpinStop = OnSpinStop;
6310 if (handlerSpinStop != null) 6746 if (handlerSpinStop != null)
6311 { 6747 {
6312 handlerSpinStop(spinStop.ObjectData.ObjectID, this); 6748 handlerSpinStop(spinStop.ObjectData.ObjectID, this);
@@ -6325,7 +6761,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6325 } 6761 }
6326 #endregion 6762 #endregion
6327 6763
6328 handlerObjectDescription = null; 6764 GenericCall7 handlerObjectDescription = null;
6329 6765
6330 for (int i = 0; i < objDes.ObjectData.Length; i++) 6766 for (int i = 0; i < objDes.ObjectData.Length; i++)
6331 { 6767 {
@@ -6349,7 +6785,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6349 } 6785 }
6350 #endregion 6786 #endregion
6351 6787
6352 handlerObjectName = null; 6788 GenericCall7 handlerObjectName = null;
6353 for (int i = 0; i < objName.ObjectData.Length; i++) 6789 for (int i = 0; i < objName.ObjectData.Length; i++)
6354 { 6790 {
6355 handlerObjectName = OnObjectName; 6791 handlerObjectName = OnObjectName;
@@ -6377,7 +6813,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6377 UUID AgentID = newobjPerms.AgentData.AgentID; 6813 UUID AgentID = newobjPerms.AgentData.AgentID;
6378 UUID SessionID = newobjPerms.AgentData.SessionID; 6814 UUID SessionID = newobjPerms.AgentData.SessionID;
6379 6815
6380 handlerObjectPermissions = null; 6816 ObjectPermissions handlerObjectPermissions = null;
6381 6817
6382 for (int i = 0; i < newobjPerms.ObjectData.Length; i++) 6818 for (int i = 0; i < newobjPerms.ObjectData.Length; i++)
6383 { 6819 {
@@ -6426,7 +6862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6426 for (int i = 0; i < undoitem.ObjectData.Length; i++) 6862 for (int i = 0; i < undoitem.ObjectData.Length; i++)
6427 { 6863 {
6428 UUID objiD = undoitem.ObjectData[i].ObjectID; 6864 UUID objiD = undoitem.ObjectData[i].ObjectID;
6429 handlerOnUndo = OnUndo; 6865 AgentSit handlerOnUndo = OnUndo;
6430 if (handlerOnUndo != null) 6866 if (handlerOnUndo != null)
6431 { 6867 {
6432 handlerOnUndo(this, objiD); 6868 handlerOnUndo(this, objiD);
@@ -6447,8 +6883,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6447 } 6883 }
6448 #endregion 6884 #endregion
6449 6885
6450 handlerObjectDuplicateOnRay = null; 6886 ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null;
6451
6452 6887
6453 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++) 6888 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++)
6454 { 6889 {
@@ -6478,7 +6913,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6478 6913
6479 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; 6914 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData;
6480 6915
6481 handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily; 6916 RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily;
6482 6917
6483 if (handlerRequestObjectPropertiesFamily != null) 6918 if (handlerRequestObjectPropertiesFamily != null)
6484 { 6919 {
@@ -6490,7 +6925,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6490 case PacketType.ObjectIncludeInSearch: 6925 case PacketType.ObjectIncludeInSearch:
6491 //This lets us set objects to appear in search (stuff like DataSnapshot, etc) 6926 //This lets us set objects to appear in search (stuff like DataSnapshot, etc)
6492 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack; 6927 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
6493 handlerObjectIncludeInSearch = null; 6928 ObjectIncludeInSearch handlerObjectIncludeInSearch = null;
6494 6929
6495 #region Packet Session and User Check 6930 #region Packet Session and User Check
6496 if (m_checkPackets) 6931 if (m_checkPackets)
@@ -6527,7 +6962,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6527 } 6962 }
6528 #endregion 6963 #endregion
6529 6964
6530 handlerScriptAnswer = OnScriptAnswer; 6965 ScriptAnswer handlerScriptAnswer = OnScriptAnswer;
6531 if (handlerScriptAnswer != null) 6966 if (handlerScriptAnswer != null)
6532 { 6967 {
6533 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions); 6968 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
@@ -6546,7 +6981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6546 } 6981 }
6547 #endregion 6982 #endregion
6548 6983
6549 handlerObjectClickAction = OnObjectClickAction; 6984 GenericCall7 handlerObjectClickAction = OnObjectClickAction;
6550 if (handlerObjectClickAction != null) 6985 if (handlerObjectClickAction != null)
6551 { 6986 {
6552 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) 6987 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData)
@@ -6570,7 +7005,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6570 } 7005 }
6571 #endregion 7006 #endregion
6572 7007
6573 handlerObjectMaterial = OnObjectMaterial; 7008 GenericCall7 handlerObjectMaterial = OnObjectMaterial;
6574 if (handlerObjectMaterial != null) 7009 if (handlerObjectMaterial != null)
6575 { 7010 {
6576 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData) 7011 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData)
@@ -6724,7 +7159,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6724 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); 7159 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString());
6725 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); 7160 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
6726 7161
6727 handlerAssetUploadRequest = OnAssetUploadRequest; 7162 UDPAssetUploadRequest handlerAssetUploadRequest = OnAssetUploadRequest;
6728 7163
6729 if (handlerAssetUploadRequest != null) 7164 if (handlerAssetUploadRequest != null)
6730 { 7165 {
@@ -6737,7 +7172,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6737 case PacketType.RequestXfer: 7172 case PacketType.RequestXfer:
6738 RequestXferPacket xferReq = (RequestXferPacket)Pack; 7173 RequestXferPacket xferReq = (RequestXferPacket)Pack;
6739 7174
6740 handlerRequestXfer = OnRequestXfer; 7175 RequestXfer handlerRequestXfer = OnRequestXfer;
6741 7176
6742 if (handlerRequestXfer != null) 7177 if (handlerRequestXfer != null)
6743 { 7178 {
@@ -6747,7 +7182,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6747 case PacketType.SendXferPacket: 7182 case PacketType.SendXferPacket:
6748 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; 7183 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
6749 7184
6750 handlerXferReceive = OnXferReceive; 7185 XferReceive handlerXferReceive = OnXferReceive;
6751 if (handlerXferReceive != null) 7186 if (handlerXferReceive != null)
6752 { 7187 {
6753 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); 7188 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
@@ -6756,7 +7191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6756 case PacketType.ConfirmXferPacket: 7191 case PacketType.ConfirmXferPacket:
6757 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; 7192 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
6758 7193
6759 handlerConfirmXfer = OnConfirmXfer; 7194 ConfirmXfer handlerConfirmXfer = OnConfirmXfer;
6760 if (handlerConfirmXfer != null) 7195 if (handlerConfirmXfer != null)
6761 { 7196 {
6762 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); 7197 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
@@ -6764,7 +7199,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6764 break; 7199 break;
6765 case PacketType.AbortXfer: 7200 case PacketType.AbortXfer:
6766 AbortXferPacket abortXfer = (AbortXferPacket)Pack; 7201 AbortXferPacket abortXfer = (AbortXferPacket)Pack;
6767 handlerAbortXfer = OnAbortXfer; 7202 AbortXfer handlerAbortXfer = OnAbortXfer;
6768 if (handlerAbortXfer != null) 7203 if (handlerAbortXfer != null)
6769 { 7204 {
6770 handlerAbortXfer(this, abortXfer.XferID.ID); 7205 handlerAbortXfer(this, abortXfer.XferID.ID);
@@ -6783,7 +7218,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6783 } 7218 }
6784 #endregion 7219 #endregion
6785 7220
6786 handlerCreateInventoryFolder = OnCreateNewInventoryFolder; 7221 CreateInventoryFolder handlerCreateInventoryFolder = OnCreateNewInventoryFolder;
6787 if (handlerCreateInventoryFolder != null) 7222 if (handlerCreateInventoryFolder != null)
6788 { 7223 {
6789 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID, 7224 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID,
@@ -6806,7 +7241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6806 } 7241 }
6807 #endregion 7242 #endregion
6808 7243
6809 handlerUpdateInventoryFolder = null; 7244 UpdateInventoryFolder handlerUpdateInventoryFolder = null;
6810 7245
6811 for (int i = 0; i < invFolderx.FolderData.Length; i++) 7246 for (int i = 0; i < invFolderx.FolderData.Length; i++)
6812 { 7247 {
@@ -6835,7 +7270,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6835 } 7270 }
6836 #endregion 7271 #endregion
6837 7272
6838 handlerMoveInventoryFolder = null; 7273 MoveInventoryFolder handlerMoveInventoryFolder = null;
6839 7274
6840 for (int i = 0; i < invFoldery.InventoryData.Length; i++) 7275 for (int i = 0; i < invFoldery.InventoryData.Length; i++)
6841 { 7276 {
@@ -6860,7 +7295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6860 } 7295 }
6861 #endregion 7296 #endregion
6862 7297
6863 handlerCreateNewInventoryItem = OnCreateNewInventoryItem; 7298 CreateNewInventoryItem handlerCreateNewInventoryItem = OnCreateNewInventoryItem;
6864 if (handlerCreateNewInventoryItem != null) 7299 if (handlerCreateNewInventoryItem != null)
6865 { 7300 {
6866 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, 7301 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID,
@@ -6889,7 +7324,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6889 } 7324 }
6890 #endregion 7325 #endregion
6891 7326
6892 handlerFetchInventory = null; 7327 FetchInventory handlerFetchInventory = null;
6893 7328
6894 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++) 7329 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++)
6895 { 7330 {
@@ -6915,7 +7350,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6915 } 7350 }
6916 #endregion 7351 #endregion
6917 7352
6918 handlerFetchInventoryDescendents = OnFetchInventoryDescendents; 7353 FetchInventoryDescendents handlerFetchInventoryDescendents = OnFetchInventoryDescendents;
6919 if (handlerFetchInventoryDescendents != null) 7354 if (handlerFetchInventoryDescendents != null)
6920 { 7355 {
6921 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, 7356 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID,
@@ -6935,7 +7370,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6935 } 7370 }
6936 #endregion 7371 #endregion
6937 7372
6938 handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents; 7373 PurgeInventoryDescendents handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents;
6939 if (handlerPurgeInventoryDescendents != null) 7374 if (handlerPurgeInventoryDescendents != null)
6940 { 7375 {
6941 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); 7376 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID);
@@ -6955,7 +7390,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6955 7390
6956 if (OnUpdateInventoryItem != null) 7391 if (OnUpdateInventoryItem != null)
6957 { 7392 {
6958 handlerUpdateInventoryItem = null; 7393 UpdateInventoryItem handlerUpdateInventoryItem = null;
6959 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++) 7394 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
6960 { 7395 {
6961 handlerUpdateInventoryItem = OnUpdateInventoryItem; 7396 handlerUpdateInventoryItem = OnUpdateInventoryItem;
@@ -6977,49 +7412,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6977 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice; 7412 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice;
6978 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType; 7413 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType;
6979 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags; 7414 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags;
6980 /* 7415
6981 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID,
6982 inventoryItemUpdate.InventoryData[i].ItemID,
6983 Util.FieldToString(inventoryItemUpdate.InventoryData[i].Name),
6984 Util.FieldToString(inventoryItemUpdate.InventoryData[i].Description),
6985 inventoryItemUpdate.InventoryData[i].NextOwnerMask);
6986 */
6987 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID, 7416 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID,
6988 inventoryItemUpdate.InventoryData[i].ItemID, 7417 inventoryItemUpdate.InventoryData[i].ItemID,
6989 itemUpd); 7418 itemUpd);
6990 } 7419 }
6991 } 7420 }
6992 } 7421 }
6993 //m_log.Debug(Pack.ToString());
6994 /*for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
6995 {
6996 if (inventoryItemUpdate.InventoryData[i].TransactionID != UUID.Zero)
6997 {
6998 AssetBase asset = m_assetCache.GetAsset(inventoryItemUpdate.InventoryData[i].TransactionID.Combine(this.SecureSessionId));
6999 if (asset != null)
7000 {
7001 // m_log.Debug("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache");
7002 m_inventoryCache.UpdateInventoryItemAsset(this, inventoryItemUpdate.InventoryData[i].ItemID, asset);
7003 }
7004 else
7005 {
7006 asset = this.UploadAssets.AddUploadToAssetCache(inventoryItemUpdate.InventoryData[i].TransactionID);
7007 if (asset != null)
7008 {
7009 //m_log.Debug("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache");
7010 m_inventoryCache.UpdateInventoryItemAsset(this, inventoryItemUpdate.InventoryData[i].ItemID, asset);
7011 }
7012 else
7013 {
7014 //m_log.Debug("trying to update inventory item, but asset is null");
7015 }
7016 }
7017 }
7018 else
7019 {
7020 m_inventoryCache.UpdateInventoryItemDetails(this, inventoryItemUpdate.InventoryData[i].ItemID, inventoryItemUpdate.InventoryData[i]); ;
7021 }
7022 }*/
7023 break; 7422 break;
7024 case PacketType.CopyInventoryItem: 7423 case PacketType.CopyInventoryItem:
7025 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; 7424 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack;
@@ -7033,7 +7432,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7033 } 7432 }
7034 #endregion 7433 #endregion
7035 7434
7036 handlerCopyInventoryItem = null; 7435 CopyInventoryItem handlerCopyInventoryItem = null;
7037 if (OnCopyInventoryItem != null) 7436 if (OnCopyInventoryItem != null)
7038 { 7437 {
7039 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) 7438 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData)
@@ -7062,7 +7461,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7062 7461
7063 if (OnMoveInventoryItem != null) 7462 if (OnMoveInventoryItem != null)
7064 { 7463 {
7065 handlerMoveInventoryItem = null; 7464 MoveInventoryItem handlerMoveInventoryItem = null;
7066 InventoryItemBase itm = null; 7465 InventoryItemBase itm = null;
7067 List<InventoryItemBase> items = new List<InventoryItemBase>(); 7466 List<InventoryItemBase> items = new List<InventoryItemBase>();
7068 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) 7467 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
@@ -7095,7 +7494,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7095 7494
7096 if (OnRemoveInventoryItem != null) 7495 if (OnRemoveInventoryItem != null)
7097 { 7496 {
7098 handlerRemoveInventoryItem = null; 7497 RemoveInventoryItem handlerRemoveInventoryItem = null;
7099 List<UUID> uuids = new List<UUID>(); 7498 List<UUID> uuids = new List<UUID>();
7100 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) 7499 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData)
7101 { 7500 {
@@ -7123,7 +7522,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7123 7522
7124 if (OnRemoveInventoryFolder != null) 7523 if (OnRemoveInventoryFolder != null)
7125 { 7524 {
7126 handlerRemoveInventoryFolder = null; 7525 RemoveInventoryFolder handlerRemoveInventoryFolder = null;
7127 List<UUID> uuids = new List<UUID>(); 7526 List<UUID> uuids = new List<UUID>();
7128 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) 7527 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
7129 { 7528 {
@@ -7148,7 +7547,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7148 #endregion 7547 #endregion
7149 if (OnRemoveInventoryFolder != null) 7548 if (OnRemoveInventoryFolder != null)
7150 { 7549 {
7151 handlerRemoveInventoryFolder = null; 7550 RemoveInventoryFolder handlerRemoveInventoryFolder = null;
7152 List<UUID> uuids = new List<UUID>(); 7551 List<UUID> uuids = new List<UUID>();
7153 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) 7552 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
7154 { 7553 {
@@ -7163,7 +7562,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7163 7562
7164 if (OnRemoveInventoryItem != null) 7563 if (OnRemoveInventoryItem != null)
7165 { 7564 {
7166 handlerRemoveInventoryItem = null; 7565 RemoveInventoryItem handlerRemoveInventoryItem = null;
7167 List<UUID> uuids = new List<UUID>(); 7566 List<UUID> uuids = new List<UUID>();
7168 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) 7567 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData)
7169 { 7568 {
@@ -7188,7 +7587,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7188 } 7587 }
7189 #endregion 7588 #endregion
7190 7589
7191 handlerRequestTaskInventory = OnRequestTaskInventory; 7590 RequestTaskInventory handlerRequestTaskInventory = OnRequestTaskInventory;
7192 if (handlerRequestTaskInventory != null) 7591 if (handlerRequestTaskInventory != null)
7193 { 7592 {
7194 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); 7593 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID);
@@ -7210,7 +7609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7210 { 7609 {
7211 if (updatetask.UpdateData.Key == 0) 7610 if (updatetask.UpdateData.Key == 0)
7212 { 7611 {
7213 handlerUpdateTaskInventory = OnUpdateTaskInventory; 7612 UpdateTaskInventory handlerUpdateTaskInventory = OnUpdateTaskInventory;
7214 if (handlerUpdateTaskInventory != null) 7613 if (handlerUpdateTaskInventory != null)
7215 { 7614 {
7216 TaskInventoryItem newTaskItem = new TaskInventoryItem(); 7615 TaskInventoryItem newTaskItem = new TaskInventoryItem();
@@ -7254,7 +7653,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7254 } 7653 }
7255 #endregion 7654 #endregion
7256 7655
7257 handlerRemoveTaskItem = OnRemoveTaskItem; 7656 RemoveTaskInventory handlerRemoveTaskItem = OnRemoveTaskItem;
7258 7657
7259 if (handlerRemoveTaskItem != null) 7658 if (handlerRemoveTaskItem != null)
7260 { 7659 {
@@ -7276,7 +7675,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7276 } 7675 }
7277 #endregion 7676 #endregion
7278 7677
7279 handlerMoveTaskItem = OnMoveTaskItem; 7678 MoveTaskInventory handlerMoveTaskItem = OnMoveTaskItem;
7280 7679
7281 if (handlerMoveTaskItem != null) 7680 if (handlerMoveTaskItem != null)
7282 { 7681 {
@@ -7301,7 +7700,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7301 } 7700 }
7302 #endregion 7701 #endregion
7303 7702
7304 handlerRezScript = OnRezScript; 7703 RezScript handlerRezScript = OnRezScript;
7305 InventoryItemBase item = new InventoryItemBase(); 7704 InventoryItemBase item = new InventoryItemBase();
7306 item.ID = rezScriptx.InventoryBlock.ItemID; 7705 item.ID = rezScriptx.InventoryBlock.ItemID;
7307 item.Folder = rezScriptx.InventoryBlock.FolderID; 7706 item.Folder = rezScriptx.InventoryBlock.FolderID;
@@ -7344,7 +7743,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7344 } 7743 }
7345 #endregion 7744 #endregion
7346 7745
7347 handlerRequestMapBlocks = OnRequestMapBlocks; 7746 RequestMapBlocks handlerRequestMapBlocks = OnRequestMapBlocks;
7348 if (handlerRequestMapBlocks != null) 7747 if (handlerRequestMapBlocks != null)
7349 { 7748 {
7350 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, 7749 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY,
@@ -7365,7 +7764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7365 7764
7366 string mapName = Util.UTF8.GetString(map.NameData.Name, 0, 7765 string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
7367 map.NameData.Name.Length - 1); 7766 map.NameData.Name.Length - 1);
7368 handlerMapNameRequest = OnMapNameRequest; 7767 RequestMapName handlerMapNameRequest = OnMapNameRequest;
7369 if (handlerMapNameRequest != null) 7768 if (handlerMapNameRequest != null)
7370 { 7769 {
7371 handlerMapNameRequest(this, mapName); 7770 handlerMapNameRequest(this, mapName);
@@ -7416,7 +7815,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7416 else 7815 else
7417 { 7816 {
7418 // Teleport home request 7817 // Teleport home request
7419 handlerTeleportHomeRequest = OnTeleportHomeRequest; 7818 UUIDNameRequest handlerTeleportHomeRequest = OnTeleportHomeRequest;
7420 if (handlerTeleportHomeRequest != null) 7819 if (handlerTeleportHomeRequest != null)
7421 { 7820 {
7422 handlerTeleportHomeRequest(AgentId, this); 7821 handlerTeleportHomeRequest(AgentId, this);
@@ -7424,7 +7823,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7424 break; 7823 break;
7425 } 7824 }
7426 7825
7427 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; 7826 TeleportLandmarkRequest handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest;
7428 if (handlerTeleportLandmarkRequest != null) 7827 if (handlerTeleportLandmarkRequest != null)
7429 { 7828 {
7430 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position); 7829 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position);
@@ -7455,7 +7854,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7455 } 7854 }
7456 #endregion 7855 #endregion
7457 7856
7458 handlerTeleportLocationRequest = OnTeleportLocationRequest; 7857 TeleportLocationRequest handlerTeleportLocationRequest = OnTeleportLocationRequest;
7459 if (handlerTeleportLocationRequest != null) 7858 if (handlerTeleportLocationRequest != null)
7460 { 7859 {
7461 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, 7860 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position,
@@ -7478,7 +7877,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7478 7877
7479 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) 7878 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
7480 { 7879 {
7481 handlerNameRequest = OnNameFromUUIDRequest; 7880 UUIDNameRequest handlerNameRequest = OnNameFromUUIDRequest;
7482 if (handlerNameRequest != null) 7881 if (handlerNameRequest != null)
7483 { 7882 {
7484 handlerNameRequest(UUIDBlock.ID, this); 7883 handlerNameRequest(UUIDBlock.ID, this);
@@ -7491,7 +7890,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7491 case PacketType.RegionHandleRequest: 7890 case PacketType.RegionHandleRequest:
7492 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; 7891 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
7493 7892
7494 handlerRegionHandleRequest = OnRegionHandleRequest; 7893 RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
7495 if (handlerRegionHandleRequest != null) 7894 if (handlerRegionHandleRequest != null)
7496 { 7895 {
7497 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); 7896 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
@@ -7510,7 +7909,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7510 } 7909 }
7511 #endregion 7910 #endregion
7512 7911
7513 handlerParcelInfoRequest = OnParcelInfoRequest; 7912 ParcelInfoRequest handlerParcelInfoRequest = OnParcelInfoRequest;
7514 if (handlerParcelInfoRequest != null) 7913 if (handlerParcelInfoRequest != null)
7515 { 7914 {
7516 handlerParcelInfoRequest(this, pirPack.Data.ParcelID); 7915 handlerParcelInfoRequest(this, pirPack.Data.ParcelID);
@@ -7529,7 +7928,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7529 } 7928 }
7530 #endregion 7929 #endregion
7531 7930
7532 handlerParcelAccessListRequest = OnParcelAccessListRequest; 7931 ParcelAccessListRequest handlerParcelAccessListRequest = OnParcelAccessListRequest;
7533 7932
7534 if (handlerParcelAccessListRequest != null) 7933 if (handlerParcelAccessListRequest != null)
7535 { 7934 {
@@ -7561,7 +7960,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7561 entries.Add(entry); 7960 entries.Add(entry);
7562 } 7961 }
7563 7962
7564 handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest; 7963 ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest;
7565 if (handlerParcelAccessListUpdateRequest != null) 7964 if (handlerParcelAccessListUpdateRequest != null)
7566 { 7965 {
7567 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, 7966 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
@@ -7582,7 +7981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7582 } 7981 }
7583 #endregion 7982 #endregion
7584 7983
7585 handlerParcelPropertiesRequest = OnParcelPropertiesRequest; 7984 ParcelPropertiesRequest handlerParcelPropertiesRequest = OnParcelPropertiesRequest;
7586 if (handlerParcelPropertiesRequest != null) 7985 if (handlerParcelPropertiesRequest != null)
7587 { 7986 {
7588 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), 7987 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West),
@@ -7605,7 +8004,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7605 } 8004 }
7606 #endregion 8005 #endregion
7607 8006
7608 handlerParcelDivideRequest = OnParcelDivideRequest; 8007 ParcelDivideRequest handlerParcelDivideRequest = OnParcelDivideRequest;
7609 if (handlerParcelDivideRequest != null) 8008 if (handlerParcelDivideRequest != null)
7610 { 8009 {
7611 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), 8010 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West),
@@ -7626,7 +8025,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7626 } 8025 }
7627 #endregion 8026 #endregion
7628 8027
7629 handlerParcelJoinRequest = OnParcelJoinRequest; 8028 ParcelJoinRequest handlerParcelJoinRequest = OnParcelJoinRequest;
7630 8029
7631 if (handlerParcelJoinRequest != null) 8030 if (handlerParcelJoinRequest != null)
7632 { 8031 {
@@ -7648,7 +8047,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7648 } 8047 }
7649 #endregion 8048 #endregion
7650 8049
7651 handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest; 8050 ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest;
7652 8051
7653 if (handlerParcelPropertiesUpdateRequest != null) 8052 if (handlerParcelPropertiesUpdateRequest != null)
7654 { 8053 {
@@ -7694,7 +8093,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7694 returnIDs.Add(rb.ReturnID); 8093 returnIDs.Add(rb.ReturnID);
7695 } 8094 }
7696 8095
7697 handlerParcelSelectObjects = OnParcelSelectObjects; 8096 ParcelSelectObjects handlerParcelSelectObjects = OnParcelSelectObjects;
7698 8097
7699 if (handlerParcelSelectObjects != null) 8098 if (handlerParcelSelectObjects != null)
7700 { 8099 {
@@ -7715,7 +8114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7715 } 8114 }
7716 #endregion 8115 #endregion
7717 8116
7718 handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; 8117 ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest;
7719 8118
7720 if (handlerParcelObjectOwnerRequest != null) 8119 if (handlerParcelObjectOwnerRequest != null)
7721 { 8120 {
@@ -7734,7 +8133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7734 } 8133 }
7735 #endregion 8134 #endregion
7736 8135
7737 handlerParcelGodForceOwner = OnParcelGodForceOwner; 8136 ParcelGodForceOwner handlerParcelGodForceOwner = OnParcelGodForceOwner;
7738 if (handlerParcelGodForceOwner != null) 8137 if (handlerParcelGodForceOwner != null)
7739 { 8138 {
7740 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); 8139 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this);
@@ -7752,7 +8151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7752 } 8151 }
7753 #endregion 8152 #endregion
7754 8153
7755 handlerParcelAbandonRequest = OnParcelAbandonRequest; 8154 ParcelAbandonRequest handlerParcelAbandonRequest = OnParcelAbandonRequest;
7756 if (handlerParcelAbandonRequest != null) 8155 if (handlerParcelAbandonRequest != null)
7757 { 8156 {
7758 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); 8157 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this);
@@ -7770,7 +8169,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7770 } 8169 }
7771 #endregion 8170 #endregion
7772 8171
7773 handlerParcelReclaim = OnParcelReclaim; 8172 ParcelReclaim handlerParcelReclaim = OnParcelReclaim;
7774 if (handlerParcelReclaim != null) 8173 if (handlerParcelReclaim != null)
7775 { 8174 {
7776 handlerParcelReclaim(reclaimPacket.Data.LocalID, this); 8175 handlerParcelReclaim(reclaimPacket.Data.LocalID, this);
@@ -7799,7 +8198,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7799 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) 8198 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++)
7800 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; 8199 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID;
7801 8200
7802 handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; 8201 ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest;
7803 if (handlerParcelReturnObjectsRequest != null) 8202 if (handlerParcelReturnObjectsRequest != null)
7804 { 8203 {
7805 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this); 8204 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this);
@@ -7819,7 +8218,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7819 } 8218 }
7820 #endregion 8219 #endregion
7821 8220
7822 handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; 8221 ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime;
7823 if (handlerParcelSetOtherCleanTime != null) 8222 if (handlerParcelSetOtherCleanTime != null)
7824 { 8223 {
7825 handlerParcelSetOtherCleanTime(this, 8224 handlerParcelSetOtherCleanTime(this,
@@ -7840,7 +8239,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7840 } 8239 }
7841 #endregion 8240 #endregion
7842 8241
7843 handlerLandStatRequest = OnLandStatRequest; 8242 GodLandStatRequest handlerLandStatRequest = OnLandStatRequest;
7844 if (handlerLandStatRequest != null) 8243 if (handlerLandStatRequest != null)
7845 { 8244 {
7846 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); 8245 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this);
@@ -7860,7 +8259,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7860 } 8259 }
7861 #endregion 8260 #endregion
7862 8261
7863 handlerParcelDwellRequest = OnParcelDwellRequest; 8262 ParcelDwellRequest handlerParcelDwellRequest = OnParcelDwellRequest;
7864 if (handlerParcelDwellRequest != null) 8263 if (handlerParcelDwellRequest != null)
7865 { 8264 {
7866 handlerParcelDwellRequest(dwellrq.Data.LocalID, this); 8265 handlerParcelDwellRequest(dwellrq.Data.LocalID, this);
@@ -8104,7 +8503,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8104 { 8503 {
8105 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake") 8504 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake")
8106 { 8505 {
8107 handlerBakeTerrain = OnBakeTerrain; 8506 BakeTerrain handlerBakeTerrain = OnBakeTerrain;
8108 if (handlerBakeTerrain != null) 8507 if (handlerBakeTerrain != null)
8109 { 8508 {
8110 handlerBakeTerrain(this); 8509 handlerBakeTerrain(this);
@@ -8114,7 +8513,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8114 { 8513 {
8115 if (messagePacket.ParamList.Length > 1) 8514 if (messagePacket.ParamList.Length > 1)
8116 { 8515 {
8117 handlerRequestTerrain = OnRequestTerrain; 8516 RequestTerrain handlerRequestTerrain = OnRequestTerrain;
8118 if (handlerRequestTerrain != null) 8517 if (handlerRequestTerrain != null)
8119 { 8518 {
8120 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8519 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8125,7 +8524,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8125 { 8524 {
8126 if (messagePacket.ParamList.Length > 1) 8525 if (messagePacket.ParamList.Length > 1)
8127 { 8526 {
8128 handlerUploadTerrain = OnUploadTerrain; 8527 RequestTerrain handlerUploadTerrain = OnUploadTerrain;
8129 if (handlerUploadTerrain != null) 8528 if (handlerUploadTerrain != null)
8130 { 8529 {
8131 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8530 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8147,7 +8546,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8147 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8546 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
8148 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); 8547 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter));
8149 8548
8150 handlerEstateChangeInfo = OnEstateChangeInfo; 8549 EstateChangeInfo handlerEstateChangeInfo = OnEstateChangeInfo;
8151 if (handlerEstateChangeInfo != null) 8550 if (handlerEstateChangeInfo != null)
8152 { 8551 {
8153 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2); 8552 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2);
@@ -8181,7 +8580,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8181 } 8580 }
8182 #endregion 8581 #endregion
8183 8582
8184 handlerRegionInfoRequest = OnRegionInfoRequest; 8583 RegionInfoRequest handlerRegionInfoRequest = OnRegionInfoRequest;
8185 if (handlerRegionInfoRequest != null) 8584 if (handlerRegionInfoRequest != null)
8186 { 8585 {
8187 handlerRegionInfoRequest(this); 8586 handlerRegionInfoRequest(this);
@@ -8192,7 +8591,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8192 //EstateCovenantRequestPacket.AgentDataBlock epack = 8591 //EstateCovenantRequestPacket.AgentDataBlock epack =
8193 // ((EstateCovenantRequestPacket)Pack).AgentData; 8592 // ((EstateCovenantRequestPacket)Pack).AgentData;
8194 8593
8195 handlerEstateCovenantRequest = OnEstateCovenantRequest; 8594 EstateCovenantRequest handlerEstateCovenantRequest = OnEstateCovenantRequest;
8196 if (handlerEstateCovenantRequest != null) 8595 if (handlerEstateCovenantRequest != null)
8197 { 8596 {
8198 handlerEstateCovenantRequest(this); 8597 handlerEstateCovenantRequest(this);
@@ -8210,7 +8609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8210 8609
8211 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; 8610 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
8212 8611
8213 handlerReqGodlikePowers = OnRequestGodlikePowers; 8612 RequestGodlikePowers handlerReqGodlikePowers = OnRequestGodlikePowers;
8214 8613
8215 if (handlerReqGodlikePowers != null) 8614 if (handlerReqGodlikePowers != null)
8216 { 8615 {
@@ -8223,7 +8622,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8223 8622
8224 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) 8623 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID)
8225 { 8624 {
8226 handlerGodKickUser = OnGodKickUser; 8625 GodKickUser handlerGodKickUser = OnGodKickUser;
8227 if (handlerGodKickUser != null) 8626 if (handlerGodKickUser != null)
8228 { 8627 {
8229 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, 8628 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID,
@@ -8263,7 +8662,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8263 } 8662 }
8264 #endregion 8663 #endregion
8265 8664
8266 handlerMoneyBalanceRequest = OnMoneyBalanceRequest; 8665 MoneyBalanceRequest handlerMoneyBalanceRequest = OnMoneyBalanceRequest;
8267 8666
8268 if (handlerMoneyBalanceRequest != null) 8667 if (handlerMoneyBalanceRequest != null)
8269 { 8668 {
@@ -8274,7 +8673,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8274 case PacketType.EconomyDataRequest: 8673 case PacketType.EconomyDataRequest:
8275 8674
8276 8675
8277 handlerEconomoyDataRequest = OnEconomyDataRequest; 8676 EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest;
8278 if (handlerEconomoyDataRequest != null) 8677 if (handlerEconomoyDataRequest != null)
8279 { 8678 {
8280 handlerEconomoyDataRequest(AgentId); 8679 handlerEconomoyDataRequest(AgentId);
@@ -8283,7 +8682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8283 case PacketType.RequestPayPrice: 8682 case PacketType.RequestPayPrice:
8284 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; 8683 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack;
8285 8684
8286 handlerRequestPayPrice = OnRequestPayPrice; 8685 RequestPayPrice handlerRequestPayPrice = OnRequestPayPrice;
8287 if (handlerRequestPayPrice != null) 8686 if (handlerRequestPayPrice != null)
8288 { 8687 {
8289 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); 8688 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID);
@@ -8302,7 +8701,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8302 } 8701 }
8303 #endregion 8702 #endregion
8304 8703
8305 handlerObjectSaleInfo = OnObjectSaleInfo; 8704 ObjectSaleInfo handlerObjectSaleInfo = OnObjectSaleInfo;
8306 if (handlerObjectSaleInfo != null) 8705 if (handlerObjectSaleInfo != null)
8307 { 8706 {
8308 foreach (ObjectSaleInfoPacket.ObjectDataBlock d 8707 foreach (ObjectSaleInfoPacket.ObjectDataBlock d
@@ -8330,7 +8729,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8330 } 8729 }
8331 #endregion 8730 #endregion
8332 8731
8333 handlerObjectBuy = OnObjectBuy; 8732 ObjectBuy handlerObjectBuy = OnObjectBuy;
8334 8733
8335 if (handlerObjectBuy != null) 8734 if (handlerObjectBuy != null)
8336 { 8735 {
@@ -8356,7 +8755,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8356 case PacketType.GetScriptRunning: 8755 case PacketType.GetScriptRunning:
8357 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; 8756 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
8358 8757
8359 handlerGetScriptRunning = OnGetScriptRunning; 8758 GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
8360 if (handlerGetScriptRunning != null) 8759 if (handlerGetScriptRunning != null)
8361 { 8760 {
8362 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID); 8761 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
@@ -8375,7 +8774,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8375 } 8774 }
8376 #endregion 8775 #endregion
8377 8776
8378 handlerSetScriptRunning = OnSetScriptRunning; 8777 SetScriptRunning handlerSetScriptRunning = OnSetScriptRunning;
8379 if (handlerSetScriptRunning != null) 8778 if (handlerSetScriptRunning != null)
8380 { 8779 {
8381 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running); 8780 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
@@ -8394,7 +8793,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8394 } 8793 }
8395 #endregion 8794 #endregion
8396 8795
8397 handlerScriptReset = OnScriptReset; 8796 ScriptReset handlerScriptReset = OnScriptReset;
8398 if (handlerScriptReset != null) 8797 if (handlerScriptReset != null)
8399 { 8798 {
8400 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID); 8799 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
@@ -8417,7 +8816,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8417 } 8816 }
8418 #endregion 8817 #endregion
8419 8818
8420 handlerActivateGesture = OnActivateGesture; 8819 ActivateGesture handlerActivateGesture = OnActivateGesture;
8421 if (handlerActivateGesture != null) 8820 if (handlerActivateGesture != null)
8422 { 8821 {
8423 handlerActivateGesture(this, 8822 handlerActivateGesture(this,
@@ -8440,7 +8839,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8440 } 8839 }
8441 #endregion 8840 #endregion
8442 8841
8443 handlerDeactivateGesture = OnDeactivateGesture; 8842 DeactivateGesture handlerDeactivateGesture = OnDeactivateGesture;
8444 if (handlerDeactivateGesture != null) 8843 if (handlerDeactivateGesture != null)
8445 { 8844 {
8446 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID); 8845 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID);
@@ -8463,7 +8862,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8463 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData) 8862 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData)
8464 localIDs.Add(d.ObjectLocalID); 8863 localIDs.Add(d.ObjectLocalID);
8465 8864
8466 handlerObjectOwner = OnObjectOwner; 8865 ObjectOwner handlerObjectOwner = OnObjectOwner;
8467 if (handlerObjectOwner != null) 8866 if (handlerObjectOwner != null)
8468 { 8867 {
8469 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs); 8868 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs);
@@ -8476,14 +8875,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8476 #region unimplemented handlers 8875 #region unimplemented handlers
8477 8876
8478 case PacketType.StartPingCheck: 8877 case PacketType.StartPingCheck:
8479 // Send the client the ping response back 8878 StartPingCheckPacket pingStart = (StartPingCheckPacket)Pack;
8480 // Pass the same PingID in the matching packet 8879 CompletePingCheckPacket pingComplete = new CompletePingCheckPacket();
8481 // Handled In the packet processing 8880 pingComplete.PingID.PingID = pingStart.PingID.PingID;
8482 //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet"); 8881 m_udpServer.SendPacket(m_udpClient, pingComplete, ThrottleOutPacketType.Unknown, false);
8483 break; 8882 break;
8883
8484 case PacketType.CompletePingCheck: 8884 case PacketType.CompletePingCheck:
8485 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client 8885 // TODO: Do stats tracking or something with these?
8486 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
8487 break; 8886 break;
8488 8887
8489 case PacketType.ViewerStats: 8888 case PacketType.ViewerStats:
@@ -8504,7 +8903,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8504 #endregion 8903 #endregion
8505 8904
8506 //m_log.Debug(mirpk.ToString()); 8905 //m_log.Debug(mirpk.ToString());
8507 handlerMapItemRequest = OnMapItemRequest; 8906 MapItemRequest handlerMapItemRequest = OnMapItemRequest;
8508 if (handlerMapItemRequest != null) 8907 if (handlerMapItemRequest != null)
8509 { 8908 {
8510 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID, 8909 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
@@ -8531,7 +8930,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8531 } 8930 }
8532 #endregion 8931 #endregion
8533 8932
8534 handlerMuteListRequest = OnMuteListRequest; 8933 MuteListRequest handlerMuteListRequest = OnMuteListRequest;
8535 if (handlerMuteListRequest != null) 8934 if (handlerMuteListRequest != null)
8536 { 8935 {
8537 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC); 8936 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC);
@@ -8568,7 +8967,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8568 } 8967 }
8569 #endregion 8968 #endregion
8570 8969
8571 handlerDirPlacesQuery = OnDirPlacesQuery; 8970 DirPlacesQuery handlerDirPlacesQuery = OnDirPlacesQuery;
8572 if (handlerDirPlacesQuery != null) 8971 if (handlerDirPlacesQuery != null)
8573 { 8972 {
8574 handlerDirPlacesQuery(this, 8973 handlerDirPlacesQuery(this,
@@ -8594,7 +8993,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8594 } 8993 }
8595 #endregion 8994 #endregion
8596 8995
8597 handlerDirFindQuery = OnDirFindQuery; 8996 DirFindQuery handlerDirFindQuery = OnDirFindQuery;
8598 if (handlerDirFindQuery != null) 8997 if (handlerDirFindQuery != null)
8599 { 8998 {
8600 handlerDirFindQuery(this, 8999 handlerDirFindQuery(this,
@@ -8617,7 +9016,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8617 } 9016 }
8618 #endregion 9017 #endregion
8619 9018
8620 handlerDirLandQuery = OnDirLandQuery; 9019 DirLandQuery handlerDirLandQuery = OnDirLandQuery;
8621 if (handlerDirLandQuery != null) 9020 if (handlerDirLandQuery != null)
8622 { 9021 {
8623 handlerDirLandQuery(this, 9022 handlerDirLandQuery(this,
@@ -8641,7 +9040,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8641 } 9040 }
8642 #endregion 9041 #endregion
8643 9042
8644 handlerDirPopularQuery = OnDirPopularQuery; 9043 DirPopularQuery handlerDirPopularQuery = OnDirPopularQuery;
8645 if (handlerDirPopularQuery != null) 9044 if (handlerDirPopularQuery != null)
8646 { 9045 {
8647 handlerDirPopularQuery(this, 9046 handlerDirPopularQuery(this,
@@ -8661,7 +9060,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8661 } 9060 }
8662 #endregion 9061 #endregion
8663 9062
8664 handlerDirClassifiedQuery = OnDirClassifiedQuery; 9063 DirClassifiedQuery handlerDirClassifiedQuery = OnDirClassifiedQuery;
8665 if (handlerDirClassifiedQuery != null) 9064 if (handlerDirClassifiedQuery != null)
8666 { 9065 {
8667 handlerDirClassifiedQuery(this, 9066 handlerDirClassifiedQuery(this,
@@ -9177,7 +9576,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9177 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack; 9576 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack;
9178 if (m_GroupsModule != null) 9577 if (m_GroupsModule != null)
9179 { 9578 {
9180 handlerParcelDeedToGroup = OnParcelDeedToGroup; 9579 ParcelDeedToGroup handlerParcelDeedToGroup = OnParcelDeedToGroup;
9181 if (handlerParcelDeedToGroup != null) 9580 if (handlerParcelDeedToGroup != null)
9182 { 9581 {
9183 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this); 9582 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this);
@@ -9421,7 +9820,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9421 } 9820 }
9422 #endregion 9821 #endregion
9423 9822
9424 handlerStartLure = OnStartLure; 9823 StartLure handlerStartLure = OnStartLure;
9425 if (handlerStartLure != null) 9824 if (handlerStartLure != null)
9426 handlerStartLure(startLureRequest.Info.LureType, 9825 handlerStartLure(startLureRequest.Info.LureType,
9427 Utils.BytesToString( 9826 Utils.BytesToString(
@@ -9443,7 +9842,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9443 } 9842 }
9444 #endregion 9843 #endregion
9445 9844
9446 handlerTeleportLureRequest = OnTeleportLureRequest; 9845 TeleportLureRequest handlerTeleportLureRequest = OnTeleportLureRequest;
9447 if (handlerTeleportLureRequest != null) 9846 if (handlerTeleportLureRequest != null)
9448 handlerTeleportLureRequest( 9847 handlerTeleportLureRequest(
9449 teleportLureRequest.Info.LureID, 9848 teleportLureRequest.Info.LureID,
@@ -9464,7 +9863,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9464 } 9863 }
9465 #endregion 9864 #endregion
9466 9865
9467 handlerClassifiedInfoRequest = OnClassifiedInfoRequest; 9866 ClassifiedInfoRequest handlerClassifiedInfoRequest = OnClassifiedInfoRequest;
9468 if (handlerClassifiedInfoRequest != null) 9867 if (handlerClassifiedInfoRequest != null)
9469 handlerClassifiedInfoRequest( 9868 handlerClassifiedInfoRequest(
9470 classifiedInfoRequest.Data.ClassifiedID, 9869 classifiedInfoRequest.Data.ClassifiedID,
@@ -9484,7 +9883,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9484 } 9883 }
9485 #endregion 9884 #endregion
9486 9885
9487 handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate; 9886 ClassifiedInfoUpdate handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate;
9488 if (handlerClassifiedInfoUpdate != null) 9887 if (handlerClassifiedInfoUpdate != null)
9489 handlerClassifiedInfoUpdate( 9888 handlerClassifiedInfoUpdate(
9490 classifiedInfoUpdate.Data.ClassifiedID, 9889 classifiedInfoUpdate.Data.ClassifiedID,
@@ -9516,7 +9915,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9516 } 9915 }
9517 #endregion 9916 #endregion
9518 9917
9519 handlerClassifiedDelete = OnClassifiedDelete; 9918 ClassifiedDelete handlerClassifiedDelete = OnClassifiedDelete;
9520 if (handlerClassifiedDelete != null) 9919 if (handlerClassifiedDelete != null)
9521 handlerClassifiedDelete( 9920 handlerClassifiedDelete(
9522 classifiedDelete.Data.ClassifiedID, 9921 classifiedDelete.Data.ClassifiedID,
@@ -9536,7 +9935,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9536 } 9935 }
9537 #endregion 9936 #endregion
9538 9937
9539 handlerClassifiedGodDelete = OnClassifiedGodDelete; 9938 ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete;
9540 if (handlerClassifiedGodDelete != null) 9939 if (handlerClassifiedGodDelete != null)
9541 handlerClassifiedGodDelete( 9940 handlerClassifiedGodDelete(
9542 classifiedGodDelete.Data.ClassifiedID, 9941 classifiedGodDelete.Data.ClassifiedID,
@@ -9556,7 +9955,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9556 } 9955 }
9557 #endregion 9956 #endregion
9558 9957
9559 handlerEventGodDelete = OnEventGodDelete; 9958 EventGodDelete handlerEventGodDelete = OnEventGodDelete;
9560 if (handlerEventGodDelete != null) 9959 if (handlerEventGodDelete != null)
9561 handlerEventGodDelete( 9960 handlerEventGodDelete(
9562 eventGodDelete.EventData.EventID, 9961 eventGodDelete.EventData.EventID,
@@ -9581,7 +9980,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9581 } 9980 }
9582 #endregion 9981 #endregion
9583 9982
9584 handlerEventNotificationAddRequest = OnEventNotificationAddRequest; 9983 EventNotificationAddRequest handlerEventNotificationAddRequest = OnEventNotificationAddRequest;
9585 if (handlerEventNotificationAddRequest != null) 9984 if (handlerEventNotificationAddRequest != null)
9586 handlerEventNotificationAddRequest( 9985 handlerEventNotificationAddRequest(
9587 eventNotificationAdd.EventData.EventID, this); 9986 eventNotificationAdd.EventData.EventID, this);
@@ -9600,7 +9999,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9600 } 9999 }
9601 #endregion 10000 #endregion
9602 10001
9603 handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest; 10002 EventNotificationRemoveRequest handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest;
9604 if (handlerEventNotificationRemoveRequest != null) 10003 if (handlerEventNotificationRemoveRequest != null)
9605 handlerEventNotificationRemoveRequest( 10004 handlerEventNotificationRemoveRequest(
9606 eventNotificationRemove.EventData.EventID, this); 10005 eventNotificationRemove.EventData.EventID, this);
@@ -9618,7 +10017,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9618 } 10017 }
9619 #endregion 10018 #endregion
9620 10019
9621 handlerRetrieveInstantMessages = OnRetrieveInstantMessages; 10020 RetrieveInstantMessages handlerRetrieveInstantMessages = OnRetrieveInstantMessages;
9622 if (handlerRetrieveInstantMessages != null) 10021 if (handlerRetrieveInstantMessages != null)
9623 handlerRetrieveInstantMessages(this); 10022 handlerRetrieveInstantMessages(this);
9624 break; 10023 break;
@@ -9636,7 +10035,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9636 } 10035 }
9637 #endregion 10036 #endregion
9638 10037
9639 handlerPickDelete = OnPickDelete; 10038 PickDelete handlerPickDelete = OnPickDelete;
9640 if (handlerPickDelete != null) 10039 if (handlerPickDelete != null)
9641 handlerPickDelete(this, pickDelete.Data.PickID); 10040 handlerPickDelete(this, pickDelete.Data.PickID);
9642 break; 10041 break;
@@ -9653,7 +10052,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9653 } 10052 }
9654 #endregion 10053 #endregion
9655 10054
9656 handlerPickGodDelete = OnPickGodDelete; 10055 PickGodDelete handlerPickGodDelete = OnPickGodDelete;
9657 if (handlerPickGodDelete != null) 10056 if (handlerPickGodDelete != null)
9658 handlerPickGodDelete(this, 10057 handlerPickGodDelete(this,
9659 pickGodDelete.AgentData.AgentID, 10058 pickGodDelete.AgentData.AgentID,
@@ -9673,7 +10072,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9673 } 10072 }
9674 #endregion 10073 #endregion
9675 10074
9676 handlerPickInfoUpdate = OnPickInfoUpdate; 10075 PickInfoUpdate handlerPickInfoUpdate = OnPickInfoUpdate;
9677 if (handlerPickInfoUpdate != null) 10076 if (handlerPickInfoUpdate != null)
9678 handlerPickInfoUpdate(this, 10077 handlerPickInfoUpdate(this,
9679 pickInfoUpdate.Data.PickID, 10078 pickInfoUpdate.Data.PickID,
@@ -9698,7 +10097,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9698 } 10097 }
9699 #endregion 10098 #endregion
9700 10099
9701 handlerAvatarNotesUpdate = OnAvatarNotesUpdate; 10100 AvatarNotesUpdate handlerAvatarNotesUpdate = OnAvatarNotesUpdate;
9702 if (handlerAvatarNotesUpdate != null) 10101 if (handlerAvatarNotesUpdate != null)
9703 handlerAvatarNotesUpdate(this, 10102 handlerAvatarNotesUpdate(this,
9704 avatarNotesUpdate.Data.TargetID, 10103 avatarNotesUpdate.Data.TargetID,
@@ -9715,7 +10114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9715 PlacesQueryPacket placesQueryPacket = 10114 PlacesQueryPacket placesQueryPacket =
9716 (PlacesQueryPacket)Pack; 10115 (PlacesQueryPacket)Pack;
9717 10116
9718 handlerPlacesQuery = OnPlacesQuery; 10117 PlacesQuery handlerPlacesQuery = OnPlacesQuery;
9719 10118
9720 if (handlerPlacesQuery != null) 10119 if (handlerPlacesQuery != null)
9721 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID, 10120 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID,
@@ -9769,304 +10168,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9769 //shape.Textures = ntex; 10168 //shape.Textures = ntex;
9770 return shape; 10169 return shape;
9771 } 10170 }
9772 10171
9773 /// <summary>
9774 /// Send the client an Estate message blue box pop-down with a single OK button
9775 /// </summary>
9776 /// <param name="FromAvatarID"></param>
9777 /// <param name="fromSessionID"></param>
9778 /// <param name="FromAvatarName"></param>
9779 /// <param name="Message"></param>
9780 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
9781 {
9782 if (!ChildAgentStatus())
9783 SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3()));
9784
9785 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
9786 }
9787
9788 public void SendLogoutPacket()
9789 {
9790 // I know this is a bit of a hack, however there are times when you don't
9791 // want to send this, but still need to do the rest of the shutdown process
9792 // this method gets called from the packet server.. which makes it practically
9793 // impossible to do any other way.
9794
9795 if (m_SendLogoutPacketWhenClosing)
9796 {
9797 LogoutReplyPacket logReply = (LogoutReplyPacket)PacketPool.Instance.GetPacket(PacketType.LogoutReply);
9798 // TODO: don't create new blocks if recycling an old packet
9799 logReply.AgentData.AgentID = AgentId;
9800 logReply.AgentData.SessionID = SessionId;
9801 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
9802 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
9803 logReply.InventoryData[0].ItemID = UUID.Zero;
9804
9805 OutPacket(logReply, ThrottleOutPacketType.Task);
9806 }
9807 }
9808
9809 public void SendHealth(float health)
9810 {
9811 HealthMessagePacket healthpacket = (HealthMessagePacket)PacketPool.Instance.GetPacket(PacketType.HealthMessage);
9812 healthpacket.HealthData.Health = health;
9813 OutPacket(healthpacket, ThrottleOutPacketType.Task);
9814 }
9815
9816 public void SendAgentOnline(UUID[] agentIDs)
9817 {
9818 OnlineNotificationPacket onp = new OnlineNotificationPacket();
9819 OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
9820 for (int i = 0; i < agentIDs.Length; i++)
9821 {
9822 OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
9823 onpbl.AgentID = agentIDs[i];
9824 onpb[i] = onpbl;
9825 }
9826 onp.AgentBlock = onpb;
9827 onp.Header.Reliable = true;
9828 OutPacket(onp, ThrottleOutPacketType.Task);
9829 }
9830
9831 public void SendAgentOffline(UUID[] agentIDs)
9832 {
9833 OfflineNotificationPacket offp = new OfflineNotificationPacket();
9834 OfflineNotificationPacket.AgentBlockBlock[] offpb = new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length];
9835 for (int i = 0; i < agentIDs.Length; i++)
9836 {
9837 OfflineNotificationPacket.AgentBlockBlock onpbl = new OfflineNotificationPacket.AgentBlockBlock();
9838 onpbl.AgentID = agentIDs[i];
9839 offpb[i] = onpbl;
9840 }
9841 offp.AgentBlock = offpb;
9842 offp.Header.Reliable = true;
9843 OutPacket(offp, ThrottleOutPacketType.Task);
9844 }
9845
9846 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
9847 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
9848 {
9849 AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
9850 avatarSitResponse.SitObject.ID = TargetID;
9851 if (CameraAtOffset != Vector3.Zero)
9852 {
9853 avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset;
9854 avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset;
9855 }
9856 avatarSitResponse.SitTransform.ForceMouselook = ForceMouseLook;
9857 avatarSitResponse.SitTransform.AutoPilot = autopilot;
9858 avatarSitResponse.SitTransform.SitPosition = OffsetPos;
9859 avatarSitResponse.SitTransform.SitRotation = SitOrientation;
9860
9861 OutPacket(avatarSitResponse, ThrottleOutPacketType.Task);
9862 }
9863
9864 public void SendAdminResponse(UUID Token, uint AdminLevel)
9865 {
9866 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
9867 GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
9868 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
9869
9870 adb.AgentID = AgentId;
9871 adb.SessionID = SessionId; // More security
9872 gdb.GodLevel = (byte)AdminLevel;
9873 gdb.Token = Token;
9874 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
9875 respondPacket.GrantData = gdb;
9876 respondPacket.AgentData = adb;
9877 OutPacket(respondPacket, ThrottleOutPacketType.Task);
9878 }
9879
9880 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
9881 {
9882 m_groupPowers.Clear();
9883
9884 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
9885 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
9886 for (int i = 0; i < GroupMembership.Length; i++)
9887 {
9888 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
9889
9890 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
9891 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
9892 Group.Contribution = GroupMembership[i].Contribution;
9893 Group.GroupID = GroupMembership[i].GroupID;
9894 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
9895 Group.GroupName = Utils.StringToBytes(GroupMembership[i].GroupName);
9896 Group.GroupPowers = GroupMembership[i].GroupPowers;
9897 Groups[i] = Group;
9898
9899
9900 }
9901 Groupupdate.GroupData = Groups;
9902 Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock();
9903 Groupupdate.AgentData.AgentID = AgentId;
9904 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
9905
9906 try
9907 {
9908 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
9909 if (eq != null)
9910 {
9911 eq.GroupMembership(Groupupdate, this.AgentId);
9912 }
9913 }
9914 catch (Exception ex)
9915 {
9916 m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString());
9917 m_log.Warn("sending group membership data via UDP");
9918 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
9919 }
9920 }
9921
9922
9923 public void SendGroupNameReply(UUID groupLLUID, string GroupName)
9924 {
9925 UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket();
9926 UUIDGroupNameReplyPacket.UUIDNameBlockBlock[] uidnameblock = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock[1];
9927 UUIDGroupNameReplyPacket.UUIDNameBlockBlock uidnamebloc = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock();
9928 uidnamebloc.ID = groupLLUID;
9929 uidnamebloc.GroupName = Utils.StringToBytes(GroupName);
9930 uidnameblock[0] = uidnamebloc;
9931 pack.UUIDNameBlock = uidnameblock;
9932 OutPacket(pack, ThrottleOutPacketType.Task);
9933 }
9934
9935 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
9936 {
9937 LandStatReplyPacket lsrp = new LandStatReplyPacket();
9938 // LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
9939 LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
9940 //LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
9941 // lsrepdb.
9942 lsrp.RequestData.ReportType = reportType;
9943 lsrp.RequestData.RequestFlags = requestFlags;
9944 lsrp.RequestData.TotalObjectCount = resultCount;
9945 for (int i = 0; i < lsrpia.Length; i++)
9946 {
9947 LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
9948 lsrepdb.LocationX = lsrpia[i].LocationX;
9949 lsrepdb.LocationY = lsrpia[i].LocationY;
9950 lsrepdb.LocationZ = lsrpia[i].LocationZ;
9951 lsrepdb.Score = lsrpia[i].Score;
9952 lsrepdb.TaskID = lsrpia[i].TaskID;
9953 lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID;
9954 lsrepdb.TaskName = Utils.StringToBytes(lsrpia[i].TaskName);
9955 lsrepdb.OwnerName = Utils.StringToBytes(lsrpia[i].OwnerName);
9956 lsrepdba[i] = lsrepdb;
9957 }
9958 lsrp.ReportData = lsrepdba;
9959 OutPacket(lsrp, ThrottleOutPacketType.Task);
9960 }
9961
9962 public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
9963 {
9964 ScriptRunningReplyPacket scriptRunningReply = new ScriptRunningReplyPacket();
9965 scriptRunningReply.Script.ObjectID = objectID;
9966 scriptRunningReply.Script.ItemID = itemID;
9967 scriptRunningReply.Script.Running = running;
9968
9969 OutPacket(scriptRunningReply, ThrottleOutPacketType.Task);
9970 }
9971
9972 public void SendAsset(AssetRequestToClient req)
9973 {
9974 //m_log.Debug("sending asset " + req.RequestAssetID);
9975 TransferInfoPacket Transfer = new TransferInfoPacket();
9976 Transfer.TransferInfo.ChannelType = 2;
9977 Transfer.TransferInfo.Status = 0;
9978 Transfer.TransferInfo.TargetType = 0;
9979 if (req.AssetRequestSource == 2)
9980 {
9981 Transfer.TransferInfo.Params = new byte[20];
9982 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
9983 int assType = req.AssetInf.Type;
9984 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
9985 }
9986 else if (req.AssetRequestSource == 3)
9987 {
9988 Transfer.TransferInfo.Params = req.Params;
9989 // Transfer.TransferInfo.Params = new byte[100];
9990 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
9991 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
9992 }
9993 Transfer.TransferInfo.Size = req.AssetInf.Data.Length;
9994 Transfer.TransferInfo.TransferID = req.TransferRequestID;
9995 Transfer.Header.Zerocoded = true;
9996 OutPacket(Transfer, ThrottleOutPacketType.Asset);
9997
9998 if (req.NumPackets == 1)
9999 {
10000 TransferPacketPacket TransferPacket = new TransferPacketPacket();
10001 TransferPacket.TransferData.Packet = 0;
10002 TransferPacket.TransferData.ChannelType = 2;
10003 TransferPacket.TransferData.TransferID = req.TransferRequestID;
10004 TransferPacket.TransferData.Data = req.AssetInf.Data;
10005 TransferPacket.TransferData.Status = 1;
10006 TransferPacket.Header.Zerocoded = true;
10007 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
10008 }
10009 else
10010 {
10011 int processedLength = 0;
10012 int maxChunkSize = Settings.MAX_PACKET_SIZE - 100;
10013 int packetNumber = 0;
10014
10015 while (processedLength < req.AssetInf.Data.Length)
10016 {
10017 TransferPacketPacket TransferPacket = new TransferPacketPacket();
10018 TransferPacket.TransferData.Packet = packetNumber;
10019 TransferPacket.TransferData.ChannelType = 2;
10020 TransferPacket.TransferData.TransferID = req.TransferRequestID;
10021
10022 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
10023 byte[] chunk = new byte[chunkSize];
10024 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
10025
10026 TransferPacket.TransferData.Data = chunk;
10027
10028 // 0 indicates more packets to come, 1 indicates last packet
10029 if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
10030 {
10031 TransferPacket.TransferData.Status = 0;
10032 }
10033 else
10034 {
10035 TransferPacket.TransferData.Status = 1;
10036 }
10037 TransferPacket.Header.Zerocoded = true;
10038 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
10039
10040 processedLength += chunkSize;
10041 packetNumber++;
10042 }
10043 }
10044 }
10045
10046 public void SendTexture(AssetBase TextureAsset)
10047 {
10048
10049 }
10050
10051 public ClientInfo GetClientInfo() 10172 public ClientInfo GetClientInfo()
10052 { 10173 {
10053 ClientInfo info = m_PacketHandler.GetClientInfo(); 10174 ClientInfo info = m_udpClient.GetClientInfo();
10054 10175
10055 info.userEP = m_userEndPoint; 10176 info.userEP = m_userEndPoint;
10056 info.proxyEP = m_proxyEndPoint; 10177 info.proxyEP = null;
10057 info.agentcircuit = new sAgentCircuitData(RequestClientInfo()); 10178 info.agentcircuit = new sAgentCircuitData(RequestClientInfo());
10058 10179
10059 return info; 10180 return info;
10060 } 10181 }
10061 10182
10062 public EndPoint GetClientEP() 10183 public void SetClientInfo(ClientInfo info)
10063 { 10184 {
10064 return m_userEndPoint; 10185 m_udpClient.SetClientInfo(info);
10065 } 10186 }
10066 10187
10067 public void SetClientInfo(ClientInfo info) 10188 public EndPoint GetClientEP()
10068 { 10189 {
10069 m_PacketHandler.SetClientInfo(info); 10190 return m_userEndPoint;
10070 } 10191 }
10071 10192
10072 #region Media Parcel Members 10193 #region Media Parcel Members
@@ -10101,7 +10222,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10101 10222
10102 #endregion 10223 #endregion
10103 10224
10104
10105 #region Camera 10225 #region Camera
10106 10226
10107 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters) 10227 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
@@ -10131,70 +10251,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10131 10251
10132 #endregion 10252 #endregion
10133 10253
10134 public void SendRegionHandle(UUID regionID, ulong handle) {
10135 RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
10136 reply.ReplyBlock.RegionID = regionID;
10137 reply.ReplyBlock.RegionHandle = handle;
10138 OutPacket(reply, ThrottleOutPacketType.Land);
10139 }
10140
10141 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
10142 {
10143 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
10144 reply.AgentData.AgentID = m_agentId;
10145 reply.Data.ParcelID = parcelID;
10146 reply.Data.OwnerID = land.OwnerID;
10147 reply.Data.Name = Utils.StringToBytes(land.Name);
10148 reply.Data.Desc = Utils.StringToBytes(land.Description);
10149 reply.Data.ActualArea = land.Area;
10150 reply.Data.BillableArea = land.Area; // TODO: what is this?
10151
10152 // Bit 0: Mature, bit 7: on sale, other bits: no idea
10153 reply.Data.Flags = (byte)(
10154 ((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
10155 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
10156
10157 Vector3 pos = land.UserLocation;
10158 if (pos.Equals(Vector3.Zero))
10159 {
10160 pos = (land.AABBMax + land.AABBMin) * 0.5f;
10161 }
10162 reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
10163 reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
10164 reply.Data.GlobalZ = pos.Z;
10165 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
10166 reply.Data.SnapshotID = land.SnapshotID;
10167 reply.Data.Dwell = land.Dwell;
10168 reply.Data.SalePrice = land.SalePrice;
10169 reply.Data.AuctionID = (int)land.AuctionID;
10170
10171 OutPacket(reply, ThrottleOutPacketType.Land);
10172 }
10173
10174 public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
10175 {
10176 ScriptTeleportRequestPacket packet = (ScriptTeleportRequestPacket)PacketPool.Instance.GetPacket(PacketType.ScriptTeleportRequest);
10177
10178 packet.Data.ObjectName = Utils.StringToBytes(objName);
10179 packet.Data.SimName = Utils.StringToBytes(simName);
10180 packet.Data.SimPosition = pos;
10181 packet.Data.LookAt = lookAt;
10182
10183 OutPacket(packet, ThrottleOutPacketType.Task);
10184 }
10185
10186 public void SetClientOption(string option, string value) 10254 public void SetClientOption(string option, string value)
10187 { 10255 {
10188 switch (option) 10256 switch (option)
10189 { 10257 {
10190 case "ReliableIsImportant": 10258 default:
10191 bool val; 10259 break;
10192
10193 if (bool.TryParse(value, out val))
10194 m_PacketHandler.ReliableIsImportant = val;
10195 break;
10196 default:
10197 break;
10198 } 10260 }
10199 } 10261 }
10200 10262
@@ -10202,571 +10264,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10202 { 10264 {
10203 switch (option) 10265 switch (option)
10204 { 10266 {
10205 case "ReliableIsImportant":
10206 return m_PacketHandler.ReliableIsImportant.ToString();
10207
10208 default: 10267 default:
10209 break; 10268 break;
10210 } 10269 }
10211 return string.Empty; 10270 return string.Empty;
10212 } 10271 }
10213 10272
10214 public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
10215 {
10216 DirPlacesReplyPacket packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply);
10217
10218 packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock();
10219
10220 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
10221 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
10222
10223 packet.QueryReplies =
10224 new DirPlacesReplyPacket.QueryRepliesBlock[data.Length];
10225
10226 packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[
10227 data.Length];
10228
10229 packet.AgentData.AgentID = AgentId;
10230
10231 packet.QueryData[0].QueryID = queryID;
10232
10233 int i = 0;
10234 foreach (DirPlacesReplyData d in data)
10235 {
10236 packet.QueryReplies[i] =
10237 new DirPlacesReplyPacket.QueryRepliesBlock();
10238 packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock();
10239 packet.QueryReplies[i].ParcelID = d.parcelID;
10240 packet.QueryReplies[i].Name = Utils.StringToBytes(d.name);
10241 packet.QueryReplies[i].ForSale = d.forSale;
10242 packet.QueryReplies[i].Auction = d.auction;
10243 packet.QueryReplies[i].Dwell = d.dwell;
10244 packet.StatusData[i].Status = d.Status;
10245 i++;
10246 }
10247
10248 OutPacket(packet, ThrottleOutPacketType.Task);
10249 }
10250
10251 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
10252 {
10253 DirPeopleReplyPacket packet = (DirPeopleReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPeopleReply);
10254
10255 packet.AgentData = new DirPeopleReplyPacket.AgentDataBlock();
10256 packet.AgentData.AgentID = AgentId;
10257
10258 packet.QueryData = new DirPeopleReplyPacket.QueryDataBlock();
10259 packet.QueryData.QueryID = queryID;
10260
10261 packet.QueryReplies = new DirPeopleReplyPacket.QueryRepliesBlock[
10262 data.Length];
10263
10264 int i = 0;
10265 foreach (DirPeopleReplyData d in data)
10266 {
10267 packet.QueryReplies[i] = new DirPeopleReplyPacket.QueryRepliesBlock();
10268 packet.QueryReplies[i].AgentID = d.agentID;
10269 packet.QueryReplies[i].FirstName =
10270 Utils.StringToBytes(d.firstName);
10271 packet.QueryReplies[i].LastName =
10272 Utils.StringToBytes(d.lastName);
10273 packet.QueryReplies[i].Group =
10274 Utils.StringToBytes(d.group);
10275 packet.QueryReplies[i].Online = d.online;
10276 packet.QueryReplies[i].Reputation = d.reputation;
10277 i++;
10278 }
10279
10280 OutPacket(packet, ThrottleOutPacketType.Task);
10281 }
10282
10283 public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
10284 {
10285 DirEventsReplyPacket packet = (DirEventsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirEventsReply);
10286
10287 packet.AgentData = new DirEventsReplyPacket.AgentDataBlock();
10288 packet.AgentData.AgentID = AgentId;
10289
10290 packet.QueryData = new DirEventsReplyPacket.QueryDataBlock();
10291 packet.QueryData.QueryID = queryID;
10292
10293 packet.QueryReplies = new DirEventsReplyPacket.QueryRepliesBlock[
10294 data.Length];
10295
10296 packet.StatusData = new DirEventsReplyPacket.StatusDataBlock[
10297 data.Length];
10298
10299 int i = 0;
10300 foreach (DirEventsReplyData d in data)
10301 {
10302 packet.QueryReplies[i] = new DirEventsReplyPacket.QueryRepliesBlock();
10303 packet.StatusData[i] = new DirEventsReplyPacket.StatusDataBlock();
10304 packet.QueryReplies[i].OwnerID = d.ownerID;
10305 packet.QueryReplies[i].Name =
10306 Utils.StringToBytes(d.name);
10307 packet.QueryReplies[i].EventID = d.eventID;
10308 packet.QueryReplies[i].Date =
10309 Utils.StringToBytes(d.date);
10310 packet.QueryReplies[i].UnixTime = d.unixTime;
10311 packet.QueryReplies[i].EventFlags = d.eventFlags;
10312 packet.StatusData[i].Status = d.Status;
10313 i++;
10314 }
10315
10316 OutPacket(packet, ThrottleOutPacketType.Task);
10317 }
10318
10319 public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
10320 {
10321 DirGroupsReplyPacket packet = (DirGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirGroupsReply);
10322
10323 packet.AgentData = new DirGroupsReplyPacket.AgentDataBlock();
10324 packet.AgentData.AgentID = AgentId;
10325
10326 packet.QueryData = new DirGroupsReplyPacket.QueryDataBlock();
10327 packet.QueryData.QueryID = queryID;
10328
10329 packet.QueryReplies = new DirGroupsReplyPacket.QueryRepliesBlock[
10330 data.Length];
10331
10332 int i = 0;
10333 foreach (DirGroupsReplyData d in data)
10334 {
10335 packet.QueryReplies[i] = new DirGroupsReplyPacket.QueryRepliesBlock();
10336 packet.QueryReplies[i].GroupID = d.groupID;
10337 packet.QueryReplies[i].GroupName =
10338 Utils.StringToBytes(d.groupName);
10339 packet.QueryReplies[i].Members = d.members;
10340 packet.QueryReplies[i].SearchOrder = d.searchOrder;
10341 i++;
10342 }
10343
10344 OutPacket(packet, ThrottleOutPacketType.Task);
10345 }
10346
10347 public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
10348 {
10349 DirClassifiedReplyPacket packet = (DirClassifiedReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirClassifiedReply);
10350
10351 packet.AgentData = new DirClassifiedReplyPacket.AgentDataBlock();
10352 packet.AgentData.AgentID = AgentId;
10353
10354 packet.QueryData = new DirClassifiedReplyPacket.QueryDataBlock();
10355 packet.QueryData.QueryID = queryID;
10356
10357 packet.QueryReplies = new DirClassifiedReplyPacket.QueryRepliesBlock[
10358 data.Length];
10359 packet.StatusData = new DirClassifiedReplyPacket.StatusDataBlock[
10360 data.Length];
10361
10362 int i = 0;
10363 foreach (DirClassifiedReplyData d in data)
10364 {
10365 packet.QueryReplies[i] = new DirClassifiedReplyPacket.QueryRepliesBlock();
10366 packet.StatusData[i] = new DirClassifiedReplyPacket.StatusDataBlock();
10367 packet.QueryReplies[i].ClassifiedID = d.classifiedID;
10368 packet.QueryReplies[i].Name =
10369 Utils.StringToBytes(d.name);
10370 packet.QueryReplies[i].ClassifiedFlags = d.classifiedFlags;
10371 packet.QueryReplies[i].CreationDate = d.creationDate;
10372 packet.QueryReplies[i].ExpirationDate = d.expirationDate;
10373 packet.QueryReplies[i].PriceForListing = d.price;
10374 packet.StatusData[i].Status = d.Status;
10375 i++;
10376 }
10377
10378 OutPacket(packet, ThrottleOutPacketType.Task);
10379 }
10380
10381 public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
10382 {
10383 DirLandReplyPacket packet = (DirLandReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirLandReply);
10384
10385 packet.AgentData = new DirLandReplyPacket.AgentDataBlock();
10386 packet.AgentData.AgentID = AgentId;
10387
10388 packet.QueryData = new DirLandReplyPacket.QueryDataBlock();
10389 packet.QueryData.QueryID = queryID;
10390
10391 packet.QueryReplies = new DirLandReplyPacket.QueryRepliesBlock[
10392 data.Length];
10393
10394 int i = 0;
10395 foreach (DirLandReplyData d in data)
10396 {
10397 packet.QueryReplies[i] = new DirLandReplyPacket.QueryRepliesBlock();
10398 packet.QueryReplies[i].ParcelID = d.parcelID;
10399 packet.QueryReplies[i].Name =
10400 Utils.StringToBytes(d.name);
10401 packet.QueryReplies[i].Auction = d.auction;
10402 packet.QueryReplies[i].ForSale = d.forSale;
10403 packet.QueryReplies[i].SalePrice = d.salePrice;
10404 packet.QueryReplies[i].ActualArea = d.actualArea;
10405 i++;
10406 }
10407
10408 OutPacket(packet, ThrottleOutPacketType.Task);
10409 }
10410
10411 public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
10412 {
10413 DirPopularReplyPacket packet = (DirPopularReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPopularReply);
10414
10415 packet.AgentData = new DirPopularReplyPacket.AgentDataBlock();
10416 packet.AgentData.AgentID = AgentId;
10417
10418 packet.QueryData = new DirPopularReplyPacket.QueryDataBlock();
10419 packet.QueryData.QueryID = queryID;
10420
10421 packet.QueryReplies = new DirPopularReplyPacket.QueryRepliesBlock[
10422 data.Length];
10423
10424 int i = 0;
10425 foreach (DirPopularReplyData d in data)
10426 {
10427 packet.QueryReplies[i] = new DirPopularReplyPacket.QueryRepliesBlock();
10428 packet.QueryReplies[i].ParcelID = d.parcelID;
10429 packet.QueryReplies[i].Name =
10430 Utils.StringToBytes(d.name);
10431 packet.QueryReplies[i].Dwell = d.dwell;
10432 i++;
10433 }
10434
10435 OutPacket(packet, ThrottleOutPacketType.Task);
10436 }
10437
10438 public void SendEventInfoReply(EventData data)
10439 {
10440 EventInfoReplyPacket packet = (EventInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.EventInfoReply);
10441
10442 packet.AgentData = new EventInfoReplyPacket.AgentDataBlock();
10443 packet.AgentData.AgentID = AgentId;
10444
10445 packet.EventData = new EventInfoReplyPacket.EventDataBlock();
10446 packet.EventData.EventID = data.eventID;
10447 packet.EventData.Creator = Utils.StringToBytes(data.creator);
10448 packet.EventData.Name = Utils.StringToBytes(data.name);
10449 packet.EventData.Category = Utils.StringToBytes(data.category);
10450 packet.EventData.Desc = Utils.StringToBytes(data.description);
10451 packet.EventData.Date = Utils.StringToBytes(data.date);
10452 packet.EventData.DateUTC = data.dateUTC;
10453 packet.EventData.Duration = data.duration;
10454 packet.EventData.Cover = data.cover;
10455 packet.EventData.Amount = data.amount;
10456 packet.EventData.SimName = Utils.StringToBytes(data.simName);
10457 packet.EventData.GlobalPos = new Vector3d(data.globalPos);
10458 packet.EventData.EventFlags = data.eventFlags;
10459
10460 OutPacket(packet, ThrottleOutPacketType.Task);
10461 }
10462
10463 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
10464 {
10465 MapItemReplyPacket mirplk = new MapItemReplyPacket();
10466 mirplk.AgentData.AgentID = AgentId;
10467 mirplk.RequestData.ItemType = mapitemtype;
10468 mirplk.Data = new MapItemReplyPacket.DataBlock[replies.Length];
10469 for (int i = 0; i < replies.Length; i++)
10470 {
10471 MapItemReplyPacket.DataBlock mrdata = new MapItemReplyPacket.DataBlock();
10472 mrdata.X = replies[i].x;
10473 mrdata.Y = replies[i].y;
10474 mrdata.ID = replies[i].id;
10475 mrdata.Extra = replies[i].Extra;
10476 mrdata.Extra2 = replies[i].Extra2;
10477 mrdata.Name = Utils.StringToBytes(replies[i].name);
10478 mirplk.Data[i] = mrdata;
10479 }
10480 //m_log.Debug(mirplk.ToString());
10481 OutPacket(mirplk, ThrottleOutPacketType.Task);
10482
10483 }
10484
10485 public void SendOfferCallingCard(UUID srcID, UUID transactionID)
10486 {
10487 // a bit special, as this uses AgentID to store the source instead
10488 // of the destination. The destination (the receiver) goes into destID
10489 OfferCallingCardPacket p = (OfferCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.OfferCallingCard);
10490 p.AgentData.AgentID = srcID;
10491 p.AgentData.SessionID = UUID.Zero;
10492 p.AgentBlock.DestID = AgentId;
10493 p.AgentBlock.TransactionID = transactionID;
10494 OutPacket(p, ThrottleOutPacketType.Task);
10495 }
10496
10497 public void SendAcceptCallingCard(UUID transactionID)
10498 {
10499 AcceptCallingCardPacket p = (AcceptCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.AcceptCallingCard);
10500 p.AgentData.AgentID = AgentId;
10501 p.AgentData.SessionID = UUID.Zero;
10502 p.FolderData = new AcceptCallingCardPacket.FolderDataBlock[1];
10503 p.FolderData[0] = new AcceptCallingCardPacket.FolderDataBlock();
10504 p.FolderData[0].FolderID = UUID.Zero;
10505 OutPacket(p, ThrottleOutPacketType.Task);
10506 }
10507
10508 public void SendDeclineCallingCard(UUID transactionID)
10509 {
10510 DeclineCallingCardPacket p = (DeclineCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.DeclineCallingCard);
10511 p.AgentData.AgentID = AgentId;
10512 p.AgentData.SessionID = UUID.Zero;
10513 p.TransactionBlock.TransactionID = transactionID;
10514 OutPacket(p, ThrottleOutPacketType.Task);
10515 }
10516
10517 public void SendTerminateFriend(UUID exFriendID)
10518 {
10519 TerminateFriendshipPacket p = (TerminateFriendshipPacket)PacketPool.Instance.GetPacket(PacketType.TerminateFriendship);
10520 p.AgentData.AgentID = AgentId;
10521 p.AgentData.SessionID = SessionId;
10522 p.ExBlock.OtherID = exFriendID;
10523 OutPacket(p, ThrottleOutPacketType.Task);
10524 }
10525
10526 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
10527 {
10528 AvatarGroupsReplyPacket p = (AvatarGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarGroupsReply);
10529
10530 p.AgentData = new AvatarGroupsReplyPacket.AgentDataBlock();
10531 p.AgentData.AgentID = AgentId;
10532 p.AgentData.AvatarID = avatarID;
10533
10534 p.GroupData = new AvatarGroupsReplyPacket.GroupDataBlock[data.Length];
10535 int i = 0;
10536 foreach (GroupMembershipData m in data)
10537 {
10538 p.GroupData[i] = new AvatarGroupsReplyPacket.GroupDataBlock();
10539 p.GroupData[i].GroupPowers = m.GroupPowers;
10540 p.GroupData[i].AcceptNotices = m.AcceptNotices;
10541 p.GroupData[i].GroupTitle = Utils.StringToBytes(m.GroupTitle);
10542 p.GroupData[i].GroupID = m.GroupID;
10543 p.GroupData[i].GroupName = Utils.StringToBytes(m.GroupName);
10544 p.GroupData[i].GroupInsigniaID = m.GroupPicture;
10545 i++;
10546 }
10547
10548 p.NewGroupData = new AvatarGroupsReplyPacket.NewGroupDataBlock();
10549 p.NewGroupData.ListInProfile = true;
10550
10551 OutPacket(p, ThrottleOutPacketType.Task);
10552 }
10553
10554 public void SendJoinGroupReply(UUID groupID, bool success)
10555 {
10556 JoinGroupReplyPacket p = (JoinGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.JoinGroupReply);
10557
10558 p.AgentData = new JoinGroupReplyPacket.AgentDataBlock();
10559 p.AgentData.AgentID = AgentId;
10560
10561 p.GroupData = new JoinGroupReplyPacket.GroupDataBlock();
10562 p.GroupData.GroupID = groupID;
10563 p.GroupData.Success = success;
10564
10565 OutPacket(p, ThrottleOutPacketType.Task);
10566 }
10567
10568 public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
10569 {
10570 EjectGroupMemberReplyPacket p = (EjectGroupMemberReplyPacket)PacketPool.Instance.GetPacket(PacketType.EjectGroupMemberReply);
10571
10572 p.AgentData = new EjectGroupMemberReplyPacket.AgentDataBlock();
10573 p.AgentData.AgentID = agentID;
10574
10575 p.GroupData = new EjectGroupMemberReplyPacket.GroupDataBlock();
10576 p.GroupData.GroupID = groupID;
10577
10578 p.EjectData = new EjectGroupMemberReplyPacket.EjectDataBlock();
10579 p.EjectData.Success = success;
10580
10581 OutPacket(p, ThrottleOutPacketType.Task);
10582 }
10583
10584 public void SendLeaveGroupReply(UUID groupID, bool success)
10585 {
10586 LeaveGroupReplyPacket p = (LeaveGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.LeaveGroupReply);
10587
10588 p.AgentData = new LeaveGroupReplyPacket.AgentDataBlock();
10589 p.AgentData.AgentID = AgentId;
10590
10591 p.GroupData = new LeaveGroupReplyPacket.GroupDataBlock();
10592 p.GroupData.GroupID = groupID;
10593 p.GroupData.Success = success;
10594
10595 OutPacket(p, ThrottleOutPacketType.Task);
10596 }
10597
10598 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
10599 {
10600 if (classifiedID.Length != name.Length)
10601 return;
10602
10603 AvatarClassifiedReplyPacket ac =
10604 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
10605 PacketType.AvatarClassifiedReply);
10606
10607 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
10608 ac.AgentData.AgentID = AgentId;
10609 ac.AgentData.TargetID = targetID;
10610
10611 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifiedID.Length];
10612 int i;
10613 for (i = 0 ; i < classifiedID.Length ; i++)
10614 {
10615 ac.Data[i].ClassifiedID = classifiedID[i];
10616 ac.Data[i].Name = Utils.StringToBytes(name[i]);
10617 }
10618
10619 OutPacket(ac, ThrottleOutPacketType.Task);
10620 }
10621
10622 public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price)
10623 {
10624 ClassifiedInfoReplyPacket cr =
10625 (ClassifiedInfoReplyPacket)PacketPool.Instance.GetPacket(
10626 PacketType.ClassifiedInfoReply);
10627
10628 cr.AgentData = new ClassifiedInfoReplyPacket.AgentDataBlock();
10629 cr.AgentData.AgentID = AgentId;
10630
10631 cr.Data = new ClassifiedInfoReplyPacket.DataBlock();
10632 cr.Data.ClassifiedID = classifiedID;
10633 cr.Data.CreatorID = creatorID;
10634 cr.Data.CreationDate = creationDate;
10635 cr.Data.ExpirationDate = expirationDate;
10636 cr.Data.Category = category;
10637 cr.Data.Name = Utils.StringToBytes(name);
10638 cr.Data.Desc = Utils.StringToBytes(description);
10639 cr.Data.ParcelID = parcelID;
10640 cr.Data.ParentEstate = parentEstate;
10641 cr.Data.SnapshotID = snapshotID;
10642 cr.Data.SimName = Utils.StringToBytes(simName);
10643 cr.Data.PosGlobal = new Vector3d(globalPos);
10644 cr.Data.ParcelName = Utils.StringToBytes(parcelName);
10645 cr.Data.ClassifiedFlags = classifiedFlags;
10646 cr.Data.PriceForListing = price;
10647
10648 OutPacket(cr, ThrottleOutPacketType.Task);
10649 }
10650
10651 public void SendAgentDropGroup(UUID groupID)
10652 {
10653 AgentDropGroupPacket dg =
10654 (AgentDropGroupPacket)PacketPool.Instance.GetPacket(
10655 PacketType.AgentDropGroup);
10656
10657 dg.AgentData = new AgentDropGroupPacket.AgentDataBlock();
10658 dg.AgentData.AgentID = AgentId;
10659 dg.AgentData.GroupID = groupID;
10660
10661 OutPacket(dg, ThrottleOutPacketType.Task);
10662 }
10663
10664 public void SendAvatarNotesReply(UUID targetID, string text)
10665 {
10666 AvatarNotesReplyPacket an =
10667 (AvatarNotesReplyPacket)PacketPool.Instance.GetPacket(
10668 PacketType.AvatarNotesReply);
10669
10670 an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock();
10671 an.AgentData.AgentID = AgentId;
10672
10673 an.Data = new AvatarNotesReplyPacket.DataBlock();
10674 an.Data.TargetID = targetID;
10675 an.Data.Notes = Utils.StringToBytes(text);
10676
10677 OutPacket(an, ThrottleOutPacketType.Task);
10678 }
10679
10680 public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
10681 {
10682 AvatarPicksReplyPacket ap =
10683 (AvatarPicksReplyPacket)PacketPool.Instance.GetPacket(
10684 PacketType.AvatarPicksReply);
10685
10686 ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock();
10687 ap.AgentData.AgentID = AgentId;
10688 ap.AgentData.TargetID = targetID;
10689
10690 ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count];
10691
10692 int i = 0;
10693 foreach (KeyValuePair<UUID, string> pick in picks)
10694 {
10695 ap.Data[i] = new AvatarPicksReplyPacket.DataBlock();
10696 ap.Data[i].PickID = pick.Key;
10697 ap.Data[i].PickName = Utils.StringToBytes(pick.Value);
10698 i++;
10699 }
10700
10701 OutPacket(ap, ThrottleOutPacketType.Task);
10702 }
10703
10704 public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
10705 {
10706 AvatarClassifiedReplyPacket ac =
10707 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
10708 PacketType.AvatarClassifiedReply);
10709
10710 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
10711 ac.AgentData.AgentID = AgentId;
10712 ac.AgentData.TargetID = targetID;
10713
10714 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count];
10715
10716 int i = 0;
10717 foreach (KeyValuePair<UUID, string> classified in classifieds)
10718 {
10719 ac.Data[i] = new AvatarClassifiedReplyPacket.DataBlock();
10720 ac.Data[i].ClassifiedID = classified.Key;
10721 ac.Data[i].Name = Utils.StringToBytes(classified.Value);
10722 i++;
10723 }
10724
10725 OutPacket(ac, ThrottleOutPacketType.Task);
10726 }
10727
10728 public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
10729 {
10730 ParcelDwellReplyPacket pd =
10731 (ParcelDwellReplyPacket)PacketPool.Instance.GetPacket(
10732 PacketType.ParcelDwellReply);
10733
10734 pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock();
10735 pd.AgentData.AgentID = AgentId;
10736
10737 pd.Data = new ParcelDwellReplyPacket.DataBlock();
10738 pd.Data.LocalID = localID;
10739 pd.Data.ParcelID = parcelID;
10740 pd.Data.Dwell = dwell;
10741
10742 OutPacket(pd, ThrottleOutPacketType.Land);
10743 }
10744
10745 public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
10746 {
10747 UserInfoReplyPacket ur =
10748 (UserInfoReplyPacket)PacketPool.Instance.GetPacket(
10749 PacketType.UserInfoReply);
10750
10751 string Visible = "hidden";
10752 if (visible)
10753 Visible = "default";
10754
10755 ur.AgentData = new UserInfoReplyPacket.AgentDataBlock();
10756 ur.AgentData.AgentID = AgentId;
10757
10758 ur.UserData = new UserInfoReplyPacket.UserDataBlock();
10759 ur.UserData.IMViaEMail = imViaEmail;
10760 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible);
10761 ur.UserData.EMail = Utils.StringToBytes(email);
10762
10763 OutPacket(ur, ThrottleOutPacketType.Task);
10764 }
10765
10766 public void KillEndDone() 10273 public void KillEndDone()
10767 { 10274 {
10768 KillPacket kp = new KillPacket(); 10275 m_udpClient.Shutdown();
10769 OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
10770 } 10276 }
10771 10277
10772 #region IClientCore 10278 #region IClientCore
@@ -10789,13 +10295,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10789 } 10295 }
10790 } 10296 }
10791 10297
10792 protected virtual void RegisterInterfaces()
10793 {
10794 RegisterInterface<IClientIM>(this);
10795 RegisterInterface<IClientChat>(this);
10796 RegisterInterface<IClientIPEndpoint>(this);
10797 }
10798
10799 public bool TryGet<T>(out T iface) 10298 public bool TryGet<T>(out T iface)
10800 { 10299 {
10801 if (m_clientInterfaces.ContainsKey(typeof(T))) 10300 if (m_clientInterfaces.ContainsKey(typeof(T)))
@@ -10843,78 +10342,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10843 } 10342 }
10844 } 10343 }
10845 10344
10846 public void SendCreateGroupReply(UUID groupID, bool success, string message)
10847 {
10848 CreateGroupReplyPacket createGroupReply = (CreateGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.CreateGroupReply);
10849
10850 createGroupReply.AgentData =
10851 new CreateGroupReplyPacket.AgentDataBlock();
10852 createGroupReply.ReplyData =
10853 new CreateGroupReplyPacket.ReplyDataBlock();
10854
10855 createGroupReply.AgentData.AgentID = AgentId;
10856 createGroupReply.ReplyData.GroupID = groupID;
10857
10858 createGroupReply.ReplyData.Success = success;
10859 createGroupReply.ReplyData.Message = Utils.StringToBytes(message);
10860 OutPacket(createGroupReply, ThrottleOutPacketType.Task);
10861 }
10862
10863 public void SendUseCachedMuteList()
10864 {
10865 UseCachedMuteListPacket useCachedMuteList = (UseCachedMuteListPacket)PacketPool.Instance.GetPacket(PacketType.UseCachedMuteList);
10866
10867 useCachedMuteList.AgentData = new UseCachedMuteListPacket.AgentDataBlock();
10868 useCachedMuteList.AgentData.AgentID = AgentId;
10869
10870 OutPacket(useCachedMuteList, ThrottleOutPacketType.Task);
10871 }
10872
10873 public void SendMuteListUpdate(string filename)
10874 {
10875 MuteListUpdatePacket muteListUpdate = (MuteListUpdatePacket)PacketPool.Instance.GetPacket(PacketType.MuteListUpdate);
10876
10877 muteListUpdate.MuteData = new MuteListUpdatePacket.MuteDataBlock();
10878 muteListUpdate.MuteData.AgentID = AgentId;
10879 muteListUpdate.MuteData.Filename = Utils.StringToBytes(filename);
10880
10881 OutPacket(muteListUpdate, ThrottleOutPacketType.Task);
10882 }
10883
10884 public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled)
10885 {
10886 PickInfoReplyPacket pickInfoReply = (PickInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.PickInfoReply);
10887
10888 pickInfoReply.AgentData = new PickInfoReplyPacket.AgentDataBlock();
10889 pickInfoReply.AgentData.AgentID = AgentId;
10890
10891 pickInfoReply.Data = new PickInfoReplyPacket.DataBlock();
10892 pickInfoReply.Data.PickID = pickID;
10893 pickInfoReply.Data.CreatorID = creatorID;
10894 pickInfoReply.Data.TopPick = topPick;
10895 pickInfoReply.Data.ParcelID = parcelID;
10896 pickInfoReply.Data.Name = Utils.StringToBytes(name);
10897 pickInfoReply.Data.Desc = Utils.StringToBytes(desc);
10898 pickInfoReply.Data.SnapshotID = snapshotID;
10899 pickInfoReply.Data.User = Utils.StringToBytes(user);
10900 pickInfoReply.Data.OriginalName = Utils.StringToBytes(originalName);
10901 pickInfoReply.Data.SimName = Utils.StringToBytes(simName);
10902 pickInfoReply.Data.PosGlobal = new Vector3d(posGlobal);
10903 pickInfoReply.Data.SortOrder = sortOrder;
10904 pickInfoReply.Data.Enabled = enabled;
10905
10906 OutPacket(pickInfoReply, ThrottleOutPacketType.Task);
10907 }
10908
10909 public string Report() 10345 public string Report()
10910 { 10346 {
10911 LLPacketHandler handler = (LLPacketHandler) m_PacketHandler; 10347 return m_udpClient.GetStats();
10912 return handler.PacketQueue.GetStats();
10913 } 10348 }
10914 10349
10915 public string XReport(string uptime, string version) 10350 public string XReport(string uptime, string version)
10916 { 10351 {
10917 return ""; 10352 return String.Empty;
10918 } 10353 }
10919 10354
10920 public void MakeAssetRequest(TransferRequestPacket transferRequest) 10355 public void MakeAssetRequest(TransferRequestPacket transferRequest)
@@ -11003,7 +10438,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11003 return numPackets; 10438 return numPackets;
11004 } 10439 }
11005 10440
11006
11007 #region IClientIPEndpoint Members 10441 #region IClientIPEndpoint Members
11008 10442
11009 public IPAddress EndPoint 10443 public IPAddress EndPoint