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/CoreModules | |
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_OLD-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.zip opensim-SC_OLD-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.gz opensim-SC_OLD-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.bz2 opensim-SC_OLD-fc33d569cd760b0ecf2d487b8d91d4ac3c53d08e.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules')
7 files changed, 401 insertions, 49 deletions
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)) |