diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs index adb49bd..a33607f 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs | |||
@@ -161,34 +161,34 @@ namespace OpenSim.Region.ClientStack.Linden | |||
161 | int lastattach = 0; | 161 | int lastattach = 0; |
162 | 162 | ||
163 | OSDMap rm = (OSDMap)r; | 163 | OSDMap rm = (OSDMap)r; |
164 | 164 | OSD tmpOSD; | |
165 | if (rm.ContainsKey("ObjectData")) //v2 | 165 | if (rm.TryGetValue("ObjectData", out tmpOSD)) //v2 |
166 | { | 166 | { |
167 | if (rm["ObjectData"].Type != OSDType.Map) | 167 | if (tmpOSD.Type != OSDType.Map) |
168 | { | 168 | { |
169 | responsedata["str_response_string"] = "Has ObjectData key, but data not in expected format"; | 169 | responsedata["str_response_string"] = "Has ObjectData key, but data not in expected format"; |
170 | return responsedata; | 170 | return responsedata; |
171 | } | 171 | } |
172 | 172 | ||
173 | OSDMap ObjMap = (OSDMap)rm["ObjectData"]; | 173 | OSDMap ObjMap = (OSDMap)tmpOSD; |
174 | 174 | ||
175 | bypass_raycast = ObjMap["BypassRaycast"].AsBoolean(); | 175 | bypass_raycast = ObjMap["BypassRaycast"].AsBoolean(); |
176 | everyone_mask = readuintval(ObjMap["EveryoneMask"]); | 176 | everyone_mask = ReadUIntVal(ObjMap["EveryoneMask"]); |
177 | flags = readuintval(ObjMap["Flags"]); | 177 | flags = ReadUIntVal(ObjMap["Flags"]); |
178 | group_mask = readuintval(ObjMap["GroupMask"]); | 178 | group_mask = ReadUIntVal(ObjMap["GroupMask"]); |
179 | material = ObjMap["Material"].AsInteger(); | 179 | material = ObjMap["Material"].AsInteger(); |
180 | next_owner_mask = readuintval(ObjMap["NextOwnerMask"]); | 180 | next_owner_mask = ReadUIntVal(ObjMap["NextOwnerMask"]); |
181 | p_code = ObjMap["PCode"].AsInteger(); | 181 | p_code = ObjMap["PCode"].AsInteger(); |
182 | 182 | ||
183 | if (ObjMap.ContainsKey("Path")) | 183 | if (ObjMap.TryGetValue("Path", out tmpOSD)) |
184 | { | 184 | { |
185 | if (ObjMap["Path"].Type != OSDType.Map) | 185 | if (tmpOSD.Type != OSDType.Map) |
186 | { | 186 | { |
187 | responsedata["str_response_string"] = "Has Path key, but data not in expected format"; | 187 | responsedata["str_response_string"] = "Has Path key, but data not in expected format"; |
188 | return responsedata; | 188 | return responsedata; |
189 | } | 189 | } |
190 | 190 | ||
191 | OSDMap PathMap = (OSDMap)ObjMap["Path"]; | 191 | OSDMap PathMap = (OSDMap)tmpOSD; |
192 | path_begin = PathMap["Begin"].AsInteger(); | 192 | path_begin = PathMap["Begin"].AsInteger(); |
193 | path_curve = PathMap["Curve"].AsInteger(); | 193 | path_curve = PathMap["Curve"].AsInteger(); |
194 | path_end = PathMap["End"].AsInteger(); | 194 | path_end = PathMap["End"].AsInteger(); |
@@ -203,18 +203,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
203 | path_taper_y = PathMap["TaperY"].AsInteger(); | 203 | path_taper_y = PathMap["TaperY"].AsInteger(); |
204 | path_twist = PathMap["Twist"].AsInteger(); | 204 | path_twist = PathMap["Twist"].AsInteger(); |
205 | path_twist_begin = PathMap["TwistBegin"].AsInteger(); | 205 | path_twist_begin = PathMap["TwistBegin"].AsInteger(); |
206 | |||
207 | } | 206 | } |
208 | 207 | ||
209 | if (ObjMap.ContainsKey("Profile")) | 208 | if (ObjMap.TryGetValue("Profile", out tmpOSD)) |
210 | { | 209 | { |
211 | if (ObjMap["Profile"].Type != OSDType.Map) | 210 | if (tmpOSD.Type != OSDType.Map) |
212 | { | 211 | { |
213 | responsedata["str_response_string"] = "Has Profile key, but data not in expected format"; | 212 | responsedata["str_response_string"] = "Has Profile key, but data not in expected format"; |
214 | return responsedata; | 213 | return responsedata; |
215 | } | 214 | } |
216 | 215 | ||
217 | OSDMap ProfileMap = (OSDMap)ObjMap["Profile"]; | 216 | OSDMap ProfileMap = (OSDMap)tmpOSD; |
218 | 217 | ||
219 | profile_begin = ProfileMap["Begin"].AsInteger(); | 218 | profile_begin = ProfileMap["Begin"].AsInteger(); |
220 | profile_curve = ProfileMap["Curve"].AsInteger(); | 219 | profile_curve = ProfileMap["Curve"].AsInteger(); |
@@ -239,15 +238,15 @@ namespace OpenSim.Region.ClientStack.Linden | |||
239 | return responsedata; | 238 | return responsedata; |
240 | } | 239 | } |
241 | 240 | ||
242 | if (rm.ContainsKey("AgentData")) | 241 | if (rm.TryGetValue("AgentData", out tmpOSD)) |
243 | { | 242 | { |
244 | if (rm["AgentData"].Type != OSDType.Map) | 243 | if (tmpOSD.Type != OSDType.Map) |
245 | { | 244 | { |
246 | responsedata["str_response_string"] = "Has AgentData key, but data not in expected format"; | 245 | responsedata["str_response_string"] = "Has AgentData key, but data not in expected format"; |
247 | return responsedata; | 246 | return responsedata; |
248 | } | 247 | } |
249 | 248 | ||
250 | OSDMap AgentDataMap = (OSDMap)rm["AgentData"]; | 249 | OSDMap AgentDataMap = (OSDMap)tmpOSD; |
251 | 250 | ||
252 | //session_id = AgentDataMap["SessionId"].AsUUID(); | 251 | //session_id = AgentDataMap["SessionId"].AsUUID(); |
253 | group_id = AgentDataMap["GroupId"].AsUUID(); | 252 | group_id = AgentDataMap["GroupId"].AsUUID(); |
@@ -258,13 +257,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
258 | { //v1 | 257 | { //v1 |
259 | bypass_raycast = rm["bypass_raycast"].AsBoolean(); | 258 | bypass_raycast = rm["bypass_raycast"].AsBoolean(); |
260 | 259 | ||
261 | everyone_mask = readuintval(rm["everyone_mask"]); | 260 | everyone_mask = ReadUIntVal(rm["everyone_mask"]); |
262 | flags = readuintval(rm["flags"]); | 261 | flags = ReadUIntVal(rm["flags"]); |
263 | group_id = rm["group_id"].AsUUID(); | 262 | group_id = rm["group_id"].AsUUID(); |
264 | group_mask = readuintval(rm["group_mask"]); | 263 | group_mask = ReadUIntVal(rm["group_mask"]); |
265 | hollow = rm["hollow"].AsInteger(); | 264 | hollow = rm["hollow"].AsInteger(); |
266 | material = rm["material"].AsInteger(); | 265 | material = rm["material"].AsInteger(); |
267 | next_owner_mask = readuintval(rm["next_owner_mask"]); | 266 | next_owner_mask = ReadUIntVal(rm["next_owner_mask"]); |
268 | hollow = rm["hollow"].AsInteger(); | 267 | hollow = rm["hollow"].AsInteger(); |
269 | p_code = rm["p_code"].AsInteger(); | 268 | p_code = rm["p_code"].AsInteger(); |
270 | path_begin = rm["path_begin"].AsInteger(); | 269 | path_begin = rm["path_begin"].AsInteger(); |
@@ -344,7 +343,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
344 | obj = m_scene.AddNewPrim(avatar.UUID, group_id, pos, rotation, pbs); | 343 | obj = m_scene.AddNewPrim(avatar.UUID, group_id, pos, rotation, pbs); |
345 | } | 344 | } |
346 | 345 | ||
347 | |||
348 | if (obj == null) | 346 | if (obj == null) |
349 | return responsedata; | 347 | return responsedata; |
350 | 348 | ||
@@ -369,7 +367,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
369 | return responsedata; | 367 | return responsedata; |
370 | } | 368 | } |
371 | 369 | ||
372 | private uint readuintval(OSD obj) | 370 | private uint ReadUIntVal(OSD obj) |
373 | { | 371 | { |
374 | byte[] tmp = obj.AsBinary(); | 372 | byte[] tmp = obj.AsBinary(); |
375 | if (BitConverter.IsLittleEndian) | 373 | if (BitConverter.IsLittleEndian) |