aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2009-10-07 04:37:12 +0100
committerMelanie2009-10-07 04:37:12 +0100
commitd33b6fef2b8d3898ab6411df3267d42d18e56d9b (patch)
tree822e39f2add4ca9f8c31902187295fb7492ea0cb
parentMerge branch 'master' into htb-throttle (diff)
downloadopensim-SC_OLD-d33b6fef2b8d3898ab6411df3267d42d18e56d9b.zip
opensim-SC_OLD-d33b6fef2b8d3898ab6411df3267d42d18e56d9b.tar.gz
opensim-SC_OLD-d33b6fef2b8d3898ab6411df3267d42d18e56d9b.tar.bz2
opensim-SC_OLD-d33b6fef2b8d3898ab6411df3267d42d18e56d9b.tar.xz
replace LLClientView with proper version
-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 0052729..84e705a 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];
@@ -3201,7 +3625,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3201 } 3625 }
3202 3626
3203 outPacket.Header.Zerocoded = true; 3627 outPacket.Header.Zerocoded = true;
3204 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); 3628 OutPacket(outPacket, ThrottleOutPacketType.Task);
3205 3629
3206 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) 3630 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled)
3207 lock (m_primFullUpdateTimer) 3631 lock (m_primFullUpdateTimer)
@@ -3291,7 +3715,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3291 3715
3292 outPacket.Header.Reliable = false; 3716 outPacket.Header.Reliable = false;
3293 outPacket.Header.Zerocoded = true; 3717 outPacket.Header.Zerocoded = true;
3294 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority); 3718 OutPacket(outPacket, ThrottleOutPacketType.Task);
3295 3719
3296 if (m_primTerseUpdates.Count == 0) 3720 if (m_primTerseUpdates.Count == 0)
3297 lock (m_primTerseUpdateTimer) 3721 lock (m_primTerseUpdateTimer)
@@ -3442,8 +3866,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3442 objPropDB.SalePrice = SalePrice; 3866 objPropDB.SalePrice = SalePrice;
3443 objPropDB.Category = Category; 3867 objPropDB.Category = Category;
3444 objPropDB.LastOwnerID = LastOwnerID; 3868 objPropDB.LastOwnerID = LastOwnerID;
3445 objPropDB.Name = LLUtil.StringToPacketBytes(ObjectName); 3869 objPropDB.Name = Util.StringToBytes256(ObjectName);
3446 objPropDB.Description = LLUtil.StringToPacketBytes(Description); 3870 objPropDB.Description = Util.StringToBytes256(Description);
3447 objPropFamilyPack.ObjectData = objPropDB; 3871 objPropFamilyPack.ObjectData = objPropDB;
3448 objPropFamilyPack.Header.Zerocoded = true; 3872 objPropFamilyPack.Header.Zerocoded = true;
3449 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task); 3873 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
@@ -3477,11 +3901,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3477 proper.ObjectData[0].OwnerID = UUID.Zero; 3901 proper.ObjectData[0].OwnerID = UUID.Zero;
3478 else 3902 else
3479 proper.ObjectData[0].OwnerID = OwnerUUID; 3903 proper.ObjectData[0].OwnerID = OwnerUUID;
3480 proper.ObjectData[0].TouchName = LLUtil.StringToPacketBytes(TouchTitle); 3904 proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle);
3481 proper.ObjectData[0].TextureID = TextureID; 3905 proper.ObjectData[0].TextureID = TextureID;
3482 proper.ObjectData[0].SitName = LLUtil.StringToPacketBytes(SitTitle); 3906 proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle);
3483 proper.ObjectData[0].Name = LLUtil.StringToPacketBytes(ItemName); 3907 proper.ObjectData[0].Name = Util.StringToBytes256(ItemName);
3484 proper.ObjectData[0].Description = LLUtil.StringToPacketBytes(ItemDescription); 3908 proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription);
3485 proper.ObjectData[0].OwnerMask = OwnerMask; 3909 proper.ObjectData[0].OwnerMask = OwnerMask;
3486 proper.ObjectData[0].NextOwnerMask = NextOwnerMask; 3910 proper.ObjectData[0].NextOwnerMask = NextOwnerMask;
3487 proper.ObjectData[0].GroupMask = GroupMask; 3911 proper.ObjectData[0].GroupMask = GroupMask;
@@ -3722,11 +4146,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3722 4146
3723 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 4147 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale;
3724 updatePacket.ParcelData.MediaID = landData.MediaID; 4148 updatePacket.ParcelData.MediaID = landData.MediaID;
3725 updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL); 4149 updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL);
3726 updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL); 4150 updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL);
3727 updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name); 4151 updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name);
3728 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 4152 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime;
3729 updatePacket.ParcelData.OtherCount = 0; //unemplemented 4153 updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented
3730 updatePacket.ParcelData.OtherPrims = landData.OtherPrims; 4154 updatePacket.ParcelData.OtherPrims = landData.OtherPrims;
3731 updatePacket.ParcelData.OwnerID = landData.OwnerID; 4155 updatePacket.ParcelData.OwnerID = landData.OwnerID;
3732 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; 4156 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims;
@@ -3734,22 +4158,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3734 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; 4158 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor;
3735 updatePacket.ParcelData.PassHours = landData.PassHours; 4159 updatePacket.ParcelData.PassHours = landData.PassHours;
3736 updatePacket.ParcelData.PassPrice = landData.PassPrice; 4160 updatePacket.ParcelData.PassPrice = landData.PassPrice;
3737 updatePacket.ParcelData.PublicCount = 0; //unemplemented 4161 updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented
3738 4162
3739 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)RegionFlags.DenyAnonymous) > 4163 updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0;
3740 0); 4164 updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0;
3741 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)RegionFlags.DenyIdentified) > 4165 updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
3742 0); 4166 updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
3743 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)RegionFlags.DenyTransacted) >
3744 0);
3745 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)RegionFlags.RestrictPushObject) >
3746 0);
3747 4167
3748 updatePacket.ParcelData.RentPrice = 0; 4168 updatePacket.ParcelData.RentPrice = 0;
3749 updatePacket.ParcelData.RequestResult = request_result; 4169 updatePacket.ParcelData.RequestResult = request_result;
3750 updatePacket.ParcelData.SalePrice = landData.SalePrice; 4170 updatePacket.ParcelData.SalePrice = landData.SalePrice;
3751 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; 4171 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims;
3752 updatePacket.ParcelData.SelfCount = 0; //unemplemented 4172 updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented
3753 updatePacket.ParcelData.SequenceID = sequence_id; 4173 updatePacket.ParcelData.SequenceID = sequence_id;
3754 if (landData.SimwideArea > 0) 4174 if (landData.SimwideArea > 0)
3755 { 4175 {
@@ -4242,6 +4662,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4242 OutPacket(packet, ThrottleOutPacketType.Task); 4662 OutPacket(packet, ThrottleOutPacketType.Task);
4243 } 4663 }
4244 4664
4665 public ulong GetGroupPowers(UUID groupID)
4666 {
4667 if (groupID == m_activeGroupID)
4668 return m_activeGroupPowers;
4669
4670 if (m_groupPowers.ContainsKey(groupID))
4671 return m_groupPowers[groupID];
4672
4673 return 0;
4674 }
4675
4676 /// <summary>
4677 /// This is a utility method used by single states to not duplicate kicks and blue card of death messages.
4678 /// </summary>
4679 public bool ChildAgentStatus()
4680 {
4681 return m_scene.PresenceChildStatus(AgentId);
4682 }
4683
4245 #endregion 4684 #endregion
4246 4685
4247 /// <summary> 4686 /// <summary>
@@ -4260,6 +4699,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4260 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); 4699 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
4261 } 4700 }
4262 4701
4702 #region Packet Handlers
4703
4263 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) 4704 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
4264 { 4705 {
4265 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack; 4706 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack;
@@ -4267,7 +4708,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4267 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId && 4708 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId &&
4268 money.AgentData.SessionID == sender.SessionId) 4709 money.AgentData.SessionID == sender.SessionId)
4269 { 4710 {
4270 handlerMoneyTransferRequest = OnMoneyTransferRequest; 4711 MoneyTransferRequest handlerMoneyTransferRequest = OnMoneyTransferRequest;
4271 if (handlerMoneyTransferRequest != null) 4712 if (handlerMoneyTransferRequest != null)
4272 { 4713 {
4273 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID, 4714 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
@@ -4286,7 +4727,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4286 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack; 4727 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack;
4287 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId) 4728 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
4288 { 4729 {
4289 handlerParcelBuy = OnParcelBuy; 4730 ParcelBuy handlerParcelBuy = OnParcelBuy;
4290 if (handlerParcelBuy != null) 4731 if (handlerParcelBuy != null)
4291 { 4732 {
4292 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final, 4733 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final,
@@ -4307,7 +4748,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4307 4748
4308 for (int i = 0; i < upack.UUIDNameBlock.Length; i++) 4749 for (int i = 0; i < upack.UUIDNameBlock.Length; i++)
4309 { 4750 {
4310 handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest; 4751 UUIDNameRequest handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest;
4311 if (handlerUUIDGroupNameRequest != null) 4752 if (handlerUUIDGroupNameRequest != null)
4312 { 4753 {
4313 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this); 4754 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this);
@@ -4323,7 +4764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4323 if (m_genericPacketHandlers.Count == 0) return false; 4764 if (m_genericPacketHandlers.Count == 0) return false;
4324 if (gmpack.AgentData.SessionID != SessionId) return false; 4765 if (gmpack.AgentData.SessionID != SessionId) return false;
4325 4766
4326 handlerGenericMessage = null; 4767 GenericMessage handlerGenericMessage = null;
4327 4768
4328 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); 4769 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim();
4329 4770
@@ -4364,7 +4805,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4364 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack; 4805 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack;
4365 if (ogpack.AgentData.SessionID != SessionId) return false; 4806 if (ogpack.AgentData.SessionID != SessionId) return false;
4366 4807
4367 handlerObjectGroupRequest = OnObjectGroupRequest; 4808 RequestObjectPropertiesFamily handlerObjectGroupRequest = OnObjectGroupRequest;
4368 if (handlerObjectGroupRequest != null) 4809 if (handlerObjectGroupRequest != null)
4369 { 4810 {
4370 for (int i = 0; i < ogpack.ObjectData.Length; i++) 4811 for (int i = 0; i < ogpack.ObjectData.Length; i++)
@@ -4379,7 +4820,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4379 { 4820 {
4380 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; 4821 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
4381 if (viewer.AgentData.SessionID != SessionId) return false; 4822 if (viewer.AgentData.SessionID != SessionId) return false;
4382 handlerViewerEffect = OnViewerEffect; 4823 ViewerEffectEventHandler handlerViewerEffect = OnViewerEffect;
4383 if (handlerViewerEffect != null) 4824 if (handlerViewerEffect != null)
4384 { 4825 {
4385 int length = viewer.Effect.Length; 4826 int length = viewer.Effect.Length;
@@ -4403,6 +4844,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4403 return true; 4844 return true;
4404 } 4845 }
4405 4846
4847 #endregion Packet Handlers
4848
4406 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) 4849 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
4407 { 4850 {
4408 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); 4851 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
@@ -4468,7 +4911,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4468 { 4911 {
4469 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName); 4912 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName);
4470 4913
4471 handlerLogout = OnLogout; 4914 Action<IClientAPI> handlerLogout = OnLogout;
4472 4915
4473 if (handlerLogout != null) 4916 if (handlerLogout != null)
4474 { 4917 {
@@ -4550,7 +4993,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4550 case 1: 4993 case 1:
4551 Vector3 pos1 = new Vector3(block.Data, 0); 4994 Vector3 pos1 = new Vector3(block.Data, 0);
4552 4995
4553 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 4996 UpdateVector handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
4554 if (handlerUpdatePrimSinglePosition != null) 4997 if (handlerUpdatePrimSinglePosition != null)
4555 { 4998 {
4556 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); 4999 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
@@ -4560,7 +5003,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4560 case 2: 5003 case 2:
4561 Quaternion rot1 = new Quaternion(block.Data, 0, true); 5004 Quaternion rot1 = new Quaternion(block.Data, 0, true);
4562 5005
4563 handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; 5006 UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
4564 if (handlerUpdatePrimSingleRotation != null) 5007 if (handlerUpdatePrimSingleRotation != null)
4565 { 5008 {
4566 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W); 5009 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W);
@@ -4571,7 +5014,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4571 Vector3 rotPos = new Vector3(block.Data, 0); 5014 Vector3 rotPos = new Vector3(block.Data, 0);
4572 Quaternion rot2 = new Quaternion(block.Data, 12, true); 5015 Quaternion rot2 = new Quaternion(block.Data, 12, true);
4573 5016
4574 handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; 5017 UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition;
4575 if (handlerUpdatePrimSingleRotationPosition != null) 5018 if (handlerUpdatePrimSingleRotationPosition != null)
4576 { 5019 {
4577 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z); 5020 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z);
@@ -4583,7 +5026,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4583 case 20: 5026 case 20:
4584 Vector3 scale4 = new Vector3(block.Data, 0); 5027 Vector3 scale4 = new Vector3(block.Data, 0);
4585 5028
4586 handlerUpdatePrimScale = OnUpdatePrimScale; 5029 UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale;
4587 if (handlerUpdatePrimScale != null) 5030 if (handlerUpdatePrimScale != null)
4588 { 5031 {
4589// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z); 5032// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z);
@@ -4611,7 +5054,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4611 case 9: 5054 case 9:
4612 Vector3 pos2 = new Vector3(block.Data, 0); 5055 Vector3 pos2 = new Vector3(block.Data, 0);
4613 5056
4614 handlerUpdateVector = OnUpdatePrimGroupPosition; 5057 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition;
4615 5058
4616 if (handlerUpdateVector != null) 5059 if (handlerUpdateVector != null)
4617 { 5060 {
@@ -4622,7 +5065,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4622 case 10: 5065 case 10:
4623 Quaternion rot3 = new Quaternion(block.Data, 0, true); 5066 Quaternion rot3 = new Quaternion(block.Data, 0, true);
4624 5067
4625 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 5068 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
4626 if (handlerUpdatePrimRotation != null) 5069 if (handlerUpdatePrimRotation != null)
4627 { 5070 {
4628 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); 5071 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W);
@@ -4645,7 +5088,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4645 case 28: 5088 case 28:
4646 Vector3 scale7 = new Vector3(block.Data, 0); 5089 Vector3 scale7 = new Vector3(block.Data, 0);
4647 5090
4648 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 5091 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
4649 if (handlerUpdatePrimGroupScale != null) 5092 if (handlerUpdatePrimGroupScale != null)
4650 { 5093 {
4651// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); 5094// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z);
@@ -4765,45 +5208,40 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4765 } 5208 }
4766 5209
4767 /// <summary> 5210 /// <summary>
4768 /// returns a byte array of the client set throttles Gets multiplied by the multiplier 5211 /// Sets the throttles from values supplied by the client
4769 ///
4770 /// </summary> 5212 /// </summary>
4771 /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param> 5213 /// <param name="throttles"></param>
4772 /// <returns></returns> 5214 public void SetChildAgentThrottle(byte[] throttles)
4773 public byte[] GetThrottlesPacked(float multiplier)
4774 { 5215 {
4775 return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier); 5216 m_udpClient.SetThrottles(throttles);
4776 } 5217 }
5218
4777 /// <summary> 5219 /// <summary>
4778 /// sets the throttles from values supplied by the client 5220 /// Get the current throttles for this client as a packed byte array
4779 /// </summary> 5221 /// </summary>
4780 /// <param name="throttles"></param> 5222 /// <param name="multiplier">Unused</param>
4781 public void SetChildAgentThrottle(byte[] throttles) 5223 /// <returns></returns>
5224 public byte[] GetThrottlesPacked(float multiplier)
4782 { 5225 {
4783 m_PacketHandler.PacketQueue.SetThrottleFromClient(throttles); 5226 return m_udpClient.GetThrottlesPacked();
4784 } 5227 }
4785 5228
4786 /// <summary> 5229 /// <summary>
4787 /// Method gets called when a new packet has arrived from the UDP 5230 /// Cruft?
4788 /// server. This happens after it's been decoded into a libsl object.
4789 /// </summary> 5231 /// </summary>
4790 /// <param name="NewPack">object containing the packet.</param>
4791 public virtual void InPacket(object NewPack) 5232 public virtual void InPacket(object NewPack)
4792 { 5233 {
4793 // Cast NewPack to Packet. 5234 throw new NotImplementedException();
4794 m_PacketHandler.InPacket((Packet) NewPack);
4795 } 5235 }
4796 5236
4797 /// <summary> 5237 /// <summary>
4798 /// This is the starting point for sending a simulator packet out to the client. 5238 /// This is the starting point for sending a simulator packet out to the client
4799 ///
4800 /// Please do not call this from outside the LindenUDP client stack.
4801 /// </summary> 5239 /// </summary>
4802 /// <param name="NewPack"></param> 5240 /// <param name="packet">Packet to send</param>
4803 /// <param name="throttlePacketType">Corresponds to the type of data that is going out. Enum</param> 5241 /// <param name="throttlePacketType">Throttling category for the packet</param>
4804 public void OutPacket(Packet NewPack, ThrottleOutPacketType throttlePacketType) 5242 private void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType)
4805 { 5243 {
4806 m_PacketHandler.OutPacket(NewPack, throttlePacketType); 5244 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true);
4807 } 5245 }
4808 5246
4809 public bool AddMoney(int debit) 5247 public bool AddMoney(int debit)
@@ -4847,7 +5285,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4847 return; 5285 return;
4848 } 5286 }
4849 5287
4850 handlerAutoPilotGo = OnAutoPilotGo; 5288 UpdateVector handlerAutoPilotGo = OnAutoPilotGo;
4851 if (handlerAutoPilotGo != null) 5289 if (handlerAutoPilotGo != null)
4852 { 5290 {
4853 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this); 5291 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this);
@@ -4899,7 +5337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4899 } 5337 }
4900 #endregion 5338 #endregion
4901 5339
4902 handlerRequestAvatarProperties = OnRequestAvatarProperties; 5340 RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties;
4903 if (handlerRequestAvatarProperties != null) 5341 if (handlerRequestAvatarProperties != null)
4904 { 5342 {
4905 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); 5343 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
@@ -4940,7 +5378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4940 args.Sender = this; 5378 args.Sender = this;
4941 args.SenderUUID = this.AgentId; 5379 args.SenderUUID = this.AgentId;
4942 5380
4943 handlerChatFromClient = OnChatFromClient; 5381 ChatMessage handlerChatFromClient = OnChatFromClient;
4944 if (handlerChatFromClient != null) 5382 if (handlerChatFromClient != null)
4945 handlerChatFromClient(this, args); 5383 handlerChatFromClient(this, args);
4946 } 5384 }
@@ -4958,7 +5396,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4958 } 5396 }
4959 #endregion 5397 #endregion
4960 5398
4961 handlerUpdateAvatarProperties = OnUpdateAvatarProperties; 5399 UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties;
4962 if (handlerUpdateAvatarProperties != null) 5400 if (handlerUpdateAvatarProperties != null)
4963 { 5401 {
4964 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData; 5402 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
@@ -4998,7 +5436,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4998 args.Position = new Vector3(); 5436 args.Position = new Vector3();
4999 args.Scene = Scene; 5437 args.Scene = Scene;
5000 args.Sender = this; 5438 args.Sender = this;
5001 handlerChatFromClient2 = OnChatFromClient; 5439 ChatMessage handlerChatFromClient2 = OnChatFromClient;
5002 if (handlerChatFromClient2 != null) 5440 if (handlerChatFromClient2 != null)
5003 handlerChatFromClient2(this, args); 5441 handlerChatFromClient2(this, args);
5004 } 5442 }
@@ -5019,7 +5457,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5019 5457
5020 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 5458 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
5021 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message); 5459 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message);
5022 handlerInstantMessage = OnInstantMessage; 5460 ImprovedInstantMessage handlerInstantMessage = OnInstantMessage;
5023 5461
5024 if (handlerInstantMessage != null) 5462 if (handlerInstantMessage != null)
5025 { 5463 {
@@ -5062,7 +5500,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5062 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID); 5500 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID);
5063 } 5501 }
5064 5502
5065 handlerApproveFriendRequest = OnApproveFriendRequest; 5503 FriendActionDelegate handlerApproveFriendRequest = OnApproveFriendRequest;
5066 if (handlerApproveFriendRequest != null) 5504 if (handlerApproveFriendRequest != null)
5067 { 5505 {
5068 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders); 5506 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders);
@@ -5105,7 +5543,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5105 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; 5543 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
5106 UUID exFriendID = tfriendpack.ExBlock.OtherID; 5544 UUID exFriendID = tfriendpack.ExBlock.OtherID;
5107 5545
5108 handlerTerminateFriendship = OnTerminateFriendship; 5546 FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship;
5109 if (handlerTerminateFriendship != null) 5547 if (handlerTerminateFriendship != null)
5110 { 5548 {
5111 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 5549 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
@@ -5124,7 +5562,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5124 } 5562 }
5125 #endregion 5563 #endregion
5126 5564
5127 handlerRezObject = OnRezObject; 5565 RezObject handlerRezObject = OnRezObject;
5128 if (handlerRezObject != null) 5566 if (handlerRezObject != null)
5129 { 5567 {
5130 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, 5568 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
@@ -5147,7 +5585,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5147 } 5585 }
5148 #endregion 5586 #endregion
5149 5587
5150 handlerDeRezObject = OnDeRezObject; 5588 DeRezObject handlerDeRezObject = OnDeRezObject;
5151 if (handlerDeRezObject != null) 5589 if (handlerDeRezObject != null)
5152 { 5590 {
5153 List<uint> deRezIDs = new List<uint>(); 5591 List<uint> deRezIDs = new List<uint>();
@@ -5186,7 +5624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5186 { 5624 {
5187 for (int i = 0; i < modify.ParcelData.Length; i++) 5625 for (int i = 0; i < modify.ParcelData.Length; i++)
5188 { 5626 {
5189 handlerModifyTerrain = OnModifyTerrain; 5627 ModifyTerrain handlerModifyTerrain = OnModifyTerrain;
5190 if (handlerModifyTerrain != null) 5628 if (handlerModifyTerrain != null)
5191 { 5629 {
5192 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, 5630 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
@@ -5203,7 +5641,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5203 5641
5204 case PacketType.RegionHandshakeReply: 5642 case PacketType.RegionHandshakeReply:
5205 5643
5206 handlerRegionHandShakeReply = OnRegionHandShakeReply; 5644 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
5207 if (handlerRegionHandShakeReply != null) 5645 if (handlerRegionHandShakeReply != null)
5208 { 5646 {
5209 handlerRegionHandShakeReply(this); 5647 handlerRegionHandShakeReply(this);
@@ -5212,14 +5650,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5212 break; 5650 break;
5213 5651
5214 case PacketType.AgentWearablesRequest: 5652 case PacketType.AgentWearablesRequest:
5215 handlerRequestWearables = OnRequestWearables; 5653 GenericCall2 handlerRequestWearables = OnRequestWearables;
5216 5654
5217 if (handlerRequestWearables != null) 5655 if (handlerRequestWearables != null)
5218 { 5656 {
5219 handlerRequestWearables(); 5657 handlerRequestWearables();
5220 } 5658 }
5221 5659
5222 handlerRequestAvatarsData = OnRequestAvatarsData; 5660 Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData;
5223 5661
5224 if (handlerRequestAvatarsData != null) 5662 if (handlerRequestAvatarsData != null)
5225 { 5663 {
@@ -5240,7 +5678,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5240 } 5678 }
5241 #endregion 5679 #endregion
5242 5680
5243 handlerSetAppearance = OnSetAppearance; 5681 SetAppearance handlerSetAppearance = OnSetAppearance;
5244 if (handlerSetAppearance != null) 5682 if (handlerSetAppearance != null)
5245 { 5683 {
5246 // Temporarily protect ourselves from the mantis #951 failure. 5684 // Temporarily protect ourselves from the mantis #951 failure.
@@ -5291,7 +5729,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5291 wearingArgs.NowWearing.Add(wearable); 5729 wearingArgs.NowWearing.Add(wearable);
5292 } 5730 }
5293 5731
5294 handlerAvatarNowWearing = OnAvatarNowWearing; 5732 AvatarNowWearing handlerAvatarNowWearing = OnAvatarNowWearing;
5295 if (handlerAvatarNowWearing != null) 5733 if (handlerAvatarNowWearing != null)
5296 { 5734 {
5297 handlerAvatarNowWearing(this, wearingArgs); 5735 handlerAvatarNowWearing(this, wearingArgs);
@@ -5300,7 +5738,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5300 break; 5738 break;
5301 5739
5302 case PacketType.RezSingleAttachmentFromInv: 5740 case PacketType.RezSingleAttachmentFromInv:
5303 handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; 5741 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
5304 if (handlerRezSingleAttachment != null) 5742 if (handlerRezSingleAttachment != null)
5305 { 5743 {
5306 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack; 5744 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack;
@@ -5321,7 +5759,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5321 break; 5759 break;
5322 5760
5323 case PacketType.RezMultipleAttachmentsFromInv: 5761 case PacketType.RezMultipleAttachmentsFromInv:
5324 handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; 5762 RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv;
5325 if (handlerRezMultipleAttachments != null) 5763 if (handlerRezMultipleAttachments != null)
5326 { 5764 {
5327 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; 5765 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack;
@@ -5332,7 +5770,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5332 break; 5770 break;
5333 5771
5334 case PacketType.DetachAttachmentIntoInv: 5772 case PacketType.DetachAttachmentIntoInv:
5335 handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; 5773 UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
5336 if (handlerDetachAttachmentIntoInv != null) 5774 if (handlerDetachAttachmentIntoInv != null)
5337 { 5775 {
5338 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; 5776 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
@@ -5362,7 +5800,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5362 } 5800 }
5363 #endregion 5801 #endregion
5364 5802
5365 handlerObjectAttach = OnObjectAttach; 5803 ObjectAttach handlerObjectAttach = OnObjectAttach;
5366 5804
5367 if (handlerObjectAttach != null) 5805 if (handlerObjectAttach != null)
5368 { 5806 {
@@ -5389,7 +5827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5389 for (int j = 0; j < dett.ObjectData.Length; j++) 5827 for (int j = 0; j < dett.ObjectData.Length; j++)
5390 { 5828 {
5391 uint obj = dett.ObjectData[j].ObjectLocalID; 5829 uint obj = dett.ObjectData[j].ObjectLocalID;
5392 handlerObjectDetach = OnObjectDetach; 5830 ObjectDeselect handlerObjectDetach = OnObjectDetach;
5393 if (handlerObjectDetach != null) 5831 if (handlerObjectDetach != null)
5394 { 5832 {
5395 handlerObjectDetach(obj, this); 5833 handlerObjectDetach(obj, this);
@@ -5413,7 +5851,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5413 for (int j = 0; j < dropp.ObjectData.Length; j++) 5851 for (int j = 0; j < dropp.ObjectData.Length; j++)
5414 { 5852 {
5415 uint obj = dropp.ObjectData[j].ObjectLocalID; 5853 uint obj = dropp.ObjectData[j].ObjectLocalID;
5416 handlerObjectDrop = OnObjectDrop; 5854 ObjectDrop handlerObjectDrop = OnObjectDrop;
5417 if (handlerObjectDrop != null) 5855 if (handlerObjectDrop != null)
5418 { 5856 {
5419 handlerObjectDrop(obj, this); 5857 handlerObjectDrop(obj, this);
@@ -5433,14 +5871,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5433 } 5871 }
5434 #endregion 5872 #endregion
5435 5873
5436 handlerSetAlwaysRun = OnSetAlwaysRun; 5874 SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun;
5437 if (handlerSetAlwaysRun != null) 5875 if (handlerSetAlwaysRun != null)
5438 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); 5876 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun);
5439 5877
5440 break; 5878 break;
5441 5879
5442 case PacketType.CompleteAgentMovement: 5880 case PacketType.CompleteAgentMovement:
5443 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 5881 GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
5444 if (handlerCompleteMovementToRegion != null) 5882 if (handlerCompleteMovementToRegion != null)
5445 { 5883 {
5446 handlerCompleteMovementToRegion(); 5884 handlerCompleteMovementToRegion();
@@ -5509,7 +5947,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5509 arg.HeadRotation = x.HeadRotation; 5947 arg.HeadRotation = x.HeadRotation;
5510 arg.SessionID = x.SessionID; 5948 arg.SessionID = x.SessionID;
5511 arg.State = x.State; 5949 arg.State = x.State;
5512 handlerAgentUpdate = OnAgentUpdate; 5950 UpdateAgent handlerAgentUpdate = OnAgentUpdate;
5513 lastarg = arg; // save this set of arguments for nexttime 5951 lastarg = arg; // save this set of arguments for nexttime
5514 if (handlerAgentUpdate != null) 5952 if (handlerAgentUpdate != null)
5515 OnAgentUpdate(this, arg); 5953 OnAgentUpdate(this, arg);
@@ -5532,8 +5970,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5532 } 5970 }
5533 #endregion 5971 #endregion
5534 5972
5535 handlerStartAnim = null; 5973 StartAnim handlerStartAnim = null;
5536 handlerStopAnim = null; 5974 StopAnim handlerStopAnim = null;
5537 5975
5538 for (int i = 0; i < AgentAni.AnimationList.Length; i++) 5976 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
5539 { 5977 {
@@ -5570,7 +6008,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5570 } 6008 }
5571 #endregion 6009 #endregion
5572 6010
5573 handlerAgentRequestSit = OnAgentRequestSit; 6011 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
5574 if (handlerAgentRequestSit != null) 6012 if (handlerAgentRequestSit != null)
5575 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, 6013 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
5576 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); 6014 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
@@ -5591,7 +6029,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5591 } 6029 }
5592 #endregion 6030 #endregion
5593 6031
5594 handlerAgentSit = OnAgentSit; 6032 AgentSit handlerAgentSit = OnAgentSit;
5595 if (handlerAgentSit != null) 6033 if (handlerAgentSit != null)
5596 { 6034 {
5597 OnAgentSit(this, agentSit.AgentData.AgentID); 6035 OnAgentSit(this, agentSit.AgentData.AgentID);
@@ -5609,7 +6047,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5609 } 6047 }
5610 #endregion 6048 #endregion
5611 6049
5612 handlerSoundTrigger = OnSoundTrigger; 6050 SoundTrigger handlerSoundTrigger = OnSoundTrigger;
5613 if (handlerSoundTrigger != null) 6051 if (handlerSoundTrigger != null)
5614 { 6052 {
5615 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, 6053 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID,
@@ -5636,7 +6074,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5636 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; 6074 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
5637 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); 6075 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name));
5638 6076
5639 handlerAvatarPickerRequest = OnAvatarPickerRequest; 6077 AvatarPickerRequest handlerAvatarPickerRequest = OnAvatarPickerRequest;
5640 if (handlerAvatarPickerRequest != null) 6078 if (handlerAvatarPickerRequest != null)
5641 { 6079 {
5642 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, 6080 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID,
@@ -5656,7 +6094,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5656 } 6094 }
5657 #endregion 6095 #endregion
5658 6096
5659 handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest; 6097 FetchInventory handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest;
5660 6098
5661 if (handlerAgentDataUpdateRequest != null) 6099 if (handlerAgentDataUpdateRequest != null)
5662 { 6100 {
@@ -5666,7 +6104,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5666 break; 6104 break;
5667 6105
5668 case PacketType.UserInfoRequest: 6106 case PacketType.UserInfoRequest:
5669 handlerUserInfoRequest = OnUserInfoRequest; 6107 UserInfoRequest handlerUserInfoRequest = OnUserInfoRequest;
5670 if (handlerUserInfoRequest != null) 6108 if (handlerUserInfoRequest != null)
5671 { 6109 {
5672 handlerUserInfoRequest(this); 6110 handlerUserInfoRequest(this);
@@ -5689,7 +6127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5689 } 6127 }
5690 #endregion 6128 #endregion
5691 6129
5692 handlerUpdateUserInfo = OnUpdateUserInfo; 6130 UpdateUserInfo handlerUpdateUserInfo = OnUpdateUserInfo;
5693 if (handlerUpdateUserInfo != null) 6131 if (handlerUpdateUserInfo != null)
5694 { 6132 {
5695 bool visible = true; 6133 bool visible = true;
@@ -5718,7 +6156,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5718 6156
5719 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) 6157 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
5720 { 6158 {
5721 handlerSetStartLocationRequest = OnSetStartLocationRequest; 6159 TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest;
5722 if (handlerSetStartLocationRequest != null) 6160 if (handlerSetStartLocationRequest != null)
5723 { 6161 {
5724 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos, 6162 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos,
@@ -5740,23 +6178,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5740 } 6178 }
5741 #endregion 6179 #endregion
5742 6180
5743 m_PacketHandler.PacketQueue.SetThrottleFromClient(atpack.Throttle.Throttles); 6181 m_udpClient.SetThrottles(atpack.Throttle.Throttles);
5744 break; 6182 break;
5745 6183
5746 case PacketType.AgentPause: 6184 case PacketType.AgentPause:
5747 m_probesWithNoIngressPackets = 0; 6185 m_udpClient.IsPaused = true;
5748 m_clientBlocked = true;
5749 break; 6186 break;
5750 6187
5751 case PacketType.AgentResume: 6188 case PacketType.AgentResume:
5752 m_probesWithNoIngressPackets = 0; 6189 m_udpClient.IsPaused = false;
5753 m_clientBlocked = false; 6190 SendStartPingCheck(m_udpClient.CurrentPingSequence++);
5754 SendStartPingCheck(0);
5755 6191
5756 break; 6192 break;
5757 6193
5758 case PacketType.ForceScriptControlRelease: 6194 case PacketType.ForceScriptControlRelease:
5759 handlerForceReleaseControls = OnForceReleaseControls; 6195 ForceReleaseControls handlerForceReleaseControls = OnForceReleaseControls;
5760 if (handlerForceReleaseControls != null) 6196 if (handlerForceReleaseControls != null)
5761 { 6197 {
5762 handlerForceReleaseControls(this, AgentId); 6198 handlerForceReleaseControls(this, AgentId);
@@ -5790,7 +6226,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5790 childrenprims.Add(link.ObjectData[i].ObjectLocalID); 6226 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
5791 } 6227 }
5792 } 6228 }
5793 handlerLinkObjects = OnLinkObjects; 6229 LinkObjects handlerLinkObjects = OnLinkObjects;
5794 if (handlerLinkObjects != null) 6230 if (handlerLinkObjects != null)
5795 { 6231 {
5796 handlerLinkObjects(this, parentprimid, childrenprims); 6232 handlerLinkObjects(this, parentprimid, childrenprims);
@@ -5818,7 +6254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5818 { 6254 {
5819 prims.Add(delink.ObjectData[i].ObjectLocalID); 6255 prims.Add(delink.ObjectData[i].ObjectLocalID);
5820 } 6256 }
5821 handlerDelinkObjects = OnDelinkObjects; 6257 DelinkObjects handlerDelinkObjects = OnDelinkObjects;
5822 if (handlerDelinkObjects != null) 6258 if (handlerDelinkObjects != null)
5823 { 6259 {
5824 handlerDelinkObjects(prims); 6260 handlerDelinkObjects(prims);
@@ -5850,7 +6286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5850 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the 6286 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the
5851 //object from rezing initially 6287 //object from rezing initially
5852 6288
5853 handlerAddPrim = OnAddPrim; 6289 AddNewPrim handlerAddPrim = OnAddPrim;
5854 if (handlerAddPrim != null) 6290 if (handlerAddPrim != null)
5855 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); 6291 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
5856 } 6292 }
@@ -5868,7 +6304,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5868 } 6304 }
5869 #endregion 6305 #endregion
5870 6306
5871 handlerUpdatePrimShape = null; 6307 UpdateShape handlerUpdatePrimShape = null;
5872 for (int i = 0; i < shapePacket.ObjectData.Length; i++) 6308 for (int i = 0; i < shapePacket.ObjectData.Length; i++)
5873 { 6309 {
5874 handlerUpdatePrimShape = OnUpdatePrimShape; 6310 handlerUpdatePrimShape = OnUpdatePrimShape;
@@ -5913,7 +6349,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5913 } 6349 }
5914 #endregion 6350 #endregion
5915 6351
5916 handlerUpdateExtraParams = OnUpdateExtraParams; 6352 ObjectExtraParams handlerUpdateExtraParams = OnUpdateExtraParams;
5917 if (handlerUpdateExtraParams != null) 6353 if (handlerUpdateExtraParams != null)
5918 { 6354 {
5919 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++) 6355 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++)
@@ -5938,7 +6374,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5938 6374
5939 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; 6375 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
5940 6376
5941 handlerObjectDuplicate = null; 6377 ObjectDuplicate handlerObjectDuplicate = null;
5942 6378
5943 for (int i = 0; i < dupe.ObjectData.Length; i++) 6379 for (int i = 0; i < dupe.ObjectData.Length; i++)
5944 { 6380 {
@@ -5965,7 +6401,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5965 } 6401 }
5966 #endregion 6402 #endregion
5967 6403
5968 handlerObjectRequest = null; 6404 ObjectRequest handlerObjectRequest = null;
5969 6405
5970 for (int i = 0; i < incomingRequest.ObjectData.Length; i++) 6406 for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
5971 { 6407 {
@@ -5988,7 +6424,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5988 } 6424 }
5989 #endregion 6425 #endregion
5990 6426
5991 handlerObjectSelect = null; 6427 ObjectSelect handlerObjectSelect = null;
5992 6428
5993 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 6429 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
5994 { 6430 {
@@ -6011,7 +6447,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6011 } 6447 }
6012 #endregion 6448 #endregion
6013 6449
6014 handlerObjectDeselect = null; 6450 ObjectDeselect handlerObjectDeselect = null;
6015 6451
6016 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) 6452 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++)
6017 { 6453 {
@@ -6038,7 +6474,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6038 6474
6039 for (int i = 0; i < position.ObjectData.Length; i++) 6475 for (int i = 0; i < position.ObjectData.Length; i++)
6040 { 6476 {
6041 handlerUpdateVector = OnUpdatePrimGroupPosition; 6477 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition;
6042 if (handlerUpdateVector != null) 6478 if (handlerUpdateVector != null)
6043 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this); 6479 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this);
6044 } 6480 }
@@ -6059,7 +6495,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6059 6495
6060 for (int i = 0; i < scale.ObjectData.Length; i++) 6496 for (int i = 0; i < scale.ObjectData.Length; i++)
6061 { 6497 {
6062 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 6498 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
6063 if (handlerUpdatePrimGroupScale != null) 6499 if (handlerUpdatePrimGroupScale != null)
6064 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this); 6500 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this);
6065 } 6501 }
@@ -6080,7 +6516,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6080 6516
6081 for (int i = 0; i < rotation.ObjectData.Length; i++) 6517 for (int i = 0; i < rotation.ObjectData.Length; i++)
6082 { 6518 {
6083 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 6519 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
6084 if (handlerUpdatePrimRotation != null) 6520 if (handlerUpdatePrimRotation != null)
6085 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this); 6521 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this);
6086 } 6522 }
@@ -6098,7 +6534,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6098 } 6534 }
6099 #endregion 6535 #endregion
6100 6536
6101 handlerUpdatePrimFlags = OnUpdatePrimFlags; 6537 UpdatePrimFlags handlerUpdatePrimFlags = OnUpdatePrimFlags;
6102 6538
6103 if (handlerUpdatePrimFlags != null) 6539 if (handlerUpdatePrimFlags != null)
6104 { 6540 {
@@ -6115,7 +6551,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6115 case PacketType.ObjectImage: 6551 case PacketType.ObjectImage:
6116 ObjectImagePacket imagePack = (ObjectImagePacket)Pack; 6552 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
6117 6553
6118 handlerUpdatePrimTexture = null; 6554 UpdatePrimTexture handlerUpdatePrimTexture = null;
6119 for (int i = 0; i < imagePack.ObjectData.Length; i++) 6555 for (int i = 0; i < imagePack.ObjectData.Length; i++)
6120 { 6556 {
6121 handlerUpdatePrimTexture = OnUpdatePrimTexture; 6557 handlerUpdatePrimTexture = OnUpdatePrimTexture;
@@ -6138,7 +6574,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6138 } 6574 }
6139 #endregion 6575 #endregion
6140 6576
6141 handlerGrabObject = OnGrabObject; 6577 GrabObject handlerGrabObject = OnGrabObject;
6142 6578
6143 if (handlerGrabObject != null) 6579 if (handlerGrabObject != null)
6144 { 6580 {
@@ -6172,7 +6608,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6172 } 6608 }
6173 #endregion 6609 #endregion
6174 6610
6175 handlerGrabUpdate = OnGrabUpdate; 6611 MoveObject handlerGrabUpdate = OnGrabUpdate;
6176 6612
6177 if (handlerGrabUpdate != null) 6613 if (handlerGrabUpdate != null)
6178 { 6614 {
@@ -6207,7 +6643,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6207 } 6643 }
6208 #endregion 6644 #endregion
6209 6645
6210 handlerDeGrabObject = OnDeGrabObject; 6646 DeGrabObject handlerDeGrabObject = OnDeGrabObject;
6211 if (handlerDeGrabObject != null) 6647 if (handlerDeGrabObject != null)
6212 { 6648 {
6213 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); 6649 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
@@ -6241,7 +6677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6241 } 6677 }
6242 #endregion 6678 #endregion
6243 6679
6244 handlerSpinStart = OnSpinStart; 6680 SpinStart handlerSpinStart = OnSpinStart;
6245 if (handlerSpinStart != null) 6681 if (handlerSpinStart != null)
6246 { 6682 {
6247 handlerSpinStart(spinStart.ObjectData.ObjectID, this); 6683 handlerSpinStart(spinStart.ObjectData.ObjectID, this);
@@ -6265,7 +6701,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6265 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle); 6701 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle);
6266 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle); 6702 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle);
6267 6703
6268 handlerSpinUpdate = OnSpinUpdate; 6704 SpinObject handlerSpinUpdate = OnSpinUpdate;
6269 if (handlerSpinUpdate != null) 6705 if (handlerSpinUpdate != null)
6270 { 6706 {
6271 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this); 6707 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this);
@@ -6284,7 +6720,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6284 } 6720 }
6285 #endregion 6721 #endregion
6286 6722
6287 handlerSpinStop = OnSpinStop; 6723 SpinStop handlerSpinStop = OnSpinStop;
6288 if (handlerSpinStop != null) 6724 if (handlerSpinStop != null)
6289 { 6725 {
6290 handlerSpinStop(spinStop.ObjectData.ObjectID, this); 6726 handlerSpinStop(spinStop.ObjectData.ObjectID, this);
@@ -6303,7 +6739,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6303 } 6739 }
6304 #endregion 6740 #endregion
6305 6741
6306 handlerObjectDescription = null; 6742 GenericCall7 handlerObjectDescription = null;
6307 6743
6308 for (int i = 0; i < objDes.ObjectData.Length; i++) 6744 for (int i = 0; i < objDes.ObjectData.Length; i++)
6309 { 6745 {
@@ -6327,7 +6763,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6327 } 6763 }
6328 #endregion 6764 #endregion
6329 6765
6330 handlerObjectName = null; 6766 GenericCall7 handlerObjectName = null;
6331 for (int i = 0; i < objName.ObjectData.Length; i++) 6767 for (int i = 0; i < objName.ObjectData.Length; i++)
6332 { 6768 {
6333 handlerObjectName = OnObjectName; 6769 handlerObjectName = OnObjectName;
@@ -6355,7 +6791,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6355 UUID AgentID = newobjPerms.AgentData.AgentID; 6791 UUID AgentID = newobjPerms.AgentData.AgentID;
6356 UUID SessionID = newobjPerms.AgentData.SessionID; 6792 UUID SessionID = newobjPerms.AgentData.SessionID;
6357 6793
6358 handlerObjectPermissions = null; 6794 ObjectPermissions handlerObjectPermissions = null;
6359 6795
6360 for (int i = 0; i < newobjPerms.ObjectData.Length; i++) 6796 for (int i = 0; i < newobjPerms.ObjectData.Length; i++)
6361 { 6797 {
@@ -6404,7 +6840,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6404 for (int i = 0; i < undoitem.ObjectData.Length; i++) 6840 for (int i = 0; i < undoitem.ObjectData.Length; i++)
6405 { 6841 {
6406 UUID objiD = undoitem.ObjectData[i].ObjectID; 6842 UUID objiD = undoitem.ObjectData[i].ObjectID;
6407 handlerOnUndo = OnUndo; 6843 AgentSit handlerOnUndo = OnUndo;
6408 if (handlerOnUndo != null) 6844 if (handlerOnUndo != null)
6409 { 6845 {
6410 handlerOnUndo(this, objiD); 6846 handlerOnUndo(this, objiD);
@@ -6425,8 +6861,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6425 } 6861 }
6426 #endregion 6862 #endregion
6427 6863
6428 handlerObjectDuplicateOnRay = null; 6864 ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null;
6429
6430 6865
6431 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++) 6866 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++)
6432 { 6867 {
@@ -6456,7 +6891,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6456 6891
6457 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; 6892 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData;
6458 6893
6459 handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily; 6894 RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily;
6460 6895
6461 if (handlerRequestObjectPropertiesFamily != null) 6896 if (handlerRequestObjectPropertiesFamily != null)
6462 { 6897 {
@@ -6468,7 +6903,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6468 case PacketType.ObjectIncludeInSearch: 6903 case PacketType.ObjectIncludeInSearch:
6469 //This lets us set objects to appear in search (stuff like DataSnapshot, etc) 6904 //This lets us set objects to appear in search (stuff like DataSnapshot, etc)
6470 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack; 6905 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
6471 handlerObjectIncludeInSearch = null; 6906 ObjectIncludeInSearch handlerObjectIncludeInSearch = null;
6472 6907
6473 #region Packet Session and User Check 6908 #region Packet Session and User Check
6474 if (m_checkPackets) 6909 if (m_checkPackets)
@@ -6505,7 +6940,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6505 } 6940 }
6506 #endregion 6941 #endregion
6507 6942
6508 handlerScriptAnswer = OnScriptAnswer; 6943 ScriptAnswer handlerScriptAnswer = OnScriptAnswer;
6509 if (handlerScriptAnswer != null) 6944 if (handlerScriptAnswer != null)
6510 { 6945 {
6511 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions); 6946 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
@@ -6524,7 +6959,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6524 } 6959 }
6525 #endregion 6960 #endregion
6526 6961
6527 handlerObjectClickAction = OnObjectClickAction; 6962 GenericCall7 handlerObjectClickAction = OnObjectClickAction;
6528 if (handlerObjectClickAction != null) 6963 if (handlerObjectClickAction != null)
6529 { 6964 {
6530 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) 6965 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData)
@@ -6548,7 +6983,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6548 } 6983 }
6549 #endregion 6984 #endregion
6550 6985
6551 handlerObjectMaterial = OnObjectMaterial; 6986 GenericCall7 handlerObjectMaterial = OnObjectMaterial;
6552 if (handlerObjectMaterial != null) 6987 if (handlerObjectMaterial != null)
6553 { 6988 {
6554 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData) 6989 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData)
@@ -6702,7 +7137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6702 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); 7137 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString());
6703 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); 7138 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
6704 7139
6705 handlerAssetUploadRequest = OnAssetUploadRequest; 7140 UDPAssetUploadRequest handlerAssetUploadRequest = OnAssetUploadRequest;
6706 7141
6707 if (handlerAssetUploadRequest != null) 7142 if (handlerAssetUploadRequest != null)
6708 { 7143 {
@@ -6715,7 +7150,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6715 case PacketType.RequestXfer: 7150 case PacketType.RequestXfer:
6716 RequestXferPacket xferReq = (RequestXferPacket)Pack; 7151 RequestXferPacket xferReq = (RequestXferPacket)Pack;
6717 7152
6718 handlerRequestXfer = OnRequestXfer; 7153 RequestXfer handlerRequestXfer = OnRequestXfer;
6719 7154
6720 if (handlerRequestXfer != null) 7155 if (handlerRequestXfer != null)
6721 { 7156 {
@@ -6725,7 +7160,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6725 case PacketType.SendXferPacket: 7160 case PacketType.SendXferPacket:
6726 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; 7161 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
6727 7162
6728 handlerXferReceive = OnXferReceive; 7163 XferReceive handlerXferReceive = OnXferReceive;
6729 if (handlerXferReceive != null) 7164 if (handlerXferReceive != null)
6730 { 7165 {
6731 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); 7166 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
@@ -6734,7 +7169,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6734 case PacketType.ConfirmXferPacket: 7169 case PacketType.ConfirmXferPacket:
6735 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; 7170 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
6736 7171
6737 handlerConfirmXfer = OnConfirmXfer; 7172 ConfirmXfer handlerConfirmXfer = OnConfirmXfer;
6738 if (handlerConfirmXfer != null) 7173 if (handlerConfirmXfer != null)
6739 { 7174 {
6740 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); 7175 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
@@ -6742,7 +7177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6742 break; 7177 break;
6743 case PacketType.AbortXfer: 7178 case PacketType.AbortXfer:
6744 AbortXferPacket abortXfer = (AbortXferPacket)Pack; 7179 AbortXferPacket abortXfer = (AbortXferPacket)Pack;
6745 handlerAbortXfer = OnAbortXfer; 7180 AbortXfer handlerAbortXfer = OnAbortXfer;
6746 if (handlerAbortXfer != null) 7181 if (handlerAbortXfer != null)
6747 { 7182 {
6748 handlerAbortXfer(this, abortXfer.XferID.ID); 7183 handlerAbortXfer(this, abortXfer.XferID.ID);
@@ -6761,7 +7196,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6761 } 7196 }
6762 #endregion 7197 #endregion
6763 7198
6764 handlerCreateInventoryFolder = OnCreateNewInventoryFolder; 7199 CreateInventoryFolder handlerCreateInventoryFolder = OnCreateNewInventoryFolder;
6765 if (handlerCreateInventoryFolder != null) 7200 if (handlerCreateInventoryFolder != null)
6766 { 7201 {
6767 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID, 7202 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID,
@@ -6784,7 +7219,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6784 } 7219 }
6785 #endregion 7220 #endregion
6786 7221
6787 handlerUpdateInventoryFolder = null; 7222 UpdateInventoryFolder handlerUpdateInventoryFolder = null;
6788 7223
6789 for (int i = 0; i < invFolderx.FolderData.Length; i++) 7224 for (int i = 0; i < invFolderx.FolderData.Length; i++)
6790 { 7225 {
@@ -6813,7 +7248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6813 } 7248 }
6814 #endregion 7249 #endregion
6815 7250
6816 handlerMoveInventoryFolder = null; 7251 MoveInventoryFolder handlerMoveInventoryFolder = null;
6817 7252
6818 for (int i = 0; i < invFoldery.InventoryData.Length; i++) 7253 for (int i = 0; i < invFoldery.InventoryData.Length; i++)
6819 { 7254 {
@@ -6838,7 +7273,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6838 } 7273 }
6839 #endregion 7274 #endregion
6840 7275
6841 handlerCreateNewInventoryItem = OnCreateNewInventoryItem; 7276 CreateNewInventoryItem handlerCreateNewInventoryItem = OnCreateNewInventoryItem;
6842 if (handlerCreateNewInventoryItem != null) 7277 if (handlerCreateNewInventoryItem != null)
6843 { 7278 {
6844 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, 7279 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID,
@@ -6867,7 +7302,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6867 } 7302 }
6868 #endregion 7303 #endregion
6869 7304
6870 handlerFetchInventory = null; 7305 FetchInventory handlerFetchInventory = null;
6871 7306
6872 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++) 7307 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++)
6873 { 7308 {
@@ -6893,7 +7328,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6893 } 7328 }
6894 #endregion 7329 #endregion
6895 7330
6896 handlerFetchInventoryDescendents = OnFetchInventoryDescendents; 7331 FetchInventoryDescendents handlerFetchInventoryDescendents = OnFetchInventoryDescendents;
6897 if (handlerFetchInventoryDescendents != null) 7332 if (handlerFetchInventoryDescendents != null)
6898 { 7333 {
6899 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, 7334 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID,
@@ -6913,7 +7348,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6913 } 7348 }
6914 #endregion 7349 #endregion
6915 7350
6916 handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents; 7351 PurgeInventoryDescendents handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents;
6917 if (handlerPurgeInventoryDescendents != null) 7352 if (handlerPurgeInventoryDescendents != null)
6918 { 7353 {
6919 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); 7354 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID);
@@ -6933,7 +7368,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6933 7368
6934 if (OnUpdateInventoryItem != null) 7369 if (OnUpdateInventoryItem != null)
6935 { 7370 {
6936 handlerUpdateInventoryItem = null; 7371 UpdateInventoryItem handlerUpdateInventoryItem = null;
6937 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++) 7372 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
6938 { 7373 {
6939 handlerUpdateInventoryItem = OnUpdateInventoryItem; 7374 handlerUpdateInventoryItem = OnUpdateInventoryItem;
@@ -6955,49 +7390,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6955 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice; 7390 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice;
6956 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType; 7391 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType;
6957 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags; 7392 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags;
6958 /* 7393
6959 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID,
6960 inventoryItemUpdate.InventoryData[i].ItemID,
6961 Util.FieldToString(inventoryItemUpdate.InventoryData[i].Name),
6962 Util.FieldToString(inventoryItemUpdate.InventoryData[i].Description),
6963 inventoryItemUpdate.InventoryData[i].NextOwnerMask);
6964 */
6965 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID, 7394 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID,
6966 inventoryItemUpdate.InventoryData[i].ItemID, 7395 inventoryItemUpdate.InventoryData[i].ItemID,
6967 itemUpd); 7396 itemUpd);
6968 } 7397 }
6969 } 7398 }
6970 } 7399 }
6971 //m_log.Debug(Pack.ToString());
6972 /*for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
6973 {
6974 if (inventoryItemUpdate.InventoryData[i].TransactionID != UUID.Zero)
6975 {
6976 AssetBase asset = m_assetCache.GetAsset(inventoryItemUpdate.InventoryData[i].TransactionID.Combine(this.SecureSessionId));
6977 if (asset != null)
6978 {
6979 // m_log.Debug("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache");
6980 m_inventoryCache.UpdateInventoryItemAsset(this, inventoryItemUpdate.InventoryData[i].ItemID, asset);
6981 }
6982 else
6983 {
6984 asset = this.UploadAssets.AddUploadToAssetCache(inventoryItemUpdate.InventoryData[i].TransactionID);
6985 if (asset != null)
6986 {
6987 //m_log.Debug("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache");
6988 m_inventoryCache.UpdateInventoryItemAsset(this, inventoryItemUpdate.InventoryData[i].ItemID, asset);
6989 }
6990 else
6991 {
6992 //m_log.Debug("trying to update inventory item, but asset is null");
6993 }
6994 }
6995 }
6996 else
6997 {
6998 m_inventoryCache.UpdateInventoryItemDetails(this, inventoryItemUpdate.InventoryData[i].ItemID, inventoryItemUpdate.InventoryData[i]); ;
6999 }
7000 }*/
7001 break; 7400 break;
7002 case PacketType.CopyInventoryItem: 7401 case PacketType.CopyInventoryItem:
7003 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; 7402 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack;
@@ -7011,7 +7410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7011 } 7410 }
7012 #endregion 7411 #endregion
7013 7412
7014 handlerCopyInventoryItem = null; 7413 CopyInventoryItem handlerCopyInventoryItem = null;
7015 if (OnCopyInventoryItem != null) 7414 if (OnCopyInventoryItem != null)
7016 { 7415 {
7017 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) 7416 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData)
@@ -7040,7 +7439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7040 7439
7041 if (OnMoveInventoryItem != null) 7440 if (OnMoveInventoryItem != null)
7042 { 7441 {
7043 handlerMoveInventoryItem = null; 7442 MoveInventoryItem handlerMoveInventoryItem = null;
7044 InventoryItemBase itm = null; 7443 InventoryItemBase itm = null;
7045 List<InventoryItemBase> items = new List<InventoryItemBase>(); 7444 List<InventoryItemBase> items = new List<InventoryItemBase>();
7046 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) 7445 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
@@ -7073,7 +7472,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7073 7472
7074 if (OnRemoveInventoryItem != null) 7473 if (OnRemoveInventoryItem != null)
7075 { 7474 {
7076 handlerRemoveInventoryItem = null; 7475 RemoveInventoryItem handlerRemoveInventoryItem = null;
7077 List<UUID> uuids = new List<UUID>(); 7476 List<UUID> uuids = new List<UUID>();
7078 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) 7477 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData)
7079 { 7478 {
@@ -7101,7 +7500,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7101 7500
7102 if (OnRemoveInventoryFolder != null) 7501 if (OnRemoveInventoryFolder != null)
7103 { 7502 {
7104 handlerRemoveInventoryFolder = null; 7503 RemoveInventoryFolder handlerRemoveInventoryFolder = null;
7105 List<UUID> uuids = new List<UUID>(); 7504 List<UUID> uuids = new List<UUID>();
7106 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) 7505 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
7107 { 7506 {
@@ -7126,7 +7525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7126 #endregion 7525 #endregion
7127 if (OnRemoveInventoryFolder != null) 7526 if (OnRemoveInventoryFolder != null)
7128 { 7527 {
7129 handlerRemoveInventoryFolder = null; 7528 RemoveInventoryFolder handlerRemoveInventoryFolder = null;
7130 List<UUID> uuids = new List<UUID>(); 7529 List<UUID> uuids = new List<UUID>();
7131 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) 7530 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
7132 { 7531 {
@@ -7141,7 +7540,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7141 7540
7142 if (OnRemoveInventoryItem != null) 7541 if (OnRemoveInventoryItem != null)
7143 { 7542 {
7144 handlerRemoveInventoryItem = null; 7543 RemoveInventoryItem handlerRemoveInventoryItem = null;
7145 List<UUID> uuids = new List<UUID>(); 7544 List<UUID> uuids = new List<UUID>();
7146 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) 7545 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData)
7147 { 7546 {
@@ -7166,7 +7565,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7166 } 7565 }
7167 #endregion 7566 #endregion
7168 7567
7169 handlerRequestTaskInventory = OnRequestTaskInventory; 7568 RequestTaskInventory handlerRequestTaskInventory = OnRequestTaskInventory;
7170 if (handlerRequestTaskInventory != null) 7569 if (handlerRequestTaskInventory != null)
7171 { 7570 {
7172 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); 7571 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID);
@@ -7188,7 +7587,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7188 { 7587 {
7189 if (updatetask.UpdateData.Key == 0) 7588 if (updatetask.UpdateData.Key == 0)
7190 { 7589 {
7191 handlerUpdateTaskInventory = OnUpdateTaskInventory; 7590 UpdateTaskInventory handlerUpdateTaskInventory = OnUpdateTaskInventory;
7192 if (handlerUpdateTaskInventory != null) 7591 if (handlerUpdateTaskInventory != null)
7193 { 7592 {
7194 TaskInventoryItem newTaskItem = new TaskInventoryItem(); 7593 TaskInventoryItem newTaskItem = new TaskInventoryItem();
@@ -7232,7 +7631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7232 } 7631 }
7233 #endregion 7632 #endregion
7234 7633
7235 handlerRemoveTaskItem = OnRemoveTaskItem; 7634 RemoveTaskInventory handlerRemoveTaskItem = OnRemoveTaskItem;
7236 7635
7237 if (handlerRemoveTaskItem != null) 7636 if (handlerRemoveTaskItem != null)
7238 { 7637 {
@@ -7254,7 +7653,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7254 } 7653 }
7255 #endregion 7654 #endregion
7256 7655
7257 handlerMoveTaskItem = OnMoveTaskItem; 7656 MoveTaskInventory handlerMoveTaskItem = OnMoveTaskItem;
7258 7657
7259 if (handlerMoveTaskItem != null) 7658 if (handlerMoveTaskItem != null)
7260 { 7659 {
@@ -7279,7 +7678,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7279 } 7678 }
7280 #endregion 7679 #endregion
7281 7680
7282 handlerRezScript = OnRezScript; 7681 RezScript handlerRezScript = OnRezScript;
7283 InventoryItemBase item = new InventoryItemBase(); 7682 InventoryItemBase item = new InventoryItemBase();
7284 item.ID = rezScriptx.InventoryBlock.ItemID; 7683 item.ID = rezScriptx.InventoryBlock.ItemID;
7285 item.Folder = rezScriptx.InventoryBlock.FolderID; 7684 item.Folder = rezScriptx.InventoryBlock.FolderID;
@@ -7322,7 +7721,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7322 } 7721 }
7323 #endregion 7722 #endregion
7324 7723
7325 handlerRequestMapBlocks = OnRequestMapBlocks; 7724 RequestMapBlocks handlerRequestMapBlocks = OnRequestMapBlocks;
7326 if (handlerRequestMapBlocks != null) 7725 if (handlerRequestMapBlocks != null)
7327 { 7726 {
7328 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, 7727 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY,
@@ -7343,7 +7742,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7343 7742
7344 string mapName = Util.UTF8.GetString(map.NameData.Name, 0, 7743 string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
7345 map.NameData.Name.Length - 1); 7744 map.NameData.Name.Length - 1);
7346 handlerMapNameRequest = OnMapNameRequest; 7745 RequestMapName handlerMapNameRequest = OnMapNameRequest;
7347 if (handlerMapNameRequest != null) 7746 if (handlerMapNameRequest != null)
7348 { 7747 {
7349 handlerMapNameRequest(this, mapName); 7748 handlerMapNameRequest(this, mapName);
@@ -7394,7 +7793,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7394 else 7793 else
7395 { 7794 {
7396 // Teleport home request 7795 // Teleport home request
7397 handlerTeleportHomeRequest = OnTeleportHomeRequest; 7796 UUIDNameRequest handlerTeleportHomeRequest = OnTeleportHomeRequest;
7398 if (handlerTeleportHomeRequest != null) 7797 if (handlerTeleportHomeRequest != null)
7399 { 7798 {
7400 handlerTeleportHomeRequest(AgentId, this); 7799 handlerTeleportHomeRequest(AgentId, this);
@@ -7402,7 +7801,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7402 break; 7801 break;
7403 } 7802 }
7404 7803
7405 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; 7804 TeleportLandmarkRequest handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest;
7406 if (handlerTeleportLandmarkRequest != null) 7805 if (handlerTeleportLandmarkRequest != null)
7407 { 7806 {
7408 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position); 7807 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position);
@@ -7433,7 +7832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7433 } 7832 }
7434 #endregion 7833 #endregion
7435 7834
7436 handlerTeleportLocationRequest = OnTeleportLocationRequest; 7835 TeleportLocationRequest handlerTeleportLocationRequest = OnTeleportLocationRequest;
7437 if (handlerTeleportLocationRequest != null) 7836 if (handlerTeleportLocationRequest != null)
7438 { 7837 {
7439 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, 7838 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position,
@@ -7456,7 +7855,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7456 7855
7457 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) 7856 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
7458 { 7857 {
7459 handlerNameRequest = OnNameFromUUIDRequest; 7858 UUIDNameRequest handlerNameRequest = OnNameFromUUIDRequest;
7460 if (handlerNameRequest != null) 7859 if (handlerNameRequest != null)
7461 { 7860 {
7462 handlerNameRequest(UUIDBlock.ID, this); 7861 handlerNameRequest(UUIDBlock.ID, this);
@@ -7469,7 +7868,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7469 case PacketType.RegionHandleRequest: 7868 case PacketType.RegionHandleRequest:
7470 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; 7869 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
7471 7870
7472 handlerRegionHandleRequest = OnRegionHandleRequest; 7871 RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
7473 if (handlerRegionHandleRequest != null) 7872 if (handlerRegionHandleRequest != null)
7474 { 7873 {
7475 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); 7874 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
@@ -7488,7 +7887,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7488 } 7887 }
7489 #endregion 7888 #endregion
7490 7889
7491 handlerParcelInfoRequest = OnParcelInfoRequest; 7890 ParcelInfoRequest handlerParcelInfoRequest = OnParcelInfoRequest;
7492 if (handlerParcelInfoRequest != null) 7891 if (handlerParcelInfoRequest != null)
7493 { 7892 {
7494 handlerParcelInfoRequest(this, pirPack.Data.ParcelID); 7893 handlerParcelInfoRequest(this, pirPack.Data.ParcelID);
@@ -7507,7 +7906,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7507 } 7906 }
7508 #endregion 7907 #endregion
7509 7908
7510 handlerParcelAccessListRequest = OnParcelAccessListRequest; 7909 ParcelAccessListRequest handlerParcelAccessListRequest = OnParcelAccessListRequest;
7511 7910
7512 if (handlerParcelAccessListRequest != null) 7911 if (handlerParcelAccessListRequest != null)
7513 { 7912 {
@@ -7539,7 +7938,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7539 entries.Add(entry); 7938 entries.Add(entry);
7540 } 7939 }
7541 7940
7542 handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest; 7941 ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest;
7543 if (handlerParcelAccessListUpdateRequest != null) 7942 if (handlerParcelAccessListUpdateRequest != null)
7544 { 7943 {
7545 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, 7944 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
@@ -7560,7 +7959,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7560 } 7959 }
7561 #endregion 7960 #endregion
7562 7961
7563 handlerParcelPropertiesRequest = OnParcelPropertiesRequest; 7962 ParcelPropertiesRequest handlerParcelPropertiesRequest = OnParcelPropertiesRequest;
7564 if (handlerParcelPropertiesRequest != null) 7963 if (handlerParcelPropertiesRequest != null)
7565 { 7964 {
7566 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), 7965 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West),
@@ -7583,7 +7982,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7583 } 7982 }
7584 #endregion 7983 #endregion
7585 7984
7586 handlerParcelDivideRequest = OnParcelDivideRequest; 7985 ParcelDivideRequest handlerParcelDivideRequest = OnParcelDivideRequest;
7587 if (handlerParcelDivideRequest != null) 7986 if (handlerParcelDivideRequest != null)
7588 { 7987 {
7589 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), 7988 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West),
@@ -7604,7 +8003,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7604 } 8003 }
7605 #endregion 8004 #endregion
7606 8005
7607 handlerParcelJoinRequest = OnParcelJoinRequest; 8006 ParcelJoinRequest handlerParcelJoinRequest = OnParcelJoinRequest;
7608 8007
7609 if (handlerParcelJoinRequest != null) 8008 if (handlerParcelJoinRequest != null)
7610 { 8009 {
@@ -7626,7 +8025,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7626 } 8025 }
7627 #endregion 8026 #endregion
7628 8027
7629 handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest; 8028 ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest;
7630 8029
7631 if (handlerParcelPropertiesUpdateRequest != null) 8030 if (handlerParcelPropertiesUpdateRequest != null)
7632 { 8031 {
@@ -7672,7 +8071,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7672 returnIDs.Add(rb.ReturnID); 8071 returnIDs.Add(rb.ReturnID);
7673 } 8072 }
7674 8073
7675 handlerParcelSelectObjects = OnParcelSelectObjects; 8074 ParcelSelectObjects handlerParcelSelectObjects = OnParcelSelectObjects;
7676 8075
7677 if (handlerParcelSelectObjects != null) 8076 if (handlerParcelSelectObjects != null)
7678 { 8077 {
@@ -7693,7 +8092,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7693 } 8092 }
7694 #endregion 8093 #endregion
7695 8094
7696 handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; 8095 ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest;
7697 8096
7698 if (handlerParcelObjectOwnerRequest != null) 8097 if (handlerParcelObjectOwnerRequest != null)
7699 { 8098 {
@@ -7712,7 +8111,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7712 } 8111 }
7713 #endregion 8112 #endregion
7714 8113
7715 handlerParcelGodForceOwner = OnParcelGodForceOwner; 8114 ParcelGodForceOwner handlerParcelGodForceOwner = OnParcelGodForceOwner;
7716 if (handlerParcelGodForceOwner != null) 8115 if (handlerParcelGodForceOwner != null)
7717 { 8116 {
7718 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); 8117 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this);
@@ -7730,7 +8129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7730 } 8129 }
7731 #endregion 8130 #endregion
7732 8131
7733 handlerParcelAbandonRequest = OnParcelAbandonRequest; 8132 ParcelAbandonRequest handlerParcelAbandonRequest = OnParcelAbandonRequest;
7734 if (handlerParcelAbandonRequest != null) 8133 if (handlerParcelAbandonRequest != null)
7735 { 8134 {
7736 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); 8135 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this);
@@ -7748,7 +8147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7748 } 8147 }
7749 #endregion 8148 #endregion
7750 8149
7751 handlerParcelReclaim = OnParcelReclaim; 8150 ParcelReclaim handlerParcelReclaim = OnParcelReclaim;
7752 if (handlerParcelReclaim != null) 8151 if (handlerParcelReclaim != null)
7753 { 8152 {
7754 handlerParcelReclaim(reclaimPacket.Data.LocalID, this); 8153 handlerParcelReclaim(reclaimPacket.Data.LocalID, this);
@@ -7777,7 +8176,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7777 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) 8176 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++)
7778 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; 8177 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID;
7779 8178
7780 handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; 8179 ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest;
7781 if (handlerParcelReturnObjectsRequest != null) 8180 if (handlerParcelReturnObjectsRequest != null)
7782 { 8181 {
7783 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this); 8182 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this);
@@ -7797,7 +8196,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7797 } 8196 }
7798 #endregion 8197 #endregion
7799 8198
7800 handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; 8199 ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime;
7801 if (handlerParcelSetOtherCleanTime != null) 8200 if (handlerParcelSetOtherCleanTime != null)
7802 { 8201 {
7803 handlerParcelSetOtherCleanTime(this, 8202 handlerParcelSetOtherCleanTime(this,
@@ -7818,7 +8217,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7818 } 8217 }
7819 #endregion 8218 #endregion
7820 8219
7821 handlerLandStatRequest = OnLandStatRequest; 8220 GodLandStatRequest handlerLandStatRequest = OnLandStatRequest;
7822 if (handlerLandStatRequest != null) 8221 if (handlerLandStatRequest != null)
7823 { 8222 {
7824 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); 8223 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this);
@@ -7838,7 +8237,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7838 } 8237 }
7839 #endregion 8238 #endregion
7840 8239
7841 handlerParcelDwellRequest = OnParcelDwellRequest; 8240 ParcelDwellRequest handlerParcelDwellRequest = OnParcelDwellRequest;
7842 if (handlerParcelDwellRequest != null) 8241 if (handlerParcelDwellRequest != null)
7843 { 8242 {
7844 handlerParcelDwellRequest(dwellrq.Data.LocalID, this); 8243 handlerParcelDwellRequest(dwellrq.Data.LocalID, this);
@@ -8082,7 +8481,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8082 { 8481 {
8083 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake") 8482 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake")
8084 { 8483 {
8085 handlerBakeTerrain = OnBakeTerrain; 8484 BakeTerrain handlerBakeTerrain = OnBakeTerrain;
8086 if (handlerBakeTerrain != null) 8485 if (handlerBakeTerrain != null)
8087 { 8486 {
8088 handlerBakeTerrain(this); 8487 handlerBakeTerrain(this);
@@ -8092,7 +8491,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8092 { 8491 {
8093 if (messagePacket.ParamList.Length > 1) 8492 if (messagePacket.ParamList.Length > 1)
8094 { 8493 {
8095 handlerRequestTerrain = OnRequestTerrain; 8494 RequestTerrain handlerRequestTerrain = OnRequestTerrain;
8096 if (handlerRequestTerrain != null) 8495 if (handlerRequestTerrain != null)
8097 { 8496 {
8098 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8497 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8103,7 +8502,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8103 { 8502 {
8104 if (messagePacket.ParamList.Length > 1) 8503 if (messagePacket.ParamList.Length > 1)
8105 { 8504 {
8106 handlerUploadTerrain = OnUploadTerrain; 8505 RequestTerrain handlerUploadTerrain = OnUploadTerrain;
8107 if (handlerUploadTerrain != null) 8506 if (handlerUploadTerrain != null)
8108 { 8507 {
8109 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8508 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8125,7 +8524,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8125 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8524 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
8126 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); 8525 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter));
8127 8526
8128 handlerEstateChangeInfo = OnEstateChangeInfo; 8527 EstateChangeInfo handlerEstateChangeInfo = OnEstateChangeInfo;
8129 if (handlerEstateChangeInfo != null) 8528 if (handlerEstateChangeInfo != null)
8130 { 8529 {
8131 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2); 8530 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2);
@@ -8159,7 +8558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8159 } 8558 }
8160 #endregion 8559 #endregion
8161 8560
8162 handlerRegionInfoRequest = OnRegionInfoRequest; 8561 RegionInfoRequest handlerRegionInfoRequest = OnRegionInfoRequest;
8163 if (handlerRegionInfoRequest != null) 8562 if (handlerRegionInfoRequest != null)
8164 { 8563 {
8165 handlerRegionInfoRequest(this); 8564 handlerRegionInfoRequest(this);
@@ -8170,7 +8569,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8170 //EstateCovenantRequestPacket.AgentDataBlock epack = 8569 //EstateCovenantRequestPacket.AgentDataBlock epack =
8171 // ((EstateCovenantRequestPacket)Pack).AgentData; 8570 // ((EstateCovenantRequestPacket)Pack).AgentData;
8172 8571
8173 handlerEstateCovenantRequest = OnEstateCovenantRequest; 8572 EstateCovenantRequest handlerEstateCovenantRequest = OnEstateCovenantRequest;
8174 if (handlerEstateCovenantRequest != null) 8573 if (handlerEstateCovenantRequest != null)
8175 { 8574 {
8176 handlerEstateCovenantRequest(this); 8575 handlerEstateCovenantRequest(this);
@@ -8188,7 +8587,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8188 8587
8189 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; 8588 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
8190 8589
8191 handlerReqGodlikePowers = OnRequestGodlikePowers; 8590 RequestGodlikePowers handlerReqGodlikePowers = OnRequestGodlikePowers;
8192 8591
8193 if (handlerReqGodlikePowers != null) 8592 if (handlerReqGodlikePowers != null)
8194 { 8593 {
@@ -8201,7 +8600,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8201 8600
8202 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) 8601 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID)
8203 { 8602 {
8204 handlerGodKickUser = OnGodKickUser; 8603 GodKickUser handlerGodKickUser = OnGodKickUser;
8205 if (handlerGodKickUser != null) 8604 if (handlerGodKickUser != null)
8206 { 8605 {
8207 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, 8606 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID,
@@ -8241,7 +8640,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8241 } 8640 }
8242 #endregion 8641 #endregion
8243 8642
8244 handlerMoneyBalanceRequest = OnMoneyBalanceRequest; 8643 MoneyBalanceRequest handlerMoneyBalanceRequest = OnMoneyBalanceRequest;
8245 8644
8246 if (handlerMoneyBalanceRequest != null) 8645 if (handlerMoneyBalanceRequest != null)
8247 { 8646 {
@@ -8252,7 +8651,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8252 case PacketType.EconomyDataRequest: 8651 case PacketType.EconomyDataRequest:
8253 8652
8254 8653
8255 handlerEconomoyDataRequest = OnEconomyDataRequest; 8654 EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest;
8256 if (handlerEconomoyDataRequest != null) 8655 if (handlerEconomoyDataRequest != null)
8257 { 8656 {
8258 handlerEconomoyDataRequest(AgentId); 8657 handlerEconomoyDataRequest(AgentId);
@@ -8261,7 +8660,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8261 case PacketType.RequestPayPrice: 8660 case PacketType.RequestPayPrice:
8262 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; 8661 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack;
8263 8662
8264 handlerRequestPayPrice = OnRequestPayPrice; 8663 RequestPayPrice handlerRequestPayPrice = OnRequestPayPrice;
8265 if (handlerRequestPayPrice != null) 8664 if (handlerRequestPayPrice != null)
8266 { 8665 {
8267 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); 8666 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID);
@@ -8280,7 +8679,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8280 } 8679 }
8281 #endregion 8680 #endregion
8282 8681
8283 handlerObjectSaleInfo = OnObjectSaleInfo; 8682 ObjectSaleInfo handlerObjectSaleInfo = OnObjectSaleInfo;
8284 if (handlerObjectSaleInfo != null) 8683 if (handlerObjectSaleInfo != null)
8285 { 8684 {
8286 foreach (ObjectSaleInfoPacket.ObjectDataBlock d 8685 foreach (ObjectSaleInfoPacket.ObjectDataBlock d
@@ -8308,7 +8707,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8308 } 8707 }
8309 #endregion 8708 #endregion
8310 8709
8311 handlerObjectBuy = OnObjectBuy; 8710 ObjectBuy handlerObjectBuy = OnObjectBuy;
8312 8711
8313 if (handlerObjectBuy != null) 8712 if (handlerObjectBuy != null)
8314 { 8713 {
@@ -8334,7 +8733,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8334 case PacketType.GetScriptRunning: 8733 case PacketType.GetScriptRunning:
8335 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; 8734 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
8336 8735
8337 handlerGetScriptRunning = OnGetScriptRunning; 8736 GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning;
8338 if (handlerGetScriptRunning != null) 8737 if (handlerGetScriptRunning != null)
8339 { 8738 {
8340 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID); 8739 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
@@ -8353,7 +8752,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8353 } 8752 }
8354 #endregion 8753 #endregion
8355 8754
8356 handlerSetScriptRunning = OnSetScriptRunning; 8755 SetScriptRunning handlerSetScriptRunning = OnSetScriptRunning;
8357 if (handlerSetScriptRunning != null) 8756 if (handlerSetScriptRunning != null)
8358 { 8757 {
8359 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running); 8758 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
@@ -8372,7 +8771,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8372 } 8771 }
8373 #endregion 8772 #endregion
8374 8773
8375 handlerScriptReset = OnScriptReset; 8774 ScriptReset handlerScriptReset = OnScriptReset;
8376 if (handlerScriptReset != null) 8775 if (handlerScriptReset != null)
8377 { 8776 {
8378 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID); 8777 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
@@ -8395,7 +8794,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8395 } 8794 }
8396 #endregion 8795 #endregion
8397 8796
8398 handlerActivateGesture = OnActivateGesture; 8797 ActivateGesture handlerActivateGesture = OnActivateGesture;
8399 if (handlerActivateGesture != null) 8798 if (handlerActivateGesture != null)
8400 { 8799 {
8401 handlerActivateGesture(this, 8800 handlerActivateGesture(this,
@@ -8418,7 +8817,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8418 } 8817 }
8419 #endregion 8818 #endregion
8420 8819
8421 handlerDeactivateGesture = OnDeactivateGesture; 8820 DeactivateGesture handlerDeactivateGesture = OnDeactivateGesture;
8422 if (handlerDeactivateGesture != null) 8821 if (handlerDeactivateGesture != null)
8423 { 8822 {
8424 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID); 8823 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID);
@@ -8441,7 +8840,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8441 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData) 8840 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData)
8442 localIDs.Add(d.ObjectLocalID); 8841 localIDs.Add(d.ObjectLocalID);
8443 8842
8444 handlerObjectOwner = OnObjectOwner; 8843 ObjectOwner handlerObjectOwner = OnObjectOwner;
8445 if (handlerObjectOwner != null) 8844 if (handlerObjectOwner != null)
8446 { 8845 {
8447 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs); 8846 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs);
@@ -8454,14 +8853,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8454 #region unimplemented handlers 8853 #region unimplemented handlers
8455 8854
8456 case PacketType.StartPingCheck: 8855 case PacketType.StartPingCheck:
8457 // Send the client the ping response back 8856 StartPingCheckPacket pingStart = (StartPingCheckPacket)Pack;
8458 // Pass the same PingID in the matching packet 8857 CompletePingCheckPacket pingComplete = new CompletePingCheckPacket();
8459 // Handled In the packet processing 8858 pingComplete.PingID.PingID = pingStart.PingID.PingID;
8460 //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet"); 8859 m_udpServer.SendPacket(m_udpClient, pingComplete, ThrottleOutPacketType.Unknown, false);
8461 break; 8860 break;
8861
8462 case PacketType.CompletePingCheck: 8862 case PacketType.CompletePingCheck:
8463 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client 8863 // TODO: Do stats tracking or something with these?
8464 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
8465 break; 8864 break;
8466 8865
8467 case PacketType.ViewerStats: 8866 case PacketType.ViewerStats:
@@ -8482,7 +8881,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8482 #endregion 8881 #endregion
8483 8882
8484 //m_log.Debug(mirpk.ToString()); 8883 //m_log.Debug(mirpk.ToString());
8485 handlerMapItemRequest = OnMapItemRequest; 8884 MapItemRequest handlerMapItemRequest = OnMapItemRequest;
8486 if (handlerMapItemRequest != null) 8885 if (handlerMapItemRequest != null)
8487 { 8886 {
8488 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID, 8887 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
@@ -8509,7 +8908,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8509 } 8908 }
8510 #endregion 8909 #endregion
8511 8910
8512 handlerMuteListRequest = OnMuteListRequest; 8911 MuteListRequest handlerMuteListRequest = OnMuteListRequest;
8513 if (handlerMuteListRequest != null) 8912 if (handlerMuteListRequest != null)
8514 { 8913 {
8515 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC); 8914 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC);
@@ -8546,7 +8945,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8546 } 8945 }
8547 #endregion 8946 #endregion
8548 8947
8549 handlerDirPlacesQuery = OnDirPlacesQuery; 8948 DirPlacesQuery handlerDirPlacesQuery = OnDirPlacesQuery;
8550 if (handlerDirPlacesQuery != null) 8949 if (handlerDirPlacesQuery != null)
8551 { 8950 {
8552 handlerDirPlacesQuery(this, 8951 handlerDirPlacesQuery(this,
@@ -8572,7 +8971,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8572 } 8971 }
8573 #endregion 8972 #endregion
8574 8973
8575 handlerDirFindQuery = OnDirFindQuery; 8974 DirFindQuery handlerDirFindQuery = OnDirFindQuery;
8576 if (handlerDirFindQuery != null) 8975 if (handlerDirFindQuery != null)
8577 { 8976 {
8578 handlerDirFindQuery(this, 8977 handlerDirFindQuery(this,
@@ -8595,7 +8994,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8595 } 8994 }
8596 #endregion 8995 #endregion
8597 8996
8598 handlerDirLandQuery = OnDirLandQuery; 8997 DirLandQuery handlerDirLandQuery = OnDirLandQuery;
8599 if (handlerDirLandQuery != null) 8998 if (handlerDirLandQuery != null)
8600 { 8999 {
8601 handlerDirLandQuery(this, 9000 handlerDirLandQuery(this,
@@ -8619,7 +9018,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8619 } 9018 }
8620 #endregion 9019 #endregion
8621 9020
8622 handlerDirPopularQuery = OnDirPopularQuery; 9021 DirPopularQuery handlerDirPopularQuery = OnDirPopularQuery;
8623 if (handlerDirPopularQuery != null) 9022 if (handlerDirPopularQuery != null)
8624 { 9023 {
8625 handlerDirPopularQuery(this, 9024 handlerDirPopularQuery(this,
@@ -8639,7 +9038,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8639 } 9038 }
8640 #endregion 9039 #endregion
8641 9040
8642 handlerDirClassifiedQuery = OnDirClassifiedQuery; 9041 DirClassifiedQuery handlerDirClassifiedQuery = OnDirClassifiedQuery;
8643 if (handlerDirClassifiedQuery != null) 9042 if (handlerDirClassifiedQuery != null)
8644 { 9043 {
8645 handlerDirClassifiedQuery(this, 9044 handlerDirClassifiedQuery(this,
@@ -9155,7 +9554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9155 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack; 9554 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack;
9156 if (m_GroupsModule != null) 9555 if (m_GroupsModule != null)
9157 { 9556 {
9158 handlerParcelDeedToGroup = OnParcelDeedToGroup; 9557 ParcelDeedToGroup handlerParcelDeedToGroup = OnParcelDeedToGroup;
9159 if (handlerParcelDeedToGroup != null) 9558 if (handlerParcelDeedToGroup != null)
9160 { 9559 {
9161 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this); 9560 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this);
@@ -9399,7 +9798,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9399 } 9798 }
9400 #endregion 9799 #endregion
9401 9800
9402 handlerStartLure = OnStartLure; 9801 StartLure handlerStartLure = OnStartLure;
9403 if (handlerStartLure != null) 9802 if (handlerStartLure != null)
9404 handlerStartLure(startLureRequest.Info.LureType, 9803 handlerStartLure(startLureRequest.Info.LureType,
9405 Utils.BytesToString( 9804 Utils.BytesToString(
@@ -9421,7 +9820,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9421 } 9820 }
9422 #endregion 9821 #endregion
9423 9822
9424 handlerTeleportLureRequest = OnTeleportLureRequest; 9823 TeleportLureRequest handlerTeleportLureRequest = OnTeleportLureRequest;
9425 if (handlerTeleportLureRequest != null) 9824 if (handlerTeleportLureRequest != null)
9426 handlerTeleportLureRequest( 9825 handlerTeleportLureRequest(
9427 teleportLureRequest.Info.LureID, 9826 teleportLureRequest.Info.LureID,
@@ -9442,7 +9841,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9442 } 9841 }
9443 #endregion 9842 #endregion
9444 9843
9445 handlerClassifiedInfoRequest = OnClassifiedInfoRequest; 9844 ClassifiedInfoRequest handlerClassifiedInfoRequest = OnClassifiedInfoRequest;
9446 if (handlerClassifiedInfoRequest != null) 9845 if (handlerClassifiedInfoRequest != null)
9447 handlerClassifiedInfoRequest( 9846 handlerClassifiedInfoRequest(
9448 classifiedInfoRequest.Data.ClassifiedID, 9847 classifiedInfoRequest.Data.ClassifiedID,
@@ -9462,7 +9861,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9462 } 9861 }
9463 #endregion 9862 #endregion
9464 9863
9465 handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate; 9864 ClassifiedInfoUpdate handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate;
9466 if (handlerClassifiedInfoUpdate != null) 9865 if (handlerClassifiedInfoUpdate != null)
9467 handlerClassifiedInfoUpdate( 9866 handlerClassifiedInfoUpdate(
9468 classifiedInfoUpdate.Data.ClassifiedID, 9867 classifiedInfoUpdate.Data.ClassifiedID,
@@ -9494,7 +9893,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9494 } 9893 }
9495 #endregion 9894 #endregion
9496 9895
9497 handlerClassifiedDelete = OnClassifiedDelete; 9896 ClassifiedDelete handlerClassifiedDelete = OnClassifiedDelete;
9498 if (handlerClassifiedDelete != null) 9897 if (handlerClassifiedDelete != null)
9499 handlerClassifiedDelete( 9898 handlerClassifiedDelete(
9500 classifiedDelete.Data.ClassifiedID, 9899 classifiedDelete.Data.ClassifiedID,
@@ -9514,7 +9913,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9514 } 9913 }
9515 #endregion 9914 #endregion
9516 9915
9517 handlerClassifiedGodDelete = OnClassifiedGodDelete; 9916 ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete;
9518 if (handlerClassifiedGodDelete != null) 9917 if (handlerClassifiedGodDelete != null)
9519 handlerClassifiedGodDelete( 9918 handlerClassifiedGodDelete(
9520 classifiedGodDelete.Data.ClassifiedID, 9919 classifiedGodDelete.Data.ClassifiedID,
@@ -9534,7 +9933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9534 } 9933 }
9535 #endregion 9934 #endregion
9536 9935
9537 handlerEventGodDelete = OnEventGodDelete; 9936 EventGodDelete handlerEventGodDelete = OnEventGodDelete;
9538 if (handlerEventGodDelete != null) 9937 if (handlerEventGodDelete != null)
9539 handlerEventGodDelete( 9938 handlerEventGodDelete(
9540 eventGodDelete.EventData.EventID, 9939 eventGodDelete.EventData.EventID,
@@ -9559,7 +9958,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9559 } 9958 }
9560 #endregion 9959 #endregion
9561 9960
9562 handlerEventNotificationAddRequest = OnEventNotificationAddRequest; 9961 EventNotificationAddRequest handlerEventNotificationAddRequest = OnEventNotificationAddRequest;
9563 if (handlerEventNotificationAddRequest != null) 9962 if (handlerEventNotificationAddRequest != null)
9564 handlerEventNotificationAddRequest( 9963 handlerEventNotificationAddRequest(
9565 eventNotificationAdd.EventData.EventID, this); 9964 eventNotificationAdd.EventData.EventID, this);
@@ -9578,7 +9977,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9578 } 9977 }
9579 #endregion 9978 #endregion
9580 9979
9581 handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest; 9980 EventNotificationRemoveRequest handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest;
9582 if (handlerEventNotificationRemoveRequest != null) 9981 if (handlerEventNotificationRemoveRequest != null)
9583 handlerEventNotificationRemoveRequest( 9982 handlerEventNotificationRemoveRequest(
9584 eventNotificationRemove.EventData.EventID, this); 9983 eventNotificationRemove.EventData.EventID, this);
@@ -9596,7 +9995,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9596 } 9995 }
9597 #endregion 9996 #endregion
9598 9997
9599 handlerRetrieveInstantMessages = OnRetrieveInstantMessages; 9998 RetrieveInstantMessages handlerRetrieveInstantMessages = OnRetrieveInstantMessages;
9600 if (handlerRetrieveInstantMessages != null) 9999 if (handlerRetrieveInstantMessages != null)
9601 handlerRetrieveInstantMessages(this); 10000 handlerRetrieveInstantMessages(this);
9602 break; 10001 break;
@@ -9614,7 +10013,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9614 } 10013 }
9615 #endregion 10014 #endregion
9616 10015
9617 handlerPickDelete = OnPickDelete; 10016 PickDelete handlerPickDelete = OnPickDelete;
9618 if (handlerPickDelete != null) 10017 if (handlerPickDelete != null)
9619 handlerPickDelete(this, pickDelete.Data.PickID); 10018 handlerPickDelete(this, pickDelete.Data.PickID);
9620 break; 10019 break;
@@ -9631,7 +10030,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9631 } 10030 }
9632 #endregion 10031 #endregion
9633 10032
9634 handlerPickGodDelete = OnPickGodDelete; 10033 PickGodDelete handlerPickGodDelete = OnPickGodDelete;
9635 if (handlerPickGodDelete != null) 10034 if (handlerPickGodDelete != null)
9636 handlerPickGodDelete(this, 10035 handlerPickGodDelete(this,
9637 pickGodDelete.AgentData.AgentID, 10036 pickGodDelete.AgentData.AgentID,
@@ -9651,7 +10050,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9651 } 10050 }
9652 #endregion 10051 #endregion
9653 10052
9654 handlerPickInfoUpdate = OnPickInfoUpdate; 10053 PickInfoUpdate handlerPickInfoUpdate = OnPickInfoUpdate;
9655 if (handlerPickInfoUpdate != null) 10054 if (handlerPickInfoUpdate != null)
9656 handlerPickInfoUpdate(this, 10055 handlerPickInfoUpdate(this,
9657 pickInfoUpdate.Data.PickID, 10056 pickInfoUpdate.Data.PickID,
@@ -9676,7 +10075,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9676 } 10075 }
9677 #endregion 10076 #endregion
9678 10077
9679 handlerAvatarNotesUpdate = OnAvatarNotesUpdate; 10078 AvatarNotesUpdate handlerAvatarNotesUpdate = OnAvatarNotesUpdate;
9680 if (handlerAvatarNotesUpdate != null) 10079 if (handlerAvatarNotesUpdate != null)
9681 handlerAvatarNotesUpdate(this, 10080 handlerAvatarNotesUpdate(this,
9682 avatarNotesUpdate.Data.TargetID, 10081 avatarNotesUpdate.Data.TargetID,
@@ -9693,7 +10092,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9693 PlacesQueryPacket placesQueryPacket = 10092 PlacesQueryPacket placesQueryPacket =
9694 (PlacesQueryPacket)Pack; 10093 (PlacesQueryPacket)Pack;
9695 10094
9696 handlerPlacesQuery = OnPlacesQuery; 10095 PlacesQuery handlerPlacesQuery = OnPlacesQuery;
9697 10096
9698 if (handlerPlacesQuery != null) 10097 if (handlerPlacesQuery != null)
9699 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID, 10098 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID,
@@ -9747,304 +10146,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9747 //shape.Textures = ntex; 10146 //shape.Textures = ntex;
9748 return shape; 10147 return shape;
9749 } 10148 }
9750 10149
9751 /// <summary>
9752 /// Send the client an Estate message blue box pop-down with a single OK button
9753 /// </summary>
9754 /// <param name="FromAvatarID"></param>
9755 /// <param name="fromSessionID"></param>
9756 /// <param name="FromAvatarName"></param>
9757 /// <param name="Message"></param>
9758 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
9759 {
9760 if (!ChildAgentStatus())
9761 SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3()));
9762
9763 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
9764 }
9765
9766 public void SendLogoutPacket()
9767 {
9768 // I know this is a bit of a hack, however there are times when you don't
9769 // want to send this, but still need to do the rest of the shutdown process
9770 // this method gets called from the packet server.. which makes it practically
9771 // impossible to do any other way.
9772
9773 if (m_SendLogoutPacketWhenClosing)
9774 {
9775 LogoutReplyPacket logReply = (LogoutReplyPacket)PacketPool.Instance.GetPacket(PacketType.LogoutReply);
9776 // TODO: don't create new blocks if recycling an old packet
9777 logReply.AgentData.AgentID = AgentId;
9778 logReply.AgentData.SessionID = SessionId;
9779 logReply.InventoryData = new LogoutReplyPacket.InventoryDataBlock[1];
9780 logReply.InventoryData[0] = new LogoutReplyPacket.InventoryDataBlock();
9781 logReply.InventoryData[0].ItemID = UUID.Zero;
9782
9783 OutPacket(logReply, ThrottleOutPacketType.Task);
9784 }
9785 }
9786
9787 public void SendHealth(float health)
9788 {
9789 HealthMessagePacket healthpacket = (HealthMessagePacket)PacketPool.Instance.GetPacket(PacketType.HealthMessage);
9790 healthpacket.HealthData.Health = health;
9791 OutPacket(healthpacket, ThrottleOutPacketType.Task);
9792 }
9793
9794 public void SendAgentOnline(UUID[] agentIDs)
9795 {
9796 OnlineNotificationPacket onp = new OnlineNotificationPacket();
9797 OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
9798 for (int i = 0; i < agentIDs.Length; i++)
9799 {
9800 OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
9801 onpbl.AgentID = agentIDs[i];
9802 onpb[i] = onpbl;
9803 }
9804 onp.AgentBlock = onpb;
9805 onp.Header.Reliable = true;
9806 OutPacket(onp, ThrottleOutPacketType.Task);
9807 }
9808
9809 public void SendAgentOffline(UUID[] agentIDs)
9810 {
9811 OfflineNotificationPacket offp = new OfflineNotificationPacket();
9812 OfflineNotificationPacket.AgentBlockBlock[] offpb = new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length];
9813 for (int i = 0; i < agentIDs.Length; i++)
9814 {
9815 OfflineNotificationPacket.AgentBlockBlock onpbl = new OfflineNotificationPacket.AgentBlockBlock();
9816 onpbl.AgentID = agentIDs[i];
9817 offpb[i] = onpbl;
9818 }
9819 offp.AgentBlock = offpb;
9820 offp.Header.Reliable = true;
9821 OutPacket(offp, ThrottleOutPacketType.Task);
9822 }
9823
9824 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot,
9825 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
9826 {
9827 AvatarSitResponsePacket avatarSitResponse = new AvatarSitResponsePacket();
9828 avatarSitResponse.SitObject.ID = TargetID;
9829 if (CameraAtOffset != Vector3.Zero)
9830 {
9831 avatarSitResponse.SitTransform.CameraAtOffset = CameraAtOffset;
9832 avatarSitResponse.SitTransform.CameraEyeOffset = CameraEyeOffset;
9833 }
9834 avatarSitResponse.SitTransform.ForceMouselook = ForceMouseLook;
9835 avatarSitResponse.SitTransform.AutoPilot = autopilot;
9836 avatarSitResponse.SitTransform.SitPosition = OffsetPos;
9837 avatarSitResponse.SitTransform.SitRotation = SitOrientation;
9838
9839 OutPacket(avatarSitResponse, ThrottleOutPacketType.Task);
9840 }
9841
9842 public void SendAdminResponse(UUID Token, uint AdminLevel)
9843 {
9844 GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket();
9845 GrantGodlikePowersPacket.GrantDataBlock gdb = new GrantGodlikePowersPacket.GrantDataBlock();
9846 GrantGodlikePowersPacket.AgentDataBlock adb = new GrantGodlikePowersPacket.AgentDataBlock();
9847
9848 adb.AgentID = AgentId;
9849 adb.SessionID = SessionId; // More security
9850 gdb.GodLevel = (byte)AdminLevel;
9851 gdb.Token = Token;
9852 //respondPacket.AgentData = (GrantGodlikePowersPacket.AgentDataBlock)ablock;
9853 respondPacket.GrantData = gdb;
9854 respondPacket.AgentData = adb;
9855 OutPacket(respondPacket, ThrottleOutPacketType.Task);
9856 }
9857
9858 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
9859 {
9860 m_groupPowers.Clear();
9861
9862 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
9863 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
9864 for (int i = 0; i < GroupMembership.Length; i++)
9865 {
9866 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
9867
9868 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
9869 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
9870 Group.Contribution = GroupMembership[i].Contribution;
9871 Group.GroupID = GroupMembership[i].GroupID;
9872 Group.GroupInsigniaID = GroupMembership[i].GroupPicture;
9873 Group.GroupName = Utils.StringToBytes(GroupMembership[i].GroupName);
9874 Group.GroupPowers = GroupMembership[i].GroupPowers;
9875 Groups[i] = Group;
9876
9877
9878 }
9879 Groupupdate.GroupData = Groups;
9880 Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock();
9881 Groupupdate.AgentData.AgentID = AgentId;
9882 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
9883
9884 try
9885 {
9886 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
9887 if (eq != null)
9888 {
9889 eq.GroupMembership(Groupupdate, this.AgentId);
9890 }
9891 }
9892 catch (Exception ex)
9893 {
9894 m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString());
9895 m_log.Warn("sending group membership data via UDP");
9896 OutPacket(Groupupdate, ThrottleOutPacketType.Task);
9897 }
9898 }
9899
9900
9901 public void SendGroupNameReply(UUID groupLLUID, string GroupName)
9902 {
9903 UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket();
9904 UUIDGroupNameReplyPacket.UUIDNameBlockBlock[] uidnameblock = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock[1];
9905 UUIDGroupNameReplyPacket.UUIDNameBlockBlock uidnamebloc = new UUIDGroupNameReplyPacket.UUIDNameBlockBlock();
9906 uidnamebloc.ID = groupLLUID;
9907 uidnamebloc.GroupName = Utils.StringToBytes(GroupName);
9908 uidnameblock[0] = uidnamebloc;
9909 pack.UUIDNameBlock = uidnameblock;
9910 OutPacket(pack, ThrottleOutPacketType.Task);
9911 }
9912
9913 public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
9914 {
9915 LandStatReplyPacket lsrp = new LandStatReplyPacket();
9916 // LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
9917 LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
9918 //LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
9919 // lsrepdb.
9920 lsrp.RequestData.ReportType = reportType;
9921 lsrp.RequestData.RequestFlags = requestFlags;
9922 lsrp.RequestData.TotalObjectCount = resultCount;
9923 for (int i = 0; i < lsrpia.Length; i++)
9924 {
9925 LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
9926 lsrepdb.LocationX = lsrpia[i].LocationX;
9927 lsrepdb.LocationY = lsrpia[i].LocationY;
9928 lsrepdb.LocationZ = lsrpia[i].LocationZ;
9929 lsrepdb.Score = lsrpia[i].Score;
9930 lsrepdb.TaskID = lsrpia[i].TaskID;
9931 lsrepdb.TaskLocalID = lsrpia[i].TaskLocalID;
9932 lsrepdb.TaskName = Utils.StringToBytes(lsrpia[i].TaskName);
9933 lsrepdb.OwnerName = Utils.StringToBytes(lsrpia[i].OwnerName);
9934 lsrepdba[i] = lsrepdb;
9935 }
9936 lsrp.ReportData = lsrepdba;
9937 OutPacket(lsrp, ThrottleOutPacketType.Task);
9938 }
9939
9940 public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running)
9941 {
9942 ScriptRunningReplyPacket scriptRunningReply = new ScriptRunningReplyPacket();
9943 scriptRunningReply.Script.ObjectID = objectID;
9944 scriptRunningReply.Script.ItemID = itemID;
9945 scriptRunningReply.Script.Running = running;
9946
9947 OutPacket(scriptRunningReply, ThrottleOutPacketType.Task);
9948 }
9949
9950 public void SendAsset(AssetRequestToClient req)
9951 {
9952 //m_log.Debug("sending asset " + req.RequestAssetID);
9953 TransferInfoPacket Transfer = new TransferInfoPacket();
9954 Transfer.TransferInfo.ChannelType = 2;
9955 Transfer.TransferInfo.Status = 0;
9956 Transfer.TransferInfo.TargetType = 0;
9957 if (req.AssetRequestSource == 2)
9958 {
9959 Transfer.TransferInfo.Params = new byte[20];
9960 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
9961 int assType = req.AssetInf.Type;
9962 Array.Copy(Utils.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
9963 }
9964 else if (req.AssetRequestSource == 3)
9965 {
9966 Transfer.TransferInfo.Params = req.Params;
9967 // Transfer.TransferInfo.Params = new byte[100];
9968 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
9969 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
9970 }
9971 Transfer.TransferInfo.Size = req.AssetInf.Data.Length;
9972 Transfer.TransferInfo.TransferID = req.TransferRequestID;
9973 Transfer.Header.Zerocoded = true;
9974 OutPacket(Transfer, ThrottleOutPacketType.Asset);
9975
9976 if (req.NumPackets == 1)
9977 {
9978 TransferPacketPacket TransferPacket = new TransferPacketPacket();
9979 TransferPacket.TransferData.Packet = 0;
9980 TransferPacket.TransferData.ChannelType = 2;
9981 TransferPacket.TransferData.TransferID = req.TransferRequestID;
9982 TransferPacket.TransferData.Data = req.AssetInf.Data;
9983 TransferPacket.TransferData.Status = 1;
9984 TransferPacket.Header.Zerocoded = true;
9985 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
9986 }
9987 else
9988 {
9989 int processedLength = 0;
9990 int maxChunkSize = Settings.MAX_PACKET_SIZE - 100;
9991 int packetNumber = 0;
9992
9993 while (processedLength < req.AssetInf.Data.Length)
9994 {
9995 TransferPacketPacket TransferPacket = new TransferPacketPacket();
9996 TransferPacket.TransferData.Packet = packetNumber;
9997 TransferPacket.TransferData.ChannelType = 2;
9998 TransferPacket.TransferData.TransferID = req.TransferRequestID;
9999
10000 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
10001 byte[] chunk = new byte[chunkSize];
10002 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
10003
10004 TransferPacket.TransferData.Data = chunk;
10005
10006 // 0 indicates more packets to come, 1 indicates last packet
10007 if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
10008 {
10009 TransferPacket.TransferData.Status = 0;
10010 }
10011 else
10012 {
10013 TransferPacket.TransferData.Status = 1;
10014 }
10015 TransferPacket.Header.Zerocoded = true;
10016 OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
10017
10018 processedLength += chunkSize;
10019 packetNumber++;
10020 }
10021 }
10022 }
10023
10024 public void SendTexture(AssetBase TextureAsset)
10025 {
10026
10027 }
10028
10029 public ClientInfo GetClientInfo() 10150 public ClientInfo GetClientInfo()
10030 { 10151 {
10031 ClientInfo info = m_PacketHandler.GetClientInfo(); 10152 ClientInfo info = m_udpClient.GetClientInfo();
10032 10153
10033 info.userEP = m_userEndPoint; 10154 info.userEP = m_userEndPoint;
10034 info.proxyEP = m_proxyEndPoint; 10155 info.proxyEP = null;
10035 info.agentcircuit = new sAgentCircuitData(RequestClientInfo()); 10156 info.agentcircuit = new sAgentCircuitData(RequestClientInfo());
10036 10157
10037 return info; 10158 return info;
10038 } 10159 }
10039 10160
10040 public EndPoint GetClientEP() 10161 public void SetClientInfo(ClientInfo info)
10041 { 10162 {
10042 return m_userEndPoint; 10163 m_udpClient.SetClientInfo(info);
10043 } 10164 }
10044 10165
10045 public void SetClientInfo(ClientInfo info) 10166 public EndPoint GetClientEP()
10046 { 10167 {
10047 m_PacketHandler.SetClientInfo(info); 10168 return m_userEndPoint;
10048 } 10169 }
10049 10170
10050 #region Media Parcel Members 10171 #region Media Parcel Members
@@ -10079,7 +10200,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10079 10200
10080 #endregion 10201 #endregion
10081 10202
10082
10083 #region Camera 10203 #region Camera
10084 10204
10085 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters) 10205 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
@@ -10109,70 +10229,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10109 10229
10110 #endregion 10230 #endregion
10111 10231
10112 public void SendRegionHandle(UUID regionID, ulong handle) {
10113 RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
10114 reply.ReplyBlock.RegionID = regionID;
10115 reply.ReplyBlock.RegionHandle = handle;
10116 OutPacket(reply, ThrottleOutPacketType.Land);
10117 }
10118
10119 public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y)
10120 {
10121 ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
10122 reply.AgentData.AgentID = m_agentId;
10123 reply.Data.ParcelID = parcelID;
10124 reply.Data.OwnerID = land.OwnerID;
10125 reply.Data.Name = Utils.StringToBytes(land.Name);
10126 reply.Data.Desc = Utils.StringToBytes(land.Description);
10127 reply.Data.ActualArea = land.Area;
10128 reply.Data.BillableArea = land.Area; // TODO: what is this?
10129
10130 // Bit 0: Mature, bit 7: on sale, other bits: no idea
10131 reply.Data.Flags = (byte)(
10132 ((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
10133 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
10134
10135 Vector3 pos = land.UserLocation;
10136 if (pos.Equals(Vector3.Zero))
10137 {
10138 pos = (land.AABBMax + land.AABBMin) * 0.5f;
10139 }
10140 reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
10141 reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
10142 reply.Data.GlobalZ = pos.Z;
10143 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
10144 reply.Data.SnapshotID = land.SnapshotID;
10145 reply.Data.Dwell = land.Dwell;
10146 reply.Data.SalePrice = land.SalePrice;
10147 reply.Data.AuctionID = (int)land.AuctionID;
10148
10149 OutPacket(reply, ThrottleOutPacketType.Land);
10150 }
10151
10152 public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt)
10153 {
10154 ScriptTeleportRequestPacket packet = (ScriptTeleportRequestPacket)PacketPool.Instance.GetPacket(PacketType.ScriptTeleportRequest);
10155
10156 packet.Data.ObjectName = Utils.StringToBytes(objName);
10157 packet.Data.SimName = Utils.StringToBytes(simName);
10158 packet.Data.SimPosition = pos;
10159 packet.Data.LookAt = lookAt;
10160
10161 OutPacket(packet, ThrottleOutPacketType.Task);
10162 }
10163
10164 public void SetClientOption(string option, string value) 10232 public void SetClientOption(string option, string value)
10165 { 10233 {
10166 switch (option) 10234 switch (option)
10167 { 10235 {
10168 case "ReliableIsImportant": 10236 default:
10169 bool val; 10237 break;
10170
10171 if (bool.TryParse(value, out val))
10172 m_PacketHandler.ReliableIsImportant = val;
10173 break;
10174 default:
10175 break;
10176 } 10238 }
10177 } 10239 }
10178 10240
@@ -10180,571 +10242,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10180 { 10242 {
10181 switch (option) 10243 switch (option)
10182 { 10244 {
10183 case "ReliableIsImportant":
10184 return m_PacketHandler.ReliableIsImportant.ToString();
10185
10186 default: 10245 default:
10187 break; 10246 break;
10188 } 10247 }
10189 return string.Empty; 10248 return string.Empty;
10190 } 10249 }
10191 10250
10192 public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data)
10193 {
10194 DirPlacesReplyPacket packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply);
10195
10196 packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock();
10197
10198 packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
10199 packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
10200
10201 packet.QueryReplies =
10202 new DirPlacesReplyPacket.QueryRepliesBlock[data.Length];
10203
10204 packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[
10205 data.Length];
10206
10207 packet.AgentData.AgentID = AgentId;
10208
10209 packet.QueryData[0].QueryID = queryID;
10210
10211 int i = 0;
10212 foreach (DirPlacesReplyData d in data)
10213 {
10214 packet.QueryReplies[i] =
10215 new DirPlacesReplyPacket.QueryRepliesBlock();
10216 packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock();
10217 packet.QueryReplies[i].ParcelID = d.parcelID;
10218 packet.QueryReplies[i].Name = Utils.StringToBytes(d.name);
10219 packet.QueryReplies[i].ForSale = d.forSale;
10220 packet.QueryReplies[i].Auction = d.auction;
10221 packet.QueryReplies[i].Dwell = d.dwell;
10222 packet.StatusData[i].Status = d.Status;
10223 i++;
10224 }
10225
10226 OutPacket(packet, ThrottleOutPacketType.Task);
10227 }
10228
10229 public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data)
10230 {
10231 DirPeopleReplyPacket packet = (DirPeopleReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPeopleReply);
10232
10233 packet.AgentData = new DirPeopleReplyPacket.AgentDataBlock();
10234 packet.AgentData.AgentID = AgentId;
10235
10236 packet.QueryData = new DirPeopleReplyPacket.QueryDataBlock();
10237 packet.QueryData.QueryID = queryID;
10238
10239 packet.QueryReplies = new DirPeopleReplyPacket.QueryRepliesBlock[
10240 data.Length];
10241
10242 int i = 0;
10243 foreach (DirPeopleReplyData d in data)
10244 {
10245 packet.QueryReplies[i] = new DirPeopleReplyPacket.QueryRepliesBlock();
10246 packet.QueryReplies[i].AgentID = d.agentID;
10247 packet.QueryReplies[i].FirstName =
10248 Utils.StringToBytes(d.firstName);
10249 packet.QueryReplies[i].LastName =
10250 Utils.StringToBytes(d.lastName);
10251 packet.QueryReplies[i].Group =
10252 Utils.StringToBytes(d.group);
10253 packet.QueryReplies[i].Online = d.online;
10254 packet.QueryReplies[i].Reputation = d.reputation;
10255 i++;
10256 }
10257
10258 OutPacket(packet, ThrottleOutPacketType.Task);
10259 }
10260
10261 public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data)
10262 {
10263 DirEventsReplyPacket packet = (DirEventsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirEventsReply);
10264
10265 packet.AgentData = new DirEventsReplyPacket.AgentDataBlock();
10266 packet.AgentData.AgentID = AgentId;
10267
10268 packet.QueryData = new DirEventsReplyPacket.QueryDataBlock();
10269 packet.QueryData.QueryID = queryID;
10270
10271 packet.QueryReplies = new DirEventsReplyPacket.QueryRepliesBlock[
10272 data.Length];
10273
10274 packet.StatusData = new DirEventsReplyPacket.StatusDataBlock[
10275 data.Length];
10276
10277 int i = 0;
10278 foreach (DirEventsReplyData d in data)
10279 {
10280 packet.QueryReplies[i] = new DirEventsReplyPacket.QueryRepliesBlock();
10281 packet.StatusData[i] = new DirEventsReplyPacket.StatusDataBlock();
10282 packet.QueryReplies[i].OwnerID = d.ownerID;
10283 packet.QueryReplies[i].Name =
10284 Utils.StringToBytes(d.name);
10285 packet.QueryReplies[i].EventID = d.eventID;
10286 packet.QueryReplies[i].Date =
10287 Utils.StringToBytes(d.date);
10288 packet.QueryReplies[i].UnixTime = d.unixTime;
10289 packet.QueryReplies[i].EventFlags = d.eventFlags;
10290 packet.StatusData[i].Status = d.Status;
10291 i++;
10292 }
10293
10294 OutPacket(packet, ThrottleOutPacketType.Task);
10295 }
10296
10297 public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data)
10298 {
10299 DirGroupsReplyPacket packet = (DirGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirGroupsReply);
10300
10301 packet.AgentData = new DirGroupsReplyPacket.AgentDataBlock();
10302 packet.AgentData.AgentID = AgentId;
10303
10304 packet.QueryData = new DirGroupsReplyPacket.QueryDataBlock();
10305 packet.QueryData.QueryID = queryID;
10306
10307 packet.QueryReplies = new DirGroupsReplyPacket.QueryRepliesBlock[
10308 data.Length];
10309
10310 int i = 0;
10311 foreach (DirGroupsReplyData d in data)
10312 {
10313 packet.QueryReplies[i] = new DirGroupsReplyPacket.QueryRepliesBlock();
10314 packet.QueryReplies[i].GroupID = d.groupID;
10315 packet.QueryReplies[i].GroupName =
10316 Utils.StringToBytes(d.groupName);
10317 packet.QueryReplies[i].Members = d.members;
10318 packet.QueryReplies[i].SearchOrder = d.searchOrder;
10319 i++;
10320 }
10321
10322 OutPacket(packet, ThrottleOutPacketType.Task);
10323 }
10324
10325 public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data)
10326 {
10327 DirClassifiedReplyPacket packet = (DirClassifiedReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirClassifiedReply);
10328
10329 packet.AgentData = new DirClassifiedReplyPacket.AgentDataBlock();
10330 packet.AgentData.AgentID = AgentId;
10331
10332 packet.QueryData = new DirClassifiedReplyPacket.QueryDataBlock();
10333 packet.QueryData.QueryID = queryID;
10334
10335 packet.QueryReplies = new DirClassifiedReplyPacket.QueryRepliesBlock[
10336 data.Length];
10337 packet.StatusData = new DirClassifiedReplyPacket.StatusDataBlock[
10338 data.Length];
10339
10340 int i = 0;
10341 foreach (DirClassifiedReplyData d in data)
10342 {
10343 packet.QueryReplies[i] = new DirClassifiedReplyPacket.QueryRepliesBlock();
10344 packet.StatusData[i] = new DirClassifiedReplyPacket.StatusDataBlock();
10345 packet.QueryReplies[i].ClassifiedID = d.classifiedID;
10346 packet.QueryReplies[i].Name =
10347 Utils.StringToBytes(d.name);
10348 packet.QueryReplies[i].ClassifiedFlags = d.classifiedFlags;
10349 packet.QueryReplies[i].CreationDate = d.creationDate;
10350 packet.QueryReplies[i].ExpirationDate = d.expirationDate;
10351 packet.QueryReplies[i].PriceForListing = d.price;
10352 packet.StatusData[i].Status = d.Status;
10353 i++;
10354 }
10355
10356 OutPacket(packet, ThrottleOutPacketType.Task);
10357 }
10358
10359 public void SendDirLandReply(UUID queryID, DirLandReplyData[] data)
10360 {
10361 DirLandReplyPacket packet = (DirLandReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirLandReply);
10362
10363 packet.AgentData = new DirLandReplyPacket.AgentDataBlock();
10364 packet.AgentData.AgentID = AgentId;
10365
10366 packet.QueryData = new DirLandReplyPacket.QueryDataBlock();
10367 packet.QueryData.QueryID = queryID;
10368
10369 packet.QueryReplies = new DirLandReplyPacket.QueryRepliesBlock[
10370 data.Length];
10371
10372 int i = 0;
10373 foreach (DirLandReplyData d in data)
10374 {
10375 packet.QueryReplies[i] = new DirLandReplyPacket.QueryRepliesBlock();
10376 packet.QueryReplies[i].ParcelID = d.parcelID;
10377 packet.QueryReplies[i].Name =
10378 Utils.StringToBytes(d.name);
10379 packet.QueryReplies[i].Auction = d.auction;
10380 packet.QueryReplies[i].ForSale = d.forSale;
10381 packet.QueryReplies[i].SalePrice = d.salePrice;
10382 packet.QueryReplies[i].ActualArea = d.actualArea;
10383 i++;
10384 }
10385
10386 OutPacket(packet, ThrottleOutPacketType.Task);
10387 }
10388
10389 public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data)
10390 {
10391 DirPopularReplyPacket packet = (DirPopularReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPopularReply);
10392
10393 packet.AgentData = new DirPopularReplyPacket.AgentDataBlock();
10394 packet.AgentData.AgentID = AgentId;
10395
10396 packet.QueryData = new DirPopularReplyPacket.QueryDataBlock();
10397 packet.QueryData.QueryID = queryID;
10398
10399 packet.QueryReplies = new DirPopularReplyPacket.QueryRepliesBlock[
10400 data.Length];
10401
10402 int i = 0;
10403 foreach (DirPopularReplyData d in data)
10404 {
10405 packet.QueryReplies[i] = new DirPopularReplyPacket.QueryRepliesBlock();
10406 packet.QueryReplies[i].ParcelID = d.parcelID;
10407 packet.QueryReplies[i].Name =
10408 Utils.StringToBytes(d.name);
10409 packet.QueryReplies[i].Dwell = d.dwell;
10410 i++;
10411 }
10412
10413 OutPacket(packet, ThrottleOutPacketType.Task);
10414 }
10415
10416 public void SendEventInfoReply(EventData data)
10417 {
10418 EventInfoReplyPacket packet = (EventInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.EventInfoReply);
10419
10420 packet.AgentData = new EventInfoReplyPacket.AgentDataBlock();
10421 packet.AgentData.AgentID = AgentId;
10422
10423 packet.EventData = new EventInfoReplyPacket.EventDataBlock();
10424 packet.EventData.EventID = data.eventID;
10425 packet.EventData.Creator = Utils.StringToBytes(data.creator);
10426 packet.EventData.Name = Utils.StringToBytes(data.name);
10427 packet.EventData.Category = Utils.StringToBytes(data.category);
10428 packet.EventData.Desc = Utils.StringToBytes(data.description);
10429 packet.EventData.Date = Utils.StringToBytes(data.date);
10430 packet.EventData.DateUTC = data.dateUTC;
10431 packet.EventData.Duration = data.duration;
10432 packet.EventData.Cover = data.cover;
10433 packet.EventData.Amount = data.amount;
10434 packet.EventData.SimName = Utils.StringToBytes(data.simName);
10435 packet.EventData.GlobalPos = new Vector3d(data.globalPos);
10436 packet.EventData.EventFlags = data.eventFlags;
10437
10438 OutPacket(packet, ThrottleOutPacketType.Task);
10439 }
10440
10441 public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags)
10442 {
10443 MapItemReplyPacket mirplk = new MapItemReplyPacket();
10444 mirplk.AgentData.AgentID = AgentId;
10445 mirplk.RequestData.ItemType = mapitemtype;
10446 mirplk.Data = new MapItemReplyPacket.DataBlock[replies.Length];
10447 for (int i = 0; i < replies.Length; i++)
10448 {
10449 MapItemReplyPacket.DataBlock mrdata = new MapItemReplyPacket.DataBlock();
10450 mrdata.X = replies[i].x;
10451 mrdata.Y = replies[i].y;
10452 mrdata.ID = replies[i].id;
10453 mrdata.Extra = replies[i].Extra;
10454 mrdata.Extra2 = replies[i].Extra2;
10455 mrdata.Name = Utils.StringToBytes(replies[i].name);
10456 mirplk.Data[i] = mrdata;
10457 }
10458 //m_log.Debug(mirplk.ToString());
10459 OutPacket(mirplk, ThrottleOutPacketType.Task);
10460
10461 }
10462
10463 public void SendOfferCallingCard(UUID srcID, UUID transactionID)
10464 {
10465 // a bit special, as this uses AgentID to store the source instead
10466 // of the destination. The destination (the receiver) goes into destID
10467 OfferCallingCardPacket p = (OfferCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.OfferCallingCard);
10468 p.AgentData.AgentID = srcID;
10469 p.AgentData.SessionID = UUID.Zero;
10470 p.AgentBlock.DestID = AgentId;
10471 p.AgentBlock.TransactionID = transactionID;
10472 OutPacket(p, ThrottleOutPacketType.Task);
10473 }
10474
10475 public void SendAcceptCallingCard(UUID transactionID)
10476 {
10477 AcceptCallingCardPacket p = (AcceptCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.AcceptCallingCard);
10478 p.AgentData.AgentID = AgentId;
10479 p.AgentData.SessionID = UUID.Zero;
10480 p.FolderData = new AcceptCallingCardPacket.FolderDataBlock[1];
10481 p.FolderData[0] = new AcceptCallingCardPacket.FolderDataBlock();
10482 p.FolderData[0].FolderID = UUID.Zero;
10483 OutPacket(p, ThrottleOutPacketType.Task);
10484 }
10485
10486 public void SendDeclineCallingCard(UUID transactionID)
10487 {
10488 DeclineCallingCardPacket p = (DeclineCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.DeclineCallingCard);
10489 p.AgentData.AgentID = AgentId;
10490 p.AgentData.SessionID = UUID.Zero;
10491 p.TransactionBlock.TransactionID = transactionID;
10492 OutPacket(p, ThrottleOutPacketType.Task);
10493 }
10494
10495 public void SendTerminateFriend(UUID exFriendID)
10496 {
10497 TerminateFriendshipPacket p = (TerminateFriendshipPacket)PacketPool.Instance.GetPacket(PacketType.TerminateFriendship);
10498 p.AgentData.AgentID = AgentId;
10499 p.AgentData.SessionID = SessionId;
10500 p.ExBlock.OtherID = exFriendID;
10501 OutPacket(p, ThrottleOutPacketType.Task);
10502 }
10503
10504 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
10505 {
10506 AvatarGroupsReplyPacket p = (AvatarGroupsReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarGroupsReply);
10507
10508 p.AgentData = new AvatarGroupsReplyPacket.AgentDataBlock();
10509 p.AgentData.AgentID = AgentId;
10510 p.AgentData.AvatarID = avatarID;
10511
10512 p.GroupData = new AvatarGroupsReplyPacket.GroupDataBlock[data.Length];
10513 int i = 0;
10514 foreach (GroupMembershipData m in data)
10515 {
10516 p.GroupData[i] = new AvatarGroupsReplyPacket.GroupDataBlock();
10517 p.GroupData[i].GroupPowers = m.GroupPowers;
10518 p.GroupData[i].AcceptNotices = m.AcceptNotices;
10519 p.GroupData[i].GroupTitle = Utils.StringToBytes(m.GroupTitle);
10520 p.GroupData[i].GroupID = m.GroupID;
10521 p.GroupData[i].GroupName = Utils.StringToBytes(m.GroupName);
10522 p.GroupData[i].GroupInsigniaID = m.GroupPicture;
10523 i++;
10524 }
10525
10526 p.NewGroupData = new AvatarGroupsReplyPacket.NewGroupDataBlock();
10527 p.NewGroupData.ListInProfile = true;
10528
10529 OutPacket(p, ThrottleOutPacketType.Task);
10530 }
10531
10532 public void SendJoinGroupReply(UUID groupID, bool success)
10533 {
10534 JoinGroupReplyPacket p = (JoinGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.JoinGroupReply);
10535
10536 p.AgentData = new JoinGroupReplyPacket.AgentDataBlock();
10537 p.AgentData.AgentID = AgentId;
10538
10539 p.GroupData = new JoinGroupReplyPacket.GroupDataBlock();
10540 p.GroupData.GroupID = groupID;
10541 p.GroupData.Success = success;
10542
10543 OutPacket(p, ThrottleOutPacketType.Task);
10544 }
10545
10546 public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success)
10547 {
10548 EjectGroupMemberReplyPacket p = (EjectGroupMemberReplyPacket)PacketPool.Instance.GetPacket(PacketType.EjectGroupMemberReply);
10549
10550 p.AgentData = new EjectGroupMemberReplyPacket.AgentDataBlock();
10551 p.AgentData.AgentID = agentID;
10552
10553 p.GroupData = new EjectGroupMemberReplyPacket.GroupDataBlock();
10554 p.GroupData.GroupID = groupID;
10555
10556 p.EjectData = new EjectGroupMemberReplyPacket.EjectDataBlock();
10557 p.EjectData.Success = success;
10558
10559 OutPacket(p, ThrottleOutPacketType.Task);
10560 }
10561
10562 public void SendLeaveGroupReply(UUID groupID, bool success)
10563 {
10564 LeaveGroupReplyPacket p = (LeaveGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.LeaveGroupReply);
10565
10566 p.AgentData = new LeaveGroupReplyPacket.AgentDataBlock();
10567 p.AgentData.AgentID = AgentId;
10568
10569 p.GroupData = new LeaveGroupReplyPacket.GroupDataBlock();
10570 p.GroupData.GroupID = groupID;
10571 p.GroupData.Success = success;
10572
10573 OutPacket(p, ThrottleOutPacketType.Task);
10574 }
10575
10576 public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name)
10577 {
10578 if (classifiedID.Length != name.Length)
10579 return;
10580
10581 AvatarClassifiedReplyPacket ac =
10582 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
10583 PacketType.AvatarClassifiedReply);
10584
10585 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
10586 ac.AgentData.AgentID = AgentId;
10587 ac.AgentData.TargetID = targetID;
10588
10589 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifiedID.Length];
10590 int i;
10591 for (i = 0 ; i < classifiedID.Length ; i++)
10592 {
10593 ac.Data[i].ClassifiedID = classifiedID[i];
10594 ac.Data[i].Name = Utils.StringToBytes(name[i]);
10595 }
10596
10597 OutPacket(ac, ThrottleOutPacketType.Task);
10598 }
10599
10600 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)
10601 {
10602 ClassifiedInfoReplyPacket cr =
10603 (ClassifiedInfoReplyPacket)PacketPool.Instance.GetPacket(
10604 PacketType.ClassifiedInfoReply);
10605
10606 cr.AgentData = new ClassifiedInfoReplyPacket.AgentDataBlock();
10607 cr.AgentData.AgentID = AgentId;
10608
10609 cr.Data = new ClassifiedInfoReplyPacket.DataBlock();
10610 cr.Data.ClassifiedID = classifiedID;
10611 cr.Data.CreatorID = creatorID;
10612 cr.Data.CreationDate = creationDate;
10613 cr.Data.ExpirationDate = expirationDate;
10614 cr.Data.Category = category;
10615 cr.Data.Name = Utils.StringToBytes(name);
10616 cr.Data.Desc = Utils.StringToBytes(description);
10617 cr.Data.ParcelID = parcelID;
10618 cr.Data.ParentEstate = parentEstate;
10619 cr.Data.SnapshotID = snapshotID;
10620 cr.Data.SimName = Utils.StringToBytes(simName);
10621 cr.Data.PosGlobal = new Vector3d(globalPos);
10622 cr.Data.ParcelName = Utils.StringToBytes(parcelName);
10623 cr.Data.ClassifiedFlags = classifiedFlags;
10624 cr.Data.PriceForListing = price;
10625
10626 OutPacket(cr, ThrottleOutPacketType.Task);
10627 }
10628
10629 public void SendAgentDropGroup(UUID groupID)
10630 {
10631 AgentDropGroupPacket dg =
10632 (AgentDropGroupPacket)PacketPool.Instance.GetPacket(
10633 PacketType.AgentDropGroup);
10634
10635 dg.AgentData = new AgentDropGroupPacket.AgentDataBlock();
10636 dg.AgentData.AgentID = AgentId;
10637 dg.AgentData.GroupID = groupID;
10638
10639 OutPacket(dg, ThrottleOutPacketType.Task);
10640 }
10641
10642 public void SendAvatarNotesReply(UUID targetID, string text)
10643 {
10644 AvatarNotesReplyPacket an =
10645 (AvatarNotesReplyPacket)PacketPool.Instance.GetPacket(
10646 PacketType.AvatarNotesReply);
10647
10648 an.AgentData = new AvatarNotesReplyPacket.AgentDataBlock();
10649 an.AgentData.AgentID = AgentId;
10650
10651 an.Data = new AvatarNotesReplyPacket.DataBlock();
10652 an.Data.TargetID = targetID;
10653 an.Data.Notes = Utils.StringToBytes(text);
10654
10655 OutPacket(an, ThrottleOutPacketType.Task);
10656 }
10657
10658 public void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks)
10659 {
10660 AvatarPicksReplyPacket ap =
10661 (AvatarPicksReplyPacket)PacketPool.Instance.GetPacket(
10662 PacketType.AvatarPicksReply);
10663
10664 ap.AgentData = new AvatarPicksReplyPacket.AgentDataBlock();
10665 ap.AgentData.AgentID = AgentId;
10666 ap.AgentData.TargetID = targetID;
10667
10668 ap.Data = new AvatarPicksReplyPacket.DataBlock[picks.Count];
10669
10670 int i = 0;
10671 foreach (KeyValuePair<UUID, string> pick in picks)
10672 {
10673 ap.Data[i] = new AvatarPicksReplyPacket.DataBlock();
10674 ap.Data[i].PickID = pick.Key;
10675 ap.Data[i].PickName = Utils.StringToBytes(pick.Value);
10676 i++;
10677 }
10678
10679 OutPacket(ap, ThrottleOutPacketType.Task);
10680 }
10681
10682 public void SendAvatarClassifiedReply(UUID targetID, Dictionary<UUID, string> classifieds)
10683 {
10684 AvatarClassifiedReplyPacket ac =
10685 (AvatarClassifiedReplyPacket)PacketPool.Instance.GetPacket(
10686 PacketType.AvatarClassifiedReply);
10687
10688 ac.AgentData = new AvatarClassifiedReplyPacket.AgentDataBlock();
10689 ac.AgentData.AgentID = AgentId;
10690 ac.AgentData.TargetID = targetID;
10691
10692 ac.Data = new AvatarClassifiedReplyPacket.DataBlock[classifieds.Count];
10693
10694 int i = 0;
10695 foreach (KeyValuePair<UUID, string> classified in classifieds)
10696 {
10697 ac.Data[i] = new AvatarClassifiedReplyPacket.DataBlock();
10698 ac.Data[i].ClassifiedID = classified.Key;
10699 ac.Data[i].Name = Utils.StringToBytes(classified.Value);
10700 i++;
10701 }
10702
10703 OutPacket(ac, ThrottleOutPacketType.Task);
10704 }
10705
10706 public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
10707 {
10708 ParcelDwellReplyPacket pd =
10709 (ParcelDwellReplyPacket)PacketPool.Instance.GetPacket(
10710 PacketType.ParcelDwellReply);
10711
10712 pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock();
10713 pd.AgentData.AgentID = AgentId;
10714
10715 pd.Data = new ParcelDwellReplyPacket.DataBlock();
10716 pd.Data.LocalID = localID;
10717 pd.Data.ParcelID = parcelID;
10718 pd.Data.Dwell = dwell;
10719
10720 OutPacket(pd, ThrottleOutPacketType.Land);
10721 }
10722
10723 public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
10724 {
10725 UserInfoReplyPacket ur =
10726 (UserInfoReplyPacket)PacketPool.Instance.GetPacket(
10727 PacketType.UserInfoReply);
10728
10729 string Visible = "hidden";
10730 if (visible)
10731 Visible = "default";
10732
10733 ur.AgentData = new UserInfoReplyPacket.AgentDataBlock();
10734 ur.AgentData.AgentID = AgentId;
10735
10736 ur.UserData = new UserInfoReplyPacket.UserDataBlock();
10737 ur.UserData.IMViaEMail = imViaEmail;
10738 ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible);
10739 ur.UserData.EMail = Utils.StringToBytes(email);
10740
10741 OutPacket(ur, ThrottleOutPacketType.Task);
10742 }
10743
10744 public void KillEndDone() 10251 public void KillEndDone()
10745 { 10252 {
10746 KillPacket kp = new KillPacket(); 10253 m_udpClient.Shutdown();
10747 OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
10748 } 10254 }
10749 10255
10750 #region IClientCore 10256 #region IClientCore
@@ -10767,13 +10273,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10767 } 10273 }
10768 } 10274 }
10769 10275
10770 protected virtual void RegisterInterfaces()
10771 {
10772 RegisterInterface<IClientIM>(this);
10773 RegisterInterface<IClientChat>(this);
10774 RegisterInterface<IClientIPEndpoint>(this);
10775 }
10776
10777 public bool TryGet<T>(out T iface) 10276 public bool TryGet<T>(out T iface)
10778 { 10277 {
10779 if (m_clientInterfaces.ContainsKey(typeof(T))) 10278 if (m_clientInterfaces.ContainsKey(typeof(T)))
@@ -10821,78 +10320,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10821 } 10320 }
10822 } 10321 }
10823 10322
10824 public void SendCreateGroupReply(UUID groupID, bool success, string message)
10825 {
10826 CreateGroupReplyPacket createGroupReply = (CreateGroupReplyPacket)PacketPool.Instance.GetPacket(PacketType.CreateGroupReply);
10827
10828 createGroupReply.AgentData =
10829 new CreateGroupReplyPacket.AgentDataBlock();
10830 createGroupReply.ReplyData =
10831 new CreateGroupReplyPacket.ReplyDataBlock();
10832
10833 createGroupReply.AgentData.AgentID = AgentId;
10834 createGroupReply.ReplyData.GroupID = groupID;
10835
10836 createGroupReply.ReplyData.Success = success;
10837 createGroupReply.ReplyData.Message = Utils.StringToBytes(message);
10838 OutPacket(createGroupReply, ThrottleOutPacketType.Task);
10839 }
10840
10841 public void SendUseCachedMuteList()
10842 {
10843 UseCachedMuteListPacket useCachedMuteList = (UseCachedMuteListPacket)PacketPool.Instance.GetPacket(PacketType.UseCachedMuteList);
10844
10845 useCachedMuteList.AgentData = new UseCachedMuteListPacket.AgentDataBlock();
10846 useCachedMuteList.AgentData.AgentID = AgentId;
10847
10848 OutPacket(useCachedMuteList, ThrottleOutPacketType.Task);
10849 }
10850
10851 public void SendMuteListUpdate(string filename)
10852 {
10853 MuteListUpdatePacket muteListUpdate = (MuteListUpdatePacket)PacketPool.Instance.GetPacket(PacketType.MuteListUpdate);
10854
10855 muteListUpdate.MuteData = new MuteListUpdatePacket.MuteDataBlock();
10856 muteListUpdate.MuteData.AgentID = AgentId;
10857 muteListUpdate.MuteData.Filename = Utils.StringToBytes(filename);
10858
10859 OutPacket(muteListUpdate, ThrottleOutPacketType.Task);
10860 }
10861
10862 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)
10863 {
10864 PickInfoReplyPacket pickInfoReply = (PickInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.PickInfoReply);
10865
10866 pickInfoReply.AgentData = new PickInfoReplyPacket.AgentDataBlock();
10867 pickInfoReply.AgentData.AgentID = AgentId;
10868
10869 pickInfoReply.Data = new PickInfoReplyPacket.DataBlock();
10870 pickInfoReply.Data.PickID = pickID;
10871 pickInfoReply.Data.CreatorID = creatorID;
10872 pickInfoReply.Data.TopPick = topPick;
10873 pickInfoReply.Data.ParcelID = parcelID;
10874 pickInfoReply.Data.Name = Utils.StringToBytes(name);
10875 pickInfoReply.Data.Desc = Utils.StringToBytes(desc);
10876 pickInfoReply.Data.SnapshotID = snapshotID;
10877 pickInfoReply.Data.User = Utils.StringToBytes(user);
10878 pickInfoReply.Data.OriginalName = Utils.StringToBytes(originalName);
10879 pickInfoReply.Data.SimName = Utils.StringToBytes(simName);
10880 pickInfoReply.Data.PosGlobal = new Vector3d(posGlobal);
10881 pickInfoReply.Data.SortOrder = sortOrder;
10882 pickInfoReply.Data.Enabled = enabled;
10883
10884 OutPacket(pickInfoReply, ThrottleOutPacketType.Task);
10885 }
10886
10887 public string Report() 10323 public string Report()
10888 { 10324 {
10889 LLPacketHandler handler = (LLPacketHandler) m_PacketHandler; 10325 return m_udpClient.GetStats();
10890 return handler.PacketQueue.GetStats();
10891 } 10326 }
10892 10327
10893 public string XReport(string uptime, string version) 10328 public string XReport(string uptime, string version)
10894 { 10329 {
10895 return ""; 10330 return String.Empty;
10896 } 10331 }
10897 10332
10898 public void MakeAssetRequest(TransferRequestPacket transferRequest) 10333 public void MakeAssetRequest(TransferRequestPacket transferRequest)
@@ -10981,7 +10416,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10981 return numPackets; 10416 return numPackets;
10982 } 10417 }
10983 10418
10984
10985 #region IClientIPEndpoint Members 10419 #region IClientIPEndpoint Members
10986 10420
10987 public IPAddress EndPoint 10421 public IPAddress EndPoint