refactor: Actually use MaptileStaticFile in RegionInfo rather than having both a public field and a get property

0.8.0.3
Justin Clark-Casey (justincc) 2014-03-26 20:58:58 +00:00
parent 7a4c5b067d
commit b0bae62c30
2 changed files with 16 additions and 14 deletions

View File

@ -143,7 +143,6 @@ namespace OpenSim.Framework
public string RemotingAddress;
public UUID ScopeID = UUID.Zero;
private UUID m_maptileStaticUUID = UUID.Zero;
public string m_maptileStaticFile;
public uint WorldLocX = 0;
public uint WorldLocY = 0;
@ -351,10 +350,7 @@ namespace OpenSim.Framework
get { return m_maptileStaticUUID; }
}
public string MaptileStaticFile
{
get { return m_maptileStaticFile; }
}
public string MaptileStaticFile { get; private set; }
/// <summary>
/// The port by which http communication occurs with the region (most noticeably, CAPS communication)
@ -723,7 +719,7 @@ namespace OpenSim.Framework
config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString());
}
m_maptileStaticFile = config.GetString("MaptileStaticFile", String.Empty);
MaptileStaticFile = config.GetString("MaptileStaticFile", String.Empty);
allKeys.Remove("MaptileStaticFile");
#endregion
@ -853,8 +849,8 @@ namespace OpenSim.Framework
if (m_maptileStaticUUID != UUID.Zero)
config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString());
if (m_maptileStaticFile != String.Empty)
config.Set("MaptileStaticFile", m_maptileStaticFile);
if (MaptileStaticFile != String.Empty)
config.Set("MaptileStaticFile", MaptileStaticFile);
}
public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result)
@ -966,7 +962,7 @@ namespace OpenSim.Framework
"UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true);
configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Filename of a texture to use as the map for this region", m_maptileStaticFile, true);
"Filename of a texture to use as the map for this region", MaptileStaticFile, true);
}
public void loadConfigurationOptions()
@ -1116,7 +1112,7 @@ namespace OpenSim.Framework
m_maptileStaticUUID = (UUID)configuration_result;
break;
case "region_static_mapfile":
m_maptileStaticFile = (string)configuration_result;
MaptileStaticFile = (string)configuration_result;
break;
}

View File

@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
if (generateMaptiles)
{
if (String.IsNullOrEmpty(m_scene.RegionInfo.m_maptileStaticFile))
if (String.IsNullOrEmpty(m_scene.RegionInfo.MaptileStaticFile))
{
if (textureTerrain)
{
@ -122,15 +122,21 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
{
try
{
mapbmp = new Bitmap(m_scene.RegionInfo.m_maptileStaticFile);
mapbmp = new Bitmap(m_scene.RegionInfo.MaptileStaticFile);
}
catch (Exception e)
{
m_log.ErrorFormat("[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name);
m_log.ErrorFormat(
"[MAPTILE]: Failed to load Static map image texture file: {0} for {1}",
m_scene.RegionInfo.MaptileStaticFile, m_scene.Name);
//mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
mapbmp = null;
}
if (mapbmp != null) m_log.DebugFormat("[MAPTILE]: Static map image texture file {0} found for {1}", m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name);
if (mapbmp != null)
m_log.DebugFormat(
"[MAPTILE]: Static map image texture file {0} found for {1}",
m_scene.RegionInfo.MaptileStaticFile, m_scene.Name);
}
}
else