Change the map tile system to be multi-grid hosting compatible

This commit is contained in:
Melanie Thielker
2014-08-23 17:27:01 +02:00
parent f06f13b59d
commit cbd7c7b9ec
7 changed files with 49 additions and 28 deletions

View File

@@ -117,8 +117,11 @@ namespace OpenSim.Server.Handlers.MapImage
return FailureResult("Bad request.");
}
int x = 0, y = 0;
UUID scopeID = new UUID("07f8d88e-cd5e-4239-a0ed-843f75d09992");
Int32.TryParse(request["X"].ToString(), out x);
Int32.TryParse(request["Y"].ToString(), out y);
if (request.ContainsKey("SCOPE"))
UUID.TryParse(request["SCOPE"].ToString(), out scopeID);
m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y);
@@ -151,7 +154,7 @@ namespace OpenSim.Server.Handlers.MapImage
byte[] data = Convert.FromBase64String(request["DATA"].ToString());
string reason = string.Empty;
bool result = m_MapService.AddMapTile(x, y, data, out reason);
bool result = m_MapService.AddMapTile(x, y, data, scopeID, out reason);
if (result)
return SuccessResult();

View File

@@ -38,6 +38,7 @@ using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Base;
using OpenMetaverse;
namespace OpenSim.Server.Handlers.MapImage
{
@@ -93,7 +94,16 @@ namespace OpenSim.Server.Handlers.MapImage
byte[] result = new byte[0];
string format = string.Empty;
result = m_MapService.GetMapTile(path.Trim('/'), out format);
UUID scopeID = new UUID("07f8d88e-cd5e-4239-a0ed-843f75d09992");
string[] bits = path.Trim('/').Split(new char[] {'/'});
if (bits.Length > 1)
{
scopeID = new UUID(bits[0]);
path = bits[1];
}
result = m_MapService.GetMapTile(path.Trim('/'), scopeID, out format);
if (result.Length > 0)
{
httpResponse.StatusCode = (int)HttpStatusCode.OK;

View File

@@ -119,6 +119,9 @@ namespace OpenSim.Server.Handlers.MapImage
int x = 0, y = 0;
Int32.TryParse(request["X"].ToString(), out x);
Int32.TryParse(request["Y"].ToString(), out y);
UUID scopeID = new UUID("07f8d88e-cd5e-4239-a0ed-843f75d09992");
if (request.ContainsKey("SCOPE"))
UUID.TryParse(request["SCOPE"].ToString(), out scopeID);
m_log.DebugFormat("[MAP REMOVE SERVER CONNECTOR]: Received position data for region at {0}-{1}", x, y);
@@ -144,7 +147,7 @@ namespace OpenSim.Server.Handlers.MapImage
}
string reason = string.Empty;
bool result = m_MapService.RemoveMapTile(x, y, out reason);
bool result = m_MapService.RemoveMapTile(x, y, scopeID, out reason);
if (result)
return SuccessResult();