diff options
author | Melanie | 2010-10-21 07:33:01 +0100 |
---|---|---|
committer | Melanie | 2010-10-21 07:33:01 +0100 |
commit | fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e (patch) | |
tree | ffe3d70e95b159dc4c7b3bf9613bca865d4067d3 /OpenSim/Region | |
parent | COmmented the wrong line instead, now I commented them all to be on the safe ... (diff) | |
parent | Skip empty strings in ParseString* functions (diff) | |
download | opensim-SC-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.zip opensim-SC-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.gz opensim-SC-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.bz2 opensim-SC-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
14 files changed, 476 insertions, 75 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index c5ee385..7e0a886 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -336,8 +336,8 @@ namespace OpenSim | |||
336 | //regionInfo.originRegionID = regionInfo.RegionID; | 336 | //regionInfo.originRegionID = regionInfo.RegionID; |
337 | 337 | ||
338 | // set initial ServerURI | 338 | // set initial ServerURI |
339 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port; | ||
340 | regionInfo.HttpPort = m_httpServerPort; | 339 | regionInfo.HttpPort = m_httpServerPort; |
340 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/"; | ||
341 | 341 | ||
342 | regionInfo.osSecret = m_osSecret; | 342 | regionInfo.osSecret = m_osSecret; |
343 | 343 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index d8e0f96..80adc46 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -598,7 +598,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
598 | try | 598 | try |
599 | { | 599 | { |
600 | 600 | ||
601 | XmlRpcResponse GridResp = GridReq.Send("http://" + reginfo.ExternalHostName + ":" + reginfo.HttpPort, 3000); | 601 | XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, 3000); |
602 | 602 | ||
603 | Hashtable responseData = (Hashtable)GridResp.Value; | 603 | Hashtable responseData = (Hashtable)GridResp.Value; |
604 | 604 | ||
@@ -620,8 +620,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
620 | } | 620 | } |
621 | catch (WebException e) | 621 | catch (WebException e) |
622 | { | 622 | { |
623 | m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to http://{0}:{1} the host didn't respond ({2})", | 623 | m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})", |
624 | reginfo.ExternalHostName, reginfo.HttpPort, e.Message); | 624 | reginfo.ServerURI, e.Message); |
625 | } | 625 | } |
626 | 626 | ||
627 | return false; | 627 | return false; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index a08a628..6badc74 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -159,8 +159,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
159 | 159 | ||
160 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 160 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
161 | { | 161 | { |
162 | //m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); | 162 | // m_log.DebugFormat( |
163 | 163 | // "[INVENTORY TRANSFER]: {0} IM type received from {1}", | |
164 | // (InstantMessageDialog)im.dialog, client.Name); | ||
165 | |||
164 | Scene scene = FindClientScene(client.AgentId); | 166 | Scene scene = FindClientScene(client.AgentId); |
165 | 167 | ||
166 | if (scene == null) // Something seriously wrong here. | 168 | if (scene == null) // Something seriously wrong here. |
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs new file mode 100644 index 0000000..09b9719 --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -0,0 +1,377 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Specialized; | ||
31 | using System.Reflection; | ||
32 | using System.IO; | ||
33 | using System.Web; | ||
34 | using Mono.Addins; | ||
35 | using log4net; | ||
36 | using Nini.Config; | ||
37 | using OpenMetaverse; | ||
38 | using OpenMetaverse.StructuredData; | ||
39 | using OpenMetaverse.Messages.Linden; | ||
40 | using OpenSim.Framework; | ||
41 | using OpenSim.Framework.Servers; | ||
42 | using OpenSim.Framework.Servers.HttpServer; | ||
43 | using OpenSim.Region.Framework.Interfaces; | ||
44 | using OpenSim.Region.Framework.Scenes; | ||
45 | using OpenSim.Services.Interfaces; | ||
46 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
47 | using OSD = OpenMetaverse.StructuredData.OSD; | ||
48 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
49 | using OpenSim.Framework.Capabilities; | ||
50 | using ExtraParamType = OpenMetaverse.ExtraParamType; | ||
51 | |||
52 | namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | ||
53 | { | ||
54 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
55 | public class UploadObjectAssetModule : INonSharedRegionModule | ||
56 | { | ||
57 | private static readonly ILog m_log = | ||
58 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
59 | private Scene m_scene; | ||
60 | |||
61 | #region IRegionModuleBase Members | ||
62 | |||
63 | |||
64 | public Type ReplaceableInterface | ||
65 | { | ||
66 | get { return null; } | ||
67 | } | ||
68 | |||
69 | public void Initialise(IConfigSource source) | ||
70 | { | ||
71 | |||
72 | } | ||
73 | |||
74 | public void AddRegion(Scene pScene) | ||
75 | { | ||
76 | m_scene = pScene; | ||
77 | } | ||
78 | |||
79 | public void RemoveRegion(Scene scene) | ||
80 | { | ||
81 | |||
82 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; | ||
83 | m_scene = null; | ||
84 | } | ||
85 | |||
86 | public void RegionLoaded(Scene scene) | ||
87 | { | ||
88 | |||
89 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; | ||
90 | } | ||
91 | |||
92 | #endregion | ||
93 | |||
94 | |||
95 | #region IRegionModule Members | ||
96 | |||
97 | |||
98 | |||
99 | public void Close() { } | ||
100 | |||
101 | public string Name { get { return "UploadObjectAssetModuleModule"; } } | ||
102 | |||
103 | |||
104 | public void RegisterCaps(UUID agentID, Caps caps) | ||
105 | { | ||
106 | UUID capID = UUID.Random(); | ||
107 | |||
108 | m_log.Info("[UploadObjectAssetModule]: /CAPS/" + capID); | ||
109 | caps.RegisterHandler("UploadObjectAsset", | ||
110 | new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", | ||
111 | delegate(Hashtable m_dhttpMethod) | ||
112 | { | ||
113 | return ProcessAdd(m_dhttpMethod, agentID, caps); | ||
114 | })); | ||
115 | /* | ||
116 | caps.RegisterHandler("NewFileAgentInventoryVariablePrice", | ||
117 | |||
118 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST", | ||
119 | "/CAPS/" + capID.ToString(), | ||
120 | delegate(LLSDAssetUploadRequest req) | ||
121 | { | ||
122 | return NewAgentInventoryRequest(req,agentID); | ||
123 | })); | ||
124 | */ | ||
125 | |||
126 | } | ||
127 | |||
128 | #endregion | ||
129 | |||
130 | |||
131 | /// <summary> | ||
132 | /// Parses ad request | ||
133 | /// </summary> | ||
134 | /// <param name="request"></param> | ||
135 | /// <param name="AgentId"></param> | ||
136 | /// <param name="cap"></param> | ||
137 | /// <returns></returns> | ||
138 | public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap) | ||
139 | { | ||
140 | Hashtable responsedata = new Hashtable(); | ||
141 | responsedata["int_response_code"] = 400; //501; //410; //404; | ||
142 | responsedata["content_type"] = "text/plain"; | ||
143 | responsedata["keepalive"] = false; | ||
144 | responsedata["str_response_string"] = "Request wasn't what was expected"; | ||
145 | ScenePresence avatar; | ||
146 | |||
147 | if (!m_scene.TryGetScenePresence(AgentId, out avatar)) | ||
148 | return responsedata; | ||
149 | |||
150 | OSDMap r = (OSDMap)OSDParser.Deserialize((string)request["requestbody"]); | ||
151 | UploadObjectAssetMessage message = new UploadObjectAssetMessage(); | ||
152 | try | ||
153 | { | ||
154 | message.Deserialize(r); | ||
155 | |||
156 | } | ||
157 | catch (Exception ex) | ||
158 | { | ||
159 | m_log.Error("[UploadObjectAssetModule]: Error deserializing message " + ex.ToString()); | ||
160 | message = null; | ||
161 | } | ||
162 | |||
163 | if (message == null) | ||
164 | { | ||
165 | responsedata["int_response_code"] = 400; //501; //410; //404; | ||
166 | responsedata["content_type"] = "text/plain"; | ||
167 | responsedata["keepalive"] = false; | ||
168 | responsedata["str_response_string"] = | ||
169 | "<llsd><map><key>error</key><string>Error parsing Object</string></map></llsd>"; | ||
170 | |||
171 | return responsedata; | ||
172 | } | ||
173 | |||
174 | Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation); | ||
175 | Quaternion rot = Quaternion.Identity; | ||
176 | Vector3 rootpos = Vector3.Zero; | ||
177 | Quaternion rootrot = Quaternion.Identity; | ||
178 | |||
179 | SceneObjectGroup rootGroup = null; | ||
180 | SceneObjectGroup[] allparts = new SceneObjectGroup[message.Objects.Length]; | ||
181 | for (int i = 0; i < message.Objects.Length; i++) | ||
182 | { | ||
183 | UploadObjectAssetMessage.Object obj = message.Objects[i]; | ||
184 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); | ||
185 | |||
186 | if (i == 0) | ||
187 | { | ||
188 | rootpos = obj.Position; | ||
189 | rootrot = obj.Rotation; | ||
190 | |||
191 | } | ||
192 | |||
193 | |||
194 | // Combine the extraparams data into it's ugly blob again.... | ||
195 | //int bytelength = 0; | ||
196 | //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | ||
197 | //{ | ||
198 | // bytelength += obj.ExtraParams[extparams].ExtraParamData.Length; | ||
199 | //} | ||
200 | //byte[] extraparams = new byte[bytelength]; | ||
201 | //int position = 0; | ||
202 | |||
203 | |||
204 | |||
205 | //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | ||
206 | //{ | ||
207 | // Buffer.BlockCopy(obj.ExtraParams[extparams].ExtraParamData, 0, extraparams, position, | ||
208 | // obj.ExtraParams[extparams].ExtraParamData.Length); | ||
209 | // | ||
210 | // position += obj.ExtraParams[extparams].ExtraParamData.Length; | ||
211 | // } | ||
212 | |||
213 | //pbs.ExtraParams = extraparams; | ||
214 | for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | ||
215 | { | ||
216 | UploadObjectAssetMessage.Object.ExtraParam extraParam = obj.ExtraParams[extparams]; | ||
217 | switch ((ushort)extraParam.Type) | ||
218 | { | ||
219 | case (ushort)ExtraParamType.Sculpt: | ||
220 | Primitive.SculptData sculpt = new Primitive.SculptData(extraParam.ExtraParamData, 0); | ||
221 | |||
222 | pbs.SculptEntry = true; | ||
223 | |||
224 | pbs.SculptTexture = obj.SculptID; | ||
225 | pbs.SculptType = (byte)sculpt.Type; | ||
226 | |||
227 | break; | ||
228 | case (ushort)ExtraParamType.Flexible: | ||
229 | Primitive.FlexibleData flex = new Primitive.FlexibleData(extraParam.ExtraParamData, 0); | ||
230 | pbs.FlexiEntry = true; | ||
231 | pbs.FlexiDrag = flex.Drag; | ||
232 | pbs.FlexiForceX = flex.Force.X; | ||
233 | pbs.FlexiForceY = flex.Force.Y; | ||
234 | pbs.FlexiForceZ = flex.Force.Z; | ||
235 | pbs.FlexiGravity = flex.Gravity; | ||
236 | pbs.FlexiSoftness = flex.Softness; | ||
237 | pbs.FlexiTension = flex.Tension; | ||
238 | pbs.FlexiWind = flex.Wind; | ||
239 | break; | ||
240 | case (ushort)ExtraParamType.Light: | ||
241 | Primitive.LightData light = new Primitive.LightData(extraParam.ExtraParamData, 0); | ||
242 | pbs.LightColorA = light.Color.A; | ||
243 | pbs.LightColorB = light.Color.B; | ||
244 | pbs.LightColorG = light.Color.G; | ||
245 | pbs.LightColorR = light.Color.R; | ||
246 | pbs.LightCutoff = light.Cutoff; | ||
247 | pbs.LightEntry = true; | ||
248 | pbs.LightFalloff = light.Falloff; | ||
249 | pbs.LightIntensity = light.Intensity; | ||
250 | pbs.LightRadius = light.Radius; | ||
251 | break; | ||
252 | case 0x40: | ||
253 | pbs.ReadProjectionData(extraParam.ExtraParamData, 0); | ||
254 | break; | ||
255 | |||
256 | } | ||
257 | |||
258 | |||
259 | } | ||
260 | pbs.PathBegin = (ushort) obj.PathBegin; | ||
261 | pbs.PathCurve = (byte) obj.PathCurve; | ||
262 | pbs.PathEnd = (ushort) obj.PathEnd; | ||
263 | pbs.PathRadiusOffset = (sbyte) obj.RadiusOffset; | ||
264 | pbs.PathRevolutions = (byte) obj.Revolutions; | ||
265 | pbs.PathScaleX = (byte) obj.ScaleX; | ||
266 | pbs.PathScaleY = (byte) obj.ScaleY; | ||
267 | pbs.PathShearX = (byte) obj.ShearX; | ||
268 | pbs.PathShearY = (byte) obj.ShearY; | ||
269 | pbs.PathSkew = (sbyte) obj.Skew; | ||
270 | pbs.PathTaperX = (sbyte) obj.TaperX; | ||
271 | pbs.PathTaperY = (sbyte) obj.TaperY; | ||
272 | pbs.PathTwist = (sbyte) obj.Twist; | ||
273 | pbs.PathTwistBegin = (sbyte) obj.TwistBegin; | ||
274 | pbs.HollowShape = (HollowShape) obj.ProfileHollow; | ||
275 | pbs.PCode = (byte) PCode.Prim; | ||
276 | pbs.ProfileBegin = (ushort) obj.ProfileBegin; | ||
277 | pbs.ProfileCurve = (byte) obj.ProfileCurve; | ||
278 | pbs.ProfileEnd = (ushort) obj.ProfileEnd; | ||
279 | pbs.Scale = obj.Scale; | ||
280 | pbs.State = (byte) 0; | ||
281 | SceneObjectPart prim = new SceneObjectPart(); | ||
282 | prim.UUID = UUID.Random(); | ||
283 | prim.CreatorID = AgentId; | ||
284 | prim.OwnerID = AgentId; | ||
285 | prim.GroupID = obj.GroupID; | ||
286 | prim.LastOwnerID = prim.OwnerID; | ||
287 | prim.CreationDate = Util.UnixTimeSinceEpoch(); | ||
288 | prim.Name = obj.Name; | ||
289 | prim.Description = ""; | ||
290 | |||
291 | prim.PayPrice[0] = -2; | ||
292 | prim.PayPrice[1] = -2; | ||
293 | prim.PayPrice[2] = -2; | ||
294 | prim.PayPrice[3] = -2; | ||
295 | prim.PayPrice[4] = -2; | ||
296 | Primitive.TextureEntry tmp = | ||
297 | new Primitive.TextureEntry(UUID.Parse("89556747-24cb-43ed-920b-47caed15465f")); | ||
298 | |||
299 | for (int j = 0; j < obj.Faces.Length; j++) | ||
300 | { | ||
301 | UploadObjectAssetMessage.Object.Face face = obj.Faces[j]; | ||
302 | |||
303 | Primitive.TextureEntryFace primFace = tmp.CreateFace((uint) j); | ||
304 | |||
305 | primFace.Bump = face.Bump; | ||
306 | primFace.RGBA = face.Color; | ||
307 | primFace.Fullbright = face.Fullbright; | ||
308 | primFace.Glow = face.Glow; | ||
309 | primFace.TextureID = face.ImageID; | ||
310 | primFace.Rotation = face.ImageRot; | ||
311 | primFace.MediaFlags = ((face.MediaFlags & 1) != 0); | ||
312 | |||
313 | primFace.OffsetU = face.OffsetS; | ||
314 | primFace.OffsetV = face.OffsetT; | ||
315 | primFace.RepeatU = face.ScaleS; | ||
316 | primFace.RepeatV = face.ScaleT; | ||
317 | primFace.TexMapType = (MappingType) (face.MediaFlags & 6); | ||
318 | } | ||
319 | pbs.TextureEntry = tmp.GetBytes(); | ||
320 | prim.Shape = pbs; | ||
321 | prim.Scale = obj.Scale; | ||
322 | |||
323 | |||
324 | SceneObjectGroup grp = new SceneObjectGroup(); | ||
325 | |||
326 | grp.SetRootPart(prim); | ||
327 | prim.ParentID = 0; | ||
328 | if (i == 0) | ||
329 | { | ||
330 | rootGroup = grp; | ||
331 | |||
332 | } | ||
333 | grp.AttachToScene(m_scene); | ||
334 | grp.AbsolutePosition = obj.Position; | ||
335 | prim.RotationOffset = obj.Rotation; | ||
336 | |||
337 | grp.RootPart.IsAttachment = false; | ||
338 | // Required for linking | ||
339 | grp.RootPart.UpdateFlag = 0; | ||
340 | |||
341 | if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) | ||
342 | { | ||
343 | m_scene.AddSceneObject(grp); | ||
344 | grp.AbsolutePosition = obj.Position; | ||
345 | } | ||
346 | allparts[i] = grp; | ||
347 | |||
348 | } | ||
349 | |||
350 | for (int j = 1; j < allparts.Length; j++) | ||
351 | { | ||
352 | rootGroup.RootPart.UpdateFlag = 0; | ||
353 | allparts[j].RootPart.UpdateFlag = 0; | ||
354 | rootGroup.LinkToGroup(allparts[j]); | ||
355 | } | ||
356 | |||
357 | rootGroup.ScheduleGroupForFullUpdate(); | ||
358 | pos = m_scene.GetNewRezLocation(Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale(), false); | ||
359 | |||
360 | responsedata["int_response_code"] = 200; //501; //410; //404; | ||
361 | responsedata["content_type"] = "text/plain"; | ||
362 | responsedata["keepalive"] = false; | ||
363 | responsedata["str_response_string"] = String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>", ConvertUintToBytes(allparts[0].LocalId)); | ||
364 | |||
365 | return responsedata; | ||
366 | |||
367 | |||
368 | } | ||
369 | private string ConvertUintToBytes(uint val) | ||
370 | { | ||
371 | byte[] resultbytes = Utils.UIntToBytes(val); | ||
372 | if (BitConverter.IsLittleEndian) | ||
373 | Array.Reverse(resultbytes); | ||
374 | return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes)); | ||
375 | } | ||
376 | } | ||
377 | } | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 2921b0d..9a0e735 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -327,43 +327,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
327 | 327 | ||
328 | // OK, it got this agent. Let's close some child agents | 328 | // OK, it got this agent. Let's close some child agents |
329 | sp.CloseChildAgents(newRegionX, newRegionY); | 329 | sp.CloseChildAgents(newRegionX, newRegionY); |
330 | 330 | IClientIPEndpoint ipepClient; | |
331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 331 | if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
332 | { | 332 | { |
333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); | 333 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); |
334 | |||
335 | #region IP Translation for NAT | 334 | #region IP Translation for NAT |
336 | IClientIPEndpoint ipepClient; | 335 | // Uses ipepClient above |
337 | if (sp.ClientView.TryGet(out ipepClient)) | 336 | if (sp.ClientView.TryGet(out ipepClient)) |
338 | { | 337 | { |
339 | capsPath | 338 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); |
340 | = "http://" | ||
341 | + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName) | ||
342 | + ":" | ||
343 | + finalDestination.HttpPort | ||
344 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | capsPath | ||
349 | = "http://" | ||
350 | + finalDestination.ExternalHostName | ||
351 | + ":" | ||
352 | + finalDestination.HttpPort | ||
353 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
354 | } | 339 | } |
355 | #endregion | 340 | #endregion |
341 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
356 | 342 | ||
357 | if (eq != null) | 343 | if (eq != null) |
358 | { | 344 | { |
359 | #region IP Translation for NAT | ||
360 | // Uses ipepClient above | ||
361 | if (sp.ClientView.TryGet(out ipepClient)) | ||
362 | { | ||
363 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
364 | } | ||
365 | #endregion | ||
366 | |||
367 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); | 345 | eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); |
368 | 346 | ||
369 | // ES makes the client send a UseCircuitCode message to the destination, | 347 | // ES makes the client send a UseCircuitCode message to the destination, |
@@ -382,8 +360,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
382 | else | 360 | else |
383 | { | 361 | { |
384 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); | 362 | agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); |
385 | capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort | 363 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
386 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; | ||
387 | } | 364 | } |
388 | 365 | ||
389 | // Expect avatar crossing is a heavy-duty function at the destination. | 366 | // Expect avatar crossing is a heavy-duty function at the destination. |
@@ -518,8 +495,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
518 | 495 | ||
519 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) | 496 | protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) |
520 | { | 497 | { |
521 | agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort + | 498 | agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; |
522 | "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; | 499 | m_log.Debug("Set callback URL to " + agent.CallbackURI); |
523 | 500 | ||
524 | } | 501 | } |
525 | 502 | ||
@@ -862,8 +839,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
862 | cAgent.Position = pos; | 839 | cAgent.Position = pos; |
863 | if (isFlying) | 840 | if (isFlying) |
864 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 841 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
865 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + | 842 | cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + |
866 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 843 | "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; |
867 | 844 | ||
868 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 845 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
869 | { | 846 | { |
@@ -888,10 +865,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
888 | neighbourRegion.RegionHandle); | 865 | neighbourRegion.RegionHandle); |
889 | return agent; | 866 | return agent; |
890 | } | 867 | } |
891 | // TODO Should construct this behind a method | 868 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
892 | string capsPath = | ||
893 | "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort | ||
894 | + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; | ||
895 | 869 | ||
896 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 870 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
897 | 871 | ||
@@ -1219,8 +1193,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1219 | y = y / Constants.RegionSize; | 1193 | y = y / Constants.RegionSize; |
1220 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); | 1194 | m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); |
1221 | 1195 | ||
1222 | string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 1196 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); |
1223 | + "/CAPS/" + a.CapsPath + "0000/"; | ||
1224 | 1197 | ||
1225 | string reason = String.Empty; | 1198 | string reason = String.Empty; |
1226 | 1199 | ||
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index fd0e879..2dd7767 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -595,12 +595,12 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
595 | // DEPRECATED | 595 | // DEPRECATED |
596 | responseMap["seed_capability"] | 596 | responseMap["seed_capability"] |
597 | = OSD.FromString( | 597 | = OSD.FromString( |
598 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | 598 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); |
599 | 599 | ||
600 | // REPLACEMENT | 600 | // REPLACEMENT |
601 | responseMap["region_seed_capability"] | 601 | responseMap["region_seed_capability"] |
602 | = OSD.FromString( | 602 | = OSD.FromString( |
603 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | 603 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); |
604 | 604 | ||
605 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 605 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
606 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 606 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index 0da3f5f..155335b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
36 | { | 36 | { |
37 | public class UserAccountCache | 37 | public class UserAccountCache |
38 | { | 38 | { |
39 | private const double CACHE_EXPIRATION_SECONDS = 120.0; | 39 | private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! |
40 | 40 | ||
41 | private static readonly ILog m_log = | 41 | private static readonly ILog m_log = |
42 | LogManager.GetLogger( | 42 | LogManager.GetLogger( |
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
57 | if (account != null) | 57 | if (account != null) |
58 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); | 58 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); |
59 | 59 | ||
60 | // m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); | 60 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
61 | } | 61 | } |
62 | 62 | ||
63 | public UserAccount Get(UUID userID, out bool inCache) | 63 | public UserAccount Get(UUID userID, out bool inCache) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index a182eea..fdbbccf 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
147 | 147 | ||
148 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); | 148 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); |
149 | regionimage = regionimage.Replace("-", ""); | 149 | regionimage = regionimage.Replace("-", ""); |
150 | m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage); | 150 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage); |
151 | 151 | ||
152 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); | 152 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); |
153 | MainServer.Instance.AddLLSDHandler( | 153 | MainServer.Instance.AddLLSDHandler( |
@@ -579,7 +579,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
579 | 579 | ||
580 | if (mreg != null) | 580 | if (mreg != null) |
581 | { | 581 | { |
582 | httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString(); | 582 | httpserver = mreg.ServerURI + "MAP/MapItems/" + regionhandle.ToString(); |
583 | lock (m_cachedRegionMapItemsAddress) | 583 | lock (m_cachedRegionMapItemsAddress) |
584 | { | 584 | { |
585 | if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) | 585 | if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 618f425..06e3c0e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3329,6 +3329,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3329 | 3329 | ||
3330 | public void CopyTo(AgentData cAgent) | 3330 | public void CopyTo(AgentData cAgent) |
3331 | { | 3331 | { |
3332 | cAgent.CallbackURI = m_callbackURI; | ||
3333 | |||
3332 | cAgent.AgentID = UUID; | 3334 | cAgent.AgentID = UUID; |
3333 | cAgent.RegionID = Scene.RegionInfo.RegionID; | 3335 | cAgent.RegionID = Scene.RegionInfo.RegionID; |
3334 | 3336 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index e33ad4a..dd7e057 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -318,6 +318,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
318 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); | 318 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); |
319 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); | 319 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); |
320 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); | 320 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); |
321 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); | ||
322 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); | ||
321 | #endregion | 323 | #endregion |
322 | 324 | ||
323 | #region TaskInventoryXmlProcessors initialization | 325 | #region TaskInventoryXmlProcessors initialization |
@@ -663,6 +665,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
663 | { | 665 | { |
664 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); | 666 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); |
665 | } | 667 | } |
668 | |||
669 | private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) | ||
670 | { | ||
671 | obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); | ||
672 | } | ||
673 | |||
674 | private static void ProcessParticleSystem(SceneObjectPart obj, XmlTextReader reader) | ||
675 | { | ||
676 | obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); | ||
677 | } | ||
666 | #endregion | 678 | #endregion |
667 | 679 | ||
668 | #region TaskInventoryXmlProcessors | 680 | #region TaskInventoryXmlProcessors |
@@ -1128,6 +1140,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1128 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); | 1140 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); |
1129 | if (sop.MediaUrl != null) | 1141 | if (sop.MediaUrl != null) |
1130 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); | 1142 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); |
1143 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); | ||
1144 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); | ||
1131 | 1145 | ||
1132 | writer.WriteEndElement(); | 1146 | writer.WriteEndElement(); |
1133 | } | 1147 | } |
@@ -1161,6 +1175,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1161 | writer.WriteEndElement(); | 1175 | writer.WriteEndElement(); |
1162 | } | 1176 | } |
1163 | 1177 | ||
1178 | static void WriteBytes(XmlTextWriter writer, string name, byte[] data) | ||
1179 | { | ||
1180 | writer.WriteStartElement(name); | ||
1181 | byte[] d; | ||
1182 | if (data != null) | ||
1183 | d = data; | ||
1184 | else | ||
1185 | d = Utils.EmptyBytes; | ||
1186 | writer.WriteBase64(d, 0, d.Length); | ||
1187 | writer.WriteEndElement(); // name | ||
1188 | |||
1189 | } | ||
1190 | |||
1164 | static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options) | 1191 | static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options) |
1165 | { | 1192 | { |
1166 | if (tinv.Count > 0) // otherwise skip this | 1193 | if (tinv.Count > 0) // otherwise skip this |
@@ -1398,9 +1425,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1398 | Vector3 vec; | 1425 | Vector3 vec; |
1399 | 1426 | ||
1400 | reader.ReadStartElement(name); | 1427 | reader.ReadStartElement(name); |
1401 | vec.X = reader.ReadElementContentAsFloat("X", String.Empty); | 1428 | vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x |
1402 | vec.Y = reader.ReadElementContentAsFloat("Y", String.Empty); | 1429 | vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or Y |
1403 | vec.Z = reader.ReadElementContentAsFloat("Z", String.Empty); | 1430 | vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z |
1404 | reader.ReadEndElement(); | 1431 | reader.ReadEndElement(); |
1405 | 1432 | ||
1406 | return vec; | 1433 | return vec; |
@@ -1408,13 +1435,28 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1408 | 1435 | ||
1409 | static Quaternion ReadQuaternion(XmlTextReader reader, string name) | 1436 | static Quaternion ReadQuaternion(XmlTextReader reader, string name) |
1410 | { | 1437 | { |
1411 | Quaternion quat; | 1438 | Quaternion quat = new Quaternion(); |
1412 | 1439 | ||
1413 | reader.ReadStartElement(name); | 1440 | reader.ReadStartElement(name); |
1414 | quat.X = reader.ReadElementContentAsFloat("X", String.Empty); | 1441 | while (reader.NodeType != XmlNodeType.EndElement) |
1415 | quat.Y = reader.ReadElementContentAsFloat("Y", String.Empty); | 1442 | { |
1416 | quat.Z = reader.ReadElementContentAsFloat("Z", String.Empty); | 1443 | switch (reader.Name.ToLower()) |
1417 | quat.W = reader.ReadElementContentAsFloat("W", String.Empty); | 1444 | { |
1445 | case "x": | ||
1446 | quat.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); | ||
1447 | break; | ||
1448 | case "y": | ||
1449 | quat.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); | ||
1450 | break; | ||
1451 | case "z": | ||
1452 | quat.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); | ||
1453 | break; | ||
1454 | case "w": | ||
1455 | quat.W = reader.ReadElementContentAsFloat(reader.Name, String.Empty); | ||
1456 | break; | ||
1457 | } | ||
1458 | } | ||
1459 | |||
1418 | reader.ReadEndElement(); | 1460 | reader.ReadEndElement(); |
1419 | 1461 | ||
1420 | return quat; | 1462 | return quat; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 185d44d..25dba7f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | |||
@@ -212,12 +212,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
212 | 212 | ||
213 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) | 213 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) |
214 | { | 214 | { |
215 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); | ||
216 | |||
215 | if (m_debugEnabled) | 217 | if (m_debugEnabled) |
216 | m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 218 | m_log.DebugFormat( |
217 | 219 | "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", | |
218 | 220 | groupID, groupMembers.Count); | |
219 | foreach (GroupMembersData member in m_groupData.GetGroupMembers(UUID.Zero, groupID)) | 221 | |
220 | { | 222 | foreach (GroupMembersData member in groupMembers) |
223 | { | ||
221 | if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) | 224 | if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) |
222 | { | 225 | { |
223 | // Don't deliver messages to people who have dropped this session | 226 | // Don't deliver messages to people who have dropped this session |
@@ -263,9 +266,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
263 | 266 | ||
264 | void OnClientLogin(IClientAPI client) | 267 | void OnClientLogin(IClientAPI client) |
265 | { | 268 | { |
266 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name); | 269 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name); |
267 | |||
268 | |||
269 | } | 270 | } |
270 | 271 | ||
271 | private void OnNewClient(IClientAPI client) | 272 | private void OnNewClient(IClientAPI client) |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 6f044e0..0c8113e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -599,7 +599,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
599 | 599 | ||
600 | public List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID) | 600 | public List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID) |
601 | { | 601 | { |
602 | if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); | 602 | if (m_debugEnabled) |
603 | m_log.DebugFormat( | ||
604 | "[GROUPS]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name); | ||
605 | |||
603 | List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID); | 606 | List<GroupMembersData> data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID); |
604 | 607 | ||
605 | if (m_debugEnabled) | 608 | if (m_debugEnabled) |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 5fabbb0..2631ac1 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -641,11 +641,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
641 | } | 641 | } |
642 | 642 | ||
643 | return Roles; | 643 | return Roles; |
644 | |||
645 | } | 644 | } |
646 | 645 | ||
647 | |||
648 | |||
649 | public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID) | 646 | public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID) |
650 | { | 647 | { |
651 | Hashtable param = new Hashtable(); | 648 | Hashtable param = new Hashtable(); |
@@ -988,8 +985,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
988 | } | 985 | } |
989 | catch (Exception e) | 986 | catch (Exception e) |
990 | { | 987 | { |
991 | m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); | 988 | m_log.ErrorFormat( |
992 | m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", e.ToString()); | 989 | "[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method {0} at {1}", |
990 | function, m_groupsServerURI); | ||
991 | |||
992 | m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}{1}", e.Message, e.StackTrace); | ||
993 | 993 | ||
994 | foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) | 994 | foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) |
995 | { | 995 | { |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 72dce6d..1257804 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -349,6 +349,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
349 | 349 | ||
350 | OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); | 350 | OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); |
351 | OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); | 351 | OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); |
352 | ushort faceIndexOffset = (ushort)coords.Count; | ||
352 | 353 | ||
353 | byte[] posBytes = subMeshMap["Position"].AsBinary(); | 354 | byte[] posBytes = subMeshMap["Position"].AsBinary(); |
354 | for (int i = 0; i < posBytes.Length; i += 6) | 355 | for (int i = 0; i < posBytes.Length; i += 6) |
@@ -368,9 +369,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
368 | byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); | 369 | byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); |
369 | for (int i = 0; i < triangleBytes.Length; i += 6) | 370 | for (int i = 0; i < triangleBytes.Length; i += 6) |
370 | { | 371 | { |
371 | ushort v1 = Utils.BytesToUInt16(triangleBytes, i); | 372 | ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset); |
372 | ushort v2 = Utils.BytesToUInt16(triangleBytes, i + 2); | 373 | ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset); |
373 | ushort v3 = Utils.BytesToUInt16(triangleBytes, i + 4); | 374 | ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset); |
374 | Face f = new Face(v1, v2, v3); | 375 | Face f = new Face(v1, v2, v3); |
375 | faces.Add(f); | 376 | faces.Add(f); |
376 | } | 377 | } |