diff options
author | Teravus Ovares (Dan Olivares) | 2009-11-22 05:13:50 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-11-22 05:13:50 -0500 |
commit | 8db97f7dab5d73507bdbc2b9c41b0c85462478e0 (patch) | |
tree | c9bf1fd8812ab231653c789321677feac0d678ff /OpenSim/Region | |
parent | * Moved 13 more packet type handlers to PacketHandler Delegates.. and out o... (diff) | |
download | opensim-SC-8db97f7dab5d73507bdbc2b9c41b0c85462478e0.zip opensim-SC-8db97f7dab5d73507bdbc2b9c41b0c85462478e0.tar.gz opensim-SC-8db97f7dab5d73507bdbc2b9c41b0c85462478e0.tar.bz2 opensim-SC-8db97f7dab5d73507bdbc2b9c41b0c85462478e0.tar.xz |
* Switched over 15 more packet types from the 5000 line switch to the Packet handler delegate
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 299 |
1 files changed, 293 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5cf59d8..d20a84f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -4312,11 +4312,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4312 | AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); | 4312 | AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); |
4313 | AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); | 4313 | AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); |
4314 | AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing); | 4314 | AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing); |
4315 | AddLocalPacketHandler(PacketType.RezSingleAttachmentFromInv, HandlerRezSingleAttachmentFromInv); | ||
4316 | AddLocalPacketHandler(PacketType.RezMultipleAttachmentsFromInv, HandleRezMultipleAttachmentsFromInv); | ||
4317 | AddLocalPacketHandler(PacketType.DetachAttachmentIntoInv, HandleDetachAttachmentIntoInv); | ||
4318 | AddLocalPacketHandler(PacketType.ObjectAttach, HandleObjectAttach); | ||
4319 | AddLocalPacketHandler(PacketType.ObjectDetach, HandleObjectDetach); | ||
4320 | AddLocalPacketHandler(PacketType.ObjectDrop, HandleObjectDrop); | ||
4321 | AddLocalPacketHandler(PacketType.SetAlwaysRun, HandleSetAlwaysRun); | ||
4322 | AddLocalPacketHandler(PacketType.CompleteAgentMovement, HandleCompleteAgentMovement); | ||
4323 | AddLocalPacketHandler(PacketType.AgentAnimation, HandleAgentAnimation); | ||
4324 | AddLocalPacketHandler(PacketType.AgentRequestSit, HandleAgentRequestSit); | ||
4325 | AddLocalPacketHandler(PacketType.AgentSit, HandleAgentSit); | ||
4326 | AddLocalPacketHandler(PacketType.SoundTrigger, HandleSoundTrigger); | ||
4315 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4327 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4316 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4328 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4317 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4329 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4318 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4330 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
4319 | //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 4331 | |
4320 | } | 4332 | } |
4321 | 4333 | ||
4322 | #region Packet Handlers | 4334 | #region Packet Handlers |
@@ -4974,6 +4986,281 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4974 | return true; | 4986 | return true; |
4975 | } | 4987 | } |
4976 | 4988 | ||
4989 | private bool HandlerRezSingleAttachmentFromInv(IClientAPI sender, Packet Pack) | ||
4990 | { | ||
4991 | RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; | ||
4992 | if (handlerRezSingleAttachment != null) | ||
4993 | { | ||
4994 | RezSingleAttachmentFromInvPacket rez = (RezSingleAttachmentFromInvPacket)Pack; | ||
4995 | |||
4996 | #region Packet Session and User Check | ||
4997 | if (m_checkPackets) | ||
4998 | { | ||
4999 | if (rez.AgentData.SessionID != SessionId || | ||
5000 | rez.AgentData.AgentID != AgentId) | ||
5001 | return true; | ||
5002 | } | ||
5003 | #endregion | ||
5004 | |||
5005 | handlerRezSingleAttachment(this, rez.ObjectData.ItemID, | ||
5006 | rez.ObjectData.AttachmentPt); | ||
5007 | } | ||
5008 | |||
5009 | return true; | ||
5010 | } | ||
5011 | |||
5012 | private bool HandleRezMultipleAttachmentsFromInv(IClientAPI sender, Packet Pack) | ||
5013 | { | ||
5014 | RezMultipleAttachmentsFromInv handlerRezMultipleAttachments = OnRezMultipleAttachmentsFromInv; | ||
5015 | if (handlerRezMultipleAttachments != null) | ||
5016 | { | ||
5017 | RezMultipleAttachmentsFromInvPacket rez = (RezMultipleAttachmentsFromInvPacket)Pack; | ||
5018 | handlerRezMultipleAttachments(this, rez.HeaderData, | ||
5019 | rez.ObjectData); | ||
5020 | } | ||
5021 | |||
5022 | return true; | ||
5023 | } | ||
5024 | |||
5025 | private bool HandleDetachAttachmentIntoInv(IClientAPI sender, Packet Pack) | ||
5026 | { | ||
5027 | UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; | ||
5028 | if (handlerDetachAttachmentIntoInv != null) | ||
5029 | { | ||
5030 | DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; | ||
5031 | |||
5032 | #region Packet Session and User Check | ||
5033 | // UNSUPPORTED ON THIS PACKET | ||
5034 | #endregion | ||
5035 | |||
5036 | UUID itemID = detachtoInv.ObjectData.ItemID; | ||
5037 | // UUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; | ||
5038 | |||
5039 | handlerDetachAttachmentIntoInv(itemID, this); | ||
5040 | } | ||
5041 | return true; | ||
5042 | } | ||
5043 | |||
5044 | private bool HandleObjectAttach(IClientAPI sender, Packet Pack) | ||
5045 | { | ||
5046 | if (OnObjectAttach != null) | ||
5047 | { | ||
5048 | ObjectAttachPacket att = (ObjectAttachPacket)Pack; | ||
5049 | |||
5050 | #region Packet Session and User Check | ||
5051 | if (m_checkPackets) | ||
5052 | { | ||
5053 | if (att.AgentData.SessionID != SessionId || | ||
5054 | att.AgentData.AgentID != AgentId) | ||
5055 | return true; | ||
5056 | } | ||
5057 | #endregion | ||
5058 | |||
5059 | ObjectAttach handlerObjectAttach = OnObjectAttach; | ||
5060 | |||
5061 | if (handlerObjectAttach != null) | ||
5062 | { | ||
5063 | if (att.ObjectData.Length > 0) | ||
5064 | { | ||
5065 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false); | ||
5066 | } | ||
5067 | } | ||
5068 | } | ||
5069 | return true; | ||
5070 | } | ||
5071 | |||
5072 | private bool HandleObjectDetach(IClientAPI sender, Packet Pack) | ||
5073 | { | ||
5074 | ObjectDetachPacket dett = (ObjectDetachPacket)Pack; | ||
5075 | |||
5076 | #region Packet Session and User Check | ||
5077 | if (m_checkPackets) | ||
5078 | { | ||
5079 | if (dett.AgentData.SessionID != SessionId || | ||
5080 | dett.AgentData.AgentID != AgentId) | ||
5081 | return true; | ||
5082 | } | ||
5083 | #endregion | ||
5084 | |||
5085 | for (int j = 0; j < dett.ObjectData.Length; j++) | ||
5086 | { | ||
5087 | uint obj = dett.ObjectData[j].ObjectLocalID; | ||
5088 | ObjectDeselect handlerObjectDetach = OnObjectDetach; | ||
5089 | if (handlerObjectDetach != null) | ||
5090 | { | ||
5091 | handlerObjectDetach(obj, this); | ||
5092 | } | ||
5093 | |||
5094 | } | ||
5095 | return true; | ||
5096 | } | ||
5097 | |||
5098 | private bool HandleObjectDrop(IClientAPI sender, Packet Pack) | ||
5099 | { | ||
5100 | ObjectDropPacket dropp = (ObjectDropPacket)Pack; | ||
5101 | |||
5102 | #region Packet Session and User Check | ||
5103 | if (m_checkPackets) | ||
5104 | { | ||
5105 | if (dropp.AgentData.SessionID != SessionId || | ||
5106 | dropp.AgentData.AgentID != AgentId) | ||
5107 | return true; | ||
5108 | } | ||
5109 | #endregion | ||
5110 | |||
5111 | for (int j = 0; j < dropp.ObjectData.Length; j++) | ||
5112 | { | ||
5113 | uint obj = dropp.ObjectData[j].ObjectLocalID; | ||
5114 | ObjectDrop handlerObjectDrop = OnObjectDrop; | ||
5115 | if (handlerObjectDrop != null) | ||
5116 | { | ||
5117 | handlerObjectDrop(obj, this); | ||
5118 | } | ||
5119 | } | ||
5120 | return true; | ||
5121 | } | ||
5122 | |||
5123 | private bool HandleSetAlwaysRun(IClientAPI sender, Packet Pack) | ||
5124 | { | ||
5125 | SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; | ||
5126 | |||
5127 | #region Packet Session and User Check | ||
5128 | if (m_checkPackets) | ||
5129 | { | ||
5130 | if (run.AgentData.SessionID != SessionId || | ||
5131 | run.AgentData.AgentID != AgentId) | ||
5132 | return true; | ||
5133 | } | ||
5134 | #endregion | ||
5135 | |||
5136 | SetAlwaysRun handlerSetAlwaysRun = OnSetAlwaysRun; | ||
5137 | if (handlerSetAlwaysRun != null) | ||
5138 | handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); | ||
5139 | |||
5140 | return true; | ||
5141 | } | ||
5142 | |||
5143 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) | ||
5144 | { | ||
5145 | GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | ||
5146 | if (handlerCompleteMovementToRegion != null) | ||
5147 | { | ||
5148 | handlerCompleteMovementToRegion(); | ||
5149 | } | ||
5150 | handlerCompleteMovementToRegion = null; | ||
5151 | |||
5152 | return true; | ||
5153 | } | ||
5154 | |||
5155 | private bool HandleAgentAnimation(IClientAPI sender, Packet Pack) | ||
5156 | { | ||
5157 | AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; | ||
5158 | |||
5159 | #region Packet Session and User Check | ||
5160 | if (m_checkPackets) | ||
5161 | { | ||
5162 | if (AgentAni.AgentData.SessionID != SessionId || | ||
5163 | AgentAni.AgentData.AgentID != AgentId) | ||
5164 | return true; | ||
5165 | } | ||
5166 | #endregion | ||
5167 | |||
5168 | StartAnim handlerStartAnim = null; | ||
5169 | StopAnim handlerStopAnim = null; | ||
5170 | |||
5171 | for (int i = 0; i < AgentAni.AnimationList.Length; i++) | ||
5172 | { | ||
5173 | if (AgentAni.AnimationList[i].StartAnim) | ||
5174 | { | ||
5175 | handlerStartAnim = OnStartAnim; | ||
5176 | if (handlerStartAnim != null) | ||
5177 | { | ||
5178 | handlerStartAnim(this, AgentAni.AnimationList[i].AnimID); | ||
5179 | } | ||
5180 | } | ||
5181 | else | ||
5182 | { | ||
5183 | handlerStopAnim = OnStopAnim; | ||
5184 | if (handlerStopAnim != null) | ||
5185 | { | ||
5186 | handlerStopAnim(this, AgentAni.AnimationList[i].AnimID); | ||
5187 | } | ||
5188 | } | ||
5189 | } | ||
5190 | return true; | ||
5191 | } | ||
5192 | |||
5193 | private bool HandleAgentRequestSit(IClientAPI sender, Packet Pack) | ||
5194 | { | ||
5195 | if (OnAgentRequestSit != null) | ||
5196 | { | ||
5197 | AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack; | ||
5198 | |||
5199 | #region Packet Session and User Check | ||
5200 | if (m_checkPackets) | ||
5201 | { | ||
5202 | if (agentRequestSit.AgentData.SessionID != SessionId || | ||
5203 | agentRequestSit.AgentData.AgentID != AgentId) | ||
5204 | return true; | ||
5205 | } | ||
5206 | #endregion | ||
5207 | |||
5208 | AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; | ||
5209 | if (handlerAgentRequestSit != null) | ||
5210 | handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, | ||
5211 | agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); | ||
5212 | } | ||
5213 | return true; | ||
5214 | } | ||
5215 | |||
5216 | private bool HandleAgentSit(IClientAPI sender, Packet Pack) | ||
5217 | { | ||
5218 | if (OnAgentSit != null) | ||
5219 | { | ||
5220 | AgentSitPacket agentSit = (AgentSitPacket)Pack; | ||
5221 | |||
5222 | #region Packet Session and User Check | ||
5223 | if (m_checkPackets) | ||
5224 | { | ||
5225 | if (agentSit.AgentData.SessionID != SessionId || | ||
5226 | agentSit.AgentData.AgentID != AgentId) | ||
5227 | return true; | ||
5228 | } | ||
5229 | #endregion | ||
5230 | |||
5231 | AgentSit handlerAgentSit = OnAgentSit; | ||
5232 | if (handlerAgentSit != null) | ||
5233 | { | ||
5234 | OnAgentSit(this, agentSit.AgentData.AgentID); | ||
5235 | } | ||
5236 | } | ||
5237 | return true; | ||
5238 | } | ||
5239 | |||
5240 | private bool HandleSoundTrigger(IClientAPI sender, Packet Pack) | ||
5241 | { | ||
5242 | SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; | ||
5243 | |||
5244 | #region Packet Session and User Check | ||
5245 | if (m_checkPackets) | ||
5246 | { | ||
5247 | // UNSUPPORTED ON THIS PACKET | ||
5248 | } | ||
5249 | #endregion | ||
5250 | |||
5251 | SoundTrigger handlerSoundTrigger = OnSoundTrigger; | ||
5252 | if (handlerSoundTrigger != null) | ||
5253 | { | ||
5254 | handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, | ||
5255 | soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID, | ||
5256 | soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position, | ||
5257 | soundTriggerPacket.SoundData.Handle); | ||
5258 | |||
5259 | } | ||
5260 | return true; | ||
5261 | } | ||
5262 | |||
5263 | |||
4977 | #endregion Packet Handlers | 5264 | #endregion Packet Handlers |
4978 | 5265 | ||
4979 | public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) | 5266 | public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) |
@@ -5884,8 +6171,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5884 | } | 6171 | } |
5885 | } | 6172 | } |
5886 | break; | 6173 | break; |
5887 | */ | 6174 | |
5888 | #endregion | ||
5889 | case PacketType.RezSingleAttachmentFromInv: | 6175 | case PacketType.RezSingleAttachmentFromInv: |
5890 | RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; | 6176 | RezSingleAttachmentFromInv handlerRezSingleAttachment = OnRezSingleAttachmentFromInv; |
5891 | if (handlerRezSingleAttachment != null) | 6177 | if (handlerRezSingleAttachment != null) |
@@ -5917,7 +6203,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5917 | } | 6203 | } |
5918 | 6204 | ||
5919 | break; | 6205 | break; |
5920 | 6206 | ||
5921 | case PacketType.DetachAttachmentIntoInv: | 6207 | case PacketType.DetachAttachmentIntoInv: |
5922 | UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; | 6208 | UUIDNameRequest handlerDetachAttachmentIntoInv = OnDetachAttachmentIntoInv; |
5923 | if (handlerDetachAttachmentIntoInv != null) | 6209 | if (handlerDetachAttachmentIntoInv != null) |
@@ -6025,7 +6311,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6025 | handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); | 6311 | handlerSetAlwaysRun(this, run.AgentData.AlwaysRun); |
6026 | 6312 | ||
6027 | break; | 6313 | break; |
6028 | 6314 | ||
6029 | case PacketType.CompleteAgentMovement: | 6315 | case PacketType.CompleteAgentMovement: |
6030 | GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | 6316 | GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; |
6031 | if (handlerCompleteMovementToRegion != null) | 6317 | if (handlerCompleteMovementToRegion != null) |
@@ -6135,7 +6421,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6135 | 6421 | ||
6136 | } | 6422 | } |
6137 | break; | 6423 | break; |
6138 | 6424 | */ | |
6425 | #endregion | ||
6139 | case PacketType.AvatarPickerRequest: | 6426 | case PacketType.AvatarPickerRequest: |
6140 | AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; | 6427 | AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; |
6141 | 6428 | ||