HG LinkRegion sends region size also

melanie
UbitUmarov 2016-11-20 03:51:38 +00:00
parent 93d502e0cf
commit e2b580e569
3 changed files with 13 additions and 3 deletions

View File

@ -70,13 +70,17 @@ namespace OpenSim.Server.Handlers.Hypergrid
string imageURL = string.Empty;
ulong regionHandle = 0;
string reason = string.Empty;
int sizeX = 256;
int sizeY = 256;
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason);
bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason, out sizeX, out sizeY);
Hashtable hash = new Hashtable();
hash["result"] = success.ToString();
hash["uuid"] = regionID.ToString();
hash["handle"] = regionHandle.ToString();
hash["size_x"] = sizeX;
hash["size_y"] = sizeY;
hash["region_image"] = imageURL;
hash["external_name"] = externalName;

View File

@ -162,10 +162,12 @@ namespace OpenSim.Services.HypergridService
exceptions.Add(s.Trim());
}
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason)
public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)
{
regionID = UUID.Zero;
regionHandle = 0;
sizeX = (int)Constants.RegionSize;
sizeY = (int)Constants.RegionSize;
externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
imageURL = string.Empty;
reason = string.Empty;
@ -199,6 +201,8 @@ namespace OpenSim.Services.HypergridService
regionID = region.RegionID;
regionHandle = region.RegionHandle;
sizeX = region.RegionSizeX;
sizeY = region.RegionSizeY;
string regionimage = "regionImage" + regionID.ToString();
regionimage = regionimage.Replace("-", "");
@ -275,6 +279,7 @@ namespace OpenSim.Services.HypergridService
if (!am.Success)
{
reason = "Login failed: client " + curViewer + " is not allowed";
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", curViewer);
return false;
}
@ -287,6 +292,7 @@ namespace OpenSim.Services.HypergridService
if (dm.Success)
{
reason = "Login failed: client " + curViewer + " is denied";
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer);
return false;
}

View File

@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces
{
public interface IGatekeeperService
{
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY);
/// <summary>
/// Returns the region a Hypergrid visitor should enter.