aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs3230
1 files changed, 1898 insertions, 1332 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 84e705a..0052729 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -58,180 +58,526 @@ 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
67 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 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
69 62
70 private readonly LLUDPServer m_udpServer; 63 /* static variables */
71 private readonly LLUDPClient m_udpClient; 64 public static SynchronizeClientHandler SynchronizeClient;
65 /* private variables */
72 private readonly UUID m_sessionId; 66 private readonly UUID m_sessionId;
73 private readonly UUID m_secureSessionId; 67 private readonly UUID m_secureSessionId = UUID.Zero;
74 private readonly UUID m_agentId;
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;
79 68
69 private int m_debugPacketLevel;
70
71 //private readonly IAssetCache m_assetCache;
80 private int m_cachedTextureSerial; 72 private int m_cachedTextureSerial;
73 private Timer m_clientPingTimer;
74
81 private Timer m_avatarTerseUpdateTimer; 75 private Timer m_avatarTerseUpdateTimer;
82 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); 76 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
77
83 private Timer m_primTerseUpdateTimer; 78 private Timer m_primTerseUpdateTimer;
84 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(); 79 private List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates = new List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
85 private Timer m_primFullUpdateTimer; 80 private Timer m_primFullUpdateTimer;
86 private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = new List<ObjectUpdatePacket.ObjectDataBlock>(); 81 private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates =
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;
87 private int m_moneyBalance; 90 private int m_moneyBalance;
91 private readonly ILLPacketHandler m_PacketHandler;
92
88 private int m_animationSequenceNumber = 1; 93 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
89 private bool m_SendLogoutPacketWhenClosing = true; 99 private bool m_SendLogoutPacketWhenClosing = true;
90 private AgentUpdateArgs lastarg; 100
91 private bool m_IsActive = true; 101 private int m_inPacketsChecked;
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
92 111
93 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); 112 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>();
94 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers 113 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
114
95 protected IScene m_scene; 115 protected IScene m_scene;
116
117 protected LLPacketServer m_networkServer;
118
96 protected LLImageManager m_imageManager; 119 protected LLImageManager m_imageManager;
120
121 /* public variables */
97 protected string m_firstName; 122 protected string m_firstName;
98 protected string m_lastName; 123 protected string m_lastName;
99 protected Thread m_clientThread; 124 protected Thread m_clientThread;
100 protected Vector3 m_startpos; 125 protected Vector3 m_startpos;
101 protected EndPoint m_userEndPoint; 126 protected EndPoint m_userEndPoint;
127 protected EndPoint m_proxyEndPoint;
102 protected UUID m_activeGroupID = UUID.Zero; 128 protected UUID m_activeGroupID = UUID.Zero;
103 protected string m_activeGroupName = String.Empty; 129 protected string m_activeGroupName = String.Empty;
104 protected ulong m_activeGroupPowers; 130 protected ulong m_activeGroupPowers;
105 protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>(); 131 protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>();
106 protected int m_terrainCheckerCount; 132 protected int m_avatarTerseUpdateRate = 50;
133 protected int m_avatarTerseUpdatesPerPacket = 5;
107 134
108 // LL uses these limits, apparently. Compressed terse would be 23, but we don't have that yet 135 // LL uses these limits, apparently. Compressed terse would be
136 // 23, but we don't have that yet
137 //
109 protected int m_primTerseUpdatesPerPacket = 10; 138 protected int m_primTerseUpdatesPerPacket = 10;
110 protected int m_primFullUpdatesPerPacket = 14; 139 protected int m_primFullUpdatesPerPacket = 14;
140
111 protected int m_primTerseUpdateRate = 10; 141 protected int m_primTerseUpdateRate = 10;
112 protected int m_primFullUpdateRate = 14; 142 protected int m_primFullUpdateRate = 14;
143
113 protected int m_textureSendLimit = 20; 144 protected int m_textureSendLimit = 20;
114 protected int m_textureDataLimit = 10; 145 protected int m_textureDataLimit = 10;
115 protected int m_avatarTerseUpdateRate = 50; 146
116 protected int m_avatarTerseUpdatesPerPacket = 5;
117 protected int m_packetMTU = 1400; 147 protected int m_packetMTU = 1400;
148
118 protected IAssetService m_assetService; 149 protected IAssetService m_assetService;
119 150
120 #region Properties 151 // LLClientView Only
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 }
121 375
122 public UUID SecureSessionId { get { return m_secureSessionId; } }
123 public IScene Scene { get { return m_scene; } }
124 public UUID SessionId { get { return m_sessionId; } }
125 public Vector3 StartPos 376 public Vector3 StartPos
126 { 377 {
127 get { return m_startpos; } 378 get { return m_startpos; }
128 set { m_startpos = value; } 379 set { m_startpos = value; }
129 } 380 }
130 public UUID AgentId { get { return m_agentId; } } 381
131 public UUID ActiveGroupId { get { return m_activeGroupID; } } 382 public UUID AgentId
132 public string ActiveGroupName { get { return m_activeGroupName; } } 383 {
133 public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } } 384 get { return m_agentId; }
134 public bool IsGroupMember(UUID groupID) { return m_groupPowers.ContainsKey(groupID); } 385 }
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
135 /// <summary> 426 /// <summary>
136 /// First name of the agent/avatar represented by the client 427 /// First name of the agent/avatar represented by the client
137 /// </summary> 428 /// </summary>
138 public string FirstName { get { return m_firstName; } } 429 public string FirstName
430 {
431 get { return m_firstName; }
432 }
433
139 /// <summary> 434 /// <summary>
140 /// Last name of the agent/avatar represented by the client 435 /// Last name of the agent/avatar represented by the client
141 /// </summary> 436 /// </summary>
142 public string LastName { get { return m_lastName; } } 437 public string LastName
438 {
439 get { return m_lastName; }
440 }
441
143 /// <summary> 442 /// <summary>
144 /// Full name of the client (first name and last name) 443 /// Full name of the client (first name and last name)
145 /// </summary> 444 /// </summary>
146 public string Name { get { return FirstName + " " + LastName; } } 445 public string Name
147 public uint CircuitCode { get { return m_circuitCode; } } 446 {
148 public int MoneyBalance { get { return m_moneyBalance; } } 447 get { return FirstName + " " + LastName; }
149 public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } 448 }
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
150 public bool IsActive 472 public bool IsActive
151 { 473 {
152 get { return m_IsActive; } 474 get { return m_IsActive; }
153 set { m_IsActive = value; } 475 set { m_IsActive = value; }
154 } 476 }
155 public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } }
156 477
157 #endregion Properties 478 public bool SendLogoutPacketWhenClosing
479 {
480 set { m_SendLogoutPacketWhenClosing = value; }
481 }
482
483 /* METHODS */
158 484
159 /// <summary> 485 /// <summary>
160 /// Constructor 486 /// Constructor
161 /// </summary> 487 /// </summary>
162 public LLClientView(EndPoint remoteEP, IScene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, 488 public LLClientView(
163 UUID agentId, UUID sessionId, uint circuitCode) 489 EndPoint remoteEP, IScene scene, LLPacketServer packServer,
490 AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP,
491 ClientStackUserSettings userSettings)
164 { 492 {
165 RegisterInterface<IClientIM>(this); 493 // Should be called first?
166 RegisterInterface<IClientChat>(this); 494 RegisterInterfaces();
167 RegisterInterface<IClientIPEndpoint>(this); 495
168 496 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
497 m_moneyBalance = 1000;
498
499 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion());
500
169 InitDefaultAnimations(); 501 InitDefaultAnimations();
170 502
171 m_scene = scene; 503 m_scene = scene;
504 //m_assetCache = assetCache;
505
172 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 506 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
173 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 507
174 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); 508 m_networkServer = packServer;
175 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion()); 509
176 m_agentId = agentId; 510 m_agentId = agentId;
177 m_sessionId = sessionId; 511 m_sessionId = sessionId;
178 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
179 m_circuitCode = circuitCode; 512 m_circuitCode = circuitCode;
513
180 m_userEndPoint = remoteEP; 514 m_userEndPoint = remoteEP;
515 m_proxyEndPoint = proxyEP;
516
181 m_firstName = sessionInfo.LoginInfo.First; 517 m_firstName = sessionInfo.LoginInfo.First;
182 m_lastName = sessionInfo.LoginInfo.Last; 518 m_lastName = sessionInfo.LoginInfo.Last;
183 m_startpos = sessionInfo.LoginInfo.StartPos; 519 m_startpos = sessionInfo.LoginInfo.StartPos;
184 m_moneyBalance = 1000;
185 520
186 m_udpServer = udpServer; 521 if (sessionInfo.LoginInfo.SecureSession != UUID.Zero)
187 m_udpClient = udpClient; 522 {
188 m_udpClient.OnQueueEmpty += HandleQueueEmpty; 523 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
189 m_udpClient.OnPacketStats += PopulateStats; 524 }
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 }
190 565
191 RegisterLocalPacketHandlers(); 566 RegisterLocalPacketHandlers();
567 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
192 } 568 }
193 569
194 public void SetDebugPacketLevel(int newDebug) 570 public void SetDebugPacketLevel(int newDebugPacketLevel)
195 { 571 {
572 m_debugPacketLevel = newDebugPacketLevel;
196 } 573 }
197 574
198 #region Client Methods 575 # region Client Methods
199
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)
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);
210
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 576
233 private void CloseCleanup(bool shutdownCircuit) 577 private void CloseCleanup(bool shutdownCircuit)
234 { 578 {
579
580
235 m_scene.RemoveClient(AgentId); 581 m_scene.RemoveClient(AgentId);
236 582
237 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 583 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
@@ -244,6 +590,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
244 Thread.Sleep(2000); 590 Thread.Sleep(2000);
245 591
246 // Shut down timers. Thread Context of this method is murky. Lock all timers 592 // 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();
247 if (m_avatarTerseUpdateTimer.Enabled) 596 if (m_avatarTerseUpdateTimer.Enabled)
248 lock (m_avatarTerseUpdateTimer) 597 lock (m_avatarTerseUpdateTimer)
249 m_avatarTerseUpdateTimer.Stop(); 598 m_avatarTerseUpdateTimer.Stop();
@@ -276,21 +625,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP
276 // of the client thread regardless of where Close() is called. 625 // of the client thread regardless of where Close() is called.
277 KillEndDone(); 626 KillEndDone();
278 } 627 }
628
629 Terminate();
630 }
279 631
280 IsActive = false; 632 /// <summary>
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;
281 640
282 m_avatarTerseUpdateTimer.Close(); 641 m_log.DebugFormat(
283 m_primTerseUpdateTimer.Close(); 642 "[CLIENT]: Close has been called with shutdownCircuit = {0} for {1} attached to scene {2}",
284 m_primFullUpdateTimer.Close(); 643 shutdownCircuit, Name, m_scene.RegionInfo.RegionName);
285 644
286 //m_udpServer.OnPacketStats -= PopulateStats; 645 if (m_imageManager != null)
287 m_udpClient.Shutdown(); 646 m_imageManager.Close();
288 647
289 // wait for thread stoped 648 if (m_PacketHandler != null)
290 // m_clientThread.Join(); 649 m_PacketHandler.Flush();
291 650
292 // delete circuit code 651 // raise an event on the packet server to Shutdown the circuit
293 //m_networkServer.CloseClient(this); 652 // Now, if we raise the event then the packet server will call this method itself, so don't try cleanup
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 }
294 } 665 }
295 666
296 public void Kick(string message) 667 public void Kick(string message)
@@ -312,6 +683,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
312 public void Stop() 683 public void Stop()
313 { 684 {
314 // Shut down timers. Thread Context is Murky, lock all timers! 685 // Shut down timers. Thread Context is Murky, lock all timers!
686 if (m_clientPingTimer.Enabled)
687 lock (m_clientPingTimer)
688 m_clientPingTimer.Stop();
689
315 if (m_avatarTerseUpdateTimer.Enabled) 690 if (m_avatarTerseUpdateTimer.Enabled)
316 lock (m_avatarTerseUpdateTimer) 691 lock (m_avatarTerseUpdateTimer)
317 m_avatarTerseUpdateTimer.Stop(); 692 m_avatarTerseUpdateTimer.Stop();
@@ -325,13 +700,54 @@ namespace OpenSim.Region.ClientStack.LindenUDP
325 m_primFullUpdateTimer.Stop(); 700 m_primFullUpdateTimer.Stop();
326 } 701 }
327 702
328 #endregion Client Methods 703 public void Restart()
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
329 745
330 #region Packet Handling 746 # region Packet Handling
331 747
332 public void PopulateStats(int inPackets, int outPackets, int unAckedBytes) 748 public void PopulateStats(int inPackets, int outPackets, int unAckedBytes)
333 { 749 {
334 NetworkStats handlerNetworkStatsUpdate = OnNetworkStatsUpdate; 750 handlerNetworkStatsUpdate = OnNetworkStatsUpdate;
335 if (handlerNetworkStatsUpdate != null) 751 if (handlerNetworkStatsUpdate != null)
336 { 752 {
337 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes); 753 handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes);
@@ -412,7 +828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
412 return result; 828 return result;
413 } 829 }
414 830
415 /*protected void DebugPacket(string direction, Packet packet) 831 protected void DebugPacket(string direction, Packet packet)
416 { 832 {
417 string info; 833 string info;
418 834
@@ -438,9 +854,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP
438 } 854 }
439 855
440 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info); 856 Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
441 }*/ 857 }
442 858
443 #endregion Packet Handling 859 /// <summary>
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 }
444 939
445 # region Setup 940 # region Setup
446 941
@@ -450,6 +945,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
450 /// </summary> 945 /// </summary>
451 protected virtual void InitNewClient() 946 protected virtual void InitNewClient()
452 { 947 {
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
453 m_avatarTerseUpdateTimer = new Timer(m_avatarTerseUpdateRate); 955 m_avatarTerseUpdateTimer = new Timer(m_avatarTerseUpdateRate);
454 m_avatarTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessAvatarTerseUpdates); 956 m_avatarTerseUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessAvatarTerseUpdates);
455 m_avatarTerseUpdateTimer.AutoReset = false; 957 m_avatarTerseUpdateTimer.AutoReset = false;
@@ -469,18 +971,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
469 971
470 public virtual void Start() 972 public virtual void Start()
471 { 973 {
472 // This sets up all the timers 974 m_clientThread = new Thread(RunUserSession);
473 InitNewClient(); 975 m_clientThread.Name = "ClientThread";
976 m_clientThread.IsBackground = true;
977 m_clientThread.Start();
978 ThreadTracker.Add(m_clientThread);
474 } 979 }
475 980
476 /// <summary> 981 /// <summary>
477 /// Run a user session. This method lies at the base of the entire client thread. 982 /// Run a user session. This method lies at the base of the entire client thread.
478 /// </summary> 983 /// </summary>
479 protected void RunUserSession() 984 protected virtual void RunUserSession()
480 { 985 {
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
481 try 990 try
482 { 991 {
483 992 // This sets up all the timers
993 InitNewClient();
994 ClientLoop();
484 } 995 }
485 catch (Exception e) 996 catch (Exception e)
486 { 997 {
@@ -504,7 +1015,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
504 + "Any further actions taken will not be processed.\n" 1015 + "Any further actions taken will not be processed.\n"
505 + "Please relog", true); 1016 + "Please relog", true);
506 1017
507 m_udpServer.SendPacket(m_agentId, packet, ThrottleOutPacketType.Unknown, false); 1018 LLQueItem item = new LLQueItem();
1019 item.Packet = packet;
1020 item.Sequence = packet.Header.Sequence;
1021
1022 m_PacketHandler.ProcessOutPacket(item);
508 1023
509 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to 1024 // There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to
510 // listeners yet, though. 1025 // listeners yet, though.
@@ -522,8 +1037,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
522 1037
523 # endregion 1038 # endregion
524 1039
525 #region Events 1040 // Previously ClientView.API partial class
526
527 public event GenericMessage OnGenericMessage; 1041 public event GenericMessage OnGenericMessage;
528 public event BinaryGenericMessage OnBinaryGenericMessage; 1042 public event BinaryGenericMessage OnBinaryGenericMessage;
529 public event Action<IClientAPI> OnLogout; 1043 public event Action<IClientAPI> OnLogout;
@@ -683,10 +1197,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
683 public event GetScriptRunning OnGetScriptRunning; 1197 public event GetScriptRunning OnGetScriptRunning;
684 public event SetScriptRunning OnSetScriptRunning; 1198 public event SetScriptRunning OnSetScriptRunning;
685 public event UpdateVector OnAutoPilotGo; 1199 public event UpdateVector OnAutoPilotGo;
1200
686 public event TerrainUnacked OnUnackedTerrain; 1201 public event TerrainUnacked OnUnackedTerrain;
1202
687 public event ActivateGesture OnActivateGesture; 1203 public event ActivateGesture OnActivateGesture;
688 public event DeactivateGesture OnDeactivateGesture; 1204 public event DeactivateGesture OnDeactivateGesture;
689 public event ObjectOwner OnObjectOwner; 1205 public event ObjectOwner OnObjectOwner;
1206
690 public event DirPlacesQuery OnDirPlacesQuery; 1207 public event DirPlacesQuery OnDirPlacesQuery;
691 public event DirFindQuery OnDirFindQuery; 1208 public event DirFindQuery OnDirFindQuery;
692 public event DirLandQuery OnDirLandQuery; 1209 public event DirLandQuery OnDirLandQuery;
@@ -694,34 +1211,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP
694 public event DirClassifiedQuery OnDirClassifiedQuery; 1211 public event DirClassifiedQuery OnDirClassifiedQuery;
695 public event EventInfoRequest OnEventInfoRequest; 1212 public event EventInfoRequest OnEventInfoRequest;
696 public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime; 1213 public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime;
1214
697 public event MapItemRequest OnMapItemRequest; 1215 public event MapItemRequest OnMapItemRequest;
1216
698 public event OfferCallingCard OnOfferCallingCard; 1217 public event OfferCallingCard OnOfferCallingCard;
699 public event AcceptCallingCard OnAcceptCallingCard; 1218 public event AcceptCallingCard OnAcceptCallingCard;
700 public event DeclineCallingCard OnDeclineCallingCard; 1219 public event DeclineCallingCard OnDeclineCallingCard;
701 public event SoundTrigger OnSoundTrigger; 1220 public event SoundTrigger OnSoundTrigger;
1221
702 public event StartLure OnStartLure; 1222 public event StartLure OnStartLure;
703 public event TeleportLureRequest OnTeleportLureRequest; 1223 public event TeleportLureRequest OnTeleportLureRequest;
704 public event NetworkStats OnNetworkStatsUpdate; 1224 public event NetworkStats OnNetworkStatsUpdate;
1225
705 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 1226 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
706 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 1227 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
707 public event ClassifiedDelete OnClassifiedDelete; 1228 public event ClassifiedDelete OnClassifiedDelete;
708 public event ClassifiedDelete OnClassifiedGodDelete; 1229 public event ClassifiedDelete OnClassifiedGodDelete;
1230
709 public event EventNotificationAddRequest OnEventNotificationAddRequest; 1231 public event EventNotificationAddRequest OnEventNotificationAddRequest;
710 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 1232 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
711 public event EventGodDelete OnEventGodDelete; 1233 public event EventGodDelete OnEventGodDelete;
1234
712 public event ParcelDwellRequest OnParcelDwellRequest; 1235 public event ParcelDwellRequest OnParcelDwellRequest;
1236
713 public event UserInfoRequest OnUserInfoRequest; 1237 public event UserInfoRequest OnUserInfoRequest;
714 public event UpdateUserInfo OnUpdateUserInfo; 1238 public event UpdateUserInfo OnUpdateUserInfo;
1239
715 public event RetrieveInstantMessages OnRetrieveInstantMessages; 1240 public event RetrieveInstantMessages OnRetrieveInstantMessages;
1241
716 public event PickDelete OnPickDelete; 1242 public event PickDelete OnPickDelete;
717 public event PickGodDelete OnPickGodDelete; 1243 public event PickGodDelete OnPickGodDelete;
718 public event PickInfoUpdate OnPickInfoUpdate; 1244 public event PickInfoUpdate OnPickInfoUpdate;
719 public event AvatarNotesUpdate OnAvatarNotesUpdate; 1245 public event AvatarNotesUpdate OnAvatarNotesUpdate;
1246
720 public event MuteListRequest OnMuteListRequest; 1247 public event MuteListRequest OnMuteListRequest;
721 public event AvatarInterestUpdate OnAvatarInterestUpdate;
722 public event PlacesQuery OnPlacesQuery;
723 1248
724 #endregion Events 1249 //public event AvatarInterestUpdate OnAvatarInterestUpdate;
1250
1251 public event PlacesQuery OnPlacesQuery;
725 1252
726 public void ActivateGesture(UUID assetId, UUID gestureId) 1253 public void ActivateGesture(UUID assetId, UUID gestureId)
727 { 1254 {
@@ -1323,13 +1850,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1323 public void SendStartPingCheck(byte seq) 1850 public void SendStartPingCheck(byte seq)
1324 { 1851 {
1325 StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck); 1852 StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck);
1326 pc.Header.Reliable = false;
1327
1328 OutgoingPacket oldestPacket = m_udpClient.NeedAcks.GetOldest();
1329
1330 pc.PingID.PingID = seq; 1853 pc.PingID.PingID = seq;
1331 pc.PingID.OldestUnacked = (oldestPacket != null) ? oldestPacket.SequenceNumber : 0; 1854 pc.Header.Reliable = false;
1332
1333 OutPacket(pc, ThrottleOutPacketType.Unknown); 1855 OutPacket(pc, ThrottleOutPacketType.Unknown);
1334 } 1856 }
1335 1857
@@ -1405,12 +1927,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1405 descend.ItemData[i].AssetID = item.AssetID; 1927 descend.ItemData[i].AssetID = item.AssetID;
1406 descend.ItemData[i].CreatorID = item.CreatorIdAsUuid; 1928 descend.ItemData[i].CreatorID = item.CreatorIdAsUuid;
1407 descend.ItemData[i].BaseMask = item.BasePermissions; 1929 descend.ItemData[i].BaseMask = item.BasePermissions;
1408 descend.ItemData[i].Description = Util.StringToBytes256(item.Description); 1930 descend.ItemData[i].Description = LLUtil.StringToPacketBytes(item.Description);
1409 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions; 1931 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
1410 descend.ItemData[i].OwnerMask = item.CurrentPermissions; 1932 descend.ItemData[i].OwnerMask = item.CurrentPermissions;
1411 descend.ItemData[i].FolderID = item.Folder; 1933 descend.ItemData[i].FolderID = item.Folder;
1412 descend.ItemData[i].InvType = (sbyte)item.InvType; 1934 descend.ItemData[i].InvType = (sbyte)item.InvType;
1413 descend.ItemData[i].Name = Util.StringToBytes256(item.Name); 1935 descend.ItemData[i].Name = LLUtil.StringToPacketBytes(item.Name);
1414 descend.ItemData[i].NextOwnerMask = item.NextPermissions; 1936 descend.ItemData[i].NextOwnerMask = item.NextPermissions;
1415 descend.ItemData[i].OwnerID = item.Owner; 1937 descend.ItemData[i].OwnerID = item.Owner;
1416 descend.ItemData[i].Type = (sbyte)item.AssetType; 1938 descend.ItemData[i].Type = (sbyte)item.AssetType;
@@ -1491,7 +2013,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1491 { 2013 {
1492 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); 2014 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
1493 descend.FolderData[i].FolderID = folder.ID; 2015 descend.FolderData[i].FolderID = folder.ID;
1494 descend.FolderData[i].Name = Util.StringToBytes256(folder.Name); 2016 descend.FolderData[i].Name = LLUtil.StringToPacketBytes(folder.Name);
1495 descend.FolderData[i].ParentID = folder.ParentID; 2017 descend.FolderData[i].ParentID = folder.ParentID;
1496 descend.FolderData[i].Type = (sbyte)folder.Type; 2018 descend.FolderData[i].Type = (sbyte)folder.Type;
1497 2019
@@ -1606,11 +2128,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1606 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions; 2128 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
1607 inventoryReply.InventoryData[0].CreationDate = item.CreationDate; 2129 inventoryReply.InventoryData[0].CreationDate = item.CreationDate;
1608 2130
1609 inventoryReply.InventoryData[0].Description = Util.StringToBytes256(item.Description); 2131 inventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(item.Description);
1610 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions; 2132 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions;
1611 inventoryReply.InventoryData[0].FolderID = item.Folder; 2133 inventoryReply.InventoryData[0].FolderID = item.Folder;
1612 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType; 2134 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType;
1613 inventoryReply.InventoryData[0].Name = Util.StringToBytes256(item.Name); 2135 inventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(item.Name);
1614 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions; 2136 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions;
1615 inventoryReply.InventoryData[0].OwnerID = item.Owner; 2137 inventoryReply.InventoryData[0].OwnerID = item.Owner;
1616 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions; 2138 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions;
@@ -1735,7 +2257,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1735 folderBlock.FolderID = folder.ID; 2257 folderBlock.FolderID = folder.ID;
1736 folderBlock.ParentID = folder.ParentID; 2258 folderBlock.ParentID = folder.ParentID;
1737 folderBlock.Type = -1; 2259 folderBlock.Type = -1;
1738 folderBlock.Name = Util.StringToBytes256(folder.Name); 2260 folderBlock.Name = LLUtil.StringToPacketBytes(folder.Name);
1739 2261
1740 return folderBlock; 2262 return folderBlock;
1741 } 2263 }
@@ -1753,11 +2275,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1753 itemBlock.AssetID = item.AssetID; 2275 itemBlock.AssetID = item.AssetID;
1754 itemBlock.CreatorID = item.CreatorIdAsUuid; 2276 itemBlock.CreatorID = item.CreatorIdAsUuid;
1755 itemBlock.BaseMask = item.BasePermissions; 2277 itemBlock.BaseMask = item.BasePermissions;
1756 itemBlock.Description = Util.StringToBytes256(item.Description); 2278 itemBlock.Description = LLUtil.StringToPacketBytes(item.Description);
1757 itemBlock.EveryoneMask = item.EveryOnePermissions; 2279 itemBlock.EveryoneMask = item.EveryOnePermissions;
1758 itemBlock.FolderID = item.Folder; 2280 itemBlock.FolderID = item.Folder;
1759 itemBlock.InvType = (sbyte)item.InvType; 2281 itemBlock.InvType = (sbyte)item.InvType;
1760 itemBlock.Name = Util.StringToBytes256(item.Name); 2282 itemBlock.Name = LLUtil.StringToPacketBytes(item.Name);
1761 itemBlock.NextOwnerMask = item.NextPermissions; 2283 itemBlock.NextOwnerMask = item.NextPermissions;
1762 itemBlock.OwnerID = item.Owner; 2284 itemBlock.OwnerID = item.Owner;
1763 itemBlock.OwnerMask = item.CurrentPermissions; 2285 itemBlock.OwnerMask = item.CurrentPermissions;
@@ -1817,11 +2339,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1817 bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid; 2339 bulkUpdate.ItemData[0].CreatorID = item.CreatorIdAsUuid;
1818 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions; 2340 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
1819 bulkUpdate.ItemData[0].CreationDate = item.CreationDate; 2341 bulkUpdate.ItemData[0].CreationDate = item.CreationDate;
1820 bulkUpdate.ItemData[0].Description = Util.StringToBytes256(item.Description); 2342 bulkUpdate.ItemData[0].Description = LLUtil.StringToPacketBytes(item.Description);
1821 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions; 2343 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions;
1822 bulkUpdate.ItemData[0].FolderID = item.Folder; 2344 bulkUpdate.ItemData[0].FolderID = item.Folder;
1823 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType; 2345 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType;
1824 bulkUpdate.ItemData[0].Name = Util.StringToBytes256(item.Name); 2346 bulkUpdate.ItemData[0].Name = LLUtil.StringToPacketBytes(item.Name);
1825 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions; 2347 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions;
1826 bulkUpdate.ItemData[0].OwnerID = item.Owner; 2348 bulkUpdate.ItemData[0].OwnerID = item.Owner;
1827 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions; 2349 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions;
@@ -1864,11 +2386,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1864 InventoryReply.InventoryData[0].AssetID = Item.AssetID; 2386 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
1865 InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid; 2387 InventoryReply.InventoryData[0].CreatorID = Item.CreatorIdAsUuid;
1866 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions; 2388 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
1867 InventoryReply.InventoryData[0].Description = Util.StringToBytes256(Item.Description); 2389 InventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(Item.Description);
1868 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions; 2390 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
1869 InventoryReply.InventoryData[0].FolderID = Item.Folder; 2391 InventoryReply.InventoryData[0].FolderID = Item.Folder;
1870 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType; 2392 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType;
1871 InventoryReply.InventoryData[0].Name = Util.StringToBytes256(Item.Name); 2393 InventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(Item.Name);
1872 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions; 2394 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions;
1873 InventoryReply.InventoryData[0].OwnerID = Item.Owner; 2395 InventoryReply.InventoryData[0].OwnerID = Item.Owner;
1874 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions; 2396 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions;
@@ -2035,7 +2557,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2035 /// <param name="message"></param> 2557 /// <param name="message"></param>
2036 /// <param name="modal"></param> 2558 /// <param name="modal"></param>
2037 /// <returns></returns> 2559 /// <returns></returns>
2038 public AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal) 2560 protected AgentAlertMessagePacket BuildAgentAlertPacket(string message, bool modal)
2039 { 2561 {
2040 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); 2562 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage);
2041 alertPack.AgentData.AgentID = AgentId; 2563 alertPack.AgentData.AgentID = AgentId;
@@ -2246,953 +2768,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2246 OutPacket(avatarReply, ThrottleOutPacketType.Task); 2768 OutPacket(avatarReply, ThrottleOutPacketType.Task);
2247 } 2769 }
2248 2770
2249 /// <summary> 2771 #endregion
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
3196 2772
3197 // Gesture 2773 // Gesture
3198 2774
@@ -3488,7 +3064,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3488 objectData.FullID = objectID; 3064 objectData.FullID = objectID;
3489 objectData.OwnerID = ownerID; 3065 objectData.OwnerID = ownerID;
3490 3066
3491 objectData.Text = Util.StringToBytes256(text); 3067 objectData.Text = LLUtil.StringToPacketBytes(text);
3492 objectData.TextColor[0] = color[0]; 3068 objectData.TextColor[0] = color[0];
3493 objectData.TextColor[1] = color[1]; 3069 objectData.TextColor[1] = color[1];
3494 objectData.TextColor[2] = color[2]; 3070 objectData.TextColor[2] = color[2];
@@ -3625,7 +3201,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3625 } 3201 }
3626 3202
3627 outPacket.Header.Zerocoded = true; 3203 outPacket.Header.Zerocoded = true;
3628 OutPacket(outPacket, ThrottleOutPacketType.Task); 3204 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
3629 3205
3630 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled) 3206 if (m_primFullUpdates.Count == 0 && m_primFullUpdateTimer.Enabled)
3631 lock (m_primFullUpdateTimer) 3207 lock (m_primFullUpdateTimer)
@@ -3715,7 +3291,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3715 3291
3716 outPacket.Header.Reliable = false; 3292 outPacket.Header.Reliable = false;
3717 outPacket.Header.Zerocoded = true; 3293 outPacket.Header.Zerocoded = true;
3718 OutPacket(outPacket, ThrottleOutPacketType.Task); 3294 OutPacket(outPacket, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
3719 3295
3720 if (m_primTerseUpdates.Count == 0) 3296 if (m_primTerseUpdates.Count == 0)
3721 lock (m_primTerseUpdateTimer) 3297 lock (m_primTerseUpdateTimer)
@@ -3866,8 +3442,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3866 objPropDB.SalePrice = SalePrice; 3442 objPropDB.SalePrice = SalePrice;
3867 objPropDB.Category = Category; 3443 objPropDB.Category = Category;
3868 objPropDB.LastOwnerID = LastOwnerID; 3444 objPropDB.LastOwnerID = LastOwnerID;
3869 objPropDB.Name = Util.StringToBytes256(ObjectName); 3445 objPropDB.Name = LLUtil.StringToPacketBytes(ObjectName);
3870 objPropDB.Description = Util.StringToBytes256(Description); 3446 objPropDB.Description = LLUtil.StringToPacketBytes(Description);
3871 objPropFamilyPack.ObjectData = objPropDB; 3447 objPropFamilyPack.ObjectData = objPropDB;
3872 objPropFamilyPack.Header.Zerocoded = true; 3448 objPropFamilyPack.Header.Zerocoded = true;
3873 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task); 3449 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
@@ -3901,11 +3477,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3901 proper.ObjectData[0].OwnerID = UUID.Zero; 3477 proper.ObjectData[0].OwnerID = UUID.Zero;
3902 else 3478 else
3903 proper.ObjectData[0].OwnerID = OwnerUUID; 3479 proper.ObjectData[0].OwnerID = OwnerUUID;
3904 proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle); 3480 proper.ObjectData[0].TouchName = LLUtil.StringToPacketBytes(TouchTitle);
3905 proper.ObjectData[0].TextureID = TextureID; 3481 proper.ObjectData[0].TextureID = TextureID;
3906 proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle); 3482 proper.ObjectData[0].SitName = LLUtil.StringToPacketBytes(SitTitle);
3907 proper.ObjectData[0].Name = Util.StringToBytes256(ItemName); 3483 proper.ObjectData[0].Name = LLUtil.StringToPacketBytes(ItemName);
3908 proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription); 3484 proper.ObjectData[0].Description = LLUtil.StringToPacketBytes(ItemDescription);
3909 proper.ObjectData[0].OwnerMask = OwnerMask; 3485 proper.ObjectData[0].OwnerMask = OwnerMask;
3910 proper.ObjectData[0].NextOwnerMask = NextOwnerMask; 3486 proper.ObjectData[0].NextOwnerMask = NextOwnerMask;
3911 proper.ObjectData[0].GroupMask = GroupMask; 3487 proper.ObjectData[0].GroupMask = GroupMask;
@@ -4146,11 +3722,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4146 3722
4147 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; 3723 updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale;
4148 updatePacket.ParcelData.MediaID = landData.MediaID; 3724 updatePacket.ParcelData.MediaID = landData.MediaID;
4149 updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); 3725 updatePacket.ParcelData.MediaURL = LLUtil.StringToPacketBytes(landData.MediaURL);
4150 updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); 3726 updatePacket.ParcelData.MusicURL = LLUtil.StringToPacketBytes(landData.MusicURL);
4151 updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); 3727 updatePacket.ParcelData.Name = Utils.StringToBytes(landData.Name);
4152 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; 3728 updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime;
4153 updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented 3729 updatePacket.ParcelData.OtherCount = 0; //unemplemented
4154 updatePacket.ParcelData.OtherPrims = landData.OtherPrims; 3730 updatePacket.ParcelData.OtherPrims = landData.OtherPrims;
4155 updatePacket.ParcelData.OwnerID = landData.OwnerID; 3731 updatePacket.ParcelData.OwnerID = landData.OwnerID;
4156 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; 3732 updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims;
@@ -4158,18 +3734,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4158 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; 3734 updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor;
4159 updatePacket.ParcelData.PassHours = landData.PassHours; 3735 updatePacket.ParcelData.PassHours = landData.PassHours;
4160 updatePacket.ParcelData.PassPrice = landData.PassPrice; 3736 updatePacket.ParcelData.PassPrice = landData.PassPrice;
4161 updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented 3737 updatePacket.ParcelData.PublicCount = 0; //unemplemented
4162 3738
4163 updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; 3739 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)RegionFlags.DenyAnonymous) >
4164 updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; 3740 0);
4165 updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; 3741 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)RegionFlags.DenyIdentified) >
4166 updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; 3742 0);
3743 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)RegionFlags.DenyTransacted) >
3744 0);
3745 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)RegionFlags.RestrictPushObject) >
3746 0);
4167 3747
4168 updatePacket.ParcelData.RentPrice = 0; 3748 updatePacket.ParcelData.RentPrice = 0;
4169 updatePacket.ParcelData.RequestResult = request_result; 3749 updatePacket.ParcelData.RequestResult = request_result;
4170 updatePacket.ParcelData.SalePrice = landData.SalePrice; 3750 updatePacket.ParcelData.SalePrice = landData.SalePrice;
4171 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; 3751 updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims;
4172 updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented 3752 updatePacket.ParcelData.SelfCount = 0; //unemplemented
4173 updatePacket.ParcelData.SequenceID = sequence_id; 3753 updatePacket.ParcelData.SequenceID = sequence_id;
4174 if (landData.SimwideArea > 0) 3754 if (landData.SimwideArea > 0)
4175 { 3755 {
@@ -4662,25 +4242,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4662 OutPacket(packet, ThrottleOutPacketType.Task); 4242 OutPacket(packet, ThrottleOutPacketType.Task);
4663 } 4243 }
4664 4244
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
4684 #endregion 4245 #endregion
4685 4246
4686 /// <summary> 4247 /// <summary>
@@ -4699,8 +4260,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4699 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); 4260 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
4700 } 4261 }
4701 4262
4702 #region Packet Handlers
4703
4704 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) 4263 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
4705 { 4264 {
4706 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack; 4265 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack;
@@ -4708,7 +4267,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4708 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId && 4267 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId &&
4709 money.AgentData.SessionID == sender.SessionId) 4268 money.AgentData.SessionID == sender.SessionId)
4710 { 4269 {
4711 MoneyTransferRequest handlerMoneyTransferRequest = OnMoneyTransferRequest; 4270 handlerMoneyTransferRequest = OnMoneyTransferRequest;
4712 if (handlerMoneyTransferRequest != null) 4271 if (handlerMoneyTransferRequest != null)
4713 { 4272 {
4714 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID, 4273 handlerMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
@@ -4727,7 +4286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4727 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack; 4286 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack;
4728 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId) 4287 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
4729 { 4288 {
4730 ParcelBuy handlerParcelBuy = OnParcelBuy; 4289 handlerParcelBuy = OnParcelBuy;
4731 if (handlerParcelBuy != null) 4290 if (handlerParcelBuy != null)
4732 { 4291 {
4733 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final, 4292 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final,
@@ -4748,7 +4307,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4748 4307
4749 for (int i = 0; i < upack.UUIDNameBlock.Length; i++) 4308 for (int i = 0; i < upack.UUIDNameBlock.Length; i++)
4750 { 4309 {
4751 UUIDNameRequest handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest; 4310 handlerUUIDGroupNameRequest = OnUUIDGroupNameRequest;
4752 if (handlerUUIDGroupNameRequest != null) 4311 if (handlerUUIDGroupNameRequest != null)
4753 { 4312 {
4754 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this); 4313 handlerUUIDGroupNameRequest(upack.UUIDNameBlock[i].ID, this);
@@ -4764,7 +4323,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4764 if (m_genericPacketHandlers.Count == 0) return false; 4323 if (m_genericPacketHandlers.Count == 0) return false;
4765 if (gmpack.AgentData.SessionID != SessionId) return false; 4324 if (gmpack.AgentData.SessionID != SessionId) return false;
4766 4325
4767 GenericMessage handlerGenericMessage = null; 4326 handlerGenericMessage = null;
4768 4327
4769 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim(); 4328 string method = Util.FieldToString(gmpack.MethodData.Method).ToLower().Trim();
4770 4329
@@ -4805,7 +4364,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4805 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack; 4364 ObjectGroupPacket ogpack = (ObjectGroupPacket)Pack;
4806 if (ogpack.AgentData.SessionID != SessionId) return false; 4365 if (ogpack.AgentData.SessionID != SessionId) return false;
4807 4366
4808 RequestObjectPropertiesFamily handlerObjectGroupRequest = OnObjectGroupRequest; 4367 handlerObjectGroupRequest = OnObjectGroupRequest;
4809 if (handlerObjectGroupRequest != null) 4368 if (handlerObjectGroupRequest != null)
4810 { 4369 {
4811 for (int i = 0; i < ogpack.ObjectData.Length; i++) 4370 for (int i = 0; i < ogpack.ObjectData.Length; i++)
@@ -4820,7 +4379,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4820 { 4379 {
4821 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; 4380 ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
4822 if (viewer.AgentData.SessionID != SessionId) return false; 4381 if (viewer.AgentData.SessionID != SessionId) return false;
4823 ViewerEffectEventHandler handlerViewerEffect = OnViewerEffect; 4382 handlerViewerEffect = OnViewerEffect;
4824 if (handlerViewerEffect != null) 4383 if (handlerViewerEffect != null)
4825 { 4384 {
4826 int length = viewer.Effect.Length; 4385 int length = viewer.Effect.Length;
@@ -4844,8 +4403,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4844 return true; 4403 return true;
4845 } 4404 }
4846 4405
4847 #endregion Packet Handlers
4848
4849 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) 4406 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
4850 { 4407 {
4851 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); 4408 ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion);
@@ -4911,7 +4468,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4911 { 4468 {
4912 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName); 4469 m_log.InfoFormat("[CLIENT]: Got a logout request for {0} in {1}", Name, Scene.RegionInfo.RegionName);
4913 4470
4914 Action<IClientAPI> handlerLogout = OnLogout; 4471 handlerLogout = OnLogout;
4915 4472
4916 if (handlerLogout != null) 4473 if (handlerLogout != null)
4917 { 4474 {
@@ -4993,7 +4550,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4993 case 1: 4550 case 1:
4994 Vector3 pos1 = new Vector3(block.Data, 0); 4551 Vector3 pos1 = new Vector3(block.Data, 0);
4995 4552
4996 UpdateVector handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 4553 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
4997 if (handlerUpdatePrimSinglePosition != null) 4554 if (handlerUpdatePrimSinglePosition != null)
4998 { 4555 {
4999 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); 4556 // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
@@ -5003,7 +4560,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5003 case 2: 4560 case 2:
5004 Quaternion rot1 = new Quaternion(block.Data, 0, true); 4561 Quaternion rot1 = new Quaternion(block.Data, 0, true);
5005 4562
5006 UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; 4563 handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
5007 if (handlerUpdatePrimSingleRotation != null) 4564 if (handlerUpdatePrimSingleRotation != null)
5008 { 4565 {
5009 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W); 4566 // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W);
@@ -5014,7 +4571,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5014 Vector3 rotPos = new Vector3(block.Data, 0); 4571 Vector3 rotPos = new Vector3(block.Data, 0);
5015 Quaternion rot2 = new Quaternion(block.Data, 12, true); 4572 Quaternion rot2 = new Quaternion(block.Data, 12, true);
5016 4573
5017 UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; 4574 handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition;
5018 if (handlerUpdatePrimSingleRotationPosition != null) 4575 if (handlerUpdatePrimSingleRotationPosition != null)
5019 { 4576 {
5020 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z); 4577 // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z);
@@ -5026,7 +4583,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5026 case 20: 4583 case 20:
5027 Vector3 scale4 = new Vector3(block.Data, 0); 4584 Vector3 scale4 = new Vector3(block.Data, 0);
5028 4585
5029 UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale; 4586 handlerUpdatePrimScale = OnUpdatePrimScale;
5030 if (handlerUpdatePrimScale != null) 4587 if (handlerUpdatePrimScale != null)
5031 { 4588 {
5032// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z); 4589// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z);
@@ -5054,7 +4611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5054 case 9: 4611 case 9:
5055 Vector3 pos2 = new Vector3(block.Data, 0); 4612 Vector3 pos2 = new Vector3(block.Data, 0);
5056 4613
5057 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition; 4614 handlerUpdateVector = OnUpdatePrimGroupPosition;
5058 4615
5059 if (handlerUpdateVector != null) 4616 if (handlerUpdateVector != null)
5060 { 4617 {
@@ -5065,7 +4622,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5065 case 10: 4622 case 10:
5066 Quaternion rot3 = new Quaternion(block.Data, 0, true); 4623 Quaternion rot3 = new Quaternion(block.Data, 0, true);
5067 4624
5068 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 4625 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
5069 if (handlerUpdatePrimRotation != null) 4626 if (handlerUpdatePrimRotation != null)
5070 { 4627 {
5071 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); 4628 // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W);
@@ -5088,7 +4645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5088 case 28: 4645 case 28:
5089 Vector3 scale7 = new Vector3(block.Data, 0); 4646 Vector3 scale7 = new Vector3(block.Data, 0);
5090 4647
5091 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 4648 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
5092 if (handlerUpdatePrimGroupScale != null) 4649 if (handlerUpdatePrimGroupScale != null)
5093 { 4650 {
5094// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); 4651// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z);
@@ -5208,40 +4765,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5208 } 4765 }
5209 4766
5210 /// <summary> 4767 /// <summary>
5211 /// Sets the throttles from values supplied by the client 4768 /// returns a byte array of the client set throttles Gets multiplied by the multiplier
4769 ///
5212 /// </summary> 4770 /// </summary>
5213 /// <param name="throttles"></param> 4771 /// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param>
5214 public void SetChildAgentThrottle(byte[] throttles) 4772 /// <returns></returns>
4773 public byte[] GetThrottlesPacked(float multiplier)
5215 { 4774 {
5216 m_udpClient.SetThrottles(throttles); 4775 return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier);
5217 } 4776 }
5218
5219 /// <summary> 4777 /// <summary>
5220 /// Get the current throttles for this client as a packed byte array 4778 /// sets the throttles from values supplied by the client
5221 /// </summary> 4779 /// </summary>
5222 /// <param name="multiplier">Unused</param> 4780 /// <param name="throttles"></param>
5223 /// <returns></returns> 4781 public void SetChildAgentThrottle(byte[] throttles)
5224 public byte[] GetThrottlesPacked(float multiplier)
5225 { 4782 {
5226 return m_udpClient.GetThrottlesPacked(); 4783 m_PacketHandler.PacketQueue.SetThrottleFromClient(throttles);
5227 } 4784 }
5228 4785
5229 /// <summary> 4786 /// <summary>
5230 /// Cruft? 4787 /// Method gets called when a new packet has arrived from the UDP
4788 /// server. This happens after it's been decoded into a libsl object.
5231 /// </summary> 4789 /// </summary>
4790 /// <param name="NewPack">object containing the packet.</param>
5232 public virtual void InPacket(object NewPack) 4791 public virtual void InPacket(object NewPack)
5233 { 4792 {
5234 throw new NotImplementedException(); 4793 // Cast NewPack to Packet.
4794 m_PacketHandler.InPacket((Packet) NewPack);
5235 } 4795 }
5236 4796
5237 /// <summary> 4797 /// <summary>
5238 /// This is the starting point for sending a simulator packet out to the client 4798 /// 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.
5239 /// </summary> 4801 /// </summary>
5240 /// <param name="packet">Packet to send</param> 4802 /// <param name="NewPack"></param>
5241 /// <param name="throttlePacketType">Throttling category for the packet</param> 4803 /// <param name="throttlePacketType">Corresponds to the type of data that is going out. Enum</param>
5242 private void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType) 4804 public void OutPacket(Packet NewPack, ThrottleOutPacketType throttlePacketType)
5243 { 4805 {
5244 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true); 4806 m_PacketHandler.OutPacket(NewPack, throttlePacketType);
5245 } 4807 }
5246 4808
5247 public bool AddMoney(int debit) 4809 public bool AddMoney(int debit)
@@ -5285,7 +4847,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5285 return; 4847 return;
5286 } 4848 }
5287 4849
5288 UpdateVector handlerAutoPilotGo = OnAutoPilotGo; 4850 handlerAutoPilotGo = OnAutoPilotGo;
5289 if (handlerAutoPilotGo != null) 4851 if (handlerAutoPilotGo != null)
5290 { 4852 {
5291 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this); 4853 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this);
@@ -5337,7 +4899,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5337 } 4899 }
5338 #endregion 4900 #endregion
5339 4901
5340 RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties; 4902 handlerRequestAvatarProperties = OnRequestAvatarProperties;
5341 if (handlerRequestAvatarProperties != null) 4903 if (handlerRequestAvatarProperties != null)
5342 { 4904 {
5343 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); 4905 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
@@ -5378,7 +4940,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5378 args.Sender = this; 4940 args.Sender = this;
5379 args.SenderUUID = this.AgentId; 4941 args.SenderUUID = this.AgentId;
5380 4942
5381 ChatMessage handlerChatFromClient = OnChatFromClient; 4943 handlerChatFromClient = OnChatFromClient;
5382 if (handlerChatFromClient != null) 4944 if (handlerChatFromClient != null)
5383 handlerChatFromClient(this, args); 4945 handlerChatFromClient(this, args);
5384 } 4946 }
@@ -5396,7 +4958,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5396 } 4958 }
5397 #endregion 4959 #endregion
5398 4960
5399 UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties; 4961 handlerUpdateAvatarProperties = OnUpdateAvatarProperties;
5400 if (handlerUpdateAvatarProperties != null) 4962 if (handlerUpdateAvatarProperties != null)
5401 { 4963 {
5402 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData; 4964 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
@@ -5436,7 +4998,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5436 args.Position = new Vector3(); 4998 args.Position = new Vector3();
5437 args.Scene = Scene; 4999 args.Scene = Scene;
5438 args.Sender = this; 5000 args.Sender = this;
5439 ChatMessage handlerChatFromClient2 = OnChatFromClient; 5001 handlerChatFromClient2 = OnChatFromClient;
5440 if (handlerChatFromClient2 != null) 5002 if (handlerChatFromClient2 != null)
5441 handlerChatFromClient2(this, args); 5003 handlerChatFromClient2(this, args);
5442 } 5004 }
@@ -5457,7 +5019,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5457 5019
5458 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 5020 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
5459 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message); 5021 string IMmessage = Utils.BytesToString(msgpack.MessageBlock.Message);
5460 ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; 5022 handlerInstantMessage = OnInstantMessage;
5461 5023
5462 if (handlerInstantMessage != null) 5024 if (handlerInstantMessage != null)
5463 { 5025 {
@@ -5500,7 +5062,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5500 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID); 5062 callingCardFolders.Add(afriendpack.FolderData[fi].FolderID);
5501 } 5063 }
5502 5064
5503 FriendActionDelegate handlerApproveFriendRequest = OnApproveFriendRequest; 5065 handlerApproveFriendRequest = OnApproveFriendRequest;
5504 if (handlerApproveFriendRequest != null) 5066 if (handlerApproveFriendRequest != null)
5505 { 5067 {
5506 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders); 5068 handlerApproveFriendRequest(this, agentID, transactionID, callingCardFolders);
@@ -5543,7 +5105,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5543 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; 5105 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
5544 UUID exFriendID = tfriendpack.ExBlock.OtherID; 5106 UUID exFriendID = tfriendpack.ExBlock.OtherID;
5545 5107
5546 FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship; 5108 handlerTerminateFriendship = OnTerminateFriendship;
5547 if (handlerTerminateFriendship != null) 5109 if (handlerTerminateFriendship != null)
5548 { 5110 {
5549 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 5111 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
@@ -5562,7 +5124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5562 } 5124 }
5563 #endregion 5125 #endregion
5564 5126
5565 RezObject handlerRezObject = OnRezObject; 5127 handlerRezObject = OnRezObject;
5566 if (handlerRezObject != null) 5128 if (handlerRezObject != null)
5567 { 5129 {
5568 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, 5130 handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
@@ -5585,7 +5147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5585 } 5147 }
5586 #endregion 5148 #endregion
5587 5149
5588 DeRezObject handlerDeRezObject = OnDeRezObject; 5150 handlerDeRezObject = OnDeRezObject;
5589 if (handlerDeRezObject != null) 5151 if (handlerDeRezObject != null)
5590 { 5152 {
5591 List<uint> deRezIDs = new List<uint>(); 5153 List<uint> deRezIDs = new List<uint>();
@@ -5624,7 +5186,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5624 { 5186 {
5625 for (int i = 0; i < modify.ParcelData.Length; i++) 5187 for (int i = 0; i < modify.ParcelData.Length; i++)
5626 { 5188 {
5627 ModifyTerrain handlerModifyTerrain = OnModifyTerrain; 5189 handlerModifyTerrain = OnModifyTerrain;
5628 if (handlerModifyTerrain != null) 5190 if (handlerModifyTerrain != null)
5629 { 5191 {
5630 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, 5192 handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
@@ -5641,7 +5203,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5641 5203
5642 case PacketType.RegionHandshakeReply: 5204 case PacketType.RegionHandshakeReply:
5643 5205
5644 Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply; 5206 handlerRegionHandShakeReply = OnRegionHandShakeReply;
5645 if (handlerRegionHandShakeReply != null) 5207 if (handlerRegionHandShakeReply != null)
5646 { 5208 {
5647 handlerRegionHandShakeReply(this); 5209 handlerRegionHandShakeReply(this);
@@ -5650,14 +5212,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5650 break; 5212 break;
5651 5213
5652 case PacketType.AgentWearablesRequest: 5214 case PacketType.AgentWearablesRequest:
5653 GenericCall2 handlerRequestWearables = OnRequestWearables; 5215 handlerRequestWearables = OnRequestWearables;
5654 5216
5655 if (handlerRequestWearables != null) 5217 if (handlerRequestWearables != null)
5656 { 5218 {
5657 handlerRequestWearables(); 5219 handlerRequestWearables();
5658 } 5220 }
5659 5221
5660 Action<IClientAPI> handlerRequestAvatarsData = OnRequestAvatarsData; 5222 handlerRequestAvatarsData = OnRequestAvatarsData;
5661 5223
5662 if (handlerRequestAvatarsData != null) 5224 if (handlerRequestAvatarsData != null)
5663 { 5225 {
@@ -5678,7 +5240,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5678 } 5240 }
5679 #endregion 5241 #endregion
5680 5242
5681 SetAppearance handlerSetAppearance = OnSetAppearance; 5243 handlerSetAppearance = OnSetAppearance;
5682 if (handlerSetAppearance != null) 5244 if (handlerSetAppearance != null)
5683 { 5245 {
5684 // Temporarily protect ourselves from the mantis #951 failure. 5246 // Temporarily protect ourselves from the mantis #951 failure.
@@ -5729,7 +5291,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5729 wearingArgs.NowWearing.Add(wearable); 5291 wearingArgs.NowWearing.Add(wearable);
5730 } 5292 }
5731 5293
5732 AvatarNowWearing handlerAvatarNowWearing = OnAvatarNowWearing; 5294 handlerAvatarNowWearing = OnAvatarNowWearing;
5733 if (handlerAvatarNowWearing != null) 5295 if (handlerAvatarNowWearing != null)
5734 { 5296 {
5735 handlerAvatarNowWearing(this, wearingArgs); 5297 handlerAvatarNowWearing(this, wearingArgs);
@@ -5738,7 +5300,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5738 break; 5300 break;
5739 5301
5740 case PacketType.RezSingleAttachmentFromInv: 5302 case PacketType.RezSingleAttachmentFromInv:
5741 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; 5303 handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
5742 if (handlerRezSingleAttachment != null) 5304 if (handlerRezSingleAttachment != null)
5743 { 5305 {
5744 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack; 5306 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack;
@@ -5759,7 +5321,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5759 break; 5321 break;
5760 5322
5761 case PacketType.RezMultipleAttachmentsFromInv: 5323 case PacketType.RezMultipleAttachmentsFromInv:
5762 RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; 5324 handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv;
5763 if (handlerRezMultipleAttachments != null) 5325 if (handlerRezMultipleAttachments != null)
5764 { 5326 {
5765 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; 5327 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack;
@@ -5770,7 +5332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5770 break; 5332 break;
5771 5333
5772 case PacketType.DetachAttachmentIntoInv: 5334 case PacketType.DetachAttachmentIntoInv:
5773 UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; 5335 handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
5774 if (handlerDetachAttachmentIntoInv != null) 5336 if (handlerDetachAttachmentIntoInv != null)
5775 { 5337 {
5776 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; 5338 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
@@ -5800,7 +5362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5800 } 5362 }
5801 #endregion 5363 #endregion
5802 5364
5803 ObjectAttach handlerObjectAttach = OnObjectAttach; 5365 handlerObjectAttach = OnObjectAttach;
5804 5366
5805 if (handlerObjectAttach != null) 5367 if (handlerObjectAttach != null)
5806 { 5368 {
@@ -5827,7 +5389,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5827 for (int j = 0; j < dett.ObjectData.Length; j++) 5389 for (int j = 0; j < dett.ObjectData.Length; j++)
5828 { 5390 {
5829 uint obj = dett.ObjectData[j].ObjectLocalID; 5391 uint obj = dett.ObjectData[j].ObjectLocalID;
5830 ObjectDeselect handlerObjectDetach = OnObjectDetach; 5392 handlerObjectDetach = OnObjectDetach;
5831 if (handlerObjectDetach != null) 5393 if (handlerObjectDetach != null)
5832 { 5394 {
5833 handlerObjectDetach(obj, this); 5395 handlerObjectDetach(obj, this);
@@ -5851,7 +5413,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5851 for (int j = 0; j < dropp.ObjectData.Length; j++) 5413 for (int j = 0; j < dropp.ObjectData.Length; j++)
5852 { 5414 {
5853 uint obj = dropp.ObjectData[j].ObjectLocalID; 5415 uint obj = dropp.ObjectData[j].ObjectLocalID;
5854 ObjectDrop handlerObjectDrop = OnObjectDrop; 5416 handlerObjectDrop = OnObjectDrop;
5855 if (handlerObjectDrop != null) 5417 if (handlerObjectDrop != null)
5856 { 5418 {
5857 handlerObjectDrop(obj, this); 5419 handlerObjectDrop(obj, this);
@@ -5871,14 +5433,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5871 } 5433 }
5872 #endregion 5434 #endregion
5873 5435
5874 SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun; 5436 handlerSetAlwaysRun = OnSetAlwaysRun;
5875 if (handlerSetAlwaysRun != null) 5437 if (handlerSetAlwaysRun != null)
5876 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); 5438 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun);
5877 5439
5878 break; 5440 break;
5879 5441
5880 case PacketType.CompleteAgentMovement: 5442 case PacketType.CompleteAgentMovement:
5881 GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 5443 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
5882 if (handlerCompleteMovementToRegion != null) 5444 if (handlerCompleteMovementToRegion != null)
5883 { 5445 {
5884 handlerCompleteMovementToRegion(); 5446 handlerCompleteMovementToRegion();
@@ -5947,7 +5509,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5947 arg.HeadRotation = x.HeadRotation; 5509 arg.HeadRotation = x.HeadRotation;
5948 arg.SessionID = x.SessionID; 5510 arg.SessionID = x.SessionID;
5949 arg.State = x.State; 5511 arg.State = x.State;
5950 UpdateAgent handlerAgentUpdate = OnAgentUpdate; 5512 handlerAgentUpdate = OnAgentUpdate;
5951 lastarg = arg; // save this set of arguments for nexttime 5513 lastarg = arg; // save this set of arguments for nexttime
5952 if (handlerAgentUpdate != null) 5514 if (handlerAgentUpdate != null)
5953 OnAgentUpdate(this, arg); 5515 OnAgentUpdate(this, arg);
@@ -5970,8 +5532,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5970 } 5532 }
5971 #endregion 5533 #endregion
5972 5534
5973 StartAnim handlerStartAnim = null; 5535 handlerStartAnim = null;
5974 StopAnim handlerStopAnim = null; 5536 handlerStopAnim = null;
5975 5537
5976 for (int i = 0; i < AgentAni.AnimationList.Length; i++) 5538 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
5977 { 5539 {
@@ -6008,7 +5570,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6008 } 5570 }
6009 #endregion 5571 #endregion
6010 5572
6011 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; 5573 handlerAgentRequestSit = OnAgentRequestSit;
6012 if (handlerAgentRequestSit != null) 5574 if (handlerAgentRequestSit != null)
6013 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, 5575 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
6014 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); 5576 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
@@ -6029,7 +5591,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6029 } 5591 }
6030 #endregion 5592 #endregion
6031 5593
6032 AgentSit handlerAgentSit = OnAgentSit; 5594 handlerAgentSit = OnAgentSit;
6033 if (handlerAgentSit != null) 5595 if (handlerAgentSit != null)
6034 { 5596 {
6035 OnAgentSit(this, agentSit.AgentData.AgentID); 5597 OnAgentSit(this, agentSit.AgentData.AgentID);
@@ -6047,7 +5609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6047 } 5609 }
6048 #endregion 5610 #endregion
6049 5611
6050 SoundTrigger handlerSoundTrigger = OnSoundTrigger; 5612 handlerSoundTrigger = OnSoundTrigger;
6051 if (handlerSoundTrigger != null) 5613 if (handlerSoundTrigger != null)
6052 { 5614 {
6053 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, 5615 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID,
@@ -6074,7 +5636,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6074 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; 5636 AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data;
6075 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); 5637 //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name));
6076 5638
6077 AvatarPickerRequest handlerAvatarPickerRequest = OnAvatarPickerRequest; 5639 handlerAvatarPickerRequest = OnAvatarPickerRequest;
6078 if (handlerAvatarPickerRequest != null) 5640 if (handlerAvatarPickerRequest != null)
6079 { 5641 {
6080 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID, 5642 handlerAvatarPickerRequest(this, Requestdata.AgentID, Requestdata.QueryID,
@@ -6094,7 +5656,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6094 } 5656 }
6095 #endregion 5657 #endregion
6096 5658
6097 FetchInventory handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest; 5659 handlerAgentDataUpdateRequest = OnAgentDataUpdateRequest;
6098 5660
6099 if (handlerAgentDataUpdateRequest != null) 5661 if (handlerAgentDataUpdateRequest != null)
6100 { 5662 {
@@ -6104,7 +5666,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6104 break; 5666 break;
6105 5667
6106 case PacketType.UserInfoRequest: 5668 case PacketType.UserInfoRequest:
6107 UserInfoRequest handlerUserInfoRequest = OnUserInfoRequest; 5669 handlerUserInfoRequest = OnUserInfoRequest;
6108 if (handlerUserInfoRequest != null) 5670 if (handlerUserInfoRequest != null)
6109 { 5671 {
6110 handlerUserInfoRequest(this); 5672 handlerUserInfoRequest(this);
@@ -6127,7 +5689,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6127 } 5689 }
6128 #endregion 5690 #endregion
6129 5691
6130 UpdateUserInfo handlerUpdateUserInfo = OnUpdateUserInfo; 5692 handlerUpdateUserInfo = OnUpdateUserInfo;
6131 if (handlerUpdateUserInfo != null) 5693 if (handlerUpdateUserInfo != null)
6132 { 5694 {
6133 bool visible = true; 5695 bool visible = true;
@@ -6156,7 +5718,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6156 5718
6157 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) 5719 if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
6158 { 5720 {
6159 TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest; 5721 handlerSetStartLocationRequest = OnSetStartLocationRequest;
6160 if (handlerSetStartLocationRequest != null) 5722 if (handlerSetStartLocationRequest != null)
6161 { 5723 {
6162 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos, 5724 handlerSetStartLocationRequest(this, 0, avSetStartLocationRequestPacket.StartLocationData.LocationPos,
@@ -6178,21 +5740,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6178 } 5740 }
6179 #endregion 5741 #endregion
6180 5742
6181 m_udpClient.SetThrottles(atpack.Throttle.Throttles); 5743 m_PacketHandler.PacketQueue.SetThrottleFromClient(atpack.Throttle.Throttles);
6182 break; 5744 break;
6183 5745
6184 case PacketType.AgentPause: 5746 case PacketType.AgentPause:
6185 m_udpClient.IsPaused = true; 5747 m_probesWithNoIngressPackets = 0;
5748 m_clientBlocked = true;
6186 break; 5749 break;
6187 5750
6188 case PacketType.AgentResume: 5751 case PacketType.AgentResume:
6189 m_udpClient.IsPaused = false; 5752 m_probesWithNoIngressPackets = 0;
6190 SendStartPingCheck(m_udpClient.CurrentPingSequence++); 5753 m_clientBlocked = false;
5754 SendStartPingCheck(0);
6191 5755
6192 break; 5756 break;
6193 5757
6194 case PacketType.ForceScriptControlRelease: 5758 case PacketType.ForceScriptControlRelease:
6195 ForceReleaseControls handlerForceReleaseControls = OnForceReleaseControls; 5759 handlerForceReleaseControls = OnForceReleaseControls;
6196 if (handlerForceReleaseControls != null) 5760 if (handlerForceReleaseControls != null)
6197 { 5761 {
6198 handlerForceReleaseControls(this, AgentId); 5762 handlerForceReleaseControls(this, AgentId);
@@ -6226,7 +5790,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6226 childrenprims.Add(link.ObjectData[i].ObjectLocalID); 5790 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
6227 } 5791 }
6228 } 5792 }
6229 LinkObjects handlerLinkObjects = OnLinkObjects; 5793 handlerLinkObjects = OnLinkObjects;
6230 if (handlerLinkObjects != null) 5794 if (handlerLinkObjects != null)
6231 { 5795 {
6232 handlerLinkObjects(this, parentprimid, childrenprims); 5796 handlerLinkObjects(this, parentprimid, childrenprims);
@@ -6254,7 +5818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6254 { 5818 {
6255 prims.Add(delink.ObjectData[i].ObjectLocalID); 5819 prims.Add(delink.ObjectData[i].ObjectLocalID);
6256 } 5820 }
6257 DelinkObjects handlerDelinkObjects = OnDelinkObjects; 5821 handlerDelinkObjects = OnDelinkObjects;
6258 if (handlerDelinkObjects != null) 5822 if (handlerDelinkObjects != null)
6259 { 5823 {
6260 handlerDelinkObjects(prims); 5824 handlerDelinkObjects(prims);
@@ -6286,7 +5850,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6286 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the 5850 //Check to see if adding the prim is allowed; useful for any module wanting to restrict the
6287 //object from rezing initially 5851 //object from rezing initially
6288 5852
6289 AddNewPrim handlerAddPrim = OnAddPrim; 5853 handlerAddPrim = OnAddPrim;
6290 if (handlerAddPrim != null) 5854 if (handlerAddPrim != null)
6291 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); 5855 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
6292 } 5856 }
@@ -6304,7 +5868,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6304 } 5868 }
6305 #endregion 5869 #endregion
6306 5870
6307 UpdateShape handlerUpdatePrimShape = null; 5871 handlerUpdatePrimShape = null;
6308 for (int i = 0; i < shapePacket.ObjectData.Length; i++) 5872 for (int i = 0; i < shapePacket.ObjectData.Length; i++)
6309 { 5873 {
6310 handlerUpdatePrimShape = OnUpdatePrimShape; 5874 handlerUpdatePrimShape = OnUpdatePrimShape;
@@ -6349,7 +5913,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6349 } 5913 }
6350 #endregion 5914 #endregion
6351 5915
6352 ObjectExtraParams handlerUpdateExtraParams = OnUpdateExtraParams; 5916 handlerUpdateExtraParams = OnUpdateExtraParams;
6353 if (handlerUpdateExtraParams != null) 5917 if (handlerUpdateExtraParams != null)
6354 { 5918 {
6355 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++) 5919 for (int i = 0 ; i < extraPar.ObjectData.Length ; i++)
@@ -6374,7 +5938,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6374 5938
6375 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; 5939 ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData;
6376 5940
6377 ObjectDuplicate handlerObjectDuplicate = null; 5941 handlerObjectDuplicate = null;
6378 5942
6379 for (int i = 0; i < dupe.ObjectData.Length; i++) 5943 for (int i = 0; i < dupe.ObjectData.Length; i++)
6380 { 5944 {
@@ -6401,7 +5965,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6401 } 5965 }
6402 #endregion 5966 #endregion
6403 5967
6404 ObjectRequest handlerObjectRequest = null; 5968 handlerObjectRequest = null;
6405 5969
6406 for (int i = 0; i < incomingRequest.ObjectData.Length; i++) 5970 for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
6407 { 5971 {
@@ -6424,7 +5988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6424 } 5988 }
6425 #endregion 5989 #endregion
6426 5990
6427 ObjectSelect handlerObjectSelect = null; 5991 handlerObjectSelect = null;
6428 5992
6429 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 5993 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
6430 { 5994 {
@@ -6447,7 +6011,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6447 } 6011 }
6448 #endregion 6012 #endregion
6449 6013
6450 ObjectDeselect handlerObjectDeselect = null; 6014 handlerObjectDeselect = null;
6451 6015
6452 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) 6016 for (int i = 0; i < incomingdeselect.ObjectData.Length; i++)
6453 { 6017 {
@@ -6474,7 +6038,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6474 6038
6475 for (int i = 0; i < position.ObjectData.Length; i++) 6039 for (int i = 0; i < position.ObjectData.Length; i++)
6476 { 6040 {
6477 UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition; 6041 handlerUpdateVector = OnUpdatePrimGroupPosition;
6478 if (handlerUpdateVector != null) 6042 if (handlerUpdateVector != null)
6479 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this); 6043 handlerUpdateVector(position.ObjectData[i].ObjectLocalID, position.ObjectData[i].Position, this);
6480 } 6044 }
@@ -6495,7 +6059,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6495 6059
6496 for (int i = 0; i < scale.ObjectData.Length; i++) 6060 for (int i = 0; i < scale.ObjectData.Length; i++)
6497 { 6061 {
6498 UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; 6062 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
6499 if (handlerUpdatePrimGroupScale != null) 6063 if (handlerUpdatePrimGroupScale != null)
6500 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this); 6064 handlerUpdatePrimGroupScale(scale.ObjectData[i].ObjectLocalID, scale.ObjectData[i].Scale, this);
6501 } 6065 }
@@ -6516,7 +6080,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6516 6080
6517 for (int i = 0; i < rotation.ObjectData.Length; i++) 6081 for (int i = 0; i < rotation.ObjectData.Length; i++)
6518 { 6082 {
6519 UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; 6083 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
6520 if (handlerUpdatePrimRotation != null) 6084 if (handlerUpdatePrimRotation != null)
6521 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this); 6085 handlerUpdatePrimRotation(rotation.ObjectData[i].ObjectLocalID, rotation.ObjectData[i].Rotation, this);
6522 } 6086 }
@@ -6534,7 +6098,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6534 } 6098 }
6535 #endregion 6099 #endregion
6536 6100
6537 UpdatePrimFlags handlerUpdatePrimFlags = OnUpdatePrimFlags; 6101 handlerUpdatePrimFlags = OnUpdatePrimFlags;
6538 6102
6539 if (handlerUpdatePrimFlags != null) 6103 if (handlerUpdatePrimFlags != null)
6540 { 6104 {
@@ -6551,7 +6115,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6551 case PacketType.ObjectImage: 6115 case PacketType.ObjectImage:
6552 ObjectImagePacket imagePack = (ObjectImagePacket)Pack; 6116 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
6553 6117
6554 UpdatePrimTexture handlerUpdatePrimTexture = null; 6118 handlerUpdatePrimTexture = null;
6555 for (int i = 0; i < imagePack.ObjectData.Length; i++) 6119 for (int i = 0; i < imagePack.ObjectData.Length; i++)
6556 { 6120 {
6557 handlerUpdatePrimTexture = OnUpdatePrimTexture; 6121 handlerUpdatePrimTexture = OnUpdatePrimTexture;
@@ -6574,7 +6138,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6574 } 6138 }
6575 #endregion 6139 #endregion
6576 6140
6577 GrabObject handlerGrabObject = OnGrabObject; 6141 handlerGrabObject = OnGrabObject;
6578 6142
6579 if (handlerGrabObject != null) 6143 if (handlerGrabObject != null)
6580 { 6144 {
@@ -6608,7 +6172,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6608 } 6172 }
6609 #endregion 6173 #endregion
6610 6174
6611 MoveObject handlerGrabUpdate = OnGrabUpdate; 6175 handlerGrabUpdate = OnGrabUpdate;
6612 6176
6613 if (handlerGrabUpdate != null) 6177 if (handlerGrabUpdate != null)
6614 { 6178 {
@@ -6643,7 +6207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6643 } 6207 }
6644 #endregion 6208 #endregion
6645 6209
6646 DeGrabObject handlerDeGrabObject = OnDeGrabObject; 6210 handlerDeGrabObject = OnDeGrabObject;
6647 if (handlerDeGrabObject != null) 6211 if (handlerDeGrabObject != null)
6648 { 6212 {
6649 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>(); 6213 List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
@@ -6677,7 +6241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6677 } 6241 }
6678 #endregion 6242 #endregion
6679 6243
6680 SpinStart handlerSpinStart = OnSpinStart; 6244 handlerSpinStart = OnSpinStart;
6681 if (handlerSpinStart != null) 6245 if (handlerSpinStart != null)
6682 { 6246 {
6683 handlerSpinStart(spinStart.ObjectData.ObjectID, this); 6247 handlerSpinStart(spinStart.ObjectData.ObjectID, this);
@@ -6701,7 +6265,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6701 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle); 6265 spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle);
6702 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle); 6266 //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle);
6703 6267
6704 SpinObject handlerSpinUpdate = OnSpinUpdate; 6268 handlerSpinUpdate = OnSpinUpdate;
6705 if (handlerSpinUpdate != null) 6269 if (handlerSpinUpdate != null)
6706 { 6270 {
6707 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this); 6271 handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this);
@@ -6720,7 +6284,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6720 } 6284 }
6721 #endregion 6285 #endregion
6722 6286
6723 SpinStop handlerSpinStop = OnSpinStop; 6287 handlerSpinStop = OnSpinStop;
6724 if (handlerSpinStop != null) 6288 if (handlerSpinStop != null)
6725 { 6289 {
6726 handlerSpinStop(spinStop.ObjectData.ObjectID, this); 6290 handlerSpinStop(spinStop.ObjectData.ObjectID, this);
@@ -6739,7 +6303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6739 } 6303 }
6740 #endregion 6304 #endregion
6741 6305
6742 GenericCall7 handlerObjectDescription = null; 6306 handlerObjectDescription = null;
6743 6307
6744 for (int i = 0; i < objDes.ObjectData.Length; i++) 6308 for (int i = 0; i < objDes.ObjectData.Length; i++)
6745 { 6309 {
@@ -6763,7 +6327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6763 } 6327 }
6764 #endregion 6328 #endregion
6765 6329
6766 GenericCall7 handlerObjectName = null; 6330 handlerObjectName = null;
6767 for (int i = 0; i < objName.ObjectData.Length; i++) 6331 for (int i = 0; i < objName.ObjectData.Length; i++)
6768 { 6332 {
6769 handlerObjectName = OnObjectName; 6333 handlerObjectName = OnObjectName;
@@ -6791,7 +6355,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6791 UUID AgentID = newobjPerms.AgentData.AgentID; 6355 UUID AgentID = newobjPerms.AgentData.AgentID;
6792 UUID SessionID = newobjPerms.AgentData.SessionID; 6356 UUID SessionID = newobjPerms.AgentData.SessionID;
6793 6357
6794 ObjectPermissions handlerObjectPermissions = null; 6358 handlerObjectPermissions = null;
6795 6359
6796 for (int i = 0; i < newobjPerms.ObjectData.Length; i++) 6360 for (int i = 0; i < newobjPerms.ObjectData.Length; i++)
6797 { 6361 {
@@ -6840,7 +6404,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6840 for (int i = 0; i < undoitem.ObjectData.Length; i++) 6404 for (int i = 0; i < undoitem.ObjectData.Length; i++)
6841 { 6405 {
6842 UUID objiD = undoitem.ObjectData[i].ObjectID; 6406 UUID objiD = undoitem.ObjectData[i].ObjectID;
6843 AgentSit handlerOnUndo = OnUndo; 6407 handlerOnUndo = OnUndo;
6844 if (handlerOnUndo != null) 6408 if (handlerOnUndo != null)
6845 { 6409 {
6846 handlerOnUndo(this, objiD); 6410 handlerOnUndo(this, objiD);
@@ -6861,7 +6425,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6861 } 6425 }
6862 #endregion 6426 #endregion
6863 6427
6864 ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null; 6428 handlerObjectDuplicateOnRay = null;
6429
6865 6430
6866 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++) 6431 for (int i = 0; i < dupeOnRay.ObjectData.Length; i++)
6867 { 6432 {
@@ -6891,7 +6456,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6891 6456
6892 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; 6457 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData;
6893 6458
6894 RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily; 6459 handlerRequestObjectPropertiesFamily = OnRequestObjectPropertiesFamily;
6895 6460
6896 if (handlerRequestObjectPropertiesFamily != null) 6461 if (handlerRequestObjectPropertiesFamily != null)
6897 { 6462 {
@@ -6903,7 +6468,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6903 case PacketType.ObjectIncludeInSearch: 6468 case PacketType.ObjectIncludeInSearch:
6904 //This lets us set objects to appear in search (stuff like DataSnapshot, etc) 6469 //This lets us set objects to appear in search (stuff like DataSnapshot, etc)
6905 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack; 6470 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
6906 ObjectIncludeInSearch handlerObjectIncludeInSearch = null; 6471 handlerObjectIncludeInSearch = null;
6907 6472
6908 #region Packet Session and User Check 6473 #region Packet Session and User Check
6909 if (m_checkPackets) 6474 if (m_checkPackets)
@@ -6940,7 +6505,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6940 } 6505 }
6941 #endregion 6506 #endregion
6942 6507
6943 ScriptAnswer handlerScriptAnswer = OnScriptAnswer; 6508 handlerScriptAnswer = OnScriptAnswer;
6944 if (handlerScriptAnswer != null) 6509 if (handlerScriptAnswer != null)
6945 { 6510 {
6946 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions); 6511 handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions);
@@ -6959,7 +6524,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6959 } 6524 }
6960 #endregion 6525 #endregion
6961 6526
6962 GenericCall7 handlerObjectClickAction = OnObjectClickAction; 6527 handlerObjectClickAction = OnObjectClickAction;
6963 if (handlerObjectClickAction != null) 6528 if (handlerObjectClickAction != null)
6964 { 6529 {
6965 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData) 6530 foreach (ObjectClickActionPacket.ObjectDataBlock odata in ocpacket.ObjectData)
@@ -6983,7 +6548,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6983 } 6548 }
6984 #endregion 6549 #endregion
6985 6550
6986 GenericCall7 handlerObjectMaterial = OnObjectMaterial; 6551 handlerObjectMaterial = OnObjectMaterial;
6987 if (handlerObjectMaterial != null) 6552 if (handlerObjectMaterial != null)
6988 { 6553 {
6989 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData) 6554 foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData)
@@ -7137,7 +6702,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7137 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); 6702 // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString());
7138 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); 6703 UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
7139 6704
7140 UDPAssetUploadRequest handlerAssetUploadRequest = OnAssetUploadRequest; 6705 handlerAssetUploadRequest = OnAssetUploadRequest;
7141 6706
7142 if (handlerAssetUploadRequest != null) 6707 if (handlerAssetUploadRequest != null)
7143 { 6708 {
@@ -7150,7 +6715,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7150 case PacketType.RequestXfer: 6715 case PacketType.RequestXfer:
7151 RequestXferPacket xferReq = (RequestXferPacket)Pack; 6716 RequestXferPacket xferReq = (RequestXferPacket)Pack;
7152 6717
7153 RequestXfer handlerRequestXfer = OnRequestXfer; 6718 handlerRequestXfer = OnRequestXfer;
7154 6719
7155 if (handlerRequestXfer != null) 6720 if (handlerRequestXfer != null)
7156 { 6721 {
@@ -7160,7 +6725,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7160 case PacketType.SendXferPacket: 6725 case PacketType.SendXferPacket:
7161 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; 6726 SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack;
7162 6727
7163 XferReceive handlerXferReceive = OnXferReceive; 6728 handlerXferReceive = OnXferReceive;
7164 if (handlerXferReceive != null) 6729 if (handlerXferReceive != null)
7165 { 6730 {
7166 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); 6731 handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data);
@@ -7169,7 +6734,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7169 case PacketType.ConfirmXferPacket: 6734 case PacketType.ConfirmXferPacket:
7170 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; 6735 ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack;
7171 6736
7172 ConfirmXfer handlerConfirmXfer = OnConfirmXfer; 6737 handlerConfirmXfer = OnConfirmXfer;
7173 if (handlerConfirmXfer != null) 6738 if (handlerConfirmXfer != null)
7174 { 6739 {
7175 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); 6740 handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet);
@@ -7177,7 +6742,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7177 break; 6742 break;
7178 case PacketType.AbortXfer: 6743 case PacketType.AbortXfer:
7179 AbortXferPacket abortXfer = (AbortXferPacket)Pack; 6744 AbortXferPacket abortXfer = (AbortXferPacket)Pack;
7180 AbortXfer handlerAbortXfer = OnAbortXfer; 6745 handlerAbortXfer = OnAbortXfer;
7181 if (handlerAbortXfer != null) 6746 if (handlerAbortXfer != null)
7182 { 6747 {
7183 handlerAbortXfer(this, abortXfer.XferID.ID); 6748 handlerAbortXfer(this, abortXfer.XferID.ID);
@@ -7196,7 +6761,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7196 } 6761 }
7197 #endregion 6762 #endregion
7198 6763
7199 CreateInventoryFolder handlerCreateInventoryFolder = OnCreateNewInventoryFolder; 6764 handlerCreateInventoryFolder = OnCreateNewInventoryFolder;
7200 if (handlerCreateInventoryFolder != null) 6765 if (handlerCreateInventoryFolder != null)
7201 { 6766 {
7202 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID, 6767 handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID,
@@ -7219,7 +6784,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7219 } 6784 }
7220 #endregion 6785 #endregion
7221 6786
7222 UpdateInventoryFolder handlerUpdateInventoryFolder = null; 6787 handlerUpdateInventoryFolder = null;
7223 6788
7224 for (int i = 0; i < invFolderx.FolderData.Length; i++) 6789 for (int i = 0; i < invFolderx.FolderData.Length; i++)
7225 { 6790 {
@@ -7248,7 +6813,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7248 } 6813 }
7249 #endregion 6814 #endregion
7250 6815
7251 MoveInventoryFolder handlerMoveInventoryFolder = null; 6816 handlerMoveInventoryFolder = null;
7252 6817
7253 for (int i = 0; i < invFoldery.InventoryData.Length; i++) 6818 for (int i = 0; i < invFoldery.InventoryData.Length; i++)
7254 { 6819 {
@@ -7273,7 +6838,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7273 } 6838 }
7274 #endregion 6839 #endregion
7275 6840
7276 CreateNewInventoryItem handlerCreateNewInventoryItem = OnCreateNewInventoryItem; 6841 handlerCreateNewInventoryItem = OnCreateNewInventoryItem;
7277 if (handlerCreateNewInventoryItem != null) 6842 if (handlerCreateNewInventoryItem != null)
7278 { 6843 {
7279 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, 6844 handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID,
@@ -7302,7 +6867,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7302 } 6867 }
7303 #endregion 6868 #endregion
7304 6869
7305 FetchInventory handlerFetchInventory = null; 6870 handlerFetchInventory = null;
7306 6871
7307 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++) 6872 for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++)
7308 { 6873 {
@@ -7328,7 +6893,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7328 } 6893 }
7329 #endregion 6894 #endregion
7330 6895
7331 FetchInventoryDescendents handlerFetchInventoryDescendents = OnFetchInventoryDescendents; 6896 handlerFetchInventoryDescendents = OnFetchInventoryDescendents;
7332 if (handlerFetchInventoryDescendents != null) 6897 if (handlerFetchInventoryDescendents != null)
7333 { 6898 {
7334 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, 6899 handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID,
@@ -7348,7 +6913,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7348 } 6913 }
7349 #endregion 6914 #endregion
7350 6915
7351 PurgeInventoryDescendents handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents; 6916 handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents;
7352 if (handlerPurgeInventoryDescendents != null) 6917 if (handlerPurgeInventoryDescendents != null)
7353 { 6918 {
7354 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); 6919 handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID);
@@ -7368,7 +6933,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7368 6933
7369 if (OnUpdateInventoryItem != null) 6934 if (OnUpdateInventoryItem != null)
7370 { 6935 {
7371 UpdateInventoryItem handlerUpdateInventoryItem = null; 6936 handlerUpdateInventoryItem = null;
7372 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++) 6937 for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++)
7373 { 6938 {
7374 handlerUpdateInventoryItem = OnUpdateInventoryItem; 6939 handlerUpdateInventoryItem = OnUpdateInventoryItem;
@@ -7390,13 +6955,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7390 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice; 6955 itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice;
7391 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType; 6956 itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType;
7392 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags; 6957 itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags;
7393 6958 /*
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 */
7394 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID, 6965 OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID,
7395 inventoryItemUpdate.InventoryData[i].ItemID, 6966 inventoryItemUpdate.InventoryData[i].ItemID,
7396 itemUpd); 6967 itemUpd);
7397 } 6968 }
7398 } 6969 }
7399 } 6970 }
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 }*/
7400 break; 7001 break;
7401 case PacketType.CopyInventoryItem: 7002 case PacketType.CopyInventoryItem:
7402 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; 7003 CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack;
@@ -7410,7 +7011,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7410 } 7011 }
7411 #endregion 7012 #endregion
7412 7013
7413 CopyInventoryItem handlerCopyInventoryItem = null; 7014 handlerCopyInventoryItem = null;
7414 if (OnCopyInventoryItem != null) 7015 if (OnCopyInventoryItem != null)
7415 { 7016 {
7416 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) 7017 foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData)
@@ -7439,7 +7040,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7439 7040
7440 if (OnMoveInventoryItem != null) 7041 if (OnMoveInventoryItem != null)
7441 { 7042 {
7442 MoveInventoryItem handlerMoveInventoryItem = null; 7043 handlerMoveInventoryItem = null;
7443 InventoryItemBase itm = null; 7044 InventoryItemBase itm = null;
7444 List<InventoryItemBase> items = new List<InventoryItemBase>(); 7045 List<InventoryItemBase> items = new List<InventoryItemBase>();
7445 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) 7046 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
@@ -7472,7 +7073,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7472 7073
7473 if (OnRemoveInventoryItem != null) 7074 if (OnRemoveInventoryItem != null)
7474 { 7075 {
7475 RemoveInventoryItem handlerRemoveInventoryItem = null; 7076 handlerRemoveInventoryItem = null;
7476 List<UUID> uuids = new List<UUID>(); 7077 List<UUID> uuids = new List<UUID>();
7477 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) 7078 foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData)
7478 { 7079 {
@@ -7500,7 +7101,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7500 7101
7501 if (OnRemoveInventoryFolder != null) 7102 if (OnRemoveInventoryFolder != null)
7502 { 7103 {
7503 RemoveInventoryFolder handlerRemoveInventoryFolder = null; 7104 handlerRemoveInventoryFolder = null;
7504 List<UUID> uuids = new List<UUID>(); 7105 List<UUID> uuids = new List<UUID>();
7505 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) 7106 foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
7506 { 7107 {
@@ -7525,7 +7126,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7525 #endregion 7126 #endregion
7526 if (OnRemoveInventoryFolder != null) 7127 if (OnRemoveInventoryFolder != null)
7527 { 7128 {
7528 RemoveInventoryFolder handlerRemoveInventoryFolder = null; 7129 handlerRemoveInventoryFolder = null;
7529 List<UUID> uuids = new List<UUID>(); 7130 List<UUID> uuids = new List<UUID>();
7530 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) 7131 foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
7531 { 7132 {
@@ -7540,7 +7141,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7540 7141
7541 if (OnRemoveInventoryItem != null) 7142 if (OnRemoveInventoryItem != null)
7542 { 7143 {
7543 RemoveInventoryItem handlerRemoveInventoryItem = null; 7144 handlerRemoveInventoryItem = null;
7544 List<UUID> uuids = new List<UUID>(); 7145 List<UUID> uuids = new List<UUID>();
7545 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) 7146 foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData)
7546 { 7147 {
@@ -7565,7 +7166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7565 } 7166 }
7566 #endregion 7167 #endregion
7567 7168
7568 RequestTaskInventory handlerRequestTaskInventory = OnRequestTaskInventory; 7169 handlerRequestTaskInventory = OnRequestTaskInventory;
7569 if (handlerRequestTaskInventory != null) 7170 if (handlerRequestTaskInventory != null)
7570 { 7171 {
7571 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); 7172 handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID);
@@ -7587,7 +7188,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7587 { 7188 {
7588 if (updatetask.UpdateData.Key == 0) 7189 if (updatetask.UpdateData.Key == 0)
7589 { 7190 {
7590 UpdateTaskInventory handlerUpdateTaskInventory = OnUpdateTaskInventory; 7191 handlerUpdateTaskInventory = OnUpdateTaskInventory;
7591 if (handlerUpdateTaskInventory != null) 7192 if (handlerUpdateTaskInventory != null)
7592 { 7193 {
7593 TaskInventoryItem newTaskItem = new TaskInventoryItem(); 7194 TaskInventoryItem newTaskItem = new TaskInventoryItem();
@@ -7631,7 +7232,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7631 } 7232 }
7632 #endregion 7233 #endregion
7633 7234
7634 RemoveTaskInventory handlerRemoveTaskItem = OnRemoveTaskItem; 7235 handlerRemoveTaskItem = OnRemoveTaskItem;
7635 7236
7636 if (handlerRemoveTaskItem != null) 7237 if (handlerRemoveTaskItem != null)
7637 { 7238 {
@@ -7653,7 +7254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7653 } 7254 }
7654 #endregion 7255 #endregion
7655 7256
7656 MoveTaskInventory handlerMoveTaskItem = OnMoveTaskItem; 7257 handlerMoveTaskItem = OnMoveTaskItem;
7657 7258
7658 if (handlerMoveTaskItem != null) 7259 if (handlerMoveTaskItem != null)
7659 { 7260 {
@@ -7678,7 +7279,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7678 } 7279 }
7679 #endregion 7280 #endregion
7680 7281
7681 RezScript handlerRezScript = OnRezScript; 7282 handlerRezScript = OnRezScript;
7682 InventoryItemBase item = new InventoryItemBase(); 7283 InventoryItemBase item = new InventoryItemBase();
7683 item.ID = rezScriptx.InventoryBlock.ItemID; 7284 item.ID = rezScriptx.InventoryBlock.ItemID;
7684 item.Folder = rezScriptx.InventoryBlock.FolderID; 7285 item.Folder = rezScriptx.InventoryBlock.FolderID;
@@ -7721,7 +7322,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7721 } 7322 }
7722 #endregion 7323 #endregion
7723 7324
7724 RequestMapBlocks handlerRequestMapBlocks = OnRequestMapBlocks; 7325 handlerRequestMapBlocks = OnRequestMapBlocks;
7725 if (handlerRequestMapBlocks != null) 7326 if (handlerRequestMapBlocks != null)
7726 { 7327 {
7727 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, 7328 handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY,
@@ -7742,7 +7343,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7742 7343
7743 string mapName = Util.UTF8.GetString(map.NameData.Name, 0, 7344 string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
7744 map.NameData.Name.Length - 1); 7345 map.NameData.Name.Length - 1);
7745 RequestMapName handlerMapNameRequest = OnMapNameRequest; 7346 handlerMapNameRequest = OnMapNameRequest;
7746 if (handlerMapNameRequest != null) 7347 if (handlerMapNameRequest != null)
7747 { 7348 {
7748 handlerMapNameRequest(this, mapName); 7349 handlerMapNameRequest(this, mapName);
@@ -7793,7 +7394,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7793 else 7394 else
7794 { 7395 {
7795 // Teleport home request 7396 // Teleport home request
7796 UUIDNameRequest handlerTeleportHomeRequest = OnTeleportHomeRequest; 7397 handlerTeleportHomeRequest = OnTeleportHomeRequest;
7797 if (handlerTeleportHomeRequest != null) 7398 if (handlerTeleportHomeRequest != null)
7798 { 7399 {
7799 handlerTeleportHomeRequest(AgentId, this); 7400 handlerTeleportHomeRequest(AgentId, this);
@@ -7801,7 +7402,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7801 break; 7402 break;
7802 } 7403 }
7803 7404
7804 TeleportLandmarkRequest handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; 7405 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest;
7805 if (handlerTeleportLandmarkRequest != null) 7406 if (handlerTeleportLandmarkRequest != null)
7806 { 7407 {
7807 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position); 7408 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position);
@@ -7832,7 +7433,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7832 } 7433 }
7833 #endregion 7434 #endregion
7834 7435
7835 TeleportLocationRequest handlerTeleportLocationRequest = OnTeleportLocationRequest; 7436 handlerTeleportLocationRequest = OnTeleportLocationRequest;
7836 if (handlerTeleportLocationRequest != null) 7437 if (handlerTeleportLocationRequest != null)
7837 { 7438 {
7838 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, 7439 handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position,
@@ -7855,7 +7456,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7855 7456
7856 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) 7457 foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)
7857 { 7458 {
7858 UUIDNameRequest handlerNameRequest = OnNameFromUUIDRequest; 7459 handlerNameRequest = OnNameFromUUIDRequest;
7859 if (handlerNameRequest != null) 7460 if (handlerNameRequest != null)
7860 { 7461 {
7861 handlerNameRequest(UUIDBlock.ID, this); 7462 handlerNameRequest(UUIDBlock.ID, this);
@@ -7868,7 +7469,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7868 case PacketType.RegionHandleRequest: 7469 case PacketType.RegionHandleRequest:
7869 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; 7470 RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
7870 7471
7871 RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; 7472 handlerRegionHandleRequest = OnRegionHandleRequest;
7872 if (handlerRegionHandleRequest != null) 7473 if (handlerRegionHandleRequest != null)
7873 { 7474 {
7874 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); 7475 handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
@@ -7887,7 +7488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7887 } 7488 }
7888 #endregion 7489 #endregion
7889 7490
7890 ParcelInfoRequest handlerParcelInfoRequest = OnParcelInfoRequest; 7491 handlerParcelInfoRequest = OnParcelInfoRequest;
7891 if (handlerParcelInfoRequest != null) 7492 if (handlerParcelInfoRequest != null)
7892 { 7493 {
7893 handlerParcelInfoRequest(this, pirPack.Data.ParcelID); 7494 handlerParcelInfoRequest(this, pirPack.Data.ParcelID);
@@ -7906,7 +7507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7906 } 7507 }
7907 #endregion 7508 #endregion
7908 7509
7909 ParcelAccessListRequest handlerParcelAccessListRequest = OnParcelAccessListRequest; 7510 handlerParcelAccessListRequest = OnParcelAccessListRequest;
7910 7511
7911 if (handlerParcelAccessListRequest != null) 7512 if (handlerParcelAccessListRequest != null)
7912 { 7513 {
@@ -7938,7 +7539,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7938 entries.Add(entry); 7539 entries.Add(entry);
7939 } 7540 }
7940 7541
7941 ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest; 7542 handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest;
7942 if (handlerParcelAccessListUpdateRequest != null) 7543 if (handlerParcelAccessListUpdateRequest != null)
7943 { 7544 {
7944 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, 7545 handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID,
@@ -7959,7 +7560,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7959 } 7560 }
7960 #endregion 7561 #endregion
7961 7562
7962 ParcelPropertiesRequest handlerParcelPropertiesRequest = OnParcelPropertiesRequest; 7563 handlerParcelPropertiesRequest = OnParcelPropertiesRequest;
7963 if (handlerParcelPropertiesRequest != null) 7564 if (handlerParcelPropertiesRequest != null)
7964 { 7565 {
7965 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), 7566 handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West),
@@ -7982,7 +7583,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7982 } 7583 }
7983 #endregion 7584 #endregion
7984 7585
7985 ParcelDivideRequest handlerParcelDivideRequest = OnParcelDivideRequest; 7586 handlerParcelDivideRequest = OnParcelDivideRequest;
7986 if (handlerParcelDivideRequest != null) 7587 if (handlerParcelDivideRequest != null)
7987 { 7588 {
7988 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), 7589 handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West),
@@ -8003,7 +7604,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8003 } 7604 }
8004 #endregion 7605 #endregion
8005 7606
8006 ParcelJoinRequest handlerParcelJoinRequest = OnParcelJoinRequest; 7607 handlerParcelJoinRequest = OnParcelJoinRequest;
8007 7608
8008 if (handlerParcelJoinRequest != null) 7609 if (handlerParcelJoinRequest != null)
8009 { 7610 {
@@ -8025,7 +7626,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8025 } 7626 }
8026 #endregion 7627 #endregion
8027 7628
8028 ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest; 7629 handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest;
8029 7630
8030 if (handlerParcelPropertiesUpdateRequest != null) 7631 if (handlerParcelPropertiesUpdateRequest != null)
8031 { 7632 {
@@ -8071,7 +7672,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8071 returnIDs.Add(rb.ReturnID); 7672 returnIDs.Add(rb.ReturnID);
8072 } 7673 }
8073 7674
8074 ParcelSelectObjects handlerParcelSelectObjects = OnParcelSelectObjects; 7675 handlerParcelSelectObjects = OnParcelSelectObjects;
8075 7676
8076 if (handlerParcelSelectObjects != null) 7677 if (handlerParcelSelectObjects != null)
8077 { 7678 {
@@ -8092,7 +7693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8092 } 7693 }
8093 #endregion 7694 #endregion
8094 7695
8095 ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; 7696 handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest;
8096 7697
8097 if (handlerParcelObjectOwnerRequest != null) 7698 if (handlerParcelObjectOwnerRequest != null)
8098 { 7699 {
@@ -8111,7 +7712,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8111 } 7712 }
8112 #endregion 7713 #endregion
8113 7714
8114 ParcelGodForceOwner handlerParcelGodForceOwner = OnParcelGodForceOwner; 7715 handlerParcelGodForceOwner = OnParcelGodForceOwner;
8115 if (handlerParcelGodForceOwner != null) 7716 if (handlerParcelGodForceOwner != null)
8116 { 7717 {
8117 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); 7718 handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this);
@@ -8129,7 +7730,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8129 } 7730 }
8130 #endregion 7731 #endregion
8131 7732
8132 ParcelAbandonRequest handlerParcelAbandonRequest = OnParcelAbandonRequest; 7733 handlerParcelAbandonRequest = OnParcelAbandonRequest;
8133 if (handlerParcelAbandonRequest != null) 7734 if (handlerParcelAbandonRequest != null)
8134 { 7735 {
8135 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); 7736 handlerParcelAbandonRequest(releasePacket.Data.LocalID, this);
@@ -8147,7 +7748,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8147 } 7748 }
8148 #endregion 7749 #endregion
8149 7750
8150 ParcelReclaim handlerParcelReclaim = OnParcelReclaim; 7751 handlerParcelReclaim = OnParcelReclaim;
8151 if (handlerParcelReclaim != null) 7752 if (handlerParcelReclaim != null)
8152 { 7753 {
8153 handlerParcelReclaim(reclaimPacket.Data.LocalID, this); 7754 handlerParcelReclaim(reclaimPacket.Data.LocalID, this);
@@ -8176,7 +7777,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8176 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) 7777 for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++)
8177 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; 7778 puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID;
8178 7779
8179 ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; 7780 handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest;
8180 if (handlerParcelReturnObjectsRequest != null) 7781 if (handlerParcelReturnObjectsRequest != null)
8181 { 7782 {
8182 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this); 7783 handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this);
@@ -8196,7 +7797,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8196 } 7797 }
8197 #endregion 7798 #endregion
8198 7799
8199 ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; 7800 handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime;
8200 if (handlerParcelSetOtherCleanTime != null) 7801 if (handlerParcelSetOtherCleanTime != null)
8201 { 7802 {
8202 handlerParcelSetOtherCleanTime(this, 7803 handlerParcelSetOtherCleanTime(this,
@@ -8217,7 +7818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8217 } 7818 }
8218 #endregion 7819 #endregion
8219 7820
8220 GodLandStatRequest handlerLandStatRequest = OnLandStatRequest; 7821 handlerLandStatRequest = OnLandStatRequest;
8221 if (handlerLandStatRequest != null) 7822 if (handlerLandStatRequest != null)
8222 { 7823 {
8223 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); 7824 handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this);
@@ -8237,7 +7838,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8237 } 7838 }
8238 #endregion 7839 #endregion
8239 7840
8240 ParcelDwellRequest handlerParcelDwellRequest = OnParcelDwellRequest; 7841 handlerParcelDwellRequest = OnParcelDwellRequest;
8241 if (handlerParcelDwellRequest != null) 7842 if (handlerParcelDwellRequest != null)
8242 { 7843 {
8243 handlerParcelDwellRequest(dwellrq.Data.LocalID, this); 7844 handlerParcelDwellRequest(dwellrq.Data.LocalID, this);
@@ -8481,7 +8082,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8481 { 8082 {
8482 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake") 8083 if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake")
8483 { 8084 {
8484 BakeTerrain handlerBakeTerrain = OnBakeTerrain; 8085 handlerBakeTerrain = OnBakeTerrain;
8485 if (handlerBakeTerrain != null) 8086 if (handlerBakeTerrain != null)
8486 { 8087 {
8487 handlerBakeTerrain(this); 8088 handlerBakeTerrain(this);
@@ -8491,7 +8092,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8491 { 8092 {
8492 if (messagePacket.ParamList.Length > 1) 8093 if (messagePacket.ParamList.Length > 1)
8493 { 8094 {
8494 RequestTerrain handlerRequestTerrain = OnRequestTerrain; 8095 handlerRequestTerrain = OnRequestTerrain;
8495 if (handlerRequestTerrain != null) 8096 if (handlerRequestTerrain != null)
8496 { 8097 {
8497 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8098 handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8502,7 +8103,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8502 { 8103 {
8503 if (messagePacket.ParamList.Length > 1) 8104 if (messagePacket.ParamList.Length > 1)
8504 { 8105 {
8505 RequestTerrain handlerUploadTerrain = OnUploadTerrain; 8106 handlerUploadTerrain = OnUploadTerrain;
8506 if (handlerUploadTerrain != null) 8107 if (handlerUploadTerrain != null)
8507 { 8108 {
8508 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8109 handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter));
@@ -8524,7 +8125,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8524 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); 8125 UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
8525 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); 8126 UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter));
8526 8127
8527 EstateChangeInfo handlerEstateChangeInfo = OnEstateChangeInfo; 8128 handlerEstateChangeInfo = OnEstateChangeInfo;
8528 if (handlerEstateChangeInfo != null) 8129 if (handlerEstateChangeInfo != null)
8529 { 8130 {
8530 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2); 8131 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2);
@@ -8558,7 +8159,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8558 } 8159 }
8559 #endregion 8160 #endregion
8560 8161
8561 RegionInfoRequest handlerRegionInfoRequest = OnRegionInfoRequest; 8162 handlerRegionInfoRequest = OnRegionInfoRequest;
8562 if (handlerRegionInfoRequest != null) 8163 if (handlerRegionInfoRequest != null)
8563 { 8164 {
8564 handlerRegionInfoRequest(this); 8165 handlerRegionInfoRequest(this);
@@ -8569,7 +8170,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8569 //EstateCovenantRequestPacket.AgentDataBlock epack = 8170 //EstateCovenantRequestPacket.AgentDataBlock epack =
8570 // ((EstateCovenantRequestPacket)Pack).AgentData; 8171 // ((EstateCovenantRequestPacket)Pack).AgentData;
8571 8172
8572 EstateCovenantRequest handlerEstateCovenantRequest = OnEstateCovenantRequest; 8173 handlerEstateCovenantRequest = OnEstateCovenantRequest;
8573 if (handlerEstateCovenantRequest != null) 8174 if (handlerEstateCovenantRequest != null)
8574 { 8175 {
8575 handlerEstateCovenantRequest(this); 8176 handlerEstateCovenantRequest(this);
@@ -8587,7 +8188,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8587 8188
8588 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; 8189 RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData;
8589 8190
8590 RequestGodlikePowers handlerReqGodlikePowers = OnRequestGodlikePowers; 8191 handlerReqGodlikePowers = OnRequestGodlikePowers;
8591 8192
8592 if (handlerReqGodlikePowers != null) 8193 if (handlerReqGodlikePowers != null)
8593 { 8194 {
@@ -8600,7 +8201,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8600 8201
8601 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) 8202 if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID)
8602 { 8203 {
8603 GodKickUser handlerGodKickUser = OnGodKickUser; 8204 handlerGodKickUser = OnGodKickUser;
8604 if (handlerGodKickUser != null) 8205 if (handlerGodKickUser != null)
8605 { 8206 {
8606 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, 8207 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID,
@@ -8640,7 +8241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8640 } 8241 }
8641 #endregion 8242 #endregion
8642 8243
8643 MoneyBalanceRequest handlerMoneyBalanceRequest = OnMoneyBalanceRequest; 8244 handlerMoneyBalanceRequest = OnMoneyBalanceRequest;
8644 8245
8645 if (handlerMoneyBalanceRequest != null) 8246 if (handlerMoneyBalanceRequest != null)
8646 { 8247 {
@@ -8651,7 +8252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8651 case PacketType.EconomyDataRequest: 8252 case PacketType.EconomyDataRequest:
8652 8253
8653 8254
8654 EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; 8255 handlerEconomoyDataRequest = OnEconomyDataRequest;
8655 if (handlerEconomoyDataRequest != null) 8256 if (handlerEconomoyDataRequest != null)
8656 { 8257 {
8657 handlerEconomoyDataRequest(AgentId); 8258 handlerEconomoyDataRequest(AgentId);
@@ -8660,7 +8261,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8660 case PacketType.RequestPayPrice: 8261 case PacketType.RequestPayPrice:
8661 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; 8262 RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack;
8662 8263
8663 RequestPayPrice handlerRequestPayPrice = OnRequestPayPrice; 8264 handlerRequestPayPrice = OnRequestPayPrice;
8664 if (handlerRequestPayPrice != null) 8265 if (handlerRequestPayPrice != null)
8665 { 8266 {
8666 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); 8267 handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID);
@@ -8679,7 +8280,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8679 } 8280 }
8680 #endregion 8281 #endregion
8681 8282
8682 ObjectSaleInfo handlerObjectSaleInfo = OnObjectSaleInfo; 8283 handlerObjectSaleInfo = OnObjectSaleInfo;
8683 if (handlerObjectSaleInfo != null) 8284 if (handlerObjectSaleInfo != null)
8684 { 8285 {
8685 foreach (ObjectSaleInfoPacket.ObjectDataBlock d 8286 foreach (ObjectSaleInfoPacket.ObjectDataBlock d
@@ -8707,7 +8308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8707 } 8308 }
8708 #endregion 8309 #endregion
8709 8310
8710 ObjectBuy handlerObjectBuy = OnObjectBuy; 8311 handlerObjectBuy = OnObjectBuy;
8711 8312
8712 if (handlerObjectBuy != null) 8313 if (handlerObjectBuy != null)
8713 { 8314 {
@@ -8733,7 +8334,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8733 case PacketType.GetScriptRunning: 8334 case PacketType.GetScriptRunning:
8734 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; 8335 GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
8735 8336
8736 GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning; 8337 handlerGetScriptRunning = OnGetScriptRunning;
8737 if (handlerGetScriptRunning != null) 8338 if (handlerGetScriptRunning != null)
8738 { 8339 {
8739 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID); 8340 handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
@@ -8752,7 +8353,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8752 } 8353 }
8753 #endregion 8354 #endregion
8754 8355
8755 SetScriptRunning handlerSetScriptRunning = OnSetScriptRunning; 8356 handlerSetScriptRunning = OnSetScriptRunning;
8756 if (handlerSetScriptRunning != null) 8357 if (handlerSetScriptRunning != null)
8757 { 8358 {
8758 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running); 8359 handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
@@ -8771,7 +8372,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8771 } 8372 }
8772 #endregion 8373 #endregion
8773 8374
8774 ScriptReset handlerScriptReset = OnScriptReset; 8375 handlerScriptReset = OnScriptReset;
8775 if (handlerScriptReset != null) 8376 if (handlerScriptReset != null)
8776 { 8377 {
8777 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID); 8378 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
@@ -8794,7 +8395,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8794 } 8395 }
8795 #endregion 8396 #endregion
8796 8397
8797 ActivateGesture handlerActivateGesture = OnActivateGesture; 8398 handlerActivateGesture = OnActivateGesture;
8798 if (handlerActivateGesture != null) 8399 if (handlerActivateGesture != null)
8799 { 8400 {
8800 handlerActivateGesture(this, 8401 handlerActivateGesture(this,
@@ -8817,7 +8418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8817 } 8418 }
8818 #endregion 8419 #endregion
8819 8420
8820 DeactivateGesture handlerDeactivateGesture = OnDeactivateGesture; 8421 handlerDeactivateGesture = OnDeactivateGesture;
8821 if (handlerDeactivateGesture != null) 8422 if (handlerDeactivateGesture != null)
8822 { 8423 {
8823 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID); 8424 handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID);
@@ -8840,7 +8441,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8840 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData) 8441 foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData)
8841 localIDs.Add(d.ObjectLocalID); 8442 localIDs.Add(d.ObjectLocalID);
8842 8443
8843 ObjectOwner handlerObjectOwner = OnObjectOwner; 8444 handlerObjectOwner = OnObjectOwner;
8844 if (handlerObjectOwner != null) 8445 if (handlerObjectOwner != null)
8845 { 8446 {
8846 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs); 8447 handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs);
@@ -8853,14 +8454,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8853 #region unimplemented handlers 8454 #region unimplemented handlers
8854 8455
8855 case PacketType.StartPingCheck: 8456 case PacketType.StartPingCheck:
8856 StartPingCheckPacket pingStart = (StartPingCheckPacket)Pack; 8457 // Send the client the ping response back
8857 CompletePingCheckPacket pingComplete = new CompletePingCheckPacket(); 8458 // Pass the same PingID in the matching packet
8858 pingComplete.PingID.PingID = pingStart.PingID.PingID; 8459 // Handled In the packet processing
8859 m_udpServer.SendPacket(m_udpClient, pingComplete, ThrottleOutPacketType.Unknown, false); 8460 //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet");
8860 break; 8461 break;
8861
8862 case PacketType.CompletePingCheck: 8462 case PacketType.CompletePingCheck:
8863 // TODO: Do stats tracking or something with these? 8463 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
8464 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
8864 break; 8465 break;
8865 8466
8866 case PacketType.ViewerStats: 8467 case PacketType.ViewerStats:
@@ -8881,7 +8482,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8881 #endregion 8482 #endregion
8882 8483
8883 //m_log.Debug(mirpk.ToString()); 8484 //m_log.Debug(mirpk.ToString());
8884 MapItemRequest handlerMapItemRequest = OnMapItemRequest; 8485 handlerMapItemRequest = OnMapItemRequest;
8885 if (handlerMapItemRequest != null) 8486 if (handlerMapItemRequest != null)
8886 { 8487 {
8887 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID, 8488 handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
@@ -8908,7 +8509,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8908 } 8509 }
8909 #endregion 8510 #endregion
8910 8511
8911 MuteListRequest handlerMuteListRequest = OnMuteListRequest; 8512 handlerMuteListRequest = OnMuteListRequest;
8912 if (handlerMuteListRequest != null) 8513 if (handlerMuteListRequest != null)
8913 { 8514 {
8914 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC); 8515 handlerMuteListRequest(this, muteListRequest.MuteData.MuteCRC);
@@ -8945,7 +8546,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8945 } 8546 }
8946 #endregion 8547 #endregion
8947 8548
8948 DirPlacesQuery handlerDirPlacesQuery = OnDirPlacesQuery; 8549 handlerDirPlacesQuery = OnDirPlacesQuery;
8949 if (handlerDirPlacesQuery != null) 8550 if (handlerDirPlacesQuery != null)
8950 { 8551 {
8951 handlerDirPlacesQuery(this, 8552 handlerDirPlacesQuery(this,
@@ -8971,7 +8572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8971 } 8572 }
8972 #endregion 8573 #endregion
8973 8574
8974 DirFindQuery handlerDirFindQuery = OnDirFindQuery; 8575 handlerDirFindQuery = OnDirFindQuery;
8975 if (handlerDirFindQuery != null) 8576 if (handlerDirFindQuery != null)
8976 { 8577 {
8977 handlerDirFindQuery(this, 8578 handlerDirFindQuery(this,
@@ -8994,7 +8595,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8994 } 8595 }
8995 #endregion 8596 #endregion
8996 8597
8997 DirLandQuery handlerDirLandQuery = OnDirLandQuery; 8598 handlerDirLandQuery = OnDirLandQuery;
8998 if (handlerDirLandQuery != null) 8599 if (handlerDirLandQuery != null)
8999 { 8600 {
9000 handlerDirLandQuery(this, 8601 handlerDirLandQuery(this,
@@ -9018,7 +8619,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9018 } 8619 }
9019 #endregion 8620 #endregion
9020 8621
9021 DirPopularQuery handlerDirPopularQuery = OnDirPopularQuery; 8622 handlerDirPopularQuery = OnDirPopularQuery;
9022 if (handlerDirPopularQuery != null) 8623 if (handlerDirPopularQuery != null)
9023 { 8624 {
9024 handlerDirPopularQuery(this, 8625 handlerDirPopularQuery(this,
@@ -9038,7 +8639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9038 } 8639 }
9039 #endregion 8640 #endregion
9040 8641
9041 DirClassifiedQuery handlerDirClassifiedQuery = OnDirClassifiedQuery; 8642 handlerDirClassifiedQuery = OnDirClassifiedQuery;
9042 if (handlerDirClassifiedQuery != null) 8643 if (handlerDirClassifiedQuery != null)
9043 { 8644 {
9044 handlerDirClassifiedQuery(this, 8645 handlerDirClassifiedQuery(this,
@@ -9554,7 +9155,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9554 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack; 9155 ParcelDeedToGroupPacket parcelDeedToGroup = (ParcelDeedToGroupPacket)Pack;
9555 if (m_GroupsModule != null) 9156 if (m_GroupsModule != null)
9556 { 9157 {
9557 ParcelDeedToGroup handlerParcelDeedToGroup = OnParcelDeedToGroup; 9158 handlerParcelDeedToGroup = OnParcelDeedToGroup;
9558 if (handlerParcelDeedToGroup != null) 9159 if (handlerParcelDeedToGroup != null)
9559 { 9160 {
9560 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this); 9161 handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this);
@@ -9798,7 +9399,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9798 } 9399 }
9799 #endregion 9400 #endregion
9800 9401
9801 StartLure handlerStartLure = OnStartLure; 9402 handlerStartLure = OnStartLure;
9802 if (handlerStartLure != null) 9403 if (handlerStartLure != null)
9803 handlerStartLure(startLureRequest.Info.LureType, 9404 handlerStartLure(startLureRequest.Info.LureType,
9804 Utils.BytesToString( 9405 Utils.BytesToString(
@@ -9820,7 +9421,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9820 } 9421 }
9821 #endregion 9422 #endregion
9822 9423
9823 TeleportLureRequest handlerTeleportLureRequest = OnTeleportLureRequest; 9424 handlerTeleportLureRequest = OnTeleportLureRequest;
9824 if (handlerTeleportLureRequest != null) 9425 if (handlerTeleportLureRequest != null)
9825 handlerTeleportLureRequest( 9426 handlerTeleportLureRequest(
9826 teleportLureRequest.Info.LureID, 9427 teleportLureRequest.Info.LureID,
@@ -9841,7 +9442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9841 } 9442 }
9842 #endregion 9443 #endregion
9843 9444
9844 ClassifiedInfoRequest handlerClassifiedInfoRequest = OnClassifiedInfoRequest; 9445 handlerClassifiedInfoRequest = OnClassifiedInfoRequest;
9845 if (handlerClassifiedInfoRequest != null) 9446 if (handlerClassifiedInfoRequest != null)
9846 handlerClassifiedInfoRequest( 9447 handlerClassifiedInfoRequest(
9847 classifiedInfoRequest.Data.ClassifiedID, 9448 classifiedInfoRequest.Data.ClassifiedID,
@@ -9861,7 +9462,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9861 } 9462 }
9862 #endregion 9463 #endregion
9863 9464
9864 ClassifiedInfoUpdate handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate; 9465 handlerClassifiedInfoUpdate = OnClassifiedInfoUpdate;
9865 if (handlerClassifiedInfoUpdate != null) 9466 if (handlerClassifiedInfoUpdate != null)
9866 handlerClassifiedInfoUpdate( 9467 handlerClassifiedInfoUpdate(
9867 classifiedInfoUpdate.Data.ClassifiedID, 9468 classifiedInfoUpdate.Data.ClassifiedID,
@@ -9893,7 +9494,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9893 } 9494 }
9894 #endregion 9495 #endregion
9895 9496
9896 ClassifiedDelete handlerClassifiedDelete = OnClassifiedDelete; 9497 handlerClassifiedDelete = OnClassifiedDelete;
9897 if (handlerClassifiedDelete != null) 9498 if (handlerClassifiedDelete != null)
9898 handlerClassifiedDelete( 9499 handlerClassifiedDelete(
9899 classifiedDelete.Data.ClassifiedID, 9500 classifiedDelete.Data.ClassifiedID,
@@ -9913,7 +9514,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9913 } 9514 }
9914 #endregion 9515 #endregion
9915 9516
9916 ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete; 9517 handlerClassifiedGodDelete = OnClassifiedGodDelete;
9917 if (handlerClassifiedGodDelete != null) 9518 if (handlerClassifiedGodDelete != null)
9918 handlerClassifiedGodDelete( 9519 handlerClassifiedGodDelete(
9919 classifiedGodDelete.Data.ClassifiedID, 9520 classifiedGodDelete.Data.ClassifiedID,
@@ -9933,7 +9534,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9933 } 9534 }
9934 #endregion 9535 #endregion
9935 9536
9936 EventGodDelete handlerEventGodDelete = OnEventGodDelete; 9537 handlerEventGodDelete = OnEventGodDelete;
9937 if (handlerEventGodDelete != null) 9538 if (handlerEventGodDelete != null)
9938 handlerEventGodDelete( 9539 handlerEventGodDelete(
9939 eventGodDelete.EventData.EventID, 9540 eventGodDelete.EventData.EventID,
@@ -9958,7 +9559,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9958 } 9559 }
9959 #endregion 9560 #endregion
9960 9561
9961 EventNotificationAddRequest handlerEventNotificationAddRequest = OnEventNotificationAddRequest; 9562 handlerEventNotificationAddRequest = OnEventNotificationAddRequest;
9962 if (handlerEventNotificationAddRequest != null) 9563 if (handlerEventNotificationAddRequest != null)
9963 handlerEventNotificationAddRequest( 9564 handlerEventNotificationAddRequest(
9964 eventNotificationAdd.EventData.EventID, this); 9565 eventNotificationAdd.EventData.EventID, this);
@@ -9977,7 +9578,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9977 } 9578 }
9978 #endregion 9579 #endregion
9979 9580
9980 EventNotificationRemoveRequest handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest; 9581 handlerEventNotificationRemoveRequest = OnEventNotificationRemoveRequest;
9981 if (handlerEventNotificationRemoveRequest != null) 9582 if (handlerEventNotificationRemoveRequest != null)
9982 handlerEventNotificationRemoveRequest( 9583 handlerEventNotificationRemoveRequest(
9983 eventNotificationRemove.EventData.EventID, this); 9584 eventNotificationRemove.EventData.EventID, this);
@@ -9995,7 +9596,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9995 } 9596 }
9996 #endregion 9597 #endregion
9997 9598
9998 RetrieveInstantMessages handlerRetrieveInstantMessages = OnRetrieveInstantMessages; 9599 handlerRetrieveInstantMessages = OnRetrieveInstantMessages;
9999 if (handlerRetrieveInstantMessages != null) 9600 if (handlerRetrieveInstantMessages != null)
10000 handlerRetrieveInstantMessages(this); 9601 handlerRetrieveInstantMessages(this);
10001 break; 9602 break;
@@ -10013,7 +9614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10013 } 9614 }
10014 #endregion 9615 #endregion
10015 9616
10016 PickDelete handlerPickDelete = OnPickDelete; 9617 handlerPickDelete = OnPickDelete;
10017 if (handlerPickDelete != null) 9618 if (handlerPickDelete != null)
10018 handlerPickDelete(this, pickDelete.Data.PickID); 9619 handlerPickDelete(this, pickDelete.Data.PickID);
10019 break; 9620 break;
@@ -10030,7 +9631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10030 } 9631 }
10031 #endregion 9632 #endregion
10032 9633
10033 PickGodDelete handlerPickGodDelete = OnPickGodDelete; 9634 handlerPickGodDelete = OnPickGodDelete;
10034 if (handlerPickGodDelete != null) 9635 if (handlerPickGodDelete != null)
10035 handlerPickGodDelete(this, 9636 handlerPickGodDelete(this,
10036 pickGodDelete.AgentData.AgentID, 9637 pickGodDelete.AgentData.AgentID,
@@ -10050,7 +9651,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10050 } 9651 }
10051 #endregion 9652 #endregion
10052 9653
10053 PickInfoUpdate handlerPickInfoUpdate = OnPickInfoUpdate; 9654 handlerPickInfoUpdate = OnPickInfoUpdate;
10054 if (handlerPickInfoUpdate != null) 9655 if (handlerPickInfoUpdate != null)
10055 handlerPickInfoUpdate(this, 9656 handlerPickInfoUpdate(this,
10056 pickInfoUpdate.Data.PickID, 9657 pickInfoUpdate.Data.PickID,
@@ -10075,7 +9676,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10075 } 9676 }
10076 #endregion 9677 #endregion
10077 9678
10078 AvatarNotesUpdate handlerAvatarNotesUpdate = OnAvatarNotesUpdate; 9679 handlerAvatarNotesUpdate = OnAvatarNotesUpdate;
10079 if (handlerAvatarNotesUpdate != null) 9680 if (handlerAvatarNotesUpdate != null)
10080 handlerAvatarNotesUpdate(this, 9681 handlerAvatarNotesUpdate(this,
10081 avatarNotesUpdate.Data.TargetID, 9682 avatarNotesUpdate.Data.TargetID,
@@ -10092,7 +9693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10092 PlacesQueryPacket placesQueryPacket = 9693 PlacesQueryPacket placesQueryPacket =
10093 (PlacesQueryPacket)Pack; 9694 (PlacesQueryPacket)Pack;
10094 9695
10095 PlacesQuery handlerPlacesQuery = OnPlacesQuery; 9696 handlerPlacesQuery = OnPlacesQuery;
10096 9697
10097 if (handlerPlacesQuery != null) 9698 if (handlerPlacesQuery != null)
10098 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID, 9699 handlerPlacesQuery(placesQueryPacket.AgentData.QueryID,
@@ -10146,26 +9747,304 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10146 //shape.Textures = ntex; 9747 //shape.Textures = ntex;
10147 return shape; 9748 return shape;
10148 } 9749 }
10149 9750
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
10150 public ClientInfo GetClientInfo() 10029 public ClientInfo GetClientInfo()
10151 { 10030 {
10152 ClientInfo info = m_udpClient.GetClientInfo(); 10031 ClientInfo info = m_PacketHandler.GetClientInfo();
10153 10032
10154 info.userEP = m_userEndPoint; 10033 info.userEP = m_userEndPoint;
10155 info.proxyEP = null; 10034 info.proxyEP = m_proxyEndPoint;
10156 info.agentcircuit = new sAgentCircuitData(RequestClientInfo()); 10035 info.agentcircuit = new sAgentCircuitData(RequestClientInfo());
10157 10036
10158 return info; 10037 return info;
10159 } 10038 }
10160 10039
10161 public void SetClientInfo(ClientInfo info) 10040 public EndPoint GetClientEP()
10162 { 10041 {
10163 m_udpClient.SetClientInfo(info); 10042 return m_userEndPoint;
10164 } 10043 }
10165 10044
10166 public EndPoint GetClientEP() 10045 public void SetClientInfo(ClientInfo info)
10167 { 10046 {
10168 return m_userEndPoint; 10047 m_PacketHandler.SetClientInfo(info);
10169 } 10048 }
10170 10049
10171 #region Media Parcel Members 10050 #region Media Parcel Members
@@ -10200,6 +10079,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10200 10079
10201 #endregion 10080 #endregion
10202 10081
10082
10203 #region Camera 10083 #region Camera
10204 10084
10205 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters) 10085 public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
@@ -10229,12 +10109,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10229 10109
10230 #endregion 10110 #endregion
10231 10111
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
10232 public void SetClientOption(string option, string value) 10164 public void SetClientOption(string option, string value)
10233 { 10165 {
10234 switch (option) 10166 switch (option)
10235 { 10167 {
10236 default: 10168 case "ReliableIsImportant":
10237 break; 10169 bool val;
10170
10171 if (bool.TryParse(value, out val))
10172 m_PacketHandler.ReliableIsImportant = val;
10173 break;
10174 default:
10175 break;
10238 } 10176 }
10239 } 10177 }
10240 10178
@@ -10242,15 +10180,571 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10242 { 10180 {
10243 switch (option) 10181 switch (option)
10244 { 10182 {
10183 case "ReliableIsImportant":
10184 return m_PacketHandler.ReliableIsImportant.ToString();
10185
10245 default: 10186 default:
10246 break; 10187 break;
10247 } 10188 }
10248 return string.Empty; 10189 return string.Empty;
10249 } 10190 }
10250 10191
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
10251 public void KillEndDone() 10744 public void KillEndDone()
10252 { 10745 {
10253 m_udpClient.Shutdown(); 10746 KillPacket kp = new KillPacket();
10747 OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
10254 } 10748 }
10255 10749
10256 #region IClientCore 10750 #region IClientCore
@@ -10273,6 +10767,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10273 } 10767 }
10274 } 10768 }
10275 10769
10770 protected virtual void RegisterInterfaces()
10771 {
10772 RegisterInterface<IClientIM>(this);
10773 RegisterInterface<IClientChat>(this);
10774 RegisterInterface<IClientIPEndpoint>(this);
10775 }
10776
10276 public bool TryGet<T>(out T iface) 10777 public bool TryGet<T>(out T iface)
10277 { 10778 {
10278 if (m_clientInterfaces.ContainsKey(typeof(T))) 10779 if (m_clientInterfaces.ContainsKey(typeof(T)))
@@ -10320,14 +10821,78 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10320 } 10821 }
10321 } 10822 }
10322 10823
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
10323 public string Report() 10887 public string Report()
10324 { 10888 {
10325 return m_udpClient.GetStats(); 10889 LLPacketHandler handler = (LLPacketHandler) m_PacketHandler;
10890 return handler.PacketQueue.GetStats();
10326 } 10891 }
10327 10892
10328 public string XReport(string uptime, string version) 10893 public string XReport(string uptime, string version)
10329 { 10894 {
10330 return String.Empty; 10895 return "";
10331 } 10896 }
10332 10897
10333 public void MakeAssetRequest(TransferRequestPacket transferRequest) 10898 public void MakeAssetRequest(TransferRequestPacket transferRequest)
@@ -10416,6 +10981,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10416 return numPackets; 10981 return numPackets;
10417 } 10982 }
10418 10983
10984
10419 #region IClientIPEndpoint Members 10985 #region IClientIPEndpoint Members
10420 10986
10421 public IPAddress EndPoint 10987 public IPAddress EndPoint