Add IScene.Name for code clarity to replace the RegionInfo.RegionName used in many, many log messages.

0.7.3-extended
Justin Clark-Casey (justincc) 2012-06-29 00:03:22 +01:00
parent 663b0cc681
commit 70f85af75b
4 changed files with 38 additions and 32 deletions

View File

@ -56,6 +56,11 @@ namespace OpenSim.Framework
public interface IScene
{
/// <summary>
/// The name of this scene.
/// </summary>
string Name { get; }
RegionInfo RegionInfo { get; }
RegionStatus RegionStatus { get; set; }

View File

@ -44,9 +44,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
}
protected int m_objectNameCallsReceived;
public MockScene()
public MockScene() : base(new RegionInfo(1000, 1000, null, null))
{
m_regInfo = new RegionInfo(1000, 1000, null, null);
m_regStatus = RegionStatus.Up;
}

View File

@ -599,8 +599,7 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGridService = sceneGridService;
m_SimulationDataService = simDataService;
m_EstateDataService = estateDataService;
m_regionHandle = m_regInfo.RegionHandle;
m_regionName = m_regInfo.RegionName;
m_regionHandle = RegionInfo.RegionHandle;
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
m_asyncSceneObjectDeleter.Enabled = true;
@ -615,7 +614,7 @@ namespace OpenSim.Region.Framework.Scenes
// resave.
// FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new
// region is set up and avoid these gyrations.
RegionSettings rs = simDataService.LoadRegionSettings(m_regInfo.RegionID);
RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID);
bool updatedTerrainTextures = false;
if (rs.TerrainTexture1 == UUID.Zero)
{
@ -644,10 +643,10 @@ namespace OpenSim.Region.Framework.Scenes
if (updatedTerrainTextures)
rs.Save();
m_regInfo.RegionSettings = rs;
RegionInfo.RegionSettings = rs;
if (estateDataService != null)
m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);
RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false);
#endregion Region Settings
@ -809,7 +808,7 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
}
public Scene(RegionInfo regInfo)
public Scene(RegionInfo regInfo) : base(regInfo)
{
PhysicalPrims = true;
CollidablePrims = true;
@ -836,7 +835,6 @@ namespace OpenSim.Region.Framework.Scenes
WestBorders.Add(westBorder);
BordersLocked = false;
m_regInfo = regInfo;
m_eventManager = new EventManager();
m_permissions = new ScenePermissions(this);
@ -1178,8 +1176,8 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGraph.Close();
if (!GridService.DeregisterRegion(m_regInfo.RegionID))
m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
if (!GridService.DeregisterRegion(RegionInfo.RegionID))
m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name);
// call the base class Close method.
base.Close();
@ -1699,14 +1697,14 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreWindlightProfile(RegionLightShareData wl)
{
m_regInfo.WindlightSettings = wl;
RegionInfo.WindlightSettings = wl;
SimulationDataService.StoreRegionWindlightSettings(wl);
m_eventManager.TriggerOnSaveNewWindlightProfile();
}
public void LoadWindlightProfile()
{
m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID);
RegionInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID);
m_eventManager.TriggerOnSaveNewWindlightProfile();
}
@ -2191,7 +2189,7 @@ namespace OpenSim.Region.Framework.Scenes
ForceSceneObjectBackup(so);
so.DetachFromBackup();
SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID);
}
// We need to keep track of this state in case this group is still queued for further backup.
@ -2526,7 +2524,7 @@ namespace OpenSim.Region.Framework.Scenes
// If the user is banned, we won't let any of their objects
// enter. Period.
//
if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
if (RegionInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
{
m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID);
@ -3703,9 +3701,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
if (m_regInfo.EstateSettings != null)
if (RegionInfo.EstateSettings != null)
{
if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
if (RegionInfo.EstateSettings.IsBanned(agent.AgentID))
{
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
@ -3737,7 +3735,7 @@ namespace OpenSim.Region.Framework.Scenes
}
bool groupAccess = false;
UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups;
UUID[] estateGroups = RegionInfo.EstateSettings.EstateGroups;
if (estateGroups != null)
{
@ -3755,8 +3753,8 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!");
}
if (!m_regInfo.EstateSettings.PublicAccess &&
!m_regInfo.EstateSettings.HasAccess(agent.AgentID) &&
if (!RegionInfo.EstateSettings.PublicAccess &&
!RegionInfo.EstateSettings.HasAccess(agent.AgentID) &&
!groupAccess)
{
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate",
@ -3829,7 +3827,7 @@ namespace OpenSim.Region.Framework.Scenes
// if (loggingOffUser != null)
// {
// UUID localRegionSecret = UUID.Zero;
// bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret);
// bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret);
//
// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
// // Will update the user server in a few revisions to use it.
@ -4048,13 +4046,13 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence sp = GetScenePresence(remoteClient.AgentId);
if (sp != null)
{
uint regionX = m_regInfo.RegionLocX;
uint regionY = m_regInfo.RegionLocY;
uint regionX = RegionInfo.RegionLocX;
uint regionY = RegionInfo.RegionLocY;
Utils.LongToUInts(regionHandle, out regionX, out regionY);
int shiftx = (int) regionX - (int) m_regInfo.RegionLocX * (int)Constants.RegionSize;
int shifty = (int) regionY - (int) m_regInfo.RegionLocY * (int)Constants.RegionSize;
int shiftx = (int) regionX - (int) RegionInfo.RegionLocX * (int)Constants.RegionSize;
int shifty = (int) regionY - (int) RegionInfo.RegionLocY * (int)Constants.RegionSize;
position.X += shiftx;
position.Y += shifty;
@ -4077,7 +4075,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!result)
{
regionHandle = m_regInfo.RegionHandle;
regionHandle = RegionInfo.RegionHandle;
}
else
{
@ -4588,7 +4586,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DeleteFromStorage(UUID uuid)
{
SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID);
SimulationDataService.RemoveObject(uuid, RegionInfo.RegionID);
}
public int GetHealth()
@ -5013,7 +5011,7 @@ namespace OpenSim.Region.Framework.Scenes
IEstateDataService estateDataService = EstateDataService;
if (estateDataService != null)
{
m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);
RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false);
TriggerEstateSunUpdate();
}
}

View File

@ -51,6 +51,8 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
#region Fields
public string Name { get { return RegionInfo.RegionName; } }
public IConfigSource Config
{
@ -146,6 +148,11 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
public SceneBase(RegionInfo regInfo)
{
RegionInfo = regInfo;
}
#region Update Methods
/// <summary>
@ -209,10 +216,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// </summary>
/// <returns></returns>
public virtual RegionInfo RegionInfo
{
get { return m_regInfo; }
}
public virtual RegionInfo RegionInfo { get; private set; }
#region admin stuff