From 32ccc7a9d912543c0a5d3f8db839734194f3d8dd Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Sat, 2 Oct 2010 19:17:02 -0400
Subject: * refactor refactor refactor ServerURI 4 lyfe
---
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
.../EntityTransfer/EntityTransferModule.cs | 27 ++++++----------------
.../CoreModules/World/WorldMap/WorldMapModule.cs | 2 +-
3 files changed, 9 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 74ad168..f30a850 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -327,8 +327,8 @@ namespace OpenSim
//regionInfo.originRegionID = regionInfo.RegionID;
// set initial ServerURI
- regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port;
regionInfo.HttpPort = m_httpServerPort;
+ regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString();
regionInfo.osSecret = m_osSecret;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 81f49b6..828c4e7 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -333,20 +333,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (sp.ClientView.TryGet(out ipepClient))
{
capsPath
- = "http://"
- + NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName)
- + ":"
- + finalDestination.HttpPort
- + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
+ = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
}
else
{
- capsPath
- = "http://"
- + finalDestination.ExternalHostName
- + ":"
- + finalDestination.HttpPort
- + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
+ capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
}
#endregion
@@ -378,8 +369,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
else
{
agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
- capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort
- + "/CAPS/" + agentCircuit.CapsPath + "0000/";
+ capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/";
}
// Expect avatar crossing is a heavy-duty function at the destination.
@@ -512,8 +502,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
{
- agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort +
- "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
+ agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
}
@@ -838,7 +827,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
cAgent.Position = pos;
if (isFlying)
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
- cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort +
+ cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
"/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
@@ -866,8 +855,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
// TODO Should construct this behind a method
string capsPath =
- "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort
- + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
+ neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
@@ -1178,8 +1166,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
y = y / Constants.RegionSize;
m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
- string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
- + "/CAPS/" + a.CapsPath + "0000/";
+ string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/";
string reason = String.Empty;
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index fbc8a50..1b5f23e 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
string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString();
regionimage = regionimage.Replace("-", "");
- m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage);
+ m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage);
MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage);
MainServer.Instance.AddLLSDHandler(
--
cgit v1.1
From 69acf9c79b9e83047c2a0494a6f96c7d33839d3b Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Sun, 3 Oct 2010 18:03:53 -0400
Subject: * additional serveruri cleanup
---
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
.../CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | 6 +++---
OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f30a850..904a50c 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -328,7 +328,7 @@ namespace OpenSim
// set initial ServerURI
regionInfo.HttpPort = m_httpServerPort;
- regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString();
+ regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/";
regionInfo.osSecret = m_osSecret;
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 918fa04..fdc48c6 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -599,7 +599,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
try
{
- XmlRpcResponse GridResp = GridReq.Send("http://" + reginfo.ExternalHostName + ":" + reginfo.HttpPort, 3000);
+ XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, 3000);
Hashtable responseData = (Hashtable)GridResp.Value;
@@ -621,8 +621,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
catch (WebException e)
{
- m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to http://{0}:{1} the host didn't respond ({2})",
- reginfo.ExternalHostName, reginfo.HttpPort, e.Message);
+ m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})",
+ reginfo.ServerURI, e.Message);
}
return false;
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 1b5f23e..71cf306 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -579,7 +579,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (mreg != null)
{
- httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString();
+ httpserver = mreg.ServerURI + "MAP/MapItems/" + regionhandle.ToString();
lock (m_cachedRegionMapItemsAddress)
{
if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle))
--
cgit v1.1
From a2167b0f0dfef5f8aeb7bee99f34f672f6004bb3 Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Mon, 11 Oct 2010 16:53:00 -0400
Subject: * more url / hg cleanup
---
.../EntityTransfer/EntityTransferModule.cs | 34 +++++++---------------
.../InterGrid/OpenGridProtocolModule.cs | 4 +--
2 files changed, 12 insertions(+), 26 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3791e1d..54cc80f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -327,34 +327,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// OK, it got this agent. Let's close some child agents
sp.CloseChildAgents(newRegionX, newRegionY);
-
+ IClientIPEndpoint ipepClient;
if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
{
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
-
#region IP Translation for NAT
- IClientIPEndpoint ipepClient;
+ // Uses ipepClient above
if (sp.ClientView.TryGet(out ipepClient))
{
- capsPath
- = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
- }
- else
- {
- capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
+ endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
}
#endregion
+ capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
if (eq != null)
{
- #region IP Translation for NAT
- // Uses ipepClient above
- if (sp.ClientView.TryGet(out ipepClient))
- {
- endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
- }
- #endregion
-
eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
// ES makes the client send a UseCircuitCode message to the destination,
@@ -373,7 +360,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
else
{
agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
- capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/";
+ capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
}
// Expect avatar crossing is a heavy-duty function at the destination.
@@ -506,7 +493,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
{
- agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
+ agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
+ m_log.Debug("Set callback URL to " + agent.CallbackURI);
}
@@ -832,7 +820,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (isFlying)
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
- "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
+ "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
{
@@ -857,9 +845,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
neighbourRegion.RegionHandle);
return agent;
}
- // TODO Should construct this behind a method
- string capsPath =
- neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
+ string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
@@ -1178,7 +1164,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
y = y / Constants.RegionSize;
m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
- string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/";
+ string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
string reason = String.Empty;
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
// DEPRECATED
responseMap["seed_capability"]
= OSD.FromString(
- regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
+ regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
// REPLACEMENT
responseMap["region_seed_capability"]
= OSD.FromString(
- regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
+ regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
--
cgit v1.1
From 94684a2251a96df0ccbc45dbb12cd241a71978f8 Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Wed, 20 Oct 2010 02:36:59 -0400
Subject: * remove some spurious debug info
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 13d9964..c223b4b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2976,6 +2976,8 @@ namespace OpenSim.Region.Framework.Scenes
public void CopyTo(AgentData cAgent)
{
+ cAgent.CallbackURI = m_callbackURI;
+
cAgent.AgentID = UUID;
cAgent.RegionID = Scene.RegionInfo.RegionID;
--
cgit v1.1
From d4144bedb81346301162f1e20266561fea7b621e Mon Sep 17 00:00:00 2001
From: Jonathan Freedman
Date: Thu, 21 Oct 2010 23:22:15 -0400
Subject: * change the data exchanged within hypergrid transactions
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 +-
.../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 8 ++++----
.../Framework/EntityTransfer/HGEntityTransferModule.cs | 5 ++++-
OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
5 files changed, 14 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index cb298fd..624814a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -631,7 +631,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
IClientAPI client;
if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
{
- //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
+ m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
return;
}
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 54cc80f..925af3f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -197,8 +197,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.ControllingClient.SendTeleportFailed("Problem at destination");
return;
}
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}",
- finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID);
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} {2}@{3}",
+ finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID, finalDestination.ServerURI);
// Check that these are not the same coordinates
if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX &&
@@ -254,8 +254,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
m_log.DebugFormat(
- "[ENTITY TRANSFER MODULE]: Request Teleport to {0}:{1}:{2}/{3}",
- reg.ExternalHostName, reg.HttpPort, finalDestination.RegionName, position);
+ "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}",
+ reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
uint newRegionX = (uint)(reg.RegionHandle >> 40);
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 1ac7508..9a275ae 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -123,7 +123,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
- return m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
+ GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
+ m_log.Debug("GetfinalDestination serveruri -> " + real_destination.ServerURI);
+ return real_destination;
}
return region;
}
@@ -149,6 +151,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
{
+ m_log.Debug("CreateAgent " + reg.ServerURI + " " + finalDestination.ServerURI);
reason = string.Empty;
logout = false;
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0cfc235..2750168 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3740,9 +3740,12 @@ namespace OpenSim.Region.Framework.Scenes
// We have to wait until the viewer contacts this region after receiving EAC.
// That calls AddNewClient, which finally creates the ScenePresence
+ m_log.Debug("ICADU -> pre wait");
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
+ m_log.Debug("ICADU -> post wait");
if (childAgentUpdate != null)
{
+ m_log.Debug("ICADU -> not child agent!");
childAgentUpdate.ChildAgentDataUpdate(cAgentData);
return true;
}
@@ -3758,7 +3761,7 @@ namespace OpenSim.Region.Framework.Scenes
/// true if we handled it.
public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData)
{
- //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
+ m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null)
{
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c223b4b..68ac178 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2925,7 +2925,7 @@ namespace OpenSim.Region.Framework.Scenes
public void ChildAgentDataUpdate(AgentData cAgentData)
{
- //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
+ m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
if (!IsChildAgent)
return;
--
cgit v1.1
From 6049e548a5eb33adc41141c365acffd73642b600 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 21 Oct 2010 07:19:10 +0100
Subject: Skip empty strings in ParseString* functions
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 8bf9482..cc6ded7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8404,6 +8404,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
for (j = 0; j < seplen; j++)
{
+ if (separray[j].ToString() == String.Empty)
+ active[j] = false;
+
if (active[j])
{
// scan all of the markers
@@ -8432,6 +8435,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
{
+ if (spcarray[j].ToString() == String.Empty)
+ active[j] = false;
+
if (active[j])
{
// scan all of the markers
--
cgit v1.1
From 753137e9ad1c26fa948c51644dc9c1e80ecc0d5f Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 21 Oct 2010 09:30:09 +0100
Subject: Fix the OOB error (#5102). Sorry, my bad.
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index cc6ded7..92523d4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8435,7 +8435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
{
- if (spcarray[j].ToString() == String.Empty)
+ if (spcarray[j-seplen].ToString() == String.Empty)
active[j] = false;
if (active[j])
--
cgit v1.1
From 170c5d183bdfc6c9b8029ef70deede48bf99cfeb Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 21 Oct 2010 13:21:46 +0100
Subject: Remove a bit of dead code relating to ObjectCapacity
---
OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 2 --
1 file changed, 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index 7e1b5ac..b84a34d 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -83,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
// private int m_stipend = 1000;
-// private int ObjectCapacity = 45000;
private int ObjectCount = 0;
private int PriceEnergyUnit = 0;
private int PriceGroupCreate = 0;
@@ -135,7 +134,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
public void AddRegion(Scene scene)
{
- // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
if (m_enabled)
{
scene.RegisterModuleInterface(this);
--
cgit v1.1
From 004b395d12b4e369005a4f4a0a44a86bd278e781 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 21 Oct 2010 15:36:32 +0100
Subject: Make SImStatsReporter pick ObjectCapacity striaght out of region info
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 --
OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 10 +++-------
2 files changed, 3 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0cfc235..c9ae558 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -599,8 +599,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.OnSendStatsResult += SendSimStatsPackets;
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
- StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity);
-
// Old
/*
m_simulatorVersion = simulatorVersion
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index fd23294..87dcdee 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_activeScripts = 0;
private int m_scriptLinesPerSecond = 0;
- private int objectCapacity = 45000;
+ private int m_objectCapacity = 45000;
private Scene m_scene;
@@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene = scene;
ReportingRegion = scene.RegionInfo;
+ m_objectCapacity = scene.RegionInfo.ObjectCapacity;
m_report.AutoReset = true;
m_report.Interval = statsUpdatesEveryMS;
m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
@@ -271,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
SimStats simStats
= new SimStats(
- ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
+ ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
handlerSendStatResult = OnSendStatsResult;
if (handlerSendStatResult != null)
@@ -435,11 +436,6 @@ namespace OpenSim.Region.Framework.Scenes
m_activeScripts = count;
}
- public void SetObjectCapacity(int objects)
- {
- objectCapacity = objects;
- }
-
///
/// This is for llGetRegionFPS
///
--
cgit v1.1
From 481a44104edd2ec24b92a97dbc1766be2fb1dc70 Mon Sep 17 00:00:00 2001
From: AdelleF
Date: Thu, 21 Oct 2010 20:16:30 +0100
Subject: This fixes a delay in llSetLinkPrimitiveParamsFast
Signed-off-by: dahlia
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 92523d4..e6092d4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6892,7 +6892,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
{
- llSetLinkPrimitiveParams(linknumber, rules);
+ m_host.AddScriptLPS(1);
+
+ List parts = GetLinkParts(linknumber);
+
+ foreach (SceneObjectPart part in parts)
+ SetPrimParams(part, rules);
}
protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
--
cgit v1.1
From e06acae965d918ac0ece14a8aae2e1cf5be37d07 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 21 Oct 2010 22:04:31 +0100
Subject: Allow region modules to know which agents actually receive chat
---
.../Region/CoreModules/Avatar/Chat/ChatModule.cs | 44 ++++++++++++++++++----
OpenSim/Region/Framework/Scenes/EventManager.cs | 35 +++++++++++++++++
2 files changed, 71 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index ef5efdd..d76ff47 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// sanity check:
if (c.Sender == null)
{
- m_log.ErrorFormat("[CHAT] OnChatFromClient from {0} has empty Sender field!", sender);
+ m_log.ErrorFormat("[CHAT]: OnChatFromClient from {0} has empty Sender field!", sender);
return;
}
@@ -220,17 +220,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
if (message.Length >= 1000) // libomv limit
message = message.Substring(0, 1000);
- // m_log.DebugFormat("[CHAT]: DCTA: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, c.Type, sourceType);
+// m_log.DebugFormat(
+// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
+// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
+ HashSet receiverIDs = new HashSet();
+
foreach (Scene s in m_scenes)
{
s.ForEachScenePresence(
delegate(ScenePresence presence)
{
- TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
+ if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
+ receiverIDs.Add(presence.UUID);
}
);
}
+
+ (scene as Scene).EventManager.TriggerOnChatToClients(
+ fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
}
static private Vector3 CenterOfRegion = new Vector3(128, 128, 30);
@@ -269,6 +277,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
+ HashSet receiverIDs = new HashSet();
+
((Scene)c.Scene).ForEachScenePresence(
delegate(ScenePresence presence)
{
@@ -286,16 +296,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
+ receiverIDs.Add(presence.UUID);
});
+
+ (c.Scene as Scene).EventManager.TriggerOnChatToClients(
+ fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
}
-
- protected virtual void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
+ ///
+ /// Try to send a message to the given presence
+ ///
+ /// The receiver
+ ///
+ /// /param>
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// true if the message was sent to the receiver, false if it was not sent due to failing a
+ /// precondition
+ protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
UUID fromAgentID, string fromName, ChatTypeEnum type,
string message, ChatSourceType src)
{
// don't send stuff to child agents
- if (presence.IsChildAgent) return;
+ if (presence.IsChildAgent) return false;
Vector3 fromRegionPos = fromPos + regionPos;
Vector3 toRegionPos = presence.AbsolutePosition +
@@ -308,12 +334,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
type == ChatTypeEnum.Say && dis > m_saydistance ||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
{
- return;
+ return false;
}
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
- fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
+ fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully);
+
+ return true;
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 437b91a..4feb3fc 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -293,6 +293,17 @@ namespace OpenSim.Region.Framework.Scenes
public event ChatFromClientEvent OnChatFromClient;
///
+ /// ChatToClientsEvent is triggered via ChatModule (or
+ /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
+ /// received chat message if they satisfy various conditions (within audible range, etc.)
+ ///
+ public delegate void ChatToClientsEvent(
+ UUID senderID, HashSet receiverIDs,
+ string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
+ ChatSourceType src, ChatAudibleLevel level);
+ public event ChatToClientsEvent OnChatToClients;
+
+ ///
/// ChatBroadcastEvent is called via Scene when a broadcast chat message
/// from world comes in
///
@@ -1603,6 +1614,30 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+
+ public void TriggerOnChatToClients(
+ UUID senderID, HashSet receiverIDs,
+ string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
+ ChatSourceType src, ChatAudibleLevel level)
+ {
+ ChatToClientsEvent handler = OnChatToClients;
+ if (handler != null)
+ {
+ foreach (ChatToClientsEvent d in handler.GetInvocationList())
+ {
+ try
+ {
+ d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat(
+ "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
+ e.Message, e.StackTrace);
+ }
+ }
+ }
+ }
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
{
--
cgit v1.1
From 460b9fffe5e0d5f7f339ce490619067677b4136f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 18:39:40 +0100
Subject: write IAR control file first in the archive rather than last
---
.../Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 10 ++++++----
.../World/Archiver/ArchiveWriteRequestPreparation.cs | 3 ++-
2 files changed, 8 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index bae5a7a..f385a2a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -123,9 +123,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
try
{
- // We're almost done. Just need to write out the control file now
- m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
- m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
m_archiveWriter.Close();
}
catch (Exception e)
@@ -216,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public void Execute()
{
try
- {
+ {
InventoryFolderBase inventoryFolder = null;
InventoryItemBase inventoryItem = null;
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
@@ -277,6 +274,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_archiveWriter = new TarArchiveWriter(m_saveStream);
+ // Write out control file. This has to be done first so that subsequent loaders will see this file first
+ // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
+ m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
+ m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
+
if (inventoryFolder != null)
{
m_log.DebugFormat(
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 43789af..1687d06 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -171,7 +171,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
- // Write out control file
+ // Write out control file. This has to be done first so that subsequent loaders will see this file first
+ // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options));
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
--
cgit v1.1
From 772dbf59f37959a61681b487ded412ebdda8041a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 18:47:38 +0100
Subject: slightly simplify oar control file loading code
---
.../Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index f1f5258..9192f43 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -483,15 +483,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
///
private void LoadControlFile(string path, byte[] data)
{
- //Create the XmlNamespaceManager.
- NameTable nt = new NameTable();
- XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
-
- // Create the XmlParserContext.
+ XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
-
- XmlTextReader xtr
- = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
+ XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
@@ -530,10 +524,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString();
}
}
-
}
currentRegionSettings.Save();
}
}
-}
+}
\ No newline at end of file
--
cgit v1.1
From 607c07b4aab2a194102832a1e380cfbabe11d078 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 19:24:42 +0100
Subject: start parsing iar control file
This change requires a prebuild[.sh|.bat] since a System.Xml.Linq reference is added to prebuild.xml
---
.../Archiver/InventoryArchiveReadRequest.cs | 20 +++++++++++++++++++-
.../CoreModules/World/Archiver/ArchiveReadRequest.cs | 2 +-
2 files changed, 20 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index c1df827..2beea8e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -33,6 +33,7 @@ using System.Reflection;
using System.Threading;
using System.Text;
using System.Xml;
+using System.Xml.Linq;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
@@ -133,7 +134,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
{
- if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
+ if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
+ {
+ LoadControlFile(filePath, data);
+ }
+ else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
{
if (LoadAsset(filePath, data))
successfulAssetRestores++;
@@ -461,5 +466,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return false;
}
}
+
+ ///
+ /// Load control file
+ ///
+ ///
+ ///
+ protected void LoadControlFile(string path, byte[] data)
+ {
+ XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
+ XElement archiveElement = doc.Element("archive");
+ int.Parse(archiveElement.Attribute("major_version").Value);
+ int.Parse(archiveElement.Attribute("minor_version").Value);
+ }
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 9192f43..087d3df 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -481,7 +481,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
///
///
///
- private void LoadControlFile(string path, byte[] data)
+ protected void LoadControlFile(string path, byte[] data)
{
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
--
cgit v1.1
From bdd6857006906227470e296161483a7839cb8b91 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 19:30:15 +0100
Subject: Implement guard against trying to load incompatible version IARs
---
.../Archiver/InventoryArchiveReadRequest.cs | 21 +++++++++++++++++++--
.../World/Archiver/ArchiveReadRequest.cs | 2 +-
2 files changed, 20 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 2beea8e..5500557 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ ///
+ /// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version
+ /// bumps here should be compatible.
+ ///
+ public static int MAX_MAJOR_VERSION = 0;
+
protected TarArchiveReader archive;
private UserAccount m_userInfo;
@@ -476,8 +482,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
XElement archiveElement = doc.Element("archive");
- int.Parse(archiveElement.Attribute("major_version").Value);
- int.Parse(archiveElement.Attribute("minor_version").Value);
+ int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
+ int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
+ string version = string.Format("{0}.{1}", majorVersion, minorVersion);
+
+ if (majorVersion > MAX_MAJOR_VERSION)
+ {
+ throw new Exception(
+ string.Format(
+ "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
+ majorVersion, MAX_MAJOR_VERSION));
+ }
+
+ m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
}
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 087d3df..117b2fd 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
///
- /// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version
+ /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version
/// bumps here should be compatible.
///
public static int MAX_MAJOR_VERSION = 0;
--
cgit v1.1
From a7a8fdc7dafb01f9c7689cdc95add52446a16d89 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 19:34:06 +0100
Subject: print IAR version number on console when saving
---
.../Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index f385a2a..249a8b4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -401,13 +401,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
///
public static string Create0p1ControlFile()
{
+ int majorVersion = 0, minorVersion = 1;
+
+ m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
+
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
xtw.Formatting = Formatting.Indented;
xtw.WriteStartDocument();
xtw.WriteStartElement("archive");
- xtw.WriteAttributeString("major_version", "0");
- xtw.WriteAttributeString("minor_version", "1");
+ xtw.WriteAttributeString("major_version", majorVersion.ToString());
+ xtw.WriteAttributeString("minor_version", minorVersion.ToString());
xtw.WriteEndElement();
xtw.Flush();
--
cgit v1.1
From d58967be580afa9c349c29261fd7f845faf558e4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 22 Oct 2010 21:28:10 +0100
Subject: Fix llParcelMediaCommandList() so that it applies commands only to
the parcel that the script is in, not all parcels.
Patch from http://opensimulator.org/mantis/view.php?id=2738
Thanks snoopy and fineman.
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e6092d4..59a3618 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9101,10 +9101,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// do that one last, it will cause a ParcelPropertiesUpdate
landObject.SetMediaUrl(url);
- // now send to all (non-child) agents
+ // now send to all (non-child) agents in the parcel
World.ForEachScenePresence(delegate(ScenePresence sp)
{
- if (!sp.IsChildAgent)
+ if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
{
sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
landData.MediaID,
@@ -9134,10 +9134,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// the commandList contained a start/stop/... command, too
if (presence == null)
{
- // send to all (non-child) agents
+ // send to all (non-child) agents in the parcel
World.ForEachScenePresence(delegate(ScenePresence sp)
{
- if (!sp.IsChildAgent)
+ if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
{
sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
(ParcelMediaCommandEnum)commandToSend,
--
cgit v1.1