diff options
author | Teravus Ovares | 2009-02-05 13:43:36 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-02-05 13:43:36 +0000 |
commit | 2a998d6cd79ca7d86ddecc998e93fec7879ca03f (patch) | |
tree | 6f9d011fdca65923644fd2cc89a3107a2b51cd9f | |
parent | * Committing an experimental ObjectAdd module. Intended to work with http://... (diff) | |
download | opensim-SC_OLD-2a998d6cd79ca7d86ddecc998e93fec7879ca03f.zip opensim-SC_OLD-2a998d6cd79ca7d86ddecc998e93fec7879ca03f.tar.gz opensim-SC_OLD-2a998d6cd79ca7d86ddecc998e93fec7879ca03f.tar.bz2 opensim-SC_OLD-2a998d6cd79ca7d86ddecc998e93fec7879ca03f.tar.xz |
* Add the second version of the experimental ObjectAdd Cap. It will handle both versions currently.
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/ObjectCaps/ObjectAdd.cs | 184 |
1 files changed, 146 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/Environment/Modules/Avatar/ObjectCaps/ObjectAdd.cs index fd41146..942a9c2 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/ObjectCaps/ObjectAdd.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.ObjectCaps | |||
62 | { | 62 | { |
63 | UUID capuuid = UUID.Random(); | 63 | UUID capuuid = UUID.Random(); |
64 | 64 | ||
65 | //m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); | 65 | m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); |
66 | 66 | ||
67 | caps.RegisterHandler("ObjectAdd", | 67 | caps.RegisterHandler("ObjectAdd", |
68 | new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", | 68 | new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.ObjectCaps | |||
92 | uint group_mask = 0; | 92 | uint group_mask = 0; |
93 | uint next_owner_mask = 0; | 93 | uint next_owner_mask = 0; |
94 | uint flags = 0; | 94 | uint flags = 0; |
95 | UUID group_id; | 95 | UUID group_id = UUID.Zero; |
96 | int hollow = 0; | 96 | int hollow = 0; |
97 | int material = 0; | 97 | int material = 0; |
98 | int p_code = 0; | 98 | int p_code = 0; |
@@ -126,42 +126,150 @@ namespace OpenSim.Region.Environment.Modules.Avatar.ObjectCaps | |||
126 | 126 | ||
127 | OSDMap rm = (OSDMap)r; | 127 | OSDMap rm = (OSDMap)r; |
128 | 128 | ||
129 | bypass_raycast = rm["bypass_raycast"].AsBoolean(); | 129 | if (rm.ContainsKey("ObjectData")) //v2 |
130 | 130 | { | |
131 | everyone_mask = readuintval(rm["everyone_mask"]); | 131 | if (rm["ObjectData"].Type != OSDType.Map) |
132 | flags = readuintval(rm["flags"]); | 132 | { |
133 | group_id = rm["group_id"].AsUUID(); | 133 | responsedata["str_response_string"] = "Has ObjectData key, but data not in expected format"; |
134 | group_mask = readuintval(rm["group_mask"]); | 134 | return responsedata; |
135 | hollow = rm["hollow"].AsInteger(); | 135 | } |
136 | material = rm["material"].AsInteger(); | 136 | |
137 | next_owner_mask = readuintval(rm["next_owner_mask"]); | 137 | OSDMap ObjMap = (OSDMap) rm["ObjectData"]; |
138 | hollow = rm["hollow"].AsInteger(); | 138 | |
139 | p_code= rm["p_code"].AsInteger(); | 139 | bypass_raycast = ObjMap["BypassRaycast"].AsBoolean(); |
140 | path_begin = rm["path_begin"].AsInteger(); | 140 | everyone_mask = readuintval(ObjMap["EveryoneMask"]); |
141 | path_curve = rm["path_curve"].AsInteger(); | 141 | flags = readuintval(ObjMap["Flags"]); |
142 | path_end = rm["path_end"].AsInteger(); | 142 | group_mask = readuintval(ObjMap["GroupMask"]); |
143 | path_radius_offset = rm["path_radius_offset"].AsInteger(); | 143 | material = ObjMap["Material"].AsInteger(); |
144 | path_revolutions = rm["path_revolutions"].AsInteger(); | 144 | next_owner_mask = readuintval(ObjMap["NextOwnerMask"]); |
145 | path_scale_x = rm["path_scale_x"].AsInteger(); | 145 | p_code = ObjMap["PCode"].AsInteger(); |
146 | path_scale_y = rm["path_scale_y"].AsInteger(); | 146 | |
147 | path_shear_x = rm["path_shear_x"].AsInteger(); | 147 | if (ObjMap.ContainsKey("Path")) |
148 | path_shear_y = rm["path_shear_y"].AsInteger(); | 148 | { |
149 | path_skew = rm["path_skew"].AsInteger(); | 149 | if (ObjMap["Path"].Type != OSDType.Map) |
150 | path_taper_x = rm["path_taper_x"].AsInteger(); | 150 | { |
151 | path_taper_y = rm["path_taper_y"].AsInteger(); | 151 | responsedata["str_response_string"] = "Has Path key, but data not in expected format"; |
152 | path_twist = rm["path_twist"].AsInteger(); | 152 | return responsedata; |
153 | path_twist_begin = rm["path_twist_begin"].AsInteger(); | 153 | } |
154 | profile_begin = rm["profile_begin"].AsInteger(); | 154 | |
155 | profile_curve = rm["profile_curve"].AsInteger(); | 155 | OSDMap PathMap = (OSDMap)ObjMap["Path"]; |
156 | profile_end = rm["profile_end"].AsInteger(); | 156 | path_begin = PathMap["Begin"].AsInteger(); |
157 | ray_end = ((OSDArray) rm["ray_end"]).AsVector3(); | 157 | path_curve = PathMap["Curve"].AsInteger(); |
158 | ray_end_is_intersection = rm["ray_end_is_intersection"].AsBoolean(); | 158 | path_end = PathMap["End"].AsInteger(); |
159 | ray_start = ((OSDArray) rm["ray_start"]).AsVector3(); | 159 | path_radius_offset = PathMap["RadiusOffset"].AsInteger(); |
160 | ray_target_id = rm["ray_target_id"].AsUUID(); | 160 | path_revolutions = PathMap["Revolutions"].AsInteger(); |
161 | rotation = ((OSDArray) rm["rotation"]).AsQuaternion(); | 161 | path_scale_x = PathMap["ScaleX"].AsInteger(); |
162 | scale = ((OSDArray)rm["scale"]).AsVector3(); | 162 | path_scale_y = PathMap["ScaleY"].AsInteger(); |
163 | session_id = rm["session_id"].AsUUID(); | 163 | path_shear_x = PathMap["ShearX"].AsInteger(); |
164 | state = rm["state"].AsInteger(); | 164 | path_shear_y = PathMap["ShearY"].AsInteger(); |
165 | path_skew = PathMap["Skew"].AsInteger(); | ||
166 | path_taper_x = PathMap["TaperX"].AsInteger(); | ||
167 | path_taper_y = PathMap["TaperY"].AsInteger(); | ||
168 | path_twist = PathMap["Twist"].AsInteger(); | ||
169 | path_twist_begin = PathMap["TwistBegin"].AsInteger(); | ||
170 | |||
171 | } | ||
172 | |||
173 | if (ObjMap.ContainsKey("Profile")) | ||
174 | { | ||
175 | if (ObjMap["Profile"].Type != OSDType.Map) | ||
176 | { | ||
177 | responsedata["str_response_string"] = "Has Profile key, but data not in expected format"; | ||
178 | return responsedata; | ||
179 | } | ||
180 | |||
181 | OSDMap ProfileMap = (OSDMap)ObjMap["Profile"]; | ||
182 | |||
183 | profile_begin = ProfileMap["Begin"].AsInteger(); | ||
184 | profile_curve = ProfileMap["Curve"].AsInteger(); | ||
185 | profile_end = ProfileMap["End"].AsInteger(); | ||
186 | hollow = ProfileMap["Hollow"].AsInteger(); | ||
187 | } | ||
188 | ray_end_is_intersection = ObjMap["RayEndIsIntersection"].AsBoolean(); | ||
189 | |||
190 | ray_target_id = ObjMap["RayTargetId"].AsUUID(); | ||
191 | state = ObjMap["State"].AsInteger(); | ||
192 | try | ||
193 | { | ||
194 | ray_end = ((OSDArray) ObjMap["RayEnd"]).AsVector3(); | ||
195 | ray_start = ((OSDArray) ObjMap["RayStart"]).AsVector3(); | ||
196 | scale = ((OSDArray) ObjMap["Scale"]).AsVector3(); | ||
197 | rotation = ((OSDArray)ObjMap["Rotation"]).AsQuaternion(); | ||
198 | } | ||
199 | catch (Exception) | ||
200 | { | ||
201 | responsedata["str_response_string"] = "RayEnd, RayStart, Scale or Rotation wasn't in the expected format"; | ||
202 | return responsedata; | ||
203 | } | ||
204 | |||
205 | if (rm.ContainsKey("AgentData")) | ||
206 | { | ||
207 | if (rm["AgentData"].Type != OSDType.Map) | ||
208 | { | ||
209 | responsedata["str_response_string"] = "Has AgentData key, but data not in expected format"; | ||
210 | return responsedata; | ||
211 | } | ||
212 | |||
213 | OSDMap AgentDataMap = (OSDMap) rm["AgentData"]; | ||
214 | |||
215 | session_id = AgentDataMap["SessionId"].AsUUID(); | ||
216 | group_id = AgentDataMap["GroupId"].AsUUID(); | ||
217 | } | ||
218 | |||
219 | } | ||
220 | else | ||
221 | { //v1 | ||
222 | bypass_raycast = rm["bypass_raycast"].AsBoolean(); | ||
223 | |||
224 | everyone_mask = readuintval(rm["everyone_mask"]); | ||
225 | flags = readuintval(rm["flags"]); | ||
226 | group_id = rm["group_id"].AsUUID(); | ||
227 | group_mask = readuintval(rm["group_mask"]); | ||
228 | hollow = rm["hollow"].AsInteger(); | ||
229 | material = rm["material"].AsInteger(); | ||
230 | next_owner_mask = readuintval(rm["next_owner_mask"]); | ||
231 | hollow = rm["hollow"].AsInteger(); | ||
232 | p_code = rm["p_code"].AsInteger(); | ||
233 | path_begin = rm["path_begin"].AsInteger(); | ||
234 | path_curve = rm["path_curve"].AsInteger(); | ||
235 | path_end = rm["path_end"].AsInteger(); | ||
236 | path_radius_offset = rm["path_radius_offset"].AsInteger(); | ||
237 | path_revolutions = rm["path_revolutions"].AsInteger(); | ||
238 | path_scale_x = rm["path_scale_x"].AsInteger(); | ||
239 | path_scale_y = rm["path_scale_y"].AsInteger(); | ||
240 | path_shear_x = rm["path_shear_x"].AsInteger(); | ||
241 | path_shear_y = rm["path_shear_y"].AsInteger(); | ||
242 | path_skew = rm["path_skew"].AsInteger(); | ||
243 | path_taper_x = rm["path_taper_x"].AsInteger(); | ||
244 | path_taper_y = rm["path_taper_y"].AsInteger(); | ||
245 | path_twist = rm["path_twist"].AsInteger(); | ||
246 | path_twist_begin = rm["path_twist_begin"].AsInteger(); | ||
247 | profile_begin = rm["profile_begin"].AsInteger(); | ||
248 | profile_curve = rm["profile_curve"].AsInteger(); | ||
249 | profile_end = rm["profile_end"].AsInteger(); | ||
250 | |||
251 | ray_end_is_intersection = rm["ray_end_is_intersection"].AsBoolean(); | ||
252 | |||
253 | ray_target_id = rm["ray_target_id"].AsUUID(); | ||
254 | |||
255 | |||
256 | session_id = rm["session_id"].AsUUID(); | ||
257 | state = rm["state"].AsInteger(); | ||
258 | try | ||
259 | { | ||
260 | ray_end = ((OSDArray)rm["ray_end"]).AsVector3(); | ||
261 | ray_start = ((OSDArray)rm["ray_start"]).AsVector3(); | ||
262 | rotation = ((OSDArray)rm["rotation"]).AsQuaternion(); | ||
263 | scale = ((OSDArray)rm["scale"]).AsVector3(); | ||
264 | } | ||
265 | catch (Exception) | ||
266 | { | ||
267 | responsedata["str_response_string"] = "RayEnd, RayStart, Scale or Rotation wasn't in the expected format"; | ||
268 | return responsedata; | ||
269 | } | ||
270 | } | ||
271 | |||
272 | |||
165 | 273 | ||
166 | Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false); | 274 | Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false); |
167 | 275 | ||