From cacc02883526d6913be13d745215d7367708412e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 17 Nov 2011 21:03:08 +0000
Subject: If the entire simulator is shutting down then don't bother to unload
the scripts from the appdomain in XEngine.
All the other actions (script state save, etc.) still occur.
This makes shutdown where there are many scripts vastly quicker.
---
OpenSim/Region/Framework/Scenes/EventManager.cs | 26 +++++++++++++++----------
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 26 ++++++++++++++++++-------
2 files changed, 35 insertions(+), 17 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 4906665..4a4d98f 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -98,9 +98,10 @@ namespace OpenSim.Region.Framework.Scenes
public event OnPluginConsoleDelegate OnPluginConsole;
- public delegate void OnShutdownDelegate();
-
- public event OnShutdownDelegate OnShutdown;
+ ///
+ /// Triggered when the entire simulator is shutdown.
+ ///
+ public event Action OnShutdown;
public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
public delegate void ScriptResetDelegate(uint localID, UUID itemID);
@@ -113,9 +114,14 @@ namespace OpenSim.Region.Framework.Scenes
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
- public delegate void SceneShuttingDownDelegate(Scene scene);
-
- public event SceneShuttingDownDelegate OnSceneShuttingDown;
+ ///
+ /// Triggered when an individual scene is shutdown.
+ ///
+ ///
+ /// This does not automatically mean that the entire simulator is shutting down. Listen to OnShutdown for that
+ /// notification.
+ ///
+ public event Action OnSceneShuttingDown;
///
/// Fired when an object is touched/grabbed.
@@ -869,10 +875,10 @@ namespace OpenSim.Region.Framework.Scenes
public void TriggerShutdown()
{
- OnShutdownDelegate handlerShutdown = OnShutdown;
+ Action handlerShutdown = OnShutdown;
if (handlerShutdown != null)
{
- foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList())
+ foreach (Action d in handlerShutdown.GetInvocationList())
{
try
{
@@ -2212,10 +2218,10 @@ namespace OpenSim.Region.Framework.Scenes
public void TriggerSceneShuttingDown(Scene s)
{
- SceneShuttingDownDelegate handler = OnSceneShuttingDown;
+ Action handler = OnSceneShuttingDown;
if (handler != null)
{
- foreach (SceneShuttingDownDelegate d in handler.GetInvocationList())
+ foreach (Action d in handler.GetInvocationList())
{
try
{
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 1c16c87..12e1a78 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -90,6 +90,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private bool m_KillTimedOutScripts;
private string m_ScriptEnginesPath = null;
+ ///
+ /// Is the entire simulator in the process of shutting down?
+ ///
+ private bool m_SimulatorShuttingDown;
+
private static List m_ScriptEngines =
new List();
@@ -470,17 +475,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine
//
instance.DestroyScriptInstance();
- // Unload scripts and app domains
+ // Unload scripts and app domains.
// Must be done explicitly because they have infinite
- // lifetime
- //
- m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
- if (m_DomainScripts[instance.AppDomain].Count == 0)
+ // lifetime.
+ // However, don't bother to do this if the simulator is shutting
+ // down since it takes a long time with many scripts.
+ if (!m_SimulatorShuttingDown)
{
- m_DomainScripts.Remove(instance.AppDomain);
- UnloadAppDomain(instance.AppDomain);
+ m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
+ if (m_DomainScripts[instance.AppDomain].Count == 0)
+ {
+ m_DomainScripts.Remove(instance.AppDomain);
+ UnloadAppDomain(instance.AppDomain);
+ }
}
}
+
m_Scripts.Clear();
m_PrimObjects.Clear();
m_Assemblies.Clear();
@@ -1428,6 +1438,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void OnShutdown()
{
+ m_SimulatorShuttingDown = true;
+
List instances = new List();
lock (m_Scripts)
--
cgit v1.1
From 352672eaf2d07a210d2d0de97944dac48250828d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 17 Nov 2011 22:13:32 +0000
Subject: Make "terrain save" more friendly by telling the user if we have
saved and putting out a useful complaint message if we haven't for some
reason
---
.../CoreModules/World/Terrain/TerrainModule.cs | 50 ++++++++++++++--------
1 file changed, 32 insertions(+), 18 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index c832520..428440e 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -86,6 +86,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
private volatile bool m_tainted;
private readonly Stack m_undo = new Stack(5);
+ ///
+ /// Human readable list of terrain file extensions that are supported.
+ ///
+ private string m_supportedFileExtensions = "";
+
#region ICommandableModule Members
public ICommander CommandInterface
@@ -135,6 +140,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain
InstallDefaultEffects();
LoadPlugins();
+
+ // Generate user-readable extensions list
+ string supportedFilesSeparator = "";
+
+ foreach (KeyValuePair loader in m_loaders)
+ {
+ m_supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")";
+ supportedFilesSeparator = ", ";
+ }
}
public void RegionLoaded(Scene scene)
@@ -251,20 +265,20 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (filename.EndsWith(loader.Key))
{
loader.Value.SaveFile(filename, m_channel);
+ m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename);
return;
}
}
}
- catch (NotImplementedException)
- {
- m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented.");
- throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented"));
- }
catch (IOException ioe)
{
m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message));
throw new TerrainException(String.Format("Unable to save heightmap: {0}", ioe.Message));
}
+
+ m_log.ErrorFormat(
+ "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
+ m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
}
///
@@ -345,6 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
float duration = 0.25f;
if (action == 0)
duration = 4.0f;
+
client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
}
@@ -534,6 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_channel = channel;
UpdateRevertMap();
}
+
return;
}
}
@@ -566,10 +582,17 @@ namespace OpenSim.Region.CoreModules.World.Terrain
fileWidth, fileHeight,
(int)Constants.RegionSize,
(int)Constants.RegionSize);
+
+ m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename);
}
+
return;
}
}
+
+ m_log.ErrorFormat(
+ "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
+ m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
}
}
@@ -1124,32 +1147,23 @@ namespace OpenSim.Region.CoreModules.World.Terrain
private void InstallInterfaces()
{
- // Load / Save
- string supportedFileExtensions = "";
- string supportedFilesSeparator = "";
- foreach (KeyValuePair loader in m_loaders)
- {
- supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")";
- supportedFilesSeparator = ", ";
- }
-
Command loadFromFileCommand =
new Command("load", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadFile, "Loads a terrain from a specified file.");
loadFromFileCommand.AddArgument("filename",
"The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " +
- supportedFileExtensions, "String");
+ m_supportedFileExtensions, "String");
Command saveToFileCommand =
new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveFile, "Saves the current heightmap to a specified file.");
saveToFileCommand.AddArgument("filename",
"The destination filename for your heightmap, the file extension determines the format to save in. Supported extensions include: " +
- supportedFileExtensions, "String");
+ m_supportedFileExtensions, "String");
Command loadFromTileCommand =
new Command("load-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadTileFile, "Loads a terrain from a section of a larger file.");
loadFromTileCommand.AddArgument("filename",
"The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " +
- supportedFileExtensions, "String");
+ m_supportedFileExtensions, "String");
loadFromTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
loadFromTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
loadFromTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
@@ -1161,7 +1175,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file.");
saveToTileCommand.AddArgument("filename",
"The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " +
- supportedFileExtensions, "String");
+ m_supportedFileExtensions, "String");
saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
--
cgit v1.1
From 9c928e9dc63a03e652aa5614fc1053351aad0ed1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 17 Nov 2011 22:15:46 +0000
Subject: For TerrainModule.SaveToFile(), don't bother throwing the exception
onwards after printing out the error, since this method is invoked by users.
Still throwing the exception on the stream method since this invoked programatically
---
OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 428440e..cf000a4 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -273,7 +273,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
catch (IOException ioe)
{
m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message));
- throw new TerrainException(String.Format("Unable to save heightmap: {0}", ioe.Message));
}
m_log.ErrorFormat(
--
cgit v1.1
From 01ae916bad672722aa62ee712b7b580d6f5f4370 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 00:07:34 +0000
Subject: Don't register a region twice on both official registration and
maptile regeneration.
Maptile storage appears orthogonal to region registration
---
OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++-------
.../Services/Connectors/MapImage/MapImageServiceConnector.cs | 4 +++-
OpenSim/Services/GridService/GridService.cs | 1 +
OpenSim/Services/MapImageService/MapImageService.cs | 2 ++
4 files changed, 11 insertions(+), 8 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f10789b..47450ed 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5017,18 +5017,16 @@ namespace OpenSim.Region.Framework.Scenes
return offsets.ToArray();
}
+ ///
+ /// Regenerate the maptile for this scene.
+ ///
+ ///
+ ///
public void RegenerateMaptile(object sender, ElapsedEventArgs e)
{
IWorldMapModule mapModule = RequestModuleInterface();
if (mapModule != null)
- {
mapModule.GenerateMaptile();
-
- string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
-
- if (error != String.Empty)
- throw new Exception(error);
- }
}
// This method is called across the simulation connector to
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
index 69e2d17..e46714e 100644
--- a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
+++ b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
@@ -129,7 +129,9 @@ namespace OpenSim.Services.Connectors
}
else
- m_log.DebugFormat("[MAP IMAGE CONNECTOR]: RegisterRegion received null reply");
+ {
+ m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply");
+ }
}
catch (Exception e)
{
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 05cfe5f..768e4e1 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -156,6 +156,7 @@ namespace OpenSim.Services.GridService
regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
return "Region overlaps another region";
}
+
if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
{
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index 7e7391c..83727b6 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -138,6 +138,8 @@ namespace OpenSim.Services.MapImageService
public byte[] GetMapTile(string fileName, out string format)
{
+// m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName);
+
format = ".jpg";
string fullName = Path.Combine(m_TilesStoragePath, fileName);
if (File.Exists(fullName))
--
cgit v1.1
From 7a180781778a6369799c244ab95f5e6844b3be05 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 00:10:29 +0000
Subject: improve region deregistration log message
---
OpenSim/Services/GridService/GridService.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 768e4e1..82a9193 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -244,11 +244,14 @@ namespace OpenSim.Services.GridService
public bool DeregisterRegion(UUID regionID)
{
- m_log.DebugFormat("[GRID SERVICE]: Region {0} deregistered", regionID);
RegionData region = m_Database.Get(regionID, UUID.Zero);
if (region == null)
return false;
+ m_log.DebugFormat(
+ "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
+ region.RegionName, region.RegionID, region.posX, region.posY);
+
int flags = Convert.ToInt32(region.Data["flags"]);
if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0)
--
cgit v1.1
From d05d065d859c8877cb910cf5748e32e1560086a6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 00:29:52 +0000
Subject: Improve some grid region log messages to express regions at
co-ordinate (e.g. 1000, 1000) rather than meter positions (256000, 256000)
---
OpenSim/Data/IRegionData.cs | 20 ++++++++++++++++++++
.../Server/Handlers/Map/MapAddServerConnector.cs | 14 +++++++++-----
OpenSim/Services/GridService/GridService.cs | 6 +++---
OpenSim/Services/Interfaces/IGridService.cs | 21 +++++++++++++++++----
OpenSim/Services/MapImageService/MapImageService.cs | 2 +-
5 files changed, 50 insertions(+), 13 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 46dc4fb..4761a7a 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -37,10 +37,30 @@ namespace OpenSim.Data
public UUID RegionID;
public UUID ScopeID;
public string RegionName;
+
+ ///
+ /// The position in meters of this region.
+ ///
public int posX;
+
+ ///
+ /// The position in meters of this region.
+ ///
public int posY;
+
public int sizeX;
public int sizeY;
+
+ ///
+ /// Return the x-coordinate of this region. We currently assume that every region is the same size.
+ ///
+ public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } }
+
+ ///
+ /// Return the y-coordinate of this region. We currently assume that every region is the same size.
+ ///
+ public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } }
+
public Dictionary Data;
}
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 99f98b6..8291107 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Server.Handlers.MapImage
public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
+// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
StreamReader sr = new StreamReader(requestData);
string body = sr.ReadToEnd();
sr.Close();
@@ -97,9 +97,14 @@ namespace OpenSim.Server.Handlers.MapImage
int x = 0, y = 0;
Int32.TryParse(request["X"].ToString(), out x);
Int32.TryParse(request["Y"].ToString(), out y);
- string type = "image/jpeg";
- if (request.ContainsKey("TYPE"))
- type = request["TYPE"].ToString();
+
+ m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y);
+
+// string type = "image/jpeg";
+//
+// if (request.ContainsKey("TYPE"))
+// type = request["TYPE"].ToString();
+
byte[] data = Convert.FromBase64String(request["DATA"].ToString());
string reason = string.Empty;
@@ -117,7 +122,6 @@ namespace OpenSim.Server.Handlers.MapImage
}
return FailureResult("Unexpected server error");
-
}
private byte[] SuccessResult()
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 82a9193..eae10e8 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -237,7 +237,7 @@ namespace OpenSim.Services.GridService
}
m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
- regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
+ regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
return String.Empty;
}
@@ -250,8 +250,8 @@ namespace OpenSim.Services.GridService
m_log.DebugFormat(
"[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
- region.RegionName, region.RegionID, region.posX, region.posY);
-
+ region.RegionName, region.RegionID, region.coordX, region.coordY);
+
int flags = Convert.ToInt32(region.Data["flags"]);
if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0)
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 41dd20c..7137f9a 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -103,9 +103,8 @@ namespace OpenSim.Services.Interfaces
int GetRegionFlags(UUID scopeID, UUID regionID);
}
- public class GridRegion : Object
+ public class GridRegion
{
-
///
/// The port by which http communication occurs with the region
///
@@ -149,6 +148,19 @@ namespace OpenSim.Services.Interfaces
protected IPEndPoint m_internalEndPoint;
+ ///
+ /// The co-ordinate of this region.
+ ///
+ public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } }
+
+ ///
+ /// The co-ordinate of this region
+ ///
+ public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } }
+
+ ///
+ /// The location of this region in meters.
+ ///
public int RegionLocX
{
get { return m_regionLocX; }
@@ -156,6 +168,9 @@ namespace OpenSim.Services.Interfaces
}
protected int m_regionLocX;
+ ///
+ /// The location of this region in meters.
+ ///
public int RegionLocY
{
get { return m_regionLocY; }
@@ -407,8 +422,6 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("Token"))
Token = kvp["Token"].ToString();
-
}
}
-
}
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index 83727b6..a85ee70 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -208,7 +208,7 @@ namespace OpenSim.Services.MapImageService
private bool CreateTile(uint zoomLevel, int x, int y)
{
- m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
+// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2);
int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1);
--
cgit v1.1
From b89534ad0a8a0be24f27634b9a198e2b53f129e0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 00:34:13 +0000
Subject: Remove mono compiler warnings. Fix problem with co-ordinate given in
deregister region message
---
OpenSim/Data/IRegionData.cs | 10 +++++-----
.../Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | 2 --
OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | 6 ++++--
3 files changed, 9 insertions(+), 9 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 4761a7a..0068daa 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -47,19 +47,19 @@ namespace OpenSim.Data
/// The position in meters of this region.
///
public int posY;
-
+
public int sizeX;
public int sizeY;
///
- /// Return the x-coordinate of this region. We currently assume that every region is the same size.
+ /// Return the x-coordinate of this region.
///
- public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } }
+ public int coordX { get { return (sizeX != 0) ? posX / (int)Constants.RegionSize : -1; } }
///
- /// Return the y-coordinate of this region. We currently assume that every region is the same size.
+ /// Return the y-coordinate of this region.
///
- public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } }
+ public int coordY { get { return (sizeY != 0) ? posY / (int)Constants.RegionSize : -1; } }
public Dictionary Data;
}
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
index 5c89d0f..56f130e 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
@@ -99,7 +99,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
}
return FailureResult();
-
}
#region Method-specific handlers
@@ -127,7 +126,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
return FailureResult();
}
- string perms = "0";
FriendInfo[] friendsInfo = m_FriendsService.GetFriends(principalID);
foreach (FriendInfo finfo in friendsInfo)
{
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
index e8a424f..501074d 100644
--- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
@@ -42,7 +42,8 @@ namespace OpenSim.Server.Handlers.MapImage
{
public class MapGetServiceConnector : ServiceConnector
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
private IMapImageService m_MapService;
private string m_ConfigName = "MapImageService";
@@ -69,7 +70,8 @@ namespace OpenSim.Server.Handlers.MapImage
class MapServerGetHandler : BaseStreamHandler
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
private IMapImageService m_MapService;
public MapServerGetHandler(IMapImageService service) :
--
cgit v1.1
From 10a23a823edb261af2c0b7895ce0898ea6918ef1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 01:16:07 +0000
Subject: Get rid of the spurious [WEB UTIL] couldn't decode : Invalid character 'O' in input string
messages
These are just the result of an attempt to canonicalize received messages - it's not important that we constantly log them.
Also finally get the deregister grid service message working properly
---
OpenSim/Data/IRegionData.cs | 4 ++--
OpenSim/Framework/WebUtil.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 8 ++++++--
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 3 +--
.../Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +-
OpenSim/Services/GridService/GridService.cs | 4 ++--
6 files changed, 13 insertions(+), 10 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 0068daa..546b5e8 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -54,12 +54,12 @@ namespace OpenSim.Data
///
/// Return the x-coordinate of this region.
///
- public int coordX { get { return (sizeX != 0) ? posX / (int)Constants.RegionSize : -1; } }
+ public int coordX { get { return posX / (int)Constants.RegionSize; } }
///
/// Return the y-coordinate of this region.
///
- public int coordY { get { return (sizeY != 0) ? posY / (int)Constants.RegionSize : -1; } }
+ public int coordY { get { return posY / (int)Constants.RegionSize; } }
public Dictionary Data;
}
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index cafa441..c6be79e 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -297,7 +297,7 @@ namespace OpenSim.Framework
catch (Exception e)
{
// don't need to treat this as an error... we're just guessing anyway
- m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message);
+// m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message);
}
return result;
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 0e22156..d76ed3e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -174,7 +174,6 @@ namespace OpenSim.Region.Framework.Scenes
{
// We're ignoring a collection was modified error because this data gets old and outdated fast.
}
-
}
///
@@ -182,13 +181,18 @@ namespace OpenSim.Region.Framework.Scenes
///
protected void SendCloseChildAgent(UUID agentID, ulong regionHandle)
{
- m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
// let's do our best, but there's not much we can do if the neighbour doesn't accept.
//m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID);
uint x = 0, y = 0;
Utils.LongToUInts(regionHandle, out x, out y);
+
GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y);
+
+ m_log.DebugFormat(
+ "[INTERGRID]: Sending close agent {0} to region at {1}-{2}",
+ agentID, destination.RegionCoordX, destination.RegionCoordY);
+
m_scene.SimulationService.CloseAgent(destination, agentID);
}
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index e8ae05b..b65a443 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -220,14 +220,13 @@ namespace OpenSim.Server.Handlers.Simulation
responsedata["int_response_code"] = HttpStatusCode.OK;
responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
- m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted.");
+ m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID);
}
protected virtual void ReleaseAgent(UUID regionID, UUID id)
{
m_SimulationService.ReleaseAgent(regionID, id, "");
}
-
}
public class AgentPostHandler : BaseStreamHandler
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 7cbd361..c45f456 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -369,7 +369,7 @@ namespace OpenSim.Services.Connectors.Simulation
///
public bool CloseAgent(GridRegion destination, UUID id)
{
- // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start");
+// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start");
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index eae10e8..89f0716 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -249,7 +249,7 @@ namespace OpenSim.Services.GridService
return false;
m_log.DebugFormat(
- "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
+ "[GRID SERVICE]: Deregistering region {0} ({1}) at {2}-{3}",
region.RegionName, region.RegionID, region.coordX, region.coordY);
int flags = Convert.ToInt32(region.Data["flags"]);
@@ -296,7 +296,7 @@ namespace OpenSim.Services.GridService
}
}
- m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
+// m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
}
else
{
--
cgit v1.1
From 726ca72c479dc5c9510631e675c932f1331e92bb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 01:27:06 +0000
Subject: minor: Make HelloNeighbour messages more informative
---
.../Neighbour/LocalNeighbourServiceConnector.cs | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
index f71bf46..40cc536 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
@@ -25,11 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using log4net;
-using Nini.Config;
using System;
using System.Collections.Generic;
using System.Reflection;
+using log4net;
+using Nini.Config;
+using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Server.Base;
using OpenSim.Region.Framework.Interfaces;
@@ -119,10 +120,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
#region INeighbourService
- public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
+ public OpenSim.Services.Interfaces.GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion)
{
- m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.",
- thisRegion.RegionName, regionHandle);
+ uint x, y;
+ Utils.LongToUInts(regionHandle, out x, out y);
+
+ m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from region {0} to region at {1}-{2}",
+ thisRegion.RegionName, x / Constants.RegionSize, y / Constants.RegionSize);
+
foreach (Scene s in m_Scenes)
{
if (s.RegionInfo.RegionHandle == regionHandle)
--
cgit v1.1
From 2206e2fc9680240ce8ddad985998febc18896850 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 01:32:21 +0000
Subject: Remove the "[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for
SendCreateChildAgent" message
This is misleading since a simulator will call this method before successfully trying remote regions.
Also comments out spammy "[SIMULATION]: Stream handler called" AgentHandlers messages for now.
---
.../ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 1 -
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 2cf02b5..a17c6ae 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -196,7 +196,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
}
}
- m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for SendCreateChildAgent", destination.RegionName);
reason = "Did not find region " + destination.RegionName;
return false;
}
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index b65a443..fdb4967 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -251,7 +251,7 @@ namespace OpenSim.Server.Handlers.Simulation
public override byte[] Handle(string path, Stream request,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- m_log.DebugFormat("[SIMULATION]: Stream handler called");
+// m_log.DebugFormat("[SIMULATION]: Stream handler called");
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -438,7 +438,7 @@ namespace OpenSim.Server.Handlers.Simulation
public override byte[] Handle(string path, Stream request,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
- m_log.DebugFormat("[SIMULATION]: Stream handler called");
+// m_log.DebugFormat("[SIMULATION]: Stream handler called");
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
--
cgit v1.1