mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
work on previus 2 patchs
This commit is contained in:
@@ -330,12 +330,6 @@ namespace OpenSim.Services.Connectors
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByNameSpecific(UUID scopeID, string regionName)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
|
||||
@@ -100,8 +100,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
|
||||
#region IGridService
|
||||
|
||||
|
||||
|
||||
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
IPEndPoint ext = regionInfo.ExternalEndPoint;
|
||||
|
||||
@@ -476,9 +476,9 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(name), scopeID);
|
||||
if ((rdatas != null) && (rdatas.Count > 0))
|
||||
return RegionData2RegionInfo(rdatas[0]); // get the first
|
||||
RegionData rdata = m_Database.GetSpecific(name, scopeID);
|
||||
if (rdata != null)
|
||||
return RegionData2RegionInfo(rdata);
|
||||
|
||||
if (m_AllowHypergridMapSearch)
|
||||
{
|
||||
@@ -490,18 +490,7 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
//BA MOD....
|
||||
public GridRegion GetRegionByNameSpecific(UUID scopeID, string name)
|
||||
{
|
||||
RegionData rdata = m_Database.GetSpecific(name, scopeID);
|
||||
if (rdata != null)
|
||||
{
|
||||
return RegionData2RegionInfo(rdata);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
{
|
||||
// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
|
||||
@@ -510,7 +499,7 @@ namespace OpenSim.Services.GridService
|
||||
int count = 0;
|
||||
List<GridRegion> rinfos = new List<GridRegion>();
|
||||
|
||||
if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains("."))
|
||||
if (m_AllowHypergridMapSearch && name.Contains("."))
|
||||
{
|
||||
string regionURI = "";
|
||||
string regionHost = "";
|
||||
@@ -538,7 +527,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if(rdata.RegionName == mapname)
|
||||
if(mapname.Equals(rdata.RegionName,StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
haveMatch = true;
|
||||
if(count == maxNumber)
|
||||
@@ -560,7 +549,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if(rdata.RegionName == mapname)
|
||||
if (mapname.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
haveMatch = true;
|
||||
if(count == maxNumber)
|
||||
@@ -588,11 +577,20 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
else if (rdatas != null && (rdatas.Count > 0))
|
||||
{
|
||||
// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
//m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if (name.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if (count == maxNumber)
|
||||
{
|
||||
rinfos.RemoveAt(count - 1);
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,10 +84,6 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <returns>Returns the region information if the name matched. Null otherwise.</returns>
|
||||
GridRegion GetRegionByName(UUID scopeID, string regionName);
|
||||
|
||||
|
||||
//BA MOD.....
|
||||
GridRegion GetRegionByNameSpecific(UUID scopeID, string regionName);
|
||||
|
||||
/// <summary>
|
||||
/// Get information about regions starting with the provided name.
|
||||
/// </summary>
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenSim.Services.Interfaces
|
||||
public interface ILoginService
|
||||
{
|
||||
LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
|
||||
string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient);
|
||||
string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP);
|
||||
Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,18 +285,15 @@ namespace OpenSim.Services.LLLoginService
|
||||
}
|
||||
|
||||
public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID,
|
||||
string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient)
|
||||
string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP)
|
||||
{
|
||||
bool success = false;
|
||||
UUID session = UUID.Random();
|
||||
|
||||
string processedMessage;
|
||||
|
||||
if (clientVersion.Contains("Radegast"))
|
||||
LibOMVclient = false;
|
||||
|
||||
m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ",
|
||||
firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString());
|
||||
firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0);
|
||||
|
||||
string curMac = mac.ToString();
|
||||
|
||||
@@ -699,7 +696,6 @@ namespace OpenSim.Services.LLLoginService
|
||||
where = "safe";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -735,41 +731,32 @@ namespace OpenSim.Services.LLLoginService
|
||||
{
|
||||
if (!regionName.Contains("@"))
|
||||
{
|
||||
List<GridRegion> regions = m_GridService.GetRegionsByName(scopeID, regionName, 1);
|
||||
if ((regions == null) || (regions != null && regions.Count == 0))
|
||||
region = m_GridService.GetRegionByName (scopeID, regionName);
|
||||
if(region != null)
|
||||
return region;
|
||||
|
||||
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}. Trying defaults.", startLocation, regionName);
|
||||
List<GridRegion> regions = m_GridService.GetDefaultRegions(scopeID);
|
||||
if (regions != null && regions.Count > 0)
|
||||
{
|
||||
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}. Trying defaults.", startLocation, regionName);
|
||||
regions = m_GridService.GetDefaultRegions(scopeID);
|
||||
if (regions != null && regions.Count > 0)
|
||||
where = "safe";
|
||||
return regions[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
|
||||
region = FindAlternativeRegion(scopeID);
|
||||
if (region != null)
|
||||
{
|
||||
where = "safe";
|
||||
return regions[0];
|
||||
return region;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
|
||||
region = FindAlternativeRegion(scopeID);
|
||||
if (region != null)
|
||||
{
|
||||
where = "safe";
|
||||
return region;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, Grid does not provide default regions and no alternative found.", startLocation);
|
||||
return null;
|
||||
}
|
||||
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, Grid does not provide default regions and no alternative found.", startLocation);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//find a exact match
|
||||
foreach(GridRegion r in regions)
|
||||
{
|
||||
if(string.Equals(regionName, r.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
return r;
|
||||
}
|
||||
// else, whatever
|
||||
return regions[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user