mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Added logging in places where regions are searched for by their location
This commit also fixes the log message "Region already exists in coordinates <{0},{1}>": it was actually showing the *requested* coordinates, instead of the coordinates of the previously-existing link.
This commit is contained in:
@@ -539,13 +539,24 @@ namespace OpenSim.Services.GridService
|
||||
// multiples of the legacy region size (256).
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize;
|
||||
int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize;
|
||||
uint regionX = Util.WorldToRegionLoc((uint)x);
|
||||
uint regionY = Util.WorldToRegionLoc((uint)y);
|
||||
int snapX = (int)Util.RegionToWorldLoc(regionX);
|
||||
int snapY = (int)Util.RegionToWorldLoc(regionY);
|
||||
|
||||
RegionData rdata = m_Database.Get(snapX, snapY, scopeID);
|
||||
if (rdata != null)
|
||||
{
|
||||
m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in database. Pos=<{2},{3}>",
|
||||
LogHeader, rdata.RegionName, regionX, regionY);
|
||||
return RegionData2RegionInfo(rdata);
|
||||
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>",
|
||||
LogHeader, regionX, regionY);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string name)
|
||||
|
||||
Reference in New Issue
Block a user