aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs93
1 files changed, 73 insertions, 20 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index 54cb662..0964fc4 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -38,7 +38,10 @@ namespace OpenSim
38 else 38 else
39 { 39 {
40 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 40 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
41 41 if (Pack.Type != PacketType.PacketAck)
42 {
43 Console.WriteLine(Pack.Type.ToString());
44 }
42 switch (Pack.Type) 45 switch (Pack.Type)
43 { 46 {
44 case PacketType.ViewerEffect: 47 case PacketType.ViewerEffect:
@@ -67,7 +70,10 @@ namespace OpenSim
67 byte type = inchatpack.ChatData.Type; 70 byte type = inchatpack.ChatData.Type;
68 LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos; 71 LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos;
69 LLUUID fromAgentID = AgentID; 72 LLUUID fromAgentID = AgentID;
70 this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID); 73 if (OnChatFromViewer != null)
74 {
75 this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
76 }
71 break; 77 break;
72 case PacketType.RezObject: 78 case PacketType.RezObject:
73 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 79 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
@@ -79,40 +85,67 @@ namespace OpenSim
79 AssetBase asset = this.m_assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID); 85 AssetBase asset = this.m_assetCache.GetAsset(inven.InventoryItems[rezPacket.InventoryData.ItemID].AssetID);
80 if (asset != null) 86 if (asset != null)
81 { 87 {
82 this.OnRezObject(asset, rezPacket.RezData.RayEnd); 88 if (OnRezObject != null)
83 this.m_inventoryCache.DeleteInventoryItem(this, rezPacket.InventoryData.ItemID); 89 {
90 this.OnRezObject(asset, rezPacket.RezData.RayEnd);
91 this.m_inventoryCache.DeleteInventoryItem(this, rezPacket.InventoryData.ItemID);
92 }
84 } 93 }
85 } 94 }
86 } 95 }
87 break; 96 break;
88 case PacketType.DeRezObject: 97 case PacketType.DeRezObject:
89 OnDeRezObject(Pack, this); 98 if (OnDeRezObject != null)
99 {
100 OnDeRezObject(Pack, this);
101 }
90 break; 102 break;
91 case PacketType.ModifyLand: 103 case PacketType.ModifyLand:
92 ModifyLandPacket modify = (ModifyLandPacket)Pack; 104 ModifyLandPacket modify = (ModifyLandPacket)Pack;
93 if (modify.ParcelData.Length > 0) 105 if (modify.ParcelData.Length > 0)
94 { 106 {
95 OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); 107 if (OnModifyTerrain != null)
108 {
109 OnModifyTerrain(modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West);
110 }
96 } 111 }
97 break; 112 break;
98 case PacketType.RegionHandshakeReply: 113 case PacketType.RegionHandshakeReply:
99 OnRegionHandShakeReply(this); 114 if (OnRegionHandShakeReply != null)
115 {
116 OnRegionHandShakeReply(this);
117 }
100 break; 118 break;
101 case PacketType.AgentWearablesRequest: 119 case PacketType.AgentWearablesRequest:
102 OnRequestWearables(this); 120 if (OnRequestWearables != null)
103 OnRequestAvatarsData(this); 121 {
122 OnRequestWearables(this);
123 }
124 if (OnRequestAvatarsData != null)
125 {
126 OnRequestAvatarsData(this);
127 }
104 break; 128 break;
105 case PacketType.AgentSetAppearance: 129 case PacketType.AgentSetAppearance:
106 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; 130 AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
107 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam); 131 if (OnSetAppearance != null)
132 {
133 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
134 }
108 break; 135 break;
109 case PacketType.CompleteAgentMovement: 136 case PacketType.CompleteAgentMovement:
110 if (this.m_child) this.UpgradeClient(); 137 if (this.m_child) this.UpgradeClient();
111 OnCompleteMovementToRegion(); 138 if (OnCompleteMovementToRegion != null)
139 {
140 OnCompleteMovementToRegion();
141 }
112 this.EnableNeighbours(); 142 this.EnableNeighbours();
113 break; 143 break;
114 case PacketType.AgentUpdate: 144 case PacketType.AgentUpdate:
115 OnAgentUpdate(Pack); 145 if (OnAgentUpdate != null)
146 {
147 OnAgentUpdate(Pack);
148 }
116 break; 149 break;
117 case PacketType.AgentAnimation: 150 case PacketType.AgentAnimation:
118 if (!m_child) 151 if (!m_child)
@@ -122,7 +155,10 @@ namespace OpenSim
122 { 155 {
123 if (AgentAni.AnimationList[i].StartAnim) 156 if (AgentAni.AnimationList[i].StartAnim)
124 { 157 {
125 OnStartAnim(AgentAni.AnimationList[i].AnimID, 1); 158 if (OnStartAnim != null)
159 {
160 OnStartAnim(AgentAni.AnimationList[i].AnimID, 1);
161 }
126 } 162 }
127 } 163 }
128 } 164 }
@@ -145,36 +181,53 @@ namespace OpenSim
145 childrenprims.Add(link.ObjectData[i].ObjectLocalID); 181 childrenprims.Add(link.ObjectData[i].ObjectLocalID);
146 } 182 }
147 } 183 }
148 OnLinkObjects(parentprimid, childrenprims); 184 if (OnLinkObjects != null)
185 {
186 OnLinkObjects(parentprimid, childrenprims);
187 }
149 break; 188 break;
150 case PacketType.ObjectAdd: 189 case PacketType.ObjectAdd:
151 // m_world.AddNewPrim((ObjectAddPacket)Pack, this); 190 // m_world.AddNewPrim((ObjectAddPacket)Pack, this);
152 OnAddPrim(Pack, this); 191 if (OnAddPrim != null)
192 {
193 OnAddPrim(Pack, this);
194 }
153 break; 195 break;
154 case PacketType.ObjectShape: 196 case PacketType.ObjectShape:
155 ObjectShapePacket shape = (ObjectShapePacket)Pack; 197 ObjectShapePacket shape = (ObjectShapePacket)Pack;
156 for (int i = 0; i < shape.ObjectData.Length; i++) 198 for (int i = 0; i < shape.ObjectData.Length; i++)
157 { 199 {
158 OnUpdatePrimShape(shape.ObjectData[i].ObjectLocalID, shape.ObjectData[i]); 200 if (OnUpdatePrimShape != null)
201 {
202 OnUpdatePrimShape(shape.ObjectData[i].ObjectLocalID, shape.ObjectData[i]);
203 }
159 } 204 }
160 break; 205 break;
161 case PacketType.ObjectSelect: 206 case PacketType.ObjectSelect:
162 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; 207 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
163 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 208 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
164 { 209 {
165 OnObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this); 210 if (OnObjectSelect != null)
211 {
212 OnObjectSelect(incomingselect.ObjectData[i].ObjectLocalID, this);
213 }
166 } 214 }
167 break; 215 break;
168 case PacketType.ObjectFlagUpdate: 216 case PacketType.ObjectFlagUpdate:
169 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; 217 ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack;
170 OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this); 218 if (OnUpdatePrimFlags != null)
219 {
220 OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this);
221 }
171 break; 222 break;
172 case PacketType.ObjectImage: 223 case PacketType.ObjectImage:
173 ObjectImagePacket imagePack = (ObjectImagePacket)Pack; 224 ObjectImagePacket imagePack = (ObjectImagePacket)Pack;
174 for (int i = 0; i < imagePack.ObjectData.Length; i++) 225 for (int i = 0; i < imagePack.ObjectData.Length; i++)
175 { 226 {
176 OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this); 227 if (OnUpdatePrimTexture != null)
177 228 {
229 OnUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, imagePack.ObjectData[i].TextureEntry, this);
230 }
178 } 231 }
179 break; 232 break;
180 #endregion 233 #endregion