diff options
author | Teravus Ovares (Dan Olivares) | 2009-11-23 20:19:00 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-11-23 20:19:00 -0500 |
commit | 3bfbd2952d948f4d451ec74a618587e60faf1cca (patch) | |
tree | e2f55657d58e6428726b49bf7e54c21f9908b578 /OpenSim | |
parent | Merge branch 'master' of ssh://MyConnection/var/git/opensim (diff) | |
download | opensim-SC_OLD-3bfbd2952d948f4d451ec74a618587e60faf1cca.zip opensim-SC_OLD-3bfbd2952d948f4d451ec74a618587e60faf1cca.tar.gz opensim-SC_OLD-3bfbd2952d948f4d451ec74a618587e60faf1cca.tar.bz2 opensim-SC_OLD-3bfbd2952d948f4d451ec74a618587e60faf1cca.tar.xz |
* Moved 60 more packet handlers to Packet Handler Delegates.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2076 |
1 files changed, 2055 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7f7b820..222fb1b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -4363,11 +4363,71 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4363 | AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes); | 4363 | AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes); |
4364 | AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction); | 4364 | AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction); |
4365 | AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial); | 4365 | AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial); |
4366 | AddLocalPacketHandler(PacketType.RequestImage, HandleRequestImage); | ||
4367 | AddLocalPacketHandler(PacketType.TransferRequest, HandleTransferRequest); | ||
4368 | AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest); | ||
4369 | AddLocalPacketHandler(PacketType.RequestXfer, HandleRequestXfer); | ||
4370 | AddLocalPacketHandler(PacketType.SendXferPacket, HandleSendXferPacket); | ||
4371 | AddLocalPacketHandler(PacketType.ConfirmXferPacket, HandleConfirmXferPacket); | ||
4372 | AddLocalPacketHandler(PacketType.AbortXfer, HandleAbortXfer); | ||
4373 | AddLocalPacketHandler(PacketType.CreateInventoryFolder, HandleCreateInventoryFolder); | ||
4374 | AddLocalPacketHandler(PacketType.UpdateInventoryFolder, HandleUpdateInventoryFolder); | ||
4375 | AddLocalPacketHandler(PacketType.MoveInventoryFolder, HandleMoveInventoryFolder); | ||
4376 | AddLocalPacketHandler(PacketType.CreateInventoryItem, HandleCreateInventoryItem); | ||
4377 | AddLocalPacketHandler(PacketType.FetchInventory, HandleFetchInventory); | ||
4378 | AddLocalPacketHandler(PacketType.FetchInventoryDescendents, HandleFetchInventoryDescendents); | ||
4379 | AddLocalPacketHandler(PacketType.PurgeInventoryDescendents, HandlePurgeInventoryDescendents); | ||
4380 | AddLocalPacketHandler(PacketType.UpdateInventoryItem, HandleUpdateInventoryItem); | ||
4381 | AddLocalPacketHandler(PacketType.CopyInventoryItem, HandleCopyInventoryItem); | ||
4382 | AddLocalPacketHandler(PacketType.MoveInventoryItem, HandleMoveInventoryItem); | ||
4383 | AddLocalPacketHandler(PacketType.RemoveInventoryItem, HandleRemoveInventoryItem); | ||
4384 | AddLocalPacketHandler(PacketType.RemoveInventoryFolder, HandleRemoveInventoryFolder); | ||
4385 | AddLocalPacketHandler(PacketType.RemoveInventoryObjects, HandleRemoveInventoryObjects); | ||
4386 | AddLocalPacketHandler(PacketType.RequestTaskInventory, HandleRequestTaskInventory); | ||
4387 | AddLocalPacketHandler(PacketType.UpdateTaskInventory, HandleUpdateTaskInventory); | ||
4388 | AddLocalPacketHandler(PacketType.RemoveTaskInventory, HandleRemoveTaskInventory); | ||
4389 | AddLocalPacketHandler(PacketType.MoveTaskInventory, HandleMoveTaskInventory); | ||
4390 | AddLocalPacketHandler(PacketType.RezScript, HandleRezScript); | ||
4391 | AddLocalPacketHandler(PacketType.MapLayerRequest, HandleMapLayerRequest); | ||
4392 | AddLocalPacketHandler(PacketType.MapBlockRequest, HandleMapBlockRequest); | ||
4393 | AddLocalPacketHandler(PacketType.MapNameRequest, HandleMapNameRequest); | ||
4394 | AddLocalPacketHandler(PacketType.TeleportLandmarkRequest, HandleTeleportLandmarkRequest); | ||
4395 | AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); | ||
4396 | AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest); | ||
4397 | AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest); | ||
4398 | AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest); | ||
4399 | AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest); | ||
4400 | AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate); | ||
4401 | AddLocalPacketHandler(PacketType.ParcelPropertiesRequest, HandleParcelPropertiesRequest); | ||
4402 | AddLocalPacketHandler(PacketType.ParcelDivide, HandleParcelDivide); | ||
4403 | AddLocalPacketHandler(PacketType.ParcelJoin, HandleParcelJoin); | ||
4404 | AddLocalPacketHandler(PacketType.ParcelPropertiesUpdate, HandleParcelPropertiesUpdate); | ||
4405 | AddLocalPacketHandler(PacketType.ParcelSelectObjects, HandleParcelSelectObjects); | ||
4406 | AddLocalPacketHandler(PacketType.ParcelObjectOwnersRequest, HandleParcelObjectOwnersRequest); | ||
4407 | AddLocalPacketHandler(PacketType.ParcelGodForceOwner, HandleParcelGodForceOwner); | ||
4408 | AddLocalPacketHandler(PacketType.ParcelRelease, HandleParcelRelease); | ||
4409 | AddLocalPacketHandler(PacketType.ParcelReclaim, HandleParcelReclaim); | ||
4410 | AddLocalPacketHandler(PacketType.ParcelReturnObjects, HandleParcelReturnObjects); | ||
4411 | AddLocalPacketHandler(PacketType.ParcelSetOtherCleanTime, HandleParcelSetOtherCleanTime); | ||
4412 | AddLocalPacketHandler(PacketType.LandStatRequest, HandleLandStatRequest); | ||
4413 | AddLocalPacketHandler(PacketType.ParcelDwellRequest, HandleParcelDwellRequest); | ||
4414 | AddLocalPacketHandler(PacketType.EstateOwnerMessage, HandleEstateOwnerMessage); | ||
4415 | AddLocalPacketHandler(PacketType.RequestRegionInfo, HandleRequestRegionInfo); | ||
4416 | AddLocalPacketHandler(PacketType.EstateCovenantRequest, HandleEstateCovenantRequest); | ||
4417 | AddLocalPacketHandler(PacketType.RequestGodlikePowers, HandleRequestGodlikePowers); | ||
4418 | AddLocalPacketHandler(PacketType.GodKickUser, HandleGodKickUser); | ||
4419 | AddLocalPacketHandler(PacketType.MoneyBalanceRequest, HandleMoneyBalanceRequest); | ||
4420 | AddLocalPacketHandler(PacketType.EconomyDataRequest, HandleEconomyDataRequest); | ||
4421 | AddLocalPacketHandler(PacketType.RequestPayPrice, HandleRequestPayPrice); | ||
4422 | AddLocalPacketHandler(PacketType.ObjectSaleInfo, HandleObjectSaleInfo); | ||
4423 | AddLocalPacketHandler(PacketType.ObjectBuy, HandleObjectBuy); | ||
4424 | AddLocalPacketHandler(PacketType.GetScriptRunning, HandleGetScriptRunning); | ||
4425 | AddLocalPacketHandler(PacketType.SetScriptRunning, HandleSetScriptRunning); | ||
4426 | AddLocalPacketHandler(PacketType.ScriptReset, HandleScriptReset); | ||
4366 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4427 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4367 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4428 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4368 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4429 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4369 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4430 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4370 | |||
4371 | 4431 | ||
4372 | } | 4432 | } |
4373 | 4433 | ||
@@ -6338,6 +6398,1943 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6338 | 6398 | ||
6339 | #endregion Objects/m_sceneObjects | 6399 | #endregion Objects/m_sceneObjects |
6340 | 6400 | ||
6401 | #region Inventory/Asset/Other related packets | ||
6402 | |||
6403 | private bool HandleRequestImage(IClientAPI sender, Packet Pack) | ||
6404 | { | ||
6405 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | ||
6406 | //m_log.Debug("image request: " + Pack.ToString()); | ||
6407 | |||
6408 | #region Packet Session and User Check | ||
6409 | if (m_checkPackets) | ||
6410 | { | ||
6411 | if (imageRequest.AgentData.SessionID != SessionId || | ||
6412 | imageRequest.AgentData.AgentID != AgentId) | ||
6413 | return true; | ||
6414 | } | ||
6415 | #endregion | ||
6416 | |||
6417 | //handlerTextureRequest = null; | ||
6418 | for (int i = 0; i < imageRequest.RequestImage.Length; i++) | ||
6419 | { | ||
6420 | if (OnRequestTexture != null) | ||
6421 | { | ||
6422 | TextureRequestArgs args = new TextureRequestArgs(); | ||
6423 | |||
6424 | RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i]; | ||
6425 | |||
6426 | args.RequestedAssetID = block.Image; | ||
6427 | args.DiscardLevel = block.DiscardLevel; | ||
6428 | args.PacketNumber = block.Packet; | ||
6429 | args.Priority = block.DownloadPriority; | ||
6430 | args.requestSequence = imageRequest.Header.Sequence; | ||
6431 | |||
6432 | // NOTE: This is not a built in part of the LLUDP protocol, but we double the | ||
6433 | // priority of avatar textures to get avatars rezzing in faster than the | ||
6434 | // surrounding scene | ||
6435 | if ((ImageType)block.Type == ImageType.Baked) | ||
6436 | args.Priority *= 2.0f; | ||
6437 | |||
6438 | //handlerTextureRequest = OnRequestTexture; | ||
6439 | |||
6440 | //if (handlerTextureRequest != null) | ||
6441 | //OnRequestTexture(this, args); | ||
6442 | |||
6443 | // in the end, we null this, so we have to check if it's null | ||
6444 | if (m_imageManager != null) | ||
6445 | { | ||
6446 | m_imageManager.EnqueueReq(args); | ||
6447 | } | ||
6448 | } | ||
6449 | } | ||
6450 | return true; | ||
6451 | } | ||
6452 | |||
6453 | private bool HandleTransferRequest(IClientAPI sender, Packet Pack) | ||
6454 | { | ||
6455 | //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); | ||
6456 | |||
6457 | TransferRequestPacket transfer = (TransferRequestPacket)Pack; | ||
6458 | //m_log.Debug("Transfer Request: " + transfer.ToString()); | ||
6459 | // Validate inventory transfers | ||
6460 | // Has to be done here, because AssetCache can't do it | ||
6461 | // | ||
6462 | UUID taskID = UUID.Zero; | ||
6463 | if (transfer.TransferInfo.SourceType == 3) | ||
6464 | { | ||
6465 | taskID = new UUID(transfer.TransferInfo.Params, 48); | ||
6466 | UUID itemID = new UUID(transfer.TransferInfo.Params, 64); | ||
6467 | UUID requestID = new UUID(transfer.TransferInfo.Params, 80); | ||
6468 | if (!(((Scene)m_scene).Permissions.BypassPermissions())) | ||
6469 | { | ||
6470 | if (taskID != UUID.Zero) // Prim | ||
6471 | { | ||
6472 | SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); | ||
6473 | if (part == null) | ||
6474 | return true; | ||
6475 | |||
6476 | if (part.OwnerID != AgentId) | ||
6477 | return true; | ||
6478 | |||
6479 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | ||
6480 | return true; | ||
6481 | |||
6482 | TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); | ||
6483 | if (ti == null) | ||
6484 | return true; | ||
6485 | |||
6486 | if (ti.OwnerID != AgentId) | ||
6487 | return true; | ||
6488 | |||
6489 | if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) | ||
6490 | return true; | ||
6491 | |||
6492 | if (ti.AssetID != requestID) | ||
6493 | return true; | ||
6494 | } | ||
6495 | else // Agent | ||
6496 | { | ||
6497 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | ||
6498 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); | ||
6499 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
6500 | if (assetRequestItem == null) | ||
6501 | { | ||
6502 | assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); | ||
6503 | if (assetRequestItem == null) | ||
6504 | return true; | ||
6505 | } | ||
6506 | |||
6507 | // At this point, we need to apply perms | ||
6508 | // only to notecards and scripts. All | ||
6509 | // other asset types are always available | ||
6510 | // | ||
6511 | if (assetRequestItem.AssetType == 10) | ||
6512 | { | ||
6513 | if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) | ||
6514 | { | ||
6515 | SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
6516 | return true; | ||
6517 | } | ||
6518 | } | ||
6519 | else if (assetRequestItem.AssetType == 7) | ||
6520 | { | ||
6521 | if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) | ||
6522 | { | ||
6523 | SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
6524 | return true; | ||
6525 | } | ||
6526 | } | ||
6527 | |||
6528 | if (assetRequestItem.AssetID != requestID) | ||
6529 | return true; | ||
6530 | } | ||
6531 | } | ||
6532 | } | ||
6533 | |||
6534 | //m_assetCache.AddAssetRequest(this, transfer); | ||
6535 | |||
6536 | MakeAssetRequest(transfer, taskID); | ||
6537 | |||
6538 | /* RequestAsset = OnRequestAsset; | ||
6539 | if (RequestAsset != null) | ||
6540 | { | ||
6541 | RequestAsset(this, transfer); | ||
6542 | }*/ | ||
6543 | return true; | ||
6544 | } | ||
6545 | |||
6546 | private bool HandleAssetUploadRequest(IClientAPI sender, Packet Pack) | ||
6547 | { | ||
6548 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | ||
6549 | |||
6550 | |||
6551 | // m_log.Debug("upload request " + request.ToString()); | ||
6552 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); | ||
6553 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); | ||
6554 | |||
6555 | UDPAssetUploadRequest handlerAssetUploadRequest = OnAssetUploadRequest; | ||
6556 | |||
6557 | if (handlerAssetUploadRequest != null) | ||
6558 | { | ||
6559 | handlerAssetUploadRequest(this, temp, | ||
6560 | request.AssetBlock.TransactionID, request.AssetBlock.Type, | ||
6561 | request.AssetBlock.AssetData, request.AssetBlock.StoreLocal, | ||
6562 | request.AssetBlock.Tempfile); | ||
6563 | } | ||
6564 | return true; | ||
6565 | } | ||
6566 | |||
6567 | private bool HandleRequestXfer(IClientAPI sender, Packet Pack) | ||
6568 | { | ||
6569 | RequestXferPacket xferReq = (RequestXferPacket)Pack; | ||
6570 | |||
6571 | RequestXfer handlerRequestXfer = OnRequestXfer; | ||
6572 | |||
6573 | if (handlerRequestXfer != null) | ||
6574 | { | ||
6575 | handlerRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename)); | ||
6576 | } | ||
6577 | return true; | ||
6578 | } | ||
6579 | |||
6580 | private bool HandleSendXferPacket(IClientAPI sender, Packet Pack) | ||
6581 | { | ||
6582 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; | ||
6583 | |||
6584 | XferReceive handlerXferReceive = OnXferReceive; | ||
6585 | if (handlerXferReceive != null) | ||
6586 | { | ||
6587 | handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); | ||
6588 | } | ||
6589 | return true; | ||
6590 | } | ||
6591 | |||
6592 | private bool HandleConfirmXferPacket(IClientAPI sender, Packet Pack) | ||
6593 | { | ||
6594 | ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; | ||
6595 | |||
6596 | ConfirmXfer handlerConfirmXfer = OnConfirmXfer; | ||
6597 | if (handlerConfirmXfer != null) | ||
6598 | { | ||
6599 | handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); | ||
6600 | } | ||
6601 | return true; | ||
6602 | } | ||
6603 | |||
6604 | private bool HandleAbortXfer(IClientAPI sender, Packet Pack) | ||
6605 | { | ||
6606 | AbortXferPacket abortXfer = (AbortXferPacket)Pack; | ||
6607 | AbortXfer handlerAbortXfer = OnAbortXfer; | ||
6608 | if (handlerAbortXfer != null) | ||
6609 | { | ||
6610 | handlerAbortXfer(this, abortXfer.XferID.ID); | ||
6611 | } | ||
6612 | |||
6613 | return true; | ||
6614 | } | ||
6615 | |||
6616 | private bool HandleCreateInventoryFolder(IClientAPI sender, Packet Pack) | ||
6617 | { | ||
6618 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | ||
6619 | |||
6620 | #region Packet Session and User Check | ||
6621 | if (m_checkPackets) | ||
6622 | { | ||
6623 | if (invFolder.AgentData.SessionID != SessionId || | ||
6624 | invFolder.AgentData.AgentID != AgentId) | ||
6625 | return true; | ||
6626 | } | ||
6627 | #endregion | ||
6628 | |||
6629 | CreateInventoryFolder handlerCreateInventoryFolder = OnCreateNewInventoryFolder; | ||
6630 | if (handlerCreateInventoryFolder != null) | ||
6631 | { | ||
6632 | handlerCreateInventoryFolder(this, invFolder.FolderData.FolderID, | ||
6633 | (ushort)invFolder.FolderData.Type, | ||
6634 | Util.FieldToString(invFolder.FolderData.Name), | ||
6635 | invFolder.FolderData.ParentID); | ||
6636 | } | ||
6637 | return true; | ||
6638 | } | ||
6639 | |||
6640 | private bool HandleUpdateInventoryFolder(IClientAPI sender, Packet Pack) | ||
6641 | { | ||
6642 | if (OnUpdateInventoryFolder != null) | ||
6643 | { | ||
6644 | UpdateInventoryFolderPacket invFolderx = (UpdateInventoryFolderPacket)Pack; | ||
6645 | |||
6646 | #region Packet Session and User Check | ||
6647 | if (m_checkPackets) | ||
6648 | { | ||
6649 | if (invFolderx.AgentData.SessionID != SessionId || | ||
6650 | invFolderx.AgentData.AgentID != AgentId) | ||
6651 | return true; | ||
6652 | } | ||
6653 | #endregion | ||
6654 | |||
6655 | UpdateInventoryFolder handlerUpdateInventoryFolder = null; | ||
6656 | |||
6657 | for (int i = 0; i < invFolderx.FolderData.Length; i++) | ||
6658 | { | ||
6659 | handlerUpdateInventoryFolder = OnUpdateInventoryFolder; | ||
6660 | if (handlerUpdateInventoryFolder != null) | ||
6661 | { | ||
6662 | OnUpdateInventoryFolder(this, invFolderx.FolderData[i].FolderID, | ||
6663 | (ushort)invFolderx.FolderData[i].Type, | ||
6664 | Util.FieldToString(invFolderx.FolderData[i].Name), | ||
6665 | invFolderx.FolderData[i].ParentID); | ||
6666 | } | ||
6667 | } | ||
6668 | } | ||
6669 | return true; | ||
6670 | } | ||
6671 | |||
6672 | private bool HandleMoveInventoryFolder(IClientAPI sender, Packet Pack) | ||
6673 | { | ||
6674 | if (OnMoveInventoryFolder != null) | ||
6675 | { | ||
6676 | MoveInventoryFolderPacket invFoldery = (MoveInventoryFolderPacket)Pack; | ||
6677 | |||
6678 | #region Packet Session and User Check | ||
6679 | if (m_checkPackets) | ||
6680 | { | ||
6681 | if (invFoldery.AgentData.SessionID != SessionId || | ||
6682 | invFoldery.AgentData.AgentID != AgentId) | ||
6683 | return true; | ||
6684 | } | ||
6685 | #endregion | ||
6686 | |||
6687 | MoveInventoryFolder handlerMoveInventoryFolder = null; | ||
6688 | |||
6689 | for (int i = 0; i < invFoldery.InventoryData.Length; i++) | ||
6690 | { | ||
6691 | handlerMoveInventoryFolder = OnMoveInventoryFolder; | ||
6692 | if (handlerMoveInventoryFolder != null) | ||
6693 | { | ||
6694 | OnMoveInventoryFolder(this, invFoldery.InventoryData[i].FolderID, | ||
6695 | invFoldery.InventoryData[i].ParentID); | ||
6696 | } | ||
6697 | } | ||
6698 | } | ||
6699 | return true; | ||
6700 | } | ||
6701 | |||
6702 | private bool HandleCreateInventoryItem(IClientAPI sender, Packet Pack) | ||
6703 | { | ||
6704 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; | ||
6705 | |||
6706 | #region Packet Session and User Check | ||
6707 | if (m_checkPackets) | ||
6708 | { | ||
6709 | if (createItem.AgentData.SessionID != SessionId || | ||
6710 | createItem.AgentData.AgentID != AgentId) | ||
6711 | return true; | ||
6712 | } | ||
6713 | #endregion | ||
6714 | |||
6715 | CreateNewInventoryItem handlerCreateNewInventoryItem = OnCreateNewInventoryItem; | ||
6716 | if (handlerCreateNewInventoryItem != null) | ||
6717 | { | ||
6718 | handlerCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, | ||
6719 | createItem.InventoryBlock.FolderID, | ||
6720 | createItem.InventoryBlock.CallbackID, | ||
6721 | Util.FieldToString(createItem.InventoryBlock.Description), | ||
6722 | Util.FieldToString(createItem.InventoryBlock.Name), | ||
6723 | createItem.InventoryBlock.InvType, | ||
6724 | createItem.InventoryBlock.Type, | ||
6725 | createItem.InventoryBlock.WearableType, | ||
6726 | createItem.InventoryBlock.NextOwnerMask, | ||
6727 | Util.UnixTimeSinceEpoch()); | ||
6728 | } | ||
6729 | return true; | ||
6730 | } | ||
6731 | |||
6732 | private bool HandleFetchInventory(IClientAPI sender, Packet Pack) | ||
6733 | { | ||
6734 | if (OnFetchInventory != null) | ||
6735 | { | ||
6736 | FetchInventoryPacket FetchInventoryx = (FetchInventoryPacket)Pack; | ||
6737 | |||
6738 | #region Packet Session and User Check | ||
6739 | if (m_checkPackets) | ||
6740 | { | ||
6741 | if (FetchInventoryx.AgentData.SessionID != SessionId || | ||
6742 | FetchInventoryx.AgentData.AgentID != AgentId) | ||
6743 | return true; | ||
6744 | } | ||
6745 | #endregion | ||
6746 | |||
6747 | FetchInventory handlerFetchInventory = null; | ||
6748 | |||
6749 | for (int i = 0; i < FetchInventoryx.InventoryData.Length; i++) | ||
6750 | { | ||
6751 | handlerFetchInventory = OnFetchInventory; | ||
6752 | |||
6753 | if (handlerFetchInventory != null) | ||
6754 | { | ||
6755 | OnFetchInventory(this, FetchInventoryx.InventoryData[i].ItemID, | ||
6756 | FetchInventoryx.InventoryData[i].OwnerID); | ||
6757 | } | ||
6758 | } | ||
6759 | } | ||
6760 | return true; | ||
6761 | } | ||
6762 | |||
6763 | private bool HandleFetchInventoryDescendents(IClientAPI sender, Packet Pack) | ||
6764 | { | ||
6765 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | ||
6766 | |||
6767 | #region Packet Session and User Check | ||
6768 | if (m_checkPackets) | ||
6769 | { | ||
6770 | if (Fetch.AgentData.SessionID != SessionId || | ||
6771 | Fetch.AgentData.AgentID != AgentId) | ||
6772 | return true; | ||
6773 | } | ||
6774 | #endregion | ||
6775 | |||
6776 | FetchInventoryDescendents handlerFetchInventoryDescendents = OnFetchInventoryDescendents; | ||
6777 | if (handlerFetchInventoryDescendents != null) | ||
6778 | { | ||
6779 | handlerFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, | ||
6780 | Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, | ||
6781 | Fetch.InventoryData.SortOrder); | ||
6782 | } | ||
6783 | return true; | ||
6784 | } | ||
6785 | |||
6786 | private bool HandlePurgeInventoryDescendents(IClientAPI sender, Packet Pack) | ||
6787 | { | ||
6788 | PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; | ||
6789 | |||
6790 | #region Packet Session and User Check | ||
6791 | if (m_checkPackets) | ||
6792 | { | ||
6793 | if (Purge.AgentData.SessionID != SessionId || | ||
6794 | Purge.AgentData.AgentID != AgentId) | ||
6795 | return true; | ||
6796 | } | ||
6797 | #endregion | ||
6798 | |||
6799 | PurgeInventoryDescendents handlerPurgeInventoryDescendents = OnPurgeInventoryDescendents; | ||
6800 | if (handlerPurgeInventoryDescendents != null) | ||
6801 | { | ||
6802 | handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); | ||
6803 | } | ||
6804 | return true; | ||
6805 | } | ||
6806 | |||
6807 | private bool HandleUpdateInventoryItem(IClientAPI sender, Packet Pack) | ||
6808 | { | ||
6809 | UpdateInventoryItemPacket inventoryItemUpdate = (UpdateInventoryItemPacket)Pack; | ||
6810 | |||
6811 | #region Packet Session and User Check | ||
6812 | if (m_checkPackets) | ||
6813 | { | ||
6814 | if (inventoryItemUpdate.AgentData.SessionID != SessionId || | ||
6815 | inventoryItemUpdate.AgentData.AgentID != AgentId) | ||
6816 | return true; | ||
6817 | } | ||
6818 | #endregion | ||
6819 | |||
6820 | if (OnUpdateInventoryItem != null) | ||
6821 | { | ||
6822 | UpdateInventoryItem handlerUpdateInventoryItem = null; | ||
6823 | for (int i = 0; i < inventoryItemUpdate.InventoryData.Length; i++) | ||
6824 | { | ||
6825 | handlerUpdateInventoryItem = OnUpdateInventoryItem; | ||
6826 | |||
6827 | if (handlerUpdateInventoryItem != null) | ||
6828 | { | ||
6829 | InventoryItemBase itemUpd = new InventoryItemBase(); | ||
6830 | itemUpd.ID = inventoryItemUpdate.InventoryData[i].ItemID; | ||
6831 | itemUpd.Name = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Name); | ||
6832 | itemUpd.Description = Util.FieldToString(inventoryItemUpdate.InventoryData[i].Description); | ||
6833 | itemUpd.GroupID = inventoryItemUpdate.InventoryData[i].GroupID; | ||
6834 | itemUpd.GroupOwned = inventoryItemUpdate.InventoryData[i].GroupOwned; | ||
6835 | itemUpd.GroupPermissions = inventoryItemUpdate.InventoryData[i].GroupMask; | ||
6836 | itemUpd.NextPermissions = inventoryItemUpdate.InventoryData[i].NextOwnerMask; | ||
6837 | itemUpd.EveryOnePermissions = inventoryItemUpdate.InventoryData[i].EveryoneMask; | ||
6838 | itemUpd.CreationDate = inventoryItemUpdate.InventoryData[i].CreationDate; | ||
6839 | itemUpd.Folder = inventoryItemUpdate.InventoryData[i].FolderID; | ||
6840 | itemUpd.InvType = inventoryItemUpdate.InventoryData[i].InvType; | ||
6841 | itemUpd.SalePrice = inventoryItemUpdate.InventoryData[i].SalePrice; | ||
6842 | itemUpd.SaleType = inventoryItemUpdate.InventoryData[i].SaleType; | ||
6843 | itemUpd.Flags = inventoryItemUpdate.InventoryData[i].Flags; | ||
6844 | |||
6845 | OnUpdateInventoryItem(this, inventoryItemUpdate.InventoryData[i].TransactionID, | ||
6846 | inventoryItemUpdate.InventoryData[i].ItemID, | ||
6847 | itemUpd); | ||
6848 | } | ||
6849 | } | ||
6850 | } | ||
6851 | return true; | ||
6852 | } | ||
6853 | |||
6854 | private bool HandleCopyInventoryItem(IClientAPI sender, Packet Pack) | ||
6855 | { | ||
6856 | CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; | ||
6857 | |||
6858 | #region Packet Session and User Check | ||
6859 | if (m_checkPackets) | ||
6860 | { | ||
6861 | if (copyitem.AgentData.SessionID != SessionId || | ||
6862 | copyitem.AgentData.AgentID != AgentId) | ||
6863 | return true; | ||
6864 | } | ||
6865 | #endregion | ||
6866 | |||
6867 | CopyInventoryItem handlerCopyInventoryItem = null; | ||
6868 | if (OnCopyInventoryItem != null) | ||
6869 | { | ||
6870 | foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) | ||
6871 | { | ||
6872 | handlerCopyInventoryItem = OnCopyInventoryItem; | ||
6873 | if (handlerCopyInventoryItem != null) | ||
6874 | { | ||
6875 | handlerCopyInventoryItem(this, datablock.CallbackID, datablock.OldAgentID, | ||
6876 | datablock.OldItemID, datablock.NewFolderID, | ||
6877 | Util.FieldToString(datablock.NewName)); | ||
6878 | } | ||
6879 | } | ||
6880 | } | ||
6881 | return true; | ||
6882 | } | ||
6883 | |||
6884 | private bool HandleMoveInventoryItem(IClientAPI sender, Packet Pack) | ||
6885 | { | ||
6886 | MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; | ||
6887 | |||
6888 | #region Packet Session and User Check | ||
6889 | if (m_checkPackets) | ||
6890 | { | ||
6891 | if (moveitem.AgentData.SessionID != SessionId || | ||
6892 | moveitem.AgentData.AgentID != AgentId) | ||
6893 | return true; | ||
6894 | } | ||
6895 | #endregion | ||
6896 | |||
6897 | if (OnMoveInventoryItem != null) | ||
6898 | { | ||
6899 | MoveInventoryItem handlerMoveInventoryItem = null; | ||
6900 | InventoryItemBase itm = null; | ||
6901 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
6902 | foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) | ||
6903 | { | ||
6904 | itm = new InventoryItemBase(datablock.ItemID, AgentId); | ||
6905 | itm.Folder = datablock.FolderID; | ||
6906 | itm.Name = Util.FieldToString(datablock.NewName); | ||
6907 | // weird, comes out as empty string | ||
6908 | //m_log.DebugFormat("[XXX] new name: {0}", itm.Name); | ||
6909 | items.Add(itm); | ||
6910 | } | ||
6911 | handlerMoveInventoryItem = OnMoveInventoryItem; | ||
6912 | if (handlerMoveInventoryItem != null) | ||
6913 | { | ||
6914 | handlerMoveInventoryItem(this, items); | ||
6915 | } | ||
6916 | } | ||
6917 | return true; | ||
6918 | } | ||
6919 | |||
6920 | private bool HandleRemoveInventoryItem(IClientAPI sender, Packet Pack) | ||
6921 | { | ||
6922 | RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack; | ||
6923 | |||
6924 | #region Packet Session and User Check | ||
6925 | if (m_checkPackets) | ||
6926 | { | ||
6927 | if (removeItem.AgentData.SessionID != SessionId || | ||
6928 | removeItem.AgentData.AgentID != AgentId) | ||
6929 | return true; | ||
6930 | } | ||
6931 | #endregion | ||
6932 | |||
6933 | if (OnRemoveInventoryItem != null) | ||
6934 | { | ||
6935 | RemoveInventoryItem handlerRemoveInventoryItem = null; | ||
6936 | List<UUID> uuids = new List<UUID>(); | ||
6937 | foreach (RemoveInventoryItemPacket.InventoryDataBlock datablock in removeItem.InventoryData) | ||
6938 | { | ||
6939 | uuids.Add(datablock.ItemID); | ||
6940 | } | ||
6941 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | ||
6942 | if (handlerRemoveInventoryItem != null) | ||
6943 | { | ||
6944 | handlerRemoveInventoryItem(this, uuids); | ||
6945 | } | ||
6946 | |||
6947 | } | ||
6948 | return true; | ||
6949 | } | ||
6950 | |||
6951 | private bool HandleRemoveInventoryFolder(IClientAPI sender, Packet Pack) | ||
6952 | { | ||
6953 | RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack; | ||
6954 | |||
6955 | #region Packet Session and User Check | ||
6956 | if (m_checkPackets) | ||
6957 | { | ||
6958 | if (removeFolder.AgentData.SessionID != SessionId || | ||
6959 | removeFolder.AgentData.AgentID != AgentId) | ||
6960 | return true; | ||
6961 | } | ||
6962 | #endregion | ||
6963 | |||
6964 | if (OnRemoveInventoryFolder != null) | ||
6965 | { | ||
6966 | RemoveInventoryFolder handlerRemoveInventoryFolder = null; | ||
6967 | List<UUID> uuids = new List<UUID>(); | ||
6968 | foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData) | ||
6969 | { | ||
6970 | uuids.Add(datablock.FolderID); | ||
6971 | } | ||
6972 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | ||
6973 | if (handlerRemoveInventoryFolder != null) | ||
6974 | { | ||
6975 | handlerRemoveInventoryFolder(this, uuids); | ||
6976 | } | ||
6977 | } | ||
6978 | return true; | ||
6979 | } | ||
6980 | |||
6981 | private bool HandleRemoveInventoryObjects(IClientAPI sender, Packet Pack) | ||
6982 | { | ||
6983 | RemoveInventoryObjectsPacket removeObject = (RemoveInventoryObjectsPacket)Pack; | ||
6984 | #region Packet Session and User Check | ||
6985 | if (m_checkPackets) | ||
6986 | { | ||
6987 | if (removeObject.AgentData.SessionID != SessionId || | ||
6988 | removeObject.AgentData.AgentID != AgentId) | ||
6989 | return true; | ||
6990 | } | ||
6991 | #endregion | ||
6992 | if (OnRemoveInventoryFolder != null) | ||
6993 | { | ||
6994 | RemoveInventoryFolder handlerRemoveInventoryFolder = null; | ||
6995 | List<UUID> uuids = new List<UUID>(); | ||
6996 | foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData) | ||
6997 | { | ||
6998 | uuids.Add(datablock.FolderID); | ||
6999 | } | ||
7000 | handlerRemoveInventoryFolder = OnRemoveInventoryFolder; | ||
7001 | if (handlerRemoveInventoryFolder != null) | ||
7002 | { | ||
7003 | handlerRemoveInventoryFolder(this, uuids); | ||
7004 | } | ||
7005 | } | ||
7006 | |||
7007 | if (OnRemoveInventoryItem != null) | ||
7008 | { | ||
7009 | RemoveInventoryItem handlerRemoveInventoryItem = null; | ||
7010 | List<UUID> uuids = new List<UUID>(); | ||
7011 | foreach (RemoveInventoryObjectsPacket.ItemDataBlock datablock in removeObject.ItemData) | ||
7012 | { | ||
7013 | uuids.Add(datablock.ItemID); | ||
7014 | } | ||
7015 | handlerRemoveInventoryItem = OnRemoveInventoryItem; | ||
7016 | if (handlerRemoveInventoryItem != null) | ||
7017 | { | ||
7018 | handlerRemoveInventoryItem(this, uuids); | ||
7019 | } | ||
7020 | } | ||
7021 | return true; | ||
7022 | } | ||
7023 | |||
7024 | private bool HandleRequestTaskInventory(IClientAPI sender, Packet Pack) | ||
7025 | { | ||
7026 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | ||
7027 | |||
7028 | #region Packet Session and User Check | ||
7029 | if (m_checkPackets) | ||
7030 | { | ||
7031 | if (requesttask.AgentData.SessionID != SessionId || | ||
7032 | requesttask.AgentData.AgentID != AgentId) | ||
7033 | return true; | ||
7034 | } | ||
7035 | #endregion | ||
7036 | |||
7037 | RequestTaskInventory handlerRequestTaskInventory = OnRequestTaskInventory; | ||
7038 | if (handlerRequestTaskInventory != null) | ||
7039 | { | ||
7040 | handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); | ||
7041 | } | ||
7042 | return true; | ||
7043 | } | ||
7044 | |||
7045 | private bool HandleUpdateTaskInventory(IClientAPI sender, Packet Pack) | ||
7046 | { | ||
7047 | UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; | ||
7048 | |||
7049 | #region Packet Session and User Check | ||
7050 | if (m_checkPackets) | ||
7051 | { | ||
7052 | if (updatetask.AgentData.SessionID != SessionId || | ||
7053 | updatetask.AgentData.AgentID != AgentId) | ||
7054 | return true; | ||
7055 | } | ||
7056 | #endregion | ||
7057 | |||
7058 | if (OnUpdateTaskInventory != null) | ||
7059 | { | ||
7060 | if (updatetask.UpdateData.Key == 0) | ||
7061 | { | ||
7062 | UpdateTaskInventory handlerUpdateTaskInventory = OnUpdateTaskInventory; | ||
7063 | if (handlerUpdateTaskInventory != null) | ||
7064 | { | ||
7065 | TaskInventoryItem newTaskItem = new TaskInventoryItem(); | ||
7066 | newTaskItem.ItemID = updatetask.InventoryData.ItemID; | ||
7067 | newTaskItem.ParentID = updatetask.InventoryData.FolderID; | ||
7068 | newTaskItem.CreatorID = updatetask.InventoryData.CreatorID; | ||
7069 | newTaskItem.OwnerID = updatetask.InventoryData.OwnerID; | ||
7070 | newTaskItem.GroupID = updatetask.InventoryData.GroupID; | ||
7071 | newTaskItem.BasePermissions = updatetask.InventoryData.BaseMask; | ||
7072 | newTaskItem.CurrentPermissions = updatetask.InventoryData.OwnerMask; | ||
7073 | newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; | ||
7074 | newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; | ||
7075 | newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; | ||
7076 | //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; | ||
7077 | newTaskItem.Type = updatetask.InventoryData.Type; | ||
7078 | newTaskItem.InvType = updatetask.InventoryData.InvType; | ||
7079 | newTaskItem.Flags = updatetask.InventoryData.Flags; | ||
7080 | //newTaskItem.SaleType=updatetask.InventoryData.SaleType; | ||
7081 | //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; | ||
7082 | newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); | ||
7083 | newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); | ||
7084 | newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; | ||
7085 | handlerUpdateTaskInventory(this, updatetask.InventoryData.TransactionID, | ||
7086 | newTaskItem, updatetask.UpdateData.LocalID); | ||
7087 | } | ||
7088 | } | ||
7089 | } | ||
7090 | |||
7091 | return true; | ||
7092 | } | ||
7093 | |||
7094 | private bool HandleRemoveTaskInventory(IClientAPI sender, Packet Pack) | ||
7095 | { | ||
7096 | RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack; | ||
7097 | |||
7098 | #region Packet Session and User Check | ||
7099 | if (m_checkPackets) | ||
7100 | { | ||
7101 | if (removeTask.AgentData.SessionID != SessionId || | ||
7102 | removeTask.AgentData.AgentID != AgentId) | ||
7103 | return true; | ||
7104 | } | ||
7105 | #endregion | ||
7106 | |||
7107 | RemoveTaskInventory handlerRemoveTaskItem = OnRemoveTaskItem; | ||
7108 | |||
7109 | if (handlerRemoveTaskItem != null) | ||
7110 | { | ||
7111 | handlerRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID); | ||
7112 | } | ||
7113 | |||
7114 | return true; | ||
7115 | } | ||
7116 | |||
7117 | private bool HandleMoveTaskInventory(IClientAPI sender, Packet Pack) | ||
7118 | { | ||
7119 | MoveTaskInventoryPacket moveTaskInventoryPacket = (MoveTaskInventoryPacket)Pack; | ||
7120 | |||
7121 | #region Packet Session and User Check | ||
7122 | if (m_checkPackets) | ||
7123 | { | ||
7124 | if (moveTaskInventoryPacket.AgentData.SessionID != SessionId || | ||
7125 | moveTaskInventoryPacket.AgentData.AgentID != AgentId) | ||
7126 | return true; | ||
7127 | } | ||
7128 | #endregion | ||
7129 | |||
7130 | MoveTaskInventory handlerMoveTaskItem = OnMoveTaskItem; | ||
7131 | |||
7132 | if (handlerMoveTaskItem != null) | ||
7133 | { | ||
7134 | handlerMoveTaskItem( | ||
7135 | this, moveTaskInventoryPacket.AgentData.FolderID, | ||
7136 | moveTaskInventoryPacket.InventoryData.LocalID, | ||
7137 | moveTaskInventoryPacket.InventoryData.ItemID); | ||
7138 | } | ||
7139 | |||
7140 | return true; | ||
7141 | } | ||
7142 | |||
7143 | private bool HandleRezScript(IClientAPI sender, Packet Pack) | ||
7144 | { | ||
7145 | //m_log.Debug(Pack.ToString()); | ||
7146 | RezScriptPacket rezScriptx = (RezScriptPacket)Pack; | ||
7147 | |||
7148 | #region Packet Session and User Check | ||
7149 | if (m_checkPackets) | ||
7150 | { | ||
7151 | if (rezScriptx.AgentData.SessionID != SessionId || | ||
7152 | rezScriptx.AgentData.AgentID != AgentId) | ||
7153 | return true; | ||
7154 | } | ||
7155 | #endregion | ||
7156 | |||
7157 | RezScript handlerRezScript = OnRezScript; | ||
7158 | InventoryItemBase item = new InventoryItemBase(); | ||
7159 | item.ID = rezScriptx.InventoryBlock.ItemID; | ||
7160 | item.Folder = rezScriptx.InventoryBlock.FolderID; | ||
7161 | item.CreatorId = rezScriptx.InventoryBlock.CreatorID.ToString(); | ||
7162 | item.Owner = rezScriptx.InventoryBlock.OwnerID; | ||
7163 | item.BasePermissions = rezScriptx.InventoryBlock.BaseMask; | ||
7164 | item.CurrentPermissions = rezScriptx.InventoryBlock.OwnerMask; | ||
7165 | item.EveryOnePermissions = rezScriptx.InventoryBlock.EveryoneMask; | ||
7166 | item.NextPermissions = rezScriptx.InventoryBlock.NextOwnerMask; | ||
7167 | item.GroupPermissions = rezScriptx.InventoryBlock.GroupMask; | ||
7168 | item.GroupOwned = rezScriptx.InventoryBlock.GroupOwned; | ||
7169 | item.GroupID = rezScriptx.InventoryBlock.GroupID; | ||
7170 | item.AssetType = rezScriptx.InventoryBlock.Type; | ||
7171 | item.InvType = rezScriptx.InventoryBlock.InvType; | ||
7172 | item.Flags = rezScriptx.InventoryBlock.Flags; | ||
7173 | item.SaleType = rezScriptx.InventoryBlock.SaleType; | ||
7174 | item.SalePrice = rezScriptx.InventoryBlock.SalePrice; | ||
7175 | item.Name = Util.FieldToString(rezScriptx.InventoryBlock.Name); | ||
7176 | item.Description = Util.FieldToString(rezScriptx.InventoryBlock.Description); | ||
7177 | item.CreationDate = rezScriptx.InventoryBlock.CreationDate; | ||
7178 | |||
7179 | if (handlerRezScript != null) | ||
7180 | { | ||
7181 | handlerRezScript(this, item, rezScriptx.InventoryBlock.TransactionID, rezScriptx.UpdateBlock.ObjectLocalID); | ||
7182 | } | ||
7183 | return true; | ||
7184 | } | ||
7185 | |||
7186 | private bool HandleMapLayerRequest(IClientAPI sender, Packet Pack) | ||
7187 | { | ||
7188 | RequestMapLayer(); | ||
7189 | return true; | ||
7190 | } | ||
7191 | |||
7192 | private bool HandleMapBlockRequest(IClientAPI sender, Packet Pack) | ||
7193 | { | ||
7194 | MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack; | ||
7195 | |||
7196 | #region Packet Session and User Check | ||
7197 | if (m_checkPackets) | ||
7198 | { | ||
7199 | if (MapRequest.AgentData.SessionID != SessionId || | ||
7200 | MapRequest.AgentData.AgentID != AgentId) | ||
7201 | return true; | ||
7202 | } | ||
7203 | #endregion | ||
7204 | |||
7205 | RequestMapBlocks handlerRequestMapBlocks = OnRequestMapBlocks; | ||
7206 | if (handlerRequestMapBlocks != null) | ||
7207 | { | ||
7208 | handlerRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, | ||
7209 | MapRequest.PositionData.MaxX, MapRequest.PositionData.MaxY, MapRequest.AgentData.Flags); | ||
7210 | } | ||
7211 | return true; | ||
7212 | } | ||
7213 | |||
7214 | private bool HandleMapNameRequest(IClientAPI sender, Packet Pack) | ||
7215 | { | ||
7216 | MapNameRequestPacket map = (MapNameRequestPacket)Pack; | ||
7217 | |||
7218 | #region Packet Session and User Check | ||
7219 | if (m_checkPackets) | ||
7220 | { | ||
7221 | if (map.AgentData.SessionID != SessionId || | ||
7222 | map.AgentData.AgentID != AgentId) | ||
7223 | return true; | ||
7224 | } | ||
7225 | #endregion | ||
7226 | |||
7227 | string mapName = Util.UTF8.GetString(map.NameData.Name, 0, | ||
7228 | map.NameData.Name.Length - 1); | ||
7229 | RequestMapName handlerMapNameRequest = OnMapNameRequest; | ||
7230 | if (handlerMapNameRequest != null) | ||
7231 | { | ||
7232 | handlerMapNameRequest(this, mapName); | ||
7233 | } | ||
7234 | return true; | ||
7235 | } | ||
7236 | |||
7237 | private bool HandleTeleportLandmarkRequest(IClientAPI sender, Packet Pack) | ||
7238 | { | ||
7239 | TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; | ||
7240 | |||
7241 | #region Packet Session and User Check | ||
7242 | if (m_checkPackets) | ||
7243 | { | ||
7244 | if (tpReq.Info.SessionID != SessionId || | ||
7245 | tpReq.Info.AgentID != AgentId) | ||
7246 | return true; | ||
7247 | } | ||
7248 | #endregion | ||
7249 | |||
7250 | UUID lmid = tpReq.Info.LandmarkID; | ||
7251 | AssetLandmark lm; | ||
7252 | if (lmid != UUID.Zero) | ||
7253 | { | ||
7254 | //AssetBase lma = m_assetCache.GetAsset(lmid, false); | ||
7255 | AssetBase lma = m_assetService.Get(lmid.ToString()); | ||
7256 | |||
7257 | if (lma == null) | ||
7258 | { | ||
7259 | // Failed to find landmark | ||
7260 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
7261 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
7262 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
7263 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
7264 | } | ||
7265 | |||
7266 | try | ||
7267 | { | ||
7268 | lm = new AssetLandmark(lma); | ||
7269 | } | ||
7270 | catch (NullReferenceException) | ||
7271 | { | ||
7272 | // asset not found generates null ref inside the assetlandmark constructor. | ||
7273 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
7274 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
7275 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
7276 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
7277 | return true; | ||
7278 | } | ||
7279 | } | ||
7280 | else | ||
7281 | { | ||
7282 | // Teleport home request | ||
7283 | UUIDNameRequest handlerTeleportHomeRequest = OnTeleportHomeRequest; | ||
7284 | if (handlerTeleportHomeRequest != null) | ||
7285 | { | ||
7286 | handlerTeleportHomeRequest(AgentId, this); | ||
7287 | } | ||
7288 | return true; | ||
7289 | } | ||
7290 | |||
7291 | TeleportLandmarkRequest handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; | ||
7292 | if (handlerTeleportLandmarkRequest != null) | ||
7293 | { | ||
7294 | handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position); | ||
7295 | } | ||
7296 | else | ||
7297 | { | ||
7298 | //no event handler so cancel request | ||
7299 | |||
7300 | |||
7301 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
7302 | tpCancel.Info.AgentID = tpReq.Info.AgentID; | ||
7303 | tpCancel.Info.SessionID = tpReq.Info.SessionID; | ||
7304 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
7305 | |||
7306 | } | ||
7307 | return true; | ||
7308 | } | ||
7309 | |||
7310 | private bool HandleTeleportLocationRequest(IClientAPI sender, Packet Pack) | ||
7311 | { | ||
7312 | TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; | ||
7313 | // m_log.Debug(tpLocReq.ToString()); | ||
7314 | |||
7315 | #region Packet Session and User Check | ||
7316 | if (m_checkPackets) | ||
7317 | { | ||
7318 | if (tpLocReq.AgentData.SessionID != SessionId || | ||
7319 | tpLocReq.AgentData.AgentID != AgentId) | ||
7320 | return true; | ||
7321 | } | ||
7322 | #endregion | ||
7323 | |||
7324 | TeleportLocationRequest handlerTeleportLocationRequest = OnTeleportLocationRequest; | ||
7325 | if (handlerTeleportLocationRequest != null) | ||
7326 | { | ||
7327 | handlerTeleportLocationRequest(this, tpLocReq.Info.RegionHandle, tpLocReq.Info.Position, | ||
7328 | tpLocReq.Info.LookAt, 16); | ||
7329 | } | ||
7330 | else | ||
7331 | { | ||
7332 | //no event handler so cancel request | ||
7333 | TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); | ||
7334 | tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID; | ||
7335 | tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID; | ||
7336 | OutPacket(tpCancel, ThrottleOutPacketType.Task); | ||
7337 | } | ||
7338 | return true; | ||
7339 | } | ||
7340 | |||
7341 | #endregion Inventory/Asset/Other related packets | ||
7342 | |||
7343 | private bool HandleUUIDNameRequest(IClientAPI sender, Packet Pack) | ||
7344 | { | ||
7345 | UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; | ||
7346 | |||
7347 | foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) | ||
7348 | { | ||
7349 | UUIDNameRequest handlerNameRequest = OnNameFromUUIDRequest; | ||
7350 | if (handlerNameRequest != null) | ||
7351 | { | ||
7352 | handlerNameRequest(UUIDBlock.ID, this); | ||
7353 | } | ||
7354 | } | ||
7355 | return true; | ||
7356 | } | ||
7357 | |||
7358 | #region Parcel related packets | ||
7359 | |||
7360 | private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack) | ||
7361 | { | ||
7362 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
7363 | |||
7364 | RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest; | ||
7365 | if (handlerRegionHandleRequest != null) | ||
7366 | { | ||
7367 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | ||
7368 | } | ||
7369 | return true; | ||
7370 | } | ||
7371 | |||
7372 | private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack) | ||
7373 | { | ||
7374 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; | ||
7375 | |||
7376 | #region Packet Session and User Check | ||
7377 | if (m_checkPackets) | ||
7378 | { | ||
7379 | if (pirPack.AgentData.SessionID != SessionId || | ||
7380 | pirPack.AgentData.AgentID != AgentId) | ||
7381 | return true; | ||
7382 | } | ||
7383 | #endregion | ||
7384 | |||
7385 | ParcelInfoRequest handlerParcelInfoRequest = OnParcelInfoRequest; | ||
7386 | if (handlerParcelInfoRequest != null) | ||
7387 | { | ||
7388 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); | ||
7389 | } | ||
7390 | return true; | ||
7391 | } | ||
7392 | |||
7393 | private bool HandleParcelAccessListRequest(IClientAPI sender, Packet Pack) | ||
7394 | { | ||
7395 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | ||
7396 | |||
7397 | #region Packet Session and User Check | ||
7398 | if (m_checkPackets) | ||
7399 | { | ||
7400 | if (requestPacket.AgentData.SessionID != SessionId || | ||
7401 | requestPacket.AgentData.AgentID != AgentId) | ||
7402 | return true; | ||
7403 | } | ||
7404 | #endregion | ||
7405 | |||
7406 | ParcelAccessListRequest handlerParcelAccessListRequest = OnParcelAccessListRequest; | ||
7407 | |||
7408 | if (handlerParcelAccessListRequest != null) | ||
7409 | { | ||
7410 | handlerParcelAccessListRequest(requestPacket.AgentData.AgentID, requestPacket.AgentData.SessionID, | ||
7411 | requestPacket.Data.Flags, requestPacket.Data.SequenceID, | ||
7412 | requestPacket.Data.LocalID, this); | ||
7413 | } | ||
7414 | return true; | ||
7415 | } | ||
7416 | |||
7417 | private bool HandleParcelAccessListUpdate(IClientAPI sender, Packet Pack) | ||
7418 | { | ||
7419 | ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket)Pack; | ||
7420 | |||
7421 | #region Packet Session and User Check | ||
7422 | if (m_checkPackets) | ||
7423 | { | ||
7424 | if (updatePacket.AgentData.SessionID != SessionId || | ||
7425 | updatePacket.AgentData.AgentID != AgentId) | ||
7426 | return true; | ||
7427 | } | ||
7428 | #endregion | ||
7429 | |||
7430 | List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); | ||
7431 | foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) | ||
7432 | { | ||
7433 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
7434 | entry.AgentID = block.ID; | ||
7435 | entry.Flags = (AccessList)block.Flags; | ||
7436 | entry.Time = new DateTime(); | ||
7437 | entries.Add(entry); | ||
7438 | } | ||
7439 | |||
7440 | ParcelAccessListUpdateRequest handlerParcelAccessListUpdateRequest = OnParcelAccessListUpdateRequest; | ||
7441 | if (handlerParcelAccessListUpdateRequest != null) | ||
7442 | { | ||
7443 | handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, | ||
7444 | updatePacket.AgentData.SessionID, updatePacket.Data.Flags, | ||
7445 | updatePacket.Data.LocalID, entries, this); | ||
7446 | } | ||
7447 | return true; | ||
7448 | } | ||
7449 | |||
7450 | private bool HandleParcelPropertiesRequest(IClientAPI sender, Packet Pack) | ||
7451 | { | ||
7452 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; | ||
7453 | |||
7454 | #region Packet Session and User Check | ||
7455 | if (m_checkPackets) | ||
7456 | { | ||
7457 | if (propertiesRequest.AgentData.SessionID != SessionId || | ||
7458 | propertiesRequest.AgentData.AgentID != AgentId) | ||
7459 | return true; | ||
7460 | } | ||
7461 | #endregion | ||
7462 | |||
7463 | ParcelPropertiesRequest handlerParcelPropertiesRequest = OnParcelPropertiesRequest; | ||
7464 | if (handlerParcelPropertiesRequest != null) | ||
7465 | { | ||
7466 | handlerParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), | ||
7467 | (int)Math.Round(propertiesRequest.ParcelData.South), | ||
7468 | (int)Math.Round(propertiesRequest.ParcelData.East), | ||
7469 | (int)Math.Round(propertiesRequest.ParcelData.North), | ||
7470 | propertiesRequest.ParcelData.SequenceID, | ||
7471 | propertiesRequest.ParcelData.SnapSelection, this); | ||
7472 | } | ||
7473 | return true; | ||
7474 | } | ||
7475 | |||
7476 | private bool HandleParcelDivide(IClientAPI sender, Packet Pack) | ||
7477 | { | ||
7478 | ParcelDividePacket landDivide = (ParcelDividePacket)Pack; | ||
7479 | |||
7480 | #region Packet Session and User Check | ||
7481 | if (m_checkPackets) | ||
7482 | { | ||
7483 | if (landDivide.AgentData.SessionID != SessionId || | ||
7484 | landDivide.AgentData.AgentID != AgentId) | ||
7485 | return true; | ||
7486 | } | ||
7487 | #endregion | ||
7488 | |||
7489 | ParcelDivideRequest handlerParcelDivideRequest = OnParcelDivideRequest; | ||
7490 | if (handlerParcelDivideRequest != null) | ||
7491 | { | ||
7492 | handlerParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), | ||
7493 | (int)Math.Round(landDivide.ParcelData.South), | ||
7494 | (int)Math.Round(landDivide.ParcelData.East), | ||
7495 | (int)Math.Round(landDivide.ParcelData.North), this); | ||
7496 | } | ||
7497 | return true; | ||
7498 | } | ||
7499 | |||
7500 | private bool HandleParcelJoin(IClientAPI sender, Packet Pack) | ||
7501 | { | ||
7502 | ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack; | ||
7503 | |||
7504 | #region Packet Session and User Check | ||
7505 | if (m_checkPackets) | ||
7506 | { | ||
7507 | if (landJoin.AgentData.SessionID != SessionId || | ||
7508 | landJoin.AgentData.AgentID != AgentId) | ||
7509 | return true; | ||
7510 | } | ||
7511 | #endregion | ||
7512 | |||
7513 | ParcelJoinRequest handlerParcelJoinRequest = OnParcelJoinRequest; | ||
7514 | |||
7515 | if (handlerParcelJoinRequest != null) | ||
7516 | { | ||
7517 | handlerParcelJoinRequest((int)Math.Round(landJoin.ParcelData.West), | ||
7518 | (int)Math.Round(landJoin.ParcelData.South), | ||
7519 | (int)Math.Round(landJoin.ParcelData.East), | ||
7520 | (int)Math.Round(landJoin.ParcelData.North), this); | ||
7521 | } | ||
7522 | return true; | ||
7523 | } | ||
7524 | |||
7525 | private bool HandleParcelPropertiesUpdate(IClientAPI sender, Packet Pack) | ||
7526 | { | ||
7527 | ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack; | ||
7528 | |||
7529 | #region Packet Session and User Check | ||
7530 | if (m_checkPackets) | ||
7531 | { | ||
7532 | if (parcelPropertiesPacket.AgentData.SessionID != SessionId || | ||
7533 | parcelPropertiesPacket.AgentData.AgentID != AgentId) | ||
7534 | return true; | ||
7535 | } | ||
7536 | #endregion | ||
7537 | |||
7538 | ParcelPropertiesUpdateRequest handlerParcelPropertiesUpdateRequest = OnParcelPropertiesUpdateRequest; | ||
7539 | |||
7540 | if (handlerParcelPropertiesUpdateRequest != null) | ||
7541 | { | ||
7542 | LandUpdateArgs args = new LandUpdateArgs(); | ||
7543 | |||
7544 | args.AuthBuyerID = parcelPropertiesPacket.ParcelData.AuthBuyerID; | ||
7545 | args.Category = (ParcelCategory)parcelPropertiesPacket.ParcelData.Category; | ||
7546 | args.Desc = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc); | ||
7547 | args.GroupID = parcelPropertiesPacket.ParcelData.GroupID; | ||
7548 | args.LandingType = parcelPropertiesPacket.ParcelData.LandingType; | ||
7549 | args.MediaAutoScale = parcelPropertiesPacket.ParcelData.MediaAutoScale; | ||
7550 | args.MediaID = parcelPropertiesPacket.ParcelData.MediaID; | ||
7551 | args.MediaURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL); | ||
7552 | args.MusicURL = Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL); | ||
7553 | args.Name = Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name); | ||
7554 | args.ParcelFlags = parcelPropertiesPacket.ParcelData.ParcelFlags; | ||
7555 | args.PassHours = parcelPropertiesPacket.ParcelData.PassHours; | ||
7556 | args.PassPrice = parcelPropertiesPacket.ParcelData.PassPrice; | ||
7557 | args.SalePrice = parcelPropertiesPacket.ParcelData.SalePrice; | ||
7558 | args.SnapshotID = parcelPropertiesPacket.ParcelData.SnapshotID; | ||
7559 | args.UserLocation = parcelPropertiesPacket.ParcelData.UserLocation; | ||
7560 | args.UserLookAt = parcelPropertiesPacket.ParcelData.UserLookAt; | ||
7561 | handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID, this); | ||
7562 | } | ||
7563 | return true; | ||
7564 | } | ||
7565 | |||
7566 | private bool HandleParcelSelectObjects(IClientAPI sender, Packet Pack) | ||
7567 | { | ||
7568 | ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; | ||
7569 | |||
7570 | #region Packet Session and User Check | ||
7571 | if (m_checkPackets) | ||
7572 | { | ||
7573 | if (selectPacket.AgentData.SessionID != SessionId || | ||
7574 | selectPacket.AgentData.AgentID != AgentId) | ||
7575 | return true; | ||
7576 | } | ||
7577 | #endregion | ||
7578 | |||
7579 | List<UUID> returnIDs = new List<UUID>(); | ||
7580 | |||
7581 | foreach (ParcelSelectObjectsPacket.ReturnIDsBlock rb in | ||
7582 | selectPacket.ReturnIDs) | ||
7583 | { | ||
7584 | returnIDs.Add(rb.ReturnID); | ||
7585 | } | ||
7586 | |||
7587 | ParcelSelectObjects handlerParcelSelectObjects = OnParcelSelectObjects; | ||
7588 | |||
7589 | if (handlerParcelSelectObjects != null) | ||
7590 | { | ||
7591 | handlerParcelSelectObjects(selectPacket.ParcelData.LocalID, | ||
7592 | Convert.ToInt32(selectPacket.ParcelData.ReturnType), returnIDs, this); | ||
7593 | } | ||
7594 | return true; | ||
7595 | } | ||
7596 | |||
7597 | private bool HandleParcelObjectOwnersRequest(IClientAPI sender, Packet Pack) | ||
7598 | { | ||
7599 | ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; | ||
7600 | |||
7601 | #region Packet Session and User Check | ||
7602 | if (m_checkPackets) | ||
7603 | { | ||
7604 | if (reqPacket.AgentData.SessionID != SessionId || | ||
7605 | reqPacket.AgentData.AgentID != AgentId) | ||
7606 | return true; | ||
7607 | } | ||
7608 | #endregion | ||
7609 | |||
7610 | ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; | ||
7611 | |||
7612 | if (handlerParcelObjectOwnerRequest != null) | ||
7613 | { | ||
7614 | handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); | ||
7615 | } | ||
7616 | return true; | ||
7617 | |||
7618 | } | ||
7619 | |||
7620 | private bool HandleParcelGodForceOwner(IClientAPI sender, Packet Pack) | ||
7621 | { | ||
7622 | ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack; | ||
7623 | |||
7624 | #region Packet Session and User Check | ||
7625 | if (m_checkPackets) | ||
7626 | { | ||
7627 | if (godForceOwnerPacket.AgentData.SessionID != SessionId || | ||
7628 | godForceOwnerPacket.AgentData.AgentID != AgentId) | ||
7629 | return true; | ||
7630 | } | ||
7631 | #endregion | ||
7632 | |||
7633 | ParcelGodForceOwner handlerParcelGodForceOwner = OnParcelGodForceOwner; | ||
7634 | if (handlerParcelGodForceOwner != null) | ||
7635 | { | ||
7636 | handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); | ||
7637 | } | ||
7638 | return true; | ||
7639 | } | ||
7640 | |||
7641 | private bool HandleParcelRelease(IClientAPI sender, Packet Pack) | ||
7642 | { | ||
7643 | ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; | ||
7644 | |||
7645 | #region Packet Session and User Check | ||
7646 | if (m_checkPackets) | ||
7647 | { | ||
7648 | if (releasePacket.AgentData.SessionID != SessionId || | ||
7649 | releasePacket.AgentData.AgentID != AgentId) | ||
7650 | return true; | ||
7651 | } | ||
7652 | #endregion | ||
7653 | |||
7654 | ParcelAbandonRequest handlerParcelAbandonRequest = OnParcelAbandonRequest; | ||
7655 | if (handlerParcelAbandonRequest != null) | ||
7656 | { | ||
7657 | handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); | ||
7658 | } | ||
7659 | return true; | ||
7660 | } | ||
7661 | |||
7662 | private bool HandleParcelReclaim(IClientAPI sender, Packet Pack) | ||
7663 | { | ||
7664 | ParcelReclaimPacket reclaimPacket = (ParcelReclaimPacket)Pack; | ||
7665 | |||
7666 | #region Packet Session and User Check | ||
7667 | if (m_checkPackets) | ||
7668 | { | ||
7669 | if (reclaimPacket.AgentData.SessionID != SessionId || | ||
7670 | reclaimPacket.AgentData.AgentID != AgentId) | ||
7671 | return true; | ||
7672 | } | ||
7673 | #endregion | ||
7674 | |||
7675 | ParcelReclaim handlerParcelReclaim = OnParcelReclaim; | ||
7676 | if (handlerParcelReclaim != null) | ||
7677 | { | ||
7678 | handlerParcelReclaim(reclaimPacket.Data.LocalID, this); | ||
7679 | } | ||
7680 | return true; | ||
7681 | } | ||
7682 | |||
7683 | private bool HandleParcelReturnObjects(IClientAPI sender, Packet Pack) | ||
7684 | { | ||
7685 | ParcelReturnObjectsPacket parcelReturnObjects = (ParcelReturnObjectsPacket)Pack; | ||
7686 | |||
7687 | #region Packet Session and User Check | ||
7688 | if (m_checkPackets) | ||
7689 | { | ||
7690 | if (parcelReturnObjects.AgentData.SessionID != SessionId || | ||
7691 | parcelReturnObjects.AgentData.AgentID != AgentId) | ||
7692 | return true; | ||
7693 | } | ||
7694 | #endregion | ||
7695 | |||
7696 | UUID[] puserselectedOwnerIDs = new UUID[parcelReturnObjects.OwnerIDs.Length]; | ||
7697 | for (int parceliterator = 0; parceliterator < parcelReturnObjects.OwnerIDs.Length; parceliterator++) | ||
7698 | puserselectedOwnerIDs[parceliterator] = parcelReturnObjects.OwnerIDs[parceliterator].OwnerID; | ||
7699 | |||
7700 | UUID[] puserselectedTaskIDs = new UUID[parcelReturnObjects.TaskIDs.Length]; | ||
7701 | |||
7702 | for (int parceliterator = 0; parceliterator < parcelReturnObjects.TaskIDs.Length; parceliterator++) | ||
7703 | puserselectedTaskIDs[parceliterator] = parcelReturnObjects.TaskIDs[parceliterator].TaskID; | ||
7704 | |||
7705 | ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = OnParcelReturnObjectsRequest; | ||
7706 | if (handlerParcelReturnObjectsRequest != null) | ||
7707 | { | ||
7708 | handlerParcelReturnObjectsRequest(parcelReturnObjects.ParcelData.LocalID, parcelReturnObjects.ParcelData.ReturnType, puserselectedOwnerIDs, puserselectedTaskIDs, this); | ||
7709 | |||
7710 | } | ||
7711 | return true; | ||
7712 | } | ||
7713 | |||
7714 | private bool HandleParcelSetOtherCleanTime(IClientAPI sender, Packet Pack) | ||
7715 | { | ||
7716 | ParcelSetOtherCleanTimePacket parcelSetOtherCleanTimePacket = (ParcelSetOtherCleanTimePacket)Pack; | ||
7717 | |||
7718 | #region Packet Session and User Check | ||
7719 | if (m_checkPackets) | ||
7720 | { | ||
7721 | if (parcelSetOtherCleanTimePacket.AgentData.SessionID != SessionId || | ||
7722 | parcelSetOtherCleanTimePacket.AgentData.AgentID != AgentId) | ||
7723 | return true; | ||
7724 | } | ||
7725 | #endregion | ||
7726 | |||
7727 | ParcelSetOtherCleanTime handlerParcelSetOtherCleanTime = OnParcelSetOtherCleanTime; | ||
7728 | if (handlerParcelSetOtherCleanTime != null) | ||
7729 | { | ||
7730 | handlerParcelSetOtherCleanTime(this, | ||
7731 | parcelSetOtherCleanTimePacket.ParcelData.LocalID, | ||
7732 | parcelSetOtherCleanTimePacket.ParcelData.OtherCleanTime); | ||
7733 | } | ||
7734 | return true; | ||
7735 | } | ||
7736 | |||
7737 | private bool HandleLandStatRequest(IClientAPI sender, Packet Pack) | ||
7738 | { | ||
7739 | LandStatRequestPacket lsrp = (LandStatRequestPacket)Pack; | ||
7740 | |||
7741 | #region Packet Session and User Check | ||
7742 | if (m_checkPackets) | ||
7743 | { | ||
7744 | if (lsrp.AgentData.SessionID != SessionId || | ||
7745 | lsrp.AgentData.AgentID != AgentId) | ||
7746 | return true; | ||
7747 | } | ||
7748 | #endregion | ||
7749 | |||
7750 | GodLandStatRequest handlerLandStatRequest = OnLandStatRequest; | ||
7751 | if (handlerLandStatRequest != null) | ||
7752 | { | ||
7753 | handlerLandStatRequest(lsrp.RequestData.ParcelLocalID, lsrp.RequestData.ReportType, lsrp.RequestData.RequestFlags, Utils.BytesToString(lsrp.RequestData.Filter), this); | ||
7754 | } | ||
7755 | return true; | ||
7756 | } | ||
7757 | |||
7758 | private bool HandleParcelDwellRequest(IClientAPI sender, Packet Pack) | ||
7759 | { | ||
7760 | ParcelDwellRequestPacket dwellrq = | ||
7761 | (ParcelDwellRequestPacket)Pack; | ||
7762 | |||
7763 | #region Packet Session and User Check | ||
7764 | if (m_checkPackets) | ||
7765 | { | ||
7766 | if (dwellrq.AgentData.SessionID != SessionId || | ||
7767 | dwellrq.AgentData.AgentID != AgentId) | ||
7768 | return true; | ||
7769 | } | ||
7770 | #endregion | ||
7771 | |||
7772 | ParcelDwellRequest handlerParcelDwellRequest = OnParcelDwellRequest; | ||
7773 | if (handlerParcelDwellRequest != null) | ||
7774 | { | ||
7775 | handlerParcelDwellRequest(dwellrq.Data.LocalID, this); | ||
7776 | } | ||
7777 | return true; | ||
7778 | } | ||
7779 | |||
7780 | #endregion Parcel related packets | ||
7781 | |||
7782 | #region Estate Packets | ||
7783 | |||
7784 | private bool HandleEstateOwnerMessage(IClientAPI sender, Packet Pack) | ||
7785 | { | ||
7786 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; | ||
7787 | //m_log.Debug(messagePacket.ToString()); | ||
7788 | GodLandStatRequest handlerLandStatRequest; | ||
7789 | |||
7790 | #region Packet Session and User Check | ||
7791 | if (m_checkPackets) | ||
7792 | { | ||
7793 | if (messagePacket.AgentData.SessionID != SessionId || | ||
7794 | messagePacket.AgentData.AgentID != AgentId) | ||
7795 | return true; | ||
7796 | } | ||
7797 | #endregion | ||
7798 | |||
7799 | switch (Utils.BytesToString(messagePacket.MethodData.Method)) | ||
7800 | { | ||
7801 | case "getinfo": | ||
7802 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7803 | { | ||
7804 | OnDetailedEstateDataRequest(this, messagePacket.MethodData.Invoice); | ||
7805 | } | ||
7806 | return true; | ||
7807 | case "setregioninfo": | ||
7808 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7809 | { | ||
7810 | OnSetEstateFlagsRequest(convertParamStringToBool(messagePacket.ParamList[0].Parameter), convertParamStringToBool(messagePacket.ParamList[1].Parameter), | ||
7811 | convertParamStringToBool(messagePacket.ParamList[2].Parameter), !convertParamStringToBool(messagePacket.ParamList[3].Parameter), | ||
7812 | Convert.ToInt16(Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[4].Parameter))), | ||
7813 | (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)), | ||
7814 | Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[6].Parameter)), | ||
7815 | convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter)); | ||
7816 | } | ||
7817 | return true; | ||
7818 | // case "texturebase": | ||
7819 | // if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7820 | // { | ||
7821 | // foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
7822 | // { | ||
7823 | // string s = Utils.BytesToString(block.Parameter); | ||
7824 | // string[] splitField = s.Split(' '); | ||
7825 | // if (splitField.Length == 2) | ||
7826 | // { | ||
7827 | // UUID tempUUID = new UUID(splitField[1]); | ||
7828 | // OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID); | ||
7829 | // } | ||
7830 | // } | ||
7831 | // } | ||
7832 | // break; | ||
7833 | case "texturedetail": | ||
7834 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7835 | { | ||
7836 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
7837 | { | ||
7838 | string s = Utils.BytesToString(block.Parameter); | ||
7839 | string[] splitField = s.Split(' '); | ||
7840 | if (splitField.Length == 2) | ||
7841 | { | ||
7842 | Int16 corner = Convert.ToInt16(splitField[0]); | ||
7843 | UUID textureUUID = new UUID(splitField[1]); | ||
7844 | |||
7845 | OnSetEstateTerrainDetailTexture(this, corner, textureUUID); | ||
7846 | } | ||
7847 | } | ||
7848 | } | ||
7849 | |||
7850 | return true; | ||
7851 | case "textureheights": | ||
7852 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7853 | { | ||
7854 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
7855 | { | ||
7856 | string s = Utils.BytesToString(block.Parameter); | ||
7857 | string[] splitField = s.Split(' '); | ||
7858 | if (splitField.Length == 3) | ||
7859 | { | ||
7860 | Int16 corner = Convert.ToInt16(splitField[0]); | ||
7861 | float lowValue = (float)Convert.ToDecimal(splitField[1]); | ||
7862 | float highValue = (float)Convert.ToDecimal(splitField[2]); | ||
7863 | |||
7864 | OnSetEstateTerrainTextureHeights(this, corner, lowValue, highValue); | ||
7865 | } | ||
7866 | } | ||
7867 | } | ||
7868 | return true; | ||
7869 | case "texturecommit": | ||
7870 | OnCommitEstateTerrainTextureRequest(this); | ||
7871 | break; | ||
7872 | case "setregionterrain": | ||
7873 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7874 | { | ||
7875 | if (messagePacket.ParamList.Length != 9) | ||
7876 | { | ||
7877 | m_log.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length"); | ||
7878 | } | ||
7879 | else | ||
7880 | { | ||
7881 | try | ||
7882 | { | ||
7883 | string tmp = Utils.BytesToString(messagePacket.ParamList[0].Parameter); | ||
7884 | if (!tmp.Contains(".")) tmp += ".00"; | ||
7885 | float WaterHeight = (float)Convert.ToDecimal(tmp); | ||
7886 | tmp = Utils.BytesToString(messagePacket.ParamList[1].Parameter); | ||
7887 | if (!tmp.Contains(".")) tmp += ".00"; | ||
7888 | float TerrainRaiseLimit = (float)Convert.ToDecimal(tmp); | ||
7889 | tmp = Utils.BytesToString(messagePacket.ParamList[2].Parameter); | ||
7890 | if (!tmp.Contains(".")) tmp += ".00"; | ||
7891 | float TerrainLowerLimit = (float)Convert.ToDecimal(tmp); | ||
7892 | bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter); | ||
7893 | bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter); | ||
7894 | float SunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[5].Parameter)); | ||
7895 | bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter); | ||
7896 | bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter); | ||
7897 | float EstateSunHour = (float)Convert.ToDecimal(Utils.BytesToString(messagePacket.ParamList[8].Parameter)); | ||
7898 | |||
7899 | OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour); | ||
7900 | |||
7901 | } | ||
7902 | catch (Exception ex) | ||
7903 | { | ||
7904 | m_log.Error("EstateOwnerMessage: Exception while setting terrain settings: \n" + messagePacket + "\n" + ex); | ||
7905 | } | ||
7906 | } | ||
7907 | } | ||
7908 | |||
7909 | return true; | ||
7910 | case "restart": | ||
7911 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7912 | { | ||
7913 | // There's only 1 block in the estateResetSim.. and that's the number of seconds till restart. | ||
7914 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
7915 | { | ||
7916 | float timeSeconds; | ||
7917 | Utils.TryParseSingle(Utils.BytesToString(block.Parameter), out timeSeconds); | ||
7918 | timeSeconds = (int)timeSeconds; | ||
7919 | OnEstateRestartSimRequest(this, (int)timeSeconds); | ||
7920 | |||
7921 | } | ||
7922 | } | ||
7923 | return true; | ||
7924 | case "estatechangecovenantid": | ||
7925 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7926 | { | ||
7927 | foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList) | ||
7928 | { | ||
7929 | UUID newCovenantID = new UUID(Utils.BytesToString(block.Parameter)); | ||
7930 | OnEstateChangeCovenantRequest(this, newCovenantID); | ||
7931 | } | ||
7932 | } | ||
7933 | return true; | ||
7934 | case "estateaccessdelta": // Estate access delta manages the banlist and allow list too. | ||
7935 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7936 | { | ||
7937 | int estateAccessType = Convert.ToInt16(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
7938 | OnUpdateEstateAccessDeltaRequest(this, messagePacket.MethodData.Invoice, estateAccessType, new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter))); | ||
7939 | |||
7940 | } | ||
7941 | return true; | ||
7942 | case "simulatormessage": | ||
7943 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7944 | { | ||
7945 | UUID invoice = messagePacket.MethodData.Invoice; | ||
7946 | UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
7947 | string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); | ||
7948 | string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); | ||
7949 | UUID sessionID = messagePacket.AgentData.SessionID; | ||
7950 | OnSimulatorBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); | ||
7951 | } | ||
7952 | return true; | ||
7953 | case "instantmessage": | ||
7954 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7955 | { | ||
7956 | if (messagePacket.ParamList.Length < 5) | ||
7957 | break; | ||
7958 | UUID invoice = messagePacket.MethodData.Invoice; | ||
7959 | UUID SenderID = new UUID(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
7960 | string SenderName = Utils.BytesToString(messagePacket.ParamList[3].Parameter); | ||
7961 | string Message = Utils.BytesToString(messagePacket.ParamList[4].Parameter); | ||
7962 | UUID sessionID = messagePacket.AgentData.SessionID; | ||
7963 | OnEstateBlueBoxMessageRequest(this, invoice, SenderID, sessionID, SenderName, Message); | ||
7964 | } | ||
7965 | return true; | ||
7966 | case "setregiondebug": | ||
7967 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7968 | { | ||
7969 | UUID invoice = messagePacket.MethodData.Invoice; | ||
7970 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
7971 | bool scripted = convertParamStringToBool(messagePacket.ParamList[0].Parameter); | ||
7972 | bool collisionEvents = convertParamStringToBool(messagePacket.ParamList[1].Parameter); | ||
7973 | bool physics = convertParamStringToBool(messagePacket.ParamList[2].Parameter); | ||
7974 | |||
7975 | OnEstateDebugRegionRequest(this, invoice, SenderID, scripted, collisionEvents, physics); | ||
7976 | } | ||
7977 | return true; | ||
7978 | case "teleporthomeuser": | ||
7979 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7980 | { | ||
7981 | UUID invoice = messagePacket.MethodData.Invoice; | ||
7982 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
7983 | UUID Prey; | ||
7984 | |||
7985 | UUID.TryParse(Utils.BytesToString(messagePacket.ParamList[1].Parameter), out Prey); | ||
7986 | |||
7987 | OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey); | ||
7988 | } | ||
7989 | return true; | ||
7990 | case "teleporthomeallusers": | ||
7991 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
7992 | { | ||
7993 | UUID invoice = messagePacket.MethodData.Invoice; | ||
7994 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
7995 | OnEstateTeleportAllUsersHomeRequest(this, invoice, SenderID); | ||
7996 | } | ||
7997 | return true; | ||
7998 | case "colliders": | ||
7999 | handlerLandStatRequest = OnLandStatRequest; | ||
8000 | if (handlerLandStatRequest != null) | ||
8001 | { | ||
8002 | handlerLandStatRequest(0, 1, 0, "", this); | ||
8003 | } | ||
8004 | return true; | ||
8005 | case "scripts": | ||
8006 | handlerLandStatRequest = OnLandStatRequest; | ||
8007 | if (handlerLandStatRequest != null) | ||
8008 | { | ||
8009 | handlerLandStatRequest(0, 0, 0, "", this); | ||
8010 | } | ||
8011 | return true; | ||
8012 | case "terrain": | ||
8013 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
8014 | { | ||
8015 | if (messagePacket.ParamList.Length > 0) | ||
8016 | { | ||
8017 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "bake") | ||
8018 | { | ||
8019 | BakeTerrain handlerBakeTerrain = OnBakeTerrain; | ||
8020 | if (handlerBakeTerrain != null) | ||
8021 | { | ||
8022 | handlerBakeTerrain(this); | ||
8023 | } | ||
8024 | } | ||
8025 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "download filename") | ||
8026 | { | ||
8027 | if (messagePacket.ParamList.Length > 1) | ||
8028 | { | ||
8029 | RequestTerrain handlerRequestTerrain = OnRequestTerrain; | ||
8030 | if (handlerRequestTerrain != null) | ||
8031 | { | ||
8032 | handlerRequestTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
8033 | } | ||
8034 | } | ||
8035 | } | ||
8036 | if (Utils.BytesToString(messagePacket.ParamList[0].Parameter) == "upload filename") | ||
8037 | { | ||
8038 | if (messagePacket.ParamList.Length > 1) | ||
8039 | { | ||
8040 | RequestTerrain handlerUploadTerrain = OnUploadTerrain; | ||
8041 | if (handlerUploadTerrain != null) | ||
8042 | { | ||
8043 | handlerUploadTerrain(this, Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
8044 | } | ||
8045 | } | ||
8046 | } | ||
8047 | |||
8048 | } | ||
8049 | |||
8050 | |||
8051 | } | ||
8052 | return true; | ||
8053 | |||
8054 | case "estatechangeinfo": | ||
8055 | if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) | ||
8056 | { | ||
8057 | UUID invoice = messagePacket.MethodData.Invoice; | ||
8058 | UUID SenderID = messagePacket.AgentData.AgentID; | ||
8059 | UInt32 param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter)); | ||
8060 | UInt32 param2 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[2].Parameter)); | ||
8061 | |||
8062 | EstateChangeInfo handlerEstateChangeInfo = OnEstateChangeInfo; | ||
8063 | if (handlerEstateChangeInfo != null) | ||
8064 | { | ||
8065 | handlerEstateChangeInfo(this, invoice, SenderID, param1, param2); | ||
8066 | } | ||
8067 | } | ||
8068 | return true; | ||
8069 | |||
8070 | default: | ||
8071 | m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); | ||
8072 | return true; | ||
8073 | } | ||
8074 | |||
8075 | //int parcelID, uint reportType, uint requestflags, string filter | ||
8076 | |||
8077 | //lsrp.RequestData.ParcelLocalID; | ||
8078 | //lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts | ||
8079 | //lsrp.RequestData.RequestFlags; | ||
8080 | //lsrp.RequestData.Filter; | ||
8081 | |||
8082 | return true; | ||
8083 | } | ||
8084 | private bool HandleRequestRegionInfo(IClientAPI sender, Packet Pack) | ||
8085 | { | ||
8086 | RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; | ||
8087 | |||
8088 | #region Packet Session and User Check | ||
8089 | if (m_checkPackets) | ||
8090 | { | ||
8091 | if (mPacket.SessionID != SessionId || | ||
8092 | mPacket.AgentID != AgentId) | ||
8093 | return true; | ||
8094 | } | ||
8095 | #endregion | ||
8096 | |||
8097 | RegionInfoRequest handlerRegionInfoRequest = OnRegionInfoRequest; | ||
8098 | if (handlerRegionInfoRequest != null) | ||
8099 | { | ||
8100 | handlerRegionInfoRequest(this); | ||
8101 | } | ||
8102 | return true; | ||
8103 | } | ||
8104 | private bool HandleEstateCovenantRequest(IClientAPI sender, Packet Pack) | ||
8105 | { | ||
8106 | |||
8107 | //EstateCovenantRequestPacket.AgentDataBlock epack = | ||
8108 | // ((EstateCovenantRequestPacket)Pack).AgentData; | ||
8109 | |||
8110 | EstateCovenantRequest handlerEstateCovenantRequest = OnEstateCovenantRequest; | ||
8111 | if (handlerEstateCovenantRequest != null) | ||
8112 | { | ||
8113 | handlerEstateCovenantRequest(this); | ||
8114 | } | ||
8115 | return true; | ||
8116 | |||
8117 | } | ||
8118 | |||
8119 | #endregion Estate Packets | ||
8120 | |||
8121 | #region GodPackets | ||
8122 | |||
8123 | private bool HandleRequestGodlikePowers(IClientAPI sender, Packet Pack) | ||
8124 | { | ||
8125 | RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; | ||
8126 | RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; | ||
8127 | UUID token = rblock.Token; | ||
8128 | |||
8129 | RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; | ||
8130 | |||
8131 | RequestGodlikePowers handlerReqGodlikePowers = OnRequestGodlikePowers; | ||
8132 | |||
8133 | if (handlerReqGodlikePowers != null) | ||
8134 | { | ||
8135 | handlerReqGodlikePowers(ablock.AgentID, ablock.SessionID, token, rblock.Godlike, this); | ||
8136 | } | ||
8137 | |||
8138 | return true; | ||
8139 | } | ||
8140 | private bool HandleGodKickUser(IClientAPI sender, Packet Pack) | ||
8141 | { | ||
8142 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; | ||
8143 | |||
8144 | if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) | ||
8145 | { | ||
8146 | GodKickUser handlerGodKickUser = OnGodKickUser; | ||
8147 | if (handlerGodKickUser != null) | ||
8148 | { | ||
8149 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, | ||
8150 | gkupack.UserInfo.AgentID, (uint)0, gkupack.UserInfo.Reason); | ||
8151 | } | ||
8152 | } | ||
8153 | else | ||
8154 | { | ||
8155 | SendAgentAlertMessage("Kick request denied", false); | ||
8156 | } | ||
8157 | //KickUserPacket kupack = new KickUserPacket(); | ||
8158 | //KickUserPacket.UserInfoBlock kupackib = kupack.UserInfo; | ||
8159 | |||
8160 | //kupack.UserInfo.AgentID = gkupack.UserInfo.AgentID; | ||
8161 | //kupack.UserInfo.SessionID = gkupack.UserInfo.GodSessionID; | ||
8162 | |||
8163 | //kupack.TargetBlock.TargetIP = (uint)0; | ||
8164 | //kupack.TargetBlock.TargetPort = (ushort)0; | ||
8165 | //kupack.UserInfo.Reason = gkupack.UserInfo.Reason; | ||
8166 | |||
8167 | //OutPacket(kupack, ThrottleOutPacketType.Task); | ||
8168 | return true; | ||
8169 | } | ||
8170 | #endregion GodPackets | ||
8171 | |||
8172 | #region Economy/Transaction Packets | ||
8173 | |||
8174 | private bool HandleMoneyBalanceRequest(IClientAPI sender, Packet Pack) | ||
8175 | { | ||
8176 | MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; | ||
8177 | |||
8178 | #region Packet Session and User Check | ||
8179 | if (m_checkPackets) | ||
8180 | { | ||
8181 | if (moneybalancerequestpacket.AgentData.SessionID != SessionId || | ||
8182 | moneybalancerequestpacket.AgentData.AgentID != AgentId) | ||
8183 | return true; | ||
8184 | } | ||
8185 | #endregion | ||
8186 | |||
8187 | MoneyBalanceRequest handlerMoneyBalanceRequest = OnMoneyBalanceRequest; | ||
8188 | |||
8189 | if (handlerMoneyBalanceRequest != null) | ||
8190 | { | ||
8191 | handlerMoneyBalanceRequest(this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID); | ||
8192 | } | ||
8193 | |||
8194 | return true; | ||
8195 | } | ||
8196 | private bool HandleEconomyDataRequest(IClientAPI sender, Packet Pack) | ||
8197 | { | ||
8198 | EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; | ||
8199 | if (handlerEconomoyDataRequest != null) | ||
8200 | { | ||
8201 | handlerEconomoyDataRequest(AgentId); | ||
8202 | } | ||
8203 | return true; | ||
8204 | } | ||
8205 | private bool HandleRequestPayPrice(IClientAPI sender, Packet Pack) | ||
8206 | { | ||
8207 | RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; | ||
8208 | |||
8209 | RequestPayPrice handlerRequestPayPrice = OnRequestPayPrice; | ||
8210 | if (handlerRequestPayPrice != null) | ||
8211 | { | ||
8212 | handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); | ||
8213 | } | ||
8214 | return true; | ||
8215 | } | ||
8216 | private bool HandleObjectSaleInfo(IClientAPI sender, Packet Pack) | ||
8217 | { | ||
8218 | ObjectSaleInfoPacket objectSaleInfoPacket = (ObjectSaleInfoPacket)Pack; | ||
8219 | |||
8220 | #region Packet Session and User Check | ||
8221 | if (m_checkPackets) | ||
8222 | { | ||
8223 | if (objectSaleInfoPacket.AgentData.SessionID != SessionId || | ||
8224 | objectSaleInfoPacket.AgentData.AgentID != AgentId) | ||
8225 | return true; | ||
8226 | } | ||
8227 | #endregion | ||
8228 | |||
8229 | ObjectSaleInfo handlerObjectSaleInfo = OnObjectSaleInfo; | ||
8230 | if (handlerObjectSaleInfo != null) | ||
8231 | { | ||
8232 | foreach (ObjectSaleInfoPacket.ObjectDataBlock d | ||
8233 | in objectSaleInfoPacket.ObjectData) | ||
8234 | { | ||
8235 | handlerObjectSaleInfo(this, | ||
8236 | objectSaleInfoPacket.AgentData.AgentID, | ||
8237 | objectSaleInfoPacket.AgentData.SessionID, | ||
8238 | d.LocalID, | ||
8239 | d.SaleType, | ||
8240 | d.SalePrice); | ||
8241 | } | ||
8242 | } | ||
8243 | return true; | ||
8244 | } | ||
8245 | private bool HandleObjectBuy(IClientAPI sender, Packet Pack) | ||
8246 | { | ||
8247 | ObjectBuyPacket objectBuyPacket = (ObjectBuyPacket)Pack; | ||
8248 | |||
8249 | #region Packet Session and User Check | ||
8250 | if (m_checkPackets) | ||
8251 | { | ||
8252 | if (objectBuyPacket.AgentData.SessionID != SessionId || | ||
8253 | objectBuyPacket.AgentData.AgentID != AgentId) | ||
8254 | return true; | ||
8255 | } | ||
8256 | #endregion | ||
8257 | |||
8258 | ObjectBuy handlerObjectBuy = OnObjectBuy; | ||
8259 | |||
8260 | if (handlerObjectBuy != null) | ||
8261 | { | ||
8262 | foreach (ObjectBuyPacket.ObjectDataBlock d | ||
8263 | in objectBuyPacket.ObjectData) | ||
8264 | { | ||
8265 | handlerObjectBuy(this, | ||
8266 | objectBuyPacket.AgentData.AgentID, | ||
8267 | objectBuyPacket.AgentData.SessionID, | ||
8268 | objectBuyPacket.AgentData.GroupID, | ||
8269 | objectBuyPacket.AgentData.CategoryID, | ||
8270 | d.ObjectLocalID, | ||
8271 | d.SaleType, | ||
8272 | d.SalePrice); | ||
8273 | } | ||
8274 | } | ||
8275 | return true; | ||
8276 | } | ||
8277 | |||
8278 | #endregion Economy/Transaction Packets | ||
8279 | |||
8280 | #region Script Packets | ||
8281 | private bool HandleGetScriptRunning(IClientAPI sender, Packet Pack) | ||
8282 | { | ||
8283 | GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; | ||
8284 | |||
8285 | GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning; | ||
8286 | if (handlerGetScriptRunning != null) | ||
8287 | { | ||
8288 | handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID); | ||
8289 | } | ||
8290 | return true; | ||
8291 | } | ||
8292 | private bool HandleSetScriptRunning(IClientAPI sender, Packet Pack) | ||
8293 | { | ||
8294 | SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack; | ||
8295 | |||
8296 | #region Packet Session and User Check | ||
8297 | if (m_checkPackets) | ||
8298 | { | ||
8299 | if (setScriptRunning.AgentData.SessionID != SessionId || | ||
8300 | setScriptRunning.AgentData.AgentID != AgentId) | ||
8301 | return true; | ||
8302 | } | ||
8303 | #endregion | ||
8304 | |||
8305 | SetScriptRunning handlerSetScriptRunning = OnSetScriptRunning; | ||
8306 | if (handlerSetScriptRunning != null) | ||
8307 | { | ||
8308 | handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running); | ||
8309 | } | ||
8310 | return true; | ||
8311 | } | ||
8312 | |||
8313 | private bool HandleScriptReset(IClientAPI sender, Packet Pack) | ||
8314 | { | ||
8315 | ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack; | ||
8316 | |||
8317 | #region Packet Session and User Check | ||
8318 | if (m_checkPackets) | ||
8319 | { | ||
8320 | if (scriptResetPacket.AgentData.SessionID != SessionId || | ||
8321 | scriptResetPacket.AgentData.AgentID != AgentId) | ||
8322 | return true; | ||
8323 | } | ||
8324 | #endregion | ||
8325 | |||
8326 | ScriptReset handlerScriptReset = OnScriptReset; | ||
8327 | if (handlerScriptReset != null) | ||
8328 | { | ||
8329 | handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID); | ||
8330 | } | ||
8331 | return true; | ||
8332 | } | ||
8333 | |||
8334 | #endregion Script Packets | ||
8335 | |||
8336 | |||
8337 | |||
6341 | #endregion Packet Handlers | 8338 | #endregion Packet Handlers |
6342 | 8339 | ||
6343 | public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) | 8340 | public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) |
@@ -8456,9 +10453,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8456 | break; | 10453 | break; |
8457 | 10454 | ||
8458 | //#endregion | 10455 | //#endregion |
8459 | */ | 10456 | |
8460 | #endregion | 10457 | //#region Inventory/Asset/Other related packets |
8461 | #region Inventory/Asset/Other related packets | ||
8462 | 10458 | ||
8463 | case PacketType.RequestImage: | 10459 | case PacketType.RequestImage: |
8464 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; | 10460 | RequestImagePacket imageRequest = (RequestImagePacket)Pack; |
@@ -8592,12 +10588,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8592 | 10588 | ||
8593 | MakeAssetRequest(transfer, taskID); | 10589 | MakeAssetRequest(transfer, taskID); |
8594 | 10590 | ||
8595 | /* RequestAsset = OnRequestAsset; | 10591 | // RequestAsset = OnRequestAsset; |
8596 | if (RequestAsset != null) | 10592 | // if (RequestAsset != null) |
8597 | { | 10593 | // { |
8598 | RequestAsset(this, transfer); | 10594 | // RequestAsset(this, transfer); |
8599 | }*/ | 10595 | // } |
10596 | |||
8600 | break; | 10597 | break; |
10598 | |||
8601 | case PacketType.AssetUploadRequest: | 10599 | case PacketType.AssetUploadRequest: |
8602 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 10600 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
8603 | 10601 | ||
@@ -8616,6 +10614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8616 | request.AssetBlock.Tempfile); | 10614 | request.AssetBlock.Tempfile); |
8617 | } | 10615 | } |
8618 | break; | 10616 | break; |
10617 | |||
8619 | case PacketType.RequestXfer: | 10618 | case PacketType.RequestXfer: |
8620 | RequestXferPacket xferReq = (RequestXferPacket)Pack; | 10619 | RequestXferPacket xferReq = (RequestXferPacket)Pack; |
8621 | 10620 | ||
@@ -8626,6 +10625,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8626 | handlerRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename)); | 10625 | handlerRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename)); |
8627 | } | 10626 | } |
8628 | break; | 10627 | break; |
10628 | |||
8629 | case PacketType.SendXferPacket: | 10629 | case PacketType.SendXferPacket: |
8630 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; | 10630 | SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; |
8631 | 10631 | ||
@@ -8635,6 +10635,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8635 | handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); | 10635 | handlerXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); |
8636 | } | 10636 | } |
8637 | break; | 10637 | break; |
10638 | |||
8638 | case PacketType.ConfirmXferPacket: | 10639 | case PacketType.ConfirmXferPacket: |
8639 | ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; | 10640 | ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; |
8640 | 10641 | ||
@@ -8644,6 +10645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8644 | handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); | 10645 | handlerConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); |
8645 | } | 10646 | } |
8646 | break; | 10647 | break; |
10648 | |||
8647 | case PacketType.AbortXfer: | 10649 | case PacketType.AbortXfer: |
8648 | AbortXferPacket abortXfer = (AbortXferPacket)Pack; | 10650 | AbortXferPacket abortXfer = (AbortXferPacket)Pack; |
8649 | AbortXfer handlerAbortXfer = OnAbortXfer; | 10651 | AbortXfer handlerAbortXfer = OnAbortXfer; |
@@ -8653,6 +10655,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8653 | } | 10655 | } |
8654 | 10656 | ||
8655 | break; | 10657 | break; |
10658 | |||
8656 | case PacketType.CreateInventoryFolder: | 10659 | case PacketType.CreateInventoryFolder: |
8657 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; | 10660 | CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; |
8658 | 10661 | ||
@@ -8674,6 +10677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8674 | invFolder.FolderData.ParentID); | 10677 | invFolder.FolderData.ParentID); |
8675 | } | 10678 | } |
8676 | break; | 10679 | break; |
10680 | |||
8677 | case PacketType.UpdateInventoryFolder: | 10681 | case PacketType.UpdateInventoryFolder: |
8678 | if (OnUpdateInventoryFolder != null) | 10682 | if (OnUpdateInventoryFolder != null) |
8679 | { | 10683 | { |
@@ -8703,6 +10707,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8703 | } | 10707 | } |
8704 | } | 10708 | } |
8705 | break; | 10709 | break; |
10710 | |||
8706 | case PacketType.MoveInventoryFolder: | 10711 | case PacketType.MoveInventoryFolder: |
8707 | if (OnMoveInventoryFolder != null) | 10712 | if (OnMoveInventoryFolder != null) |
8708 | { | 10713 | { |
@@ -8730,6 +10735,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8730 | } | 10735 | } |
8731 | } | 10736 | } |
8732 | break; | 10737 | break; |
10738 | |||
8733 | case PacketType.CreateInventoryItem: | 10739 | case PacketType.CreateInventoryItem: |
8734 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; | 10740 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; |
8735 | 10741 | ||
@@ -8757,6 +10763,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8757 | Util.UnixTimeSinceEpoch()); | 10763 | Util.UnixTimeSinceEpoch()); |
8758 | } | 10764 | } |
8759 | break; | 10765 | break; |
10766 | |||
8760 | case PacketType.FetchInventory: | 10767 | case PacketType.FetchInventory: |
8761 | if (OnFetchInventory != null) | 10768 | if (OnFetchInventory != null) |
8762 | { | 10769 | { |
@@ -8785,6 +10792,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8785 | } | 10792 | } |
8786 | } | 10793 | } |
8787 | break; | 10794 | break; |
10795 | |||
8788 | case PacketType.FetchInventoryDescendents: | 10796 | case PacketType.FetchInventoryDescendents: |
8789 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; | 10797 | FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; |
8790 | 10798 | ||
@@ -8805,6 +10813,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8805 | Fetch.InventoryData.SortOrder); | 10813 | Fetch.InventoryData.SortOrder); |
8806 | } | 10814 | } |
8807 | break; | 10815 | break; |
10816 | |||
8808 | case PacketType.PurgeInventoryDescendents: | 10817 | case PacketType.PurgeInventoryDescendents: |
8809 | PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; | 10818 | PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; |
8810 | 10819 | ||
@@ -8823,6 +10832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8823 | handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); | 10832 | handlerPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); |
8824 | } | 10833 | } |
8825 | break; | 10834 | break; |
10835 | |||
8826 | case PacketType.UpdateInventoryItem: | 10836 | case PacketType.UpdateInventoryItem: |
8827 | UpdateInventoryItemPacket inventoryItemUpdate = (UpdateInventoryItemPacket)Pack; | 10837 | UpdateInventoryItemPacket inventoryItemUpdate = (UpdateInventoryItemPacket)Pack; |
8828 | 10838 | ||
@@ -8867,6 +10877,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8867 | } | 10877 | } |
8868 | } | 10878 | } |
8869 | break; | 10879 | break; |
10880 | |||
8870 | case PacketType.CopyInventoryItem: | 10881 | case PacketType.CopyInventoryItem: |
8871 | CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; | 10882 | CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; |
8872 | 10883 | ||
@@ -8894,6 +10905,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8894 | } | 10905 | } |
8895 | } | 10906 | } |
8896 | break; | 10907 | break; |
10908 | |||
8897 | case PacketType.MoveInventoryItem: | 10909 | case PacketType.MoveInventoryItem: |
8898 | MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; | 10910 | MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; |
8899 | 10911 | ||
@@ -8927,6 +10939,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8927 | } | 10939 | } |
8928 | } | 10940 | } |
8929 | break; | 10941 | break; |
10942 | |||
8930 | case PacketType.RemoveInventoryItem: | 10943 | case PacketType.RemoveInventoryItem: |
8931 | RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack; | 10944 | RemoveInventoryItemPacket removeItem = (RemoveInventoryItemPacket)Pack; |
8932 | 10945 | ||
@@ -8955,6 +10968,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8955 | 10968 | ||
8956 | } | 10969 | } |
8957 | break; | 10970 | break; |
10971 | |||
8958 | case PacketType.RemoveInventoryFolder: | 10972 | case PacketType.RemoveInventoryFolder: |
8959 | RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack; | 10973 | RemoveInventoryFolderPacket removeFolder = (RemoveInventoryFolderPacket)Pack; |
8960 | 10974 | ||
@@ -8982,6 +10996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8982 | } | 10996 | } |
8983 | } | 10997 | } |
8984 | break; | 10998 | break; |
10999 | |||
8985 | case PacketType.RemoveInventoryObjects: | 11000 | case PacketType.RemoveInventoryObjects: |
8986 | RemoveInventoryObjectsPacket removeObject = (RemoveInventoryObjectsPacket)Pack; | 11001 | RemoveInventoryObjectsPacket removeObject = (RemoveInventoryObjectsPacket)Pack; |
8987 | #region Packet Session and User Check | 11002 | #region Packet Session and User Check |
@@ -9022,6 +11037,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9022 | } | 11037 | } |
9023 | } | 11038 | } |
9024 | break; | 11039 | break; |
11040 | |||
9025 | case PacketType.RequestTaskInventory: | 11041 | case PacketType.RequestTaskInventory: |
9026 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; | 11042 | RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; |
9027 | 11043 | ||
@@ -9040,6 +11056,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9040 | handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); | 11056 | handlerRequestTaskInventory(this, requesttask.InventoryData.LocalID); |
9041 | } | 11057 | } |
9042 | break; | 11058 | break; |
11059 | |||
9043 | case PacketType.UpdateTaskInventory: | 11060 | case PacketType.UpdateTaskInventory: |
9044 | UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; | 11061 | UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; |
9045 | 11062 | ||
@@ -9217,6 +11234,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9217 | handlerMapNameRequest(this, mapName); | 11234 | handlerMapNameRequest(this, mapName); |
9218 | } | 11235 | } |
9219 | break; | 11236 | break; |
11237 | |||
9220 | case PacketType.TeleportLandmarkRequest: | 11238 | case PacketType.TeleportLandmarkRequest: |
9221 | TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; | 11239 | TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; |
9222 | 11240 | ||
@@ -9287,7 +11305,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9287 | 11305 | ||
9288 | } | 11306 | } |
9289 | break; | 11307 | break; |
9290 | 11308 | ||
9291 | case PacketType.TeleportLocationRequest: | 11309 | case PacketType.TeleportLocationRequest: |
9292 | TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; | 11310 | TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; |
9293 | // m_log.Debug(tpLocReq.ToString()); | 11311 | // m_log.Debug(tpLocReq.ToString()); |
@@ -9317,7 +11335,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9317 | } | 11335 | } |
9318 | break; | 11336 | break; |
9319 | 11337 | ||
9320 | #endregion | 11338 | //#endregion |
9321 | 11339 | ||
9322 | case PacketType.UUIDNameRequest: | 11340 | case PacketType.UUIDNameRequest: |
9323 | UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; | 11341 | UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; |
@@ -9332,7 +11350,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9332 | } | 11350 | } |
9333 | break; | 11351 | break; |
9334 | 11352 | ||
9335 | #region Parcel related packets | 11353 | //#region Parcel related packets |
11354 | |||
9336 | 11355 | ||
9337 | case PacketType.RegionHandleRequest: | 11356 | case PacketType.RegionHandleRequest: |
9338 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | 11357 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; |
@@ -9415,6 +11434,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9415 | updatePacket.Data.LocalID, entries, this); | 11434 | updatePacket.Data.LocalID, entries, this); |
9416 | } | 11435 | } |
9417 | break; | 11436 | break; |
11437 | |||
9418 | case PacketType.ParcelPropertiesRequest: | 11438 | case PacketType.ParcelPropertiesRequest: |
9419 | 11439 | ||
9420 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; | 11440 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; |
@@ -9439,6 +11459,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9439 | propertiesRequest.ParcelData.SnapSelection, this); | 11459 | propertiesRequest.ParcelData.SnapSelection, this); |
9440 | } | 11460 | } |
9441 | break; | 11461 | break; |
11462 | |||
9442 | case PacketType.ParcelDivide: | 11463 | case PacketType.ParcelDivide: |
9443 | ParcelDividePacket landDivide = (ParcelDividePacket)Pack; | 11464 | ParcelDividePacket landDivide = (ParcelDividePacket)Pack; |
9444 | 11465 | ||
@@ -9460,6 +11481,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9460 | (int)Math.Round(landDivide.ParcelData.North), this); | 11481 | (int)Math.Round(landDivide.ParcelData.North), this); |
9461 | } | 11482 | } |
9462 | break; | 11483 | break; |
11484 | |||
9463 | case PacketType.ParcelJoin: | 11485 | case PacketType.ParcelJoin: |
9464 | ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack; | 11486 | ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack; |
9465 | 11487 | ||
@@ -9482,6 +11504,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9482 | (int)Math.Round(landJoin.ParcelData.North), this); | 11504 | (int)Math.Round(landJoin.ParcelData.North), this); |
9483 | } | 11505 | } |
9484 | break; | 11506 | break; |
11507 | |||
9485 | case PacketType.ParcelPropertiesUpdate: | 11508 | case PacketType.ParcelPropertiesUpdate: |
9486 | ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack; | 11509 | ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack; |
9487 | 11510 | ||
@@ -9520,6 +11543,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9520 | handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID, this); | 11543 | handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID, this); |
9521 | } | 11544 | } |
9522 | break; | 11545 | break; |
11546 | |||
9523 | case PacketType.ParcelSelectObjects: | 11547 | case PacketType.ParcelSelectObjects: |
9524 | ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; | 11548 | ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; |
9525 | 11549 | ||
@@ -9548,6 +11572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9548 | Convert.ToInt32(selectPacket.ParcelData.ReturnType), returnIDs, this); | 11572 | Convert.ToInt32(selectPacket.ParcelData.ReturnType), returnIDs, this); |
9549 | } | 11573 | } |
9550 | break; | 11574 | break; |
11575 | |||
9551 | case PacketType.ParcelObjectOwnersRequest: | 11576 | case PacketType.ParcelObjectOwnersRequest: |
9552 | //m_log.Debug(Pack.ToString()); | 11577 | //m_log.Debug(Pack.ToString()); |
9553 | ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; | 11578 | ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; |
@@ -9568,6 +11593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9568 | handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); | 11593 | handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); |
9569 | } | 11594 | } |
9570 | break; | 11595 | break; |
11596 | |||
9571 | case PacketType.ParcelGodForceOwner: | 11597 | case PacketType.ParcelGodForceOwner: |
9572 | ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack; | 11598 | ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack; |
9573 | 11599 | ||
@@ -9586,6 +11612,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9586 | handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); | 11612 | handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); |
9587 | } | 11613 | } |
9588 | break; | 11614 | break; |
11615 | |||
9589 | case PacketType.ParcelRelease: | 11616 | case PacketType.ParcelRelease: |
9590 | ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; | 11617 | ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; |
9591 | 11618 | ||
@@ -9604,6 +11631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9604 | handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); | 11631 | handlerParcelAbandonRequest(releasePacket.Data.LocalID, this); |
9605 | } | 11632 | } |
9606 | break; | 11633 | break; |
11634 | |||
9607 | case PacketType.ParcelReclaim: | 11635 | case PacketType.ParcelReclaim: |
9608 | ParcelReclaimPacket reclaimPacket = (ParcelReclaimPacket)Pack; | 11636 | ParcelReclaimPacket reclaimPacket = (ParcelReclaimPacket)Pack; |
9609 | 11637 | ||
@@ -9622,6 +11650,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9622 | handlerParcelReclaim(reclaimPacket.Data.LocalID, this); | 11650 | handlerParcelReclaim(reclaimPacket.Data.LocalID, this); |
9623 | } | 11651 | } |
9624 | break; | 11652 | break; |
11653 | |||
9625 | case PacketType.ParcelReturnObjects: | 11654 | case PacketType.ParcelReturnObjects: |
9626 | 11655 | ||
9627 | 11656 | ||
@@ -9713,9 +11742,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9713 | } | 11742 | } |
9714 | break; | 11743 | break; |
9715 | 11744 | ||
9716 | #endregion | 11745 | //#endregion |
9717 | 11746 | ||
9718 | #region Estate Packets | 11747 | //#region Estate Packets |
9719 | 11748 | ||
9720 | case PacketType.EstateOwnerMessage: | 11749 | case PacketType.EstateOwnerMessage: |
9721 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; | 11750 | EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; |
@@ -10033,6 +12062,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10033 | handlerRegionInfoRequest(this); | 12062 | handlerRegionInfoRequest(this); |
10034 | } | 12063 | } |
10035 | break; | 12064 | break; |
12065 | |||
10036 | case PacketType.EstateCovenantRequest: | 12066 | case PacketType.EstateCovenantRequest: |
10037 | 12067 | ||
10038 | //EstateCovenantRequestPacket.AgentDataBlock epack = | 12068 | //EstateCovenantRequestPacket.AgentDataBlock epack = |
@@ -10045,9 +12075,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10045 | } | 12075 | } |
10046 | break; | 12076 | break; |
10047 | 12077 | ||
10048 | #endregion | 12078 | //#endregion |
10049 | 12079 | ||
10050 | #region GodPackets | 12080 | //#region GodPackets |
10051 | 12081 | ||
10052 | case PacketType.RequestGodlikePowers: | 12082 | case PacketType.RequestGodlikePowers: |
10053 | RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; | 12083 | RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; |
@@ -10064,6 +12094,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10064 | } | 12094 | } |
10065 | 12095 | ||
10066 | break; | 12096 | break; |
12097 | |||
10067 | case PacketType.GodKickUser: | 12098 | case PacketType.GodKickUser: |
10068 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; | 12099 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; |
10069 | 12100 | ||
@@ -10093,9 +12124,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10093 | //OutPacket(kupack, ThrottleOutPacketType.Task); | 12124 | //OutPacket(kupack, ThrottleOutPacketType.Task); |
10094 | break; | 12125 | break; |
10095 | 12126 | ||
10096 | #endregion | 12127 | //#endregion |
10097 | 12128 | ||
10098 | #region Economy/Transaction Packets | 12129 | //#region Economy/Transaction Packets |
10099 | 12130 | ||
10100 | case PacketType.MoneyBalanceRequest: | 12131 | case PacketType.MoneyBalanceRequest: |
10101 | MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; | 12132 | MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; |
@@ -10117,6 +12148,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10117 | } | 12148 | } |
10118 | 12149 | ||
10119 | break; | 12150 | break; |
12151 | |||
10120 | case PacketType.EconomyDataRequest: | 12152 | case PacketType.EconomyDataRequest: |
10121 | 12153 | ||
10122 | 12154 | ||
@@ -10126,6 +12158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10126 | handlerEconomoyDataRequest(AgentId); | 12158 | handlerEconomoyDataRequest(AgentId); |
10127 | } | 12159 | } |
10128 | break; | 12160 | break; |
12161 | |||
10129 | case PacketType.RequestPayPrice: | 12162 | case PacketType.RequestPayPrice: |
10130 | RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; | 12163 | RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; |
10131 | 12164 | ||
@@ -10195,9 +12228,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10195 | } | 12228 | } |
10196 | break; | 12229 | break; |
10197 | 12230 | ||
10198 | #endregion | 12231 | //#endregion |
10199 | 12232 | ||
10200 | #region Script Packets | 12233 | //#region Script Packets |
10201 | 12234 | ||
10202 | case PacketType.GetScriptRunning: | 12235 | case PacketType.GetScriptRunning: |
10203 | GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; | 12236 | GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack; |
@@ -10247,8 +12280,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10247 | } | 12280 | } |
10248 | break; | 12281 | break; |
10249 | 12282 | ||
12283 | //#endregion | ||
12284 | */ | ||
10250 | #endregion | 12285 | #endregion |
10251 | |||
10252 | #region Gesture Managment | 12286 | #region Gesture Managment |
10253 | 12287 | ||
10254 | case PacketType.ActivateGestures: | 12288 | case PacketType.ActivateGestures: |