aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs325
1 files changed, 305 insertions, 20 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index c914d81..47251b7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1266,10 +1266,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1266 // 1266 //
1267 if (totalItems == 0 && totalFolders == 0) 1267 if (totalItems == 0 && totalFolders == 0)
1268 currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, 0, 0); 1268 currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, 0, 0);
1269 1269
1270 // To preserve SL compatibility, we will NOT combine folders and items in one packet 1270 // To preserve SL compatibility, we will NOT combine folders and items in one packet
1271 // 1271 //
1272 while(itemsSent < totalItems || foldersSent < totalFolders) 1272 while (itemsSent < totalItems || foldersSent < totalFolders)
1273 { 1273 {
1274 if (currentPacket == null) // Start a new packet 1274 if (currentPacket == null) // Start a new packet
1275 { 1275 {
@@ -1289,7 +1289,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1289 1289
1290 if (foldersToSend-- > 0) 1290 if (foldersToSend-- > 0)
1291 currentPacket.FolderData[foldersSent % MAX_FOLDERS_PER_PACKET] = CreateFolderDataBlock(folders[foldersSent++]); 1291 currentPacket.FolderData[foldersSent % MAX_FOLDERS_PER_PACKET] = CreateFolderDataBlock(folders[foldersSent++]);
1292 else if(itemsToSend-- > 0) 1292 else if (itemsToSend-- > 0)
1293 currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]); 1293 currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
1294 else 1294 else
1295 { 1295 {
@@ -2043,7 +2043,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2043 packet.AgentData.SessionID = SessionId; 2043 packet.AgentData.SessionID = SessionId;
2044 2044
2045 packet.Effect = effectBlocks; 2045 packet.Effect = effectBlocks;
2046 2046
2047 OutPacket(packet, ThrottleOutPacketType.State); 2047 OutPacket(packet, ThrottleOutPacketType.State);
2048 } 2048 }
2049 2049
@@ -2742,7 +2742,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2742 } 2742 }
2743 llsd.Add("GroupData", GroupData); 2743 llsd.Add("GroupData", GroupData);
2744 llsd.Add("NewGroupData", NewGroupData); 2744 llsd.Add("NewGroupData", NewGroupData);
2745 2745
2746 IEventQueue eq = this.Scene.RequestModuleInterface<IEventQueue>(); 2746 IEventQueue eq = this.Scene.RequestModuleInterface<IEventQueue>();
2747 if (eq != null) 2747 if (eq != null)
2748 { 2748 {
@@ -4295,11 +4295,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4295 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); 4295 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
4296 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); 4296 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
4297 AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing); 4297 AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing);
4298 AddLocalPacketHandler(PacketType.RezSingleAttachmentFromInv, HandlerRezSingleAttachmentFromInv);
4299 AddLocalPacketHandler(PacketType.RezMultipleAttachmentsFromInv, HandleRezMultipleAttachmentsFromInv);
4300 AddLocalPacketHandler(PacketType.DetachAttachmentIntoInv, HandleDetachAttachmentIntoInv);
4301 AddLocalPacketHandler(PacketType.ObjectAttach, HandleObjectAttach);
4302 AddLocalPacketHandler(PacketType.ObjectDetach, HandleObjectDetach);
4303 AddLocalPacketHandler(PacketType.ObjectDrop, HandleObjectDrop);
4304 AddLocalPacketHandler(PacketType.SetAlwaysRun, HandleSetAlwaysRun);
4305 AddLocalPacketHandler(PacketType.CompleteAgentMovement, HandleCompleteAgentMovement);
4306 AddLocalPacketHandler(PacketType.AgentAnimation, HandleAgentAnimation);
4307 AddLocalPacketHandler(PacketType.AgentRequestSit, HandleAgentRequestSit);
4308 AddLocalPacketHandler(PacketType.AgentSit, HandleAgentSit);
4309 AddLocalPacketHandler(PacketType.SoundTrigger, HandleSoundTrigger);
4298 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 4310 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4299 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 4311 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4300 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 4312 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4301 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 4313 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4302 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 4314
4303 } 4315 }
4304 4316
4305 #region Packet Handlers 4317 #region Packet Handlers
@@ -4957,6 +4969,281 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4957 return true; 4969 return true;
4958 } 4970 }
4959 4971
4972 private bool HandlerRezSingleAttachmentFromInv(IClientAPI sender, Packet Pack)
4973 {
4974 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
4975 if (handlerRezSingleAttachment != null)
4976 {
4977 RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack;
4978
4979 #region Packet Session and User Check
4980 if (m_checkPackets)
4981 {
4982 if (rez.AgentData.SessionID != SessionId ||
4983 rez.AgentData.AgentID != AgentId)
4984 return true;
4985 }
4986 #endregion
4987
4988 handlerRezSingleAttachment(this, rez.ObjectData.ItemID,
4989 rez.ObjectData.AttachmentPt);
4990 }
4991
4992 return true;
4993 }
4994
4995 private bool HandleRezMultipleAttachmentsFromInv(IClientAPI sender, Packet Pack)
4996 {
4997 RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv;
4998 if (handlerRezMultipleAttachments != null)
4999 {
5000 RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack;
5001 handlerRezMultipleAttachments(this, rez.HeaderData,
5002 rez.ObjectData);
5003 }
5004
5005 return true;
5006 }
5007
5008 private bool HandleDetachAttachmentIntoInv(IClientAPI sender, Packet Pack)
5009 {
5010 UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv;
5011 if (handlerDetachAttachmentIntoInv != null)
5012 {
5013 DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
5014
5015 #region Packet Session and User Check
5016 // UNSUPPORTED ON THIS PACKET
5017 #endregion
5018
5019 UUID itemID = detachtoInv.ObjectData.ItemID;
5020 // UUID ATTACH_agentID = detachtoInv.ObjectData.AgentID;
5021
5022 handlerDetachAttachmentIntoInv(itemID, this);
5023 }
5024 return true;
5025 }
5026
5027 private bool HandleObjectAttach(IClientAPI sender, Packet Pack)
5028 {
5029 if (OnObjectAttach != null)
5030 {
5031 ObjectAttachPacket att = (ObjectAttachPacket)Pack;
5032
5033 #region Packet Session and User Check
5034 if (m_checkPackets)
5035 {
5036 if (att.AgentData.SessionID != SessionId ||
5037 att.AgentData.AgentID != AgentId)
5038 return true;
5039 }
5040 #endregion
5041
5042 ObjectAttach handlerObjectAttach = OnObjectAttach;
5043
5044 if (handlerObjectAttach != null)
5045 {
5046 if (att.ObjectData.Length > 0)
5047 {
5048 handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false);
5049 }
5050 }
5051 }
5052 return true;
5053 }
5054
5055 private bool HandleObjectDetach(IClientAPI sender, Packet Pack)
5056 {
5057 ObjectDetachPacket dett = (ObjectDetachPacket)Pack;
5058
5059 #region Packet Session and User Check
5060 if (m_checkPackets)
5061 {
5062 if (dett.AgentData.SessionID != SessionId ||
5063 dett.AgentData.AgentID != AgentId)
5064 return true;
5065 }
5066 #endregion
5067
5068 for (int j = 0; j < dett.ObjectData.Length; j++)
5069 {
5070 uint obj = dett.ObjectData[j].ObjectLocalID;
5071 ObjectDeselect handlerObjectDetach = OnObjectDetach;
5072 if (handlerObjectDetach != null)
5073 {
5074 handlerObjectDetach(obj, this);
5075 }
5076
5077 }
5078 return true;
5079 }
5080
5081 private bool HandleObjectDrop(IClientAPI sender, Packet Pack)
5082 {
5083 ObjectDropPacket dropp = (ObjectDropPacket)Pack;
5084
5085 #region Packet Session and User Check
5086 if (m_checkPackets)
5087 {
5088 if (dropp.AgentData.SessionID != SessionId ||
5089 dropp.AgentData.AgentID != AgentId)
5090 return true;
5091 }
5092 #endregion
5093
5094 for (int j = 0; j < dropp.ObjectData.Length; j++)
5095 {
5096 uint obj = dropp.ObjectData[j].ObjectLocalID;
5097 ObjectDrop handlerObjectDrop = OnObjectDrop;
5098 if (handlerObjectDrop != null)
5099 {
5100 handlerObjectDrop(obj, this);
5101 }
5102 }
5103 return true;
5104 }
5105
5106 private bool HandleSetAlwaysRun(IClientAPI sender, Packet Pack)
5107 {
5108 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
5109
5110 #region Packet Session and User Check
5111 if (m_checkPackets)
5112 {
5113 if (run.AgentData.SessionID != SessionId ||
5114 run.AgentData.AgentID != AgentId)
5115 return true;
5116 }
5117 #endregion
5118
5119 SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun;
5120 if (handlerSetAlwaysRun != null)
5121 handlerSetAlwaysRun(this, run.AgentData.AlwaysRun);
5122
5123 return true;
5124 }
5125
5126 private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack)
5127 {
5128 GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
5129 if (handlerCompleteMovementToRegion != null)
5130 {
5131 handlerCompleteMovementToRegion();
5132 }
5133 handlerCompleteMovementToRegion = null;
5134
5135 return true;
5136 }
5137
5138 private bool HandleAgentAnimation(IClientAPI sender, Packet Pack)
5139 {
5140 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
5141
5142 #region Packet Session and User Check
5143 if (m_checkPackets)
5144 {
5145 if (AgentAni.AgentData.SessionID != SessionId ||
5146 AgentAni.AgentData.AgentID != AgentId)
5147 return true;
5148 }
5149 #endregion
5150
5151 StartAnim handlerStartAnim = null;
5152 StopAnim handlerStopAnim = null;
5153
5154 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
5155 {
5156 if (AgentAni.AnimationList[i].StartAnim)
5157 {
5158 handlerStartAnim = OnStartAnim;
5159 if (handlerStartAnim != null)
5160 {
5161 handlerStartAnim(this, AgentAni.AnimationList[i].AnimID);
5162 }
5163 }
5164 else
5165 {
5166 handlerStopAnim = OnStopAnim;
5167 if (handlerStopAnim != null)
5168 {
5169 handlerStopAnim(this, AgentAni.AnimationList[i].AnimID);
5170 }
5171 }
5172 }
5173 return true;
5174 }
5175
5176 private bool HandleAgentRequestSit(IClientAPI sender, Packet Pack)
5177 {
5178 if (OnAgentRequestSit != null)
5179 {
5180 AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack;
5181
5182 #region Packet Session and User Check
5183 if (m_checkPackets)
5184 {
5185 if (agentRequestSit.AgentData.SessionID != SessionId ||
5186 agentRequestSit.AgentData.AgentID != AgentId)
5187 return true;
5188 }
5189 #endregion
5190
5191 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
5192 if (handlerAgentRequestSit != null)
5193 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
5194 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
5195 }
5196 return true;
5197 }
5198
5199 private bool HandleAgentSit(IClientAPI sender, Packet Pack)
5200 {
5201 if (OnAgentSit != null)
5202 {
5203 AgentSitPacket agentSit = (AgentSitPacket)Pack;
5204
5205 #region Packet Session and User Check
5206 if (m_checkPackets)
5207 {
5208 if (agentSit.AgentData.SessionID != SessionId ||
5209 agentSit.AgentData.AgentID != AgentId)
5210 return true;
5211 }
5212 #endregion
5213
5214 AgentSit handlerAgentSit = OnAgentSit;
5215 if (handlerAgentSit != null)
5216 {
5217 OnAgentSit(this, agentSit.AgentData.AgentID);
5218 }
5219 }
5220 return true;
5221 }
5222
5223 private bool HandleSoundTrigger(IClientAPI sender, Packet Pack)
5224 {
5225 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack;
5226
5227 #region Packet Session and User Check
5228 if (m_checkPackets)
5229 {
5230 // UNSUPPORTED ON THIS PACKET
5231 }
5232 #endregion
5233
5234 SoundTrigger handlerSoundTrigger = OnSoundTrigger;
5235 if (handlerSoundTrigger != null)
5236 {
5237 handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID,
5238 soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID,
5239 soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position,
5240 soundTriggerPacket.SoundData.Handle);
5241
5242 }
5243 return true;
5244 }
5245
5246
4960 #endregion Packet Handlers 5247 #endregion Packet Handlers
4961 5248
4962 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) 5249 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
@@ -5448,8 +5735,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5448 return; 5735 return;
5449 } 5736 }
5450 5737
5451
5452
5453 // Main packet processing conditional 5738 // Main packet processing conditional
5454 switch (Pack.Type) 5739 switch (Pack.Type)
5455 { 5740 {
@@ -5475,7 +5760,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5475 } 5760 }
5476 5761
5477 break; 5762 break;
5478 5763
5479 case PacketType.ChatFromViewer: 5764 case PacketType.ChatFromViewer:
5480 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; 5765 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
5481 5766
@@ -5514,7 +5799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5514 handlerChatFromClient(this, args); 5799 handlerChatFromClient(this, args);
5515 } 5800 }
5516 break; 5801 break;
5517 5802
5518 case PacketType.AvatarPropertiesUpdate: 5803 case PacketType.AvatarPropertiesUpdate:
5519 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack; 5804 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
5520 5805
@@ -5542,7 +5827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5542 handlerUpdateAvatarProperties(this, UserProfile); 5827 handlerUpdateAvatarProperties(this, UserProfile);
5543 } 5828 }
5544 break; 5829 break;
5545 5830
5546 case PacketType.ScriptDialogReply: 5831 case PacketType.ScriptDialogReply:
5547 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; 5832 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
5548 5833
@@ -5573,7 +5858,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5573 } 5858 }
5574 5859
5575 break; 5860 break;
5576 5861
5577 case PacketType.ImprovedInstantMessage: 5862 case PacketType.ImprovedInstantMessage:
5578 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; 5863 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
5579 5864
@@ -5607,7 +5892,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5607 handlerInstantMessage(this, im); 5892 handlerInstantMessage(this, im);
5608 } 5893 }
5609 break; 5894 break;
5610 5895
5611 case PacketType.AcceptFriendship: 5896 case PacketType.AcceptFriendship:
5612 AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack; 5897 AcceptFriendshipPacket afriendpack = (AcceptFriendshipPacket)Pack;
5613 5898
@@ -5680,7 +5965,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5680 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 5965 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
5681 } 5966 }
5682 break; 5967 break;
5683 5968
5684 case PacketType.RezObject: 5969 case PacketType.RezObject:
5685 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 5970 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
5686 5971
@@ -5735,7 +6020,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5735 6020
5736 } 6021 }
5737 break; 6022 break;
5738 6023
5739 case PacketType.ModifyLand: 6024 case PacketType.ModifyLand:
5740 ModifyLandPacket modify = (ModifyLandPacket)Pack; 6025 ModifyLandPacket modify = (ModifyLandPacket)Pack;
5741 6026
@@ -5867,8 +6152,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5867 } 6152 }
5868 } 6153 }
5869 break; 6154 break;
5870*/ 6155
5871 #endregion
5872 case PacketType.RezSingleAttachmentFromInv: 6156 case PacketType.RezSingleAttachmentFromInv:
5873 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; 6157 RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv;
5874 if (handlerRezSingleAttachment != null) 6158 if (handlerRezSingleAttachment != null)
@@ -6118,7 +6402,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6118 6402
6119 } 6403 }
6120 break; 6404 break;
6121 6405 */
6406 #endregion
6122 case PacketType.AvatarPickerRequest: 6407 case PacketType.AvatarPickerRequest:
6123 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; 6408 AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack;
6124 6409
@@ -10175,7 +10460,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10175 Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText), 10460 Utils.BytesToString(avatarInterestUpdate.PropertiesData.SkillsText),
10176 Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText)); 10461 Utils.BytesToString(avatarInterestUpdate.PropertiesData.LanguagesText));
10177 break; 10462 break;
10178 10463
10179 case PacketType.GrantUserRights: 10464 case PacketType.GrantUserRights:
10180 GrantUserRightsPacket GrantUserRights = 10465 GrantUserRightsPacket GrantUserRights =
10181 (GrantUserRightsPacket)Pack; 10466 (GrantUserRightsPacket)Pack;
@@ -10194,7 +10479,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10194 GrantUserRights.Rights[0].AgentRelated, 10479 GrantUserRights.Rights[0].AgentRelated,
10195 GrantUserRights.Rights[0].RelatedRights); 10480 GrantUserRights.Rights[0].RelatedRights);
10196 break; 10481 break;
10197 10482
10198 case PacketType.PlacesQuery: 10483 case PacketType.PlacesQuery:
10199 PlacesQueryPacket placesQueryPacket = 10484 PlacesQueryPacket placesQueryPacket =
10200 (PlacesQueryPacket)Pack; 10485 (PlacesQueryPacket)Pack;