Mantis#1637. Thank you kindly, Melanie for a patch that:

Make each region load it's settings from the database on startup. 
No user functionality yet.
0.6.0-stable
Charles Krinke 2008-06-30 14:09:19 +00:00
parent 2dfaa3c5e4
commit 4cb42d4c35
4 changed files with 64 additions and 34 deletions

View File

@ -761,6 +761,8 @@ namespace OpenSim.Data.MySQL
{ {
fillRegionSettingsRow(settingsRow, rs); fillRegionSettingsRow(settingsRow, rs);
} }
Commit();
} }
} }
@ -910,6 +912,7 @@ namespace OpenSim.Data.MySQL
m_landDataAdapter.Update(m_landTable); m_landDataAdapter.Update(m_landTable);
m_landAccessListDataAdapter.Update(m_landAccessListTable); m_landAccessListDataAdapter.Update(m_landAccessListTable);
m_regionBanListDataAdapter.Update(m_regionBanListTable); m_regionBanListDataAdapter.Update(m_regionBanListTable);
m_regionSettingsDataAdapter.Update(m_regionSettingsTable);
m_dataSet.AcceptChanges(); m_dataSet.AcceptChanges();
} }
@ -999,6 +1002,9 @@ namespace OpenSim.Data.MySQL
createCol(regionsettings, "fixed_sun", typeof (Int32)); createCol(regionsettings, "fixed_sun", typeof (Int32));
createCol(regionsettings, "sun_position", typeof (Double)); createCol(regionsettings, "sun_position", typeof (Double));
createCol(regionsettings, "covenant", typeof(String)); createCol(regionsettings, "covenant", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] {regionsettings.Columns["RegionUUID"]};
return regionsettings; return regionsettings;
} }

View File

@ -197,6 +197,7 @@ namespace OpenSim.Framework
public string DataStore = String.Empty; public string DataStore = String.Empty;
public bool isSandbox = false; public bool isSandbox = false;
private EstateSettings m_estateSettings; private EstateSettings m_estateSettings;
private RegionSettings m_regionSettings;
// public bool m_allow_alternate_ports; // public bool m_allow_alternate_ports;
@ -280,6 +281,21 @@ namespace OpenSim.Framework
} }
} }
public RegionSettings RegionSettings
{
get
{
if(m_regionSettings == null)
{
m_regionSettings = new RegionSettings();
}
return m_regionSettings;
}
set { m_regionSettings = value; }
}
public void SetEndPoint(string ipaddr, int port) public void SetEndPoint(string ipaddr, int port)
{ {
IPAddress tmpIP = IPAddress.Parse(ipaddr); IPAddress tmpIP = IPAddress.Parse(ipaddr);

View File

@ -33,7 +33,7 @@ namespace OpenSim.Framework
{ {
public class RegionSettings public class RegionSettings
{ {
private LLUUID m_RegionUUID; private LLUUID m_RegionUUID = LLUUID.Zero;
public LLUUID RegionUUID public LLUUID RegionUUID
{ {
@ -41,7 +41,7 @@ namespace OpenSim.Framework
set { m_RegionUUID = value; } set { m_RegionUUID = value; }
} }
private bool m_BlockTerraform; private bool m_BlockTerraform = false;
public bool BlockTerraform public bool BlockTerraform
{ {
@ -49,7 +49,7 @@ namespace OpenSim.Framework
set { m_BlockTerraform = value; } set { m_BlockTerraform = value; }
} }
private bool m_BlockFly; private bool m_BlockFly = false;
public bool BlockFly public bool BlockFly
{ {
@ -57,7 +57,7 @@ namespace OpenSim.Framework
set { m_BlockFly = value; } set { m_BlockFly = value; }
} }
private bool m_AllowDamage; private bool m_AllowDamage = false;
public bool AllowDamage public bool AllowDamage
{ {
@ -65,7 +65,7 @@ namespace OpenSim.Framework
set { m_AllowDamage = value; } set { m_AllowDamage = value; }
} }
private bool m_RestrictPushing; private bool m_RestrictPushing = false;
public bool RestrictPushing public bool RestrictPushing
{ {
@ -73,7 +73,7 @@ namespace OpenSim.Framework
set { m_RestrictPushing = value; } set { m_RestrictPushing = value; }
} }
private bool m_AllowLandResell; private bool m_AllowLandResell = true;
public bool AllowLandResell public bool AllowLandResell
{ {
@ -81,7 +81,7 @@ namespace OpenSim.Framework
set { m_AllowLandResell = value; } set { m_AllowLandResell = value; }
} }
private bool m_AllowLandJoinDivide; private bool m_AllowLandJoinDivide = true;
public bool AllowLandJoinDivide public bool AllowLandJoinDivide
{ {
@ -89,7 +89,7 @@ namespace OpenSim.Framework
set { m_AllowLandJoinDivide = value; } set { m_AllowLandJoinDivide = value; }
} }
private bool m_BlockShowInSearch; private bool m_BlockShowInSearch = false;
public bool BlockShowInSearch public bool BlockShowInSearch
{ {
@ -97,7 +97,7 @@ namespace OpenSim.Framework
set { m_BlockShowInSearch = value; } set { m_BlockShowInSearch = value; }
} }
private int m_AgentLimit; private int m_AgentLimit = 40;
public int AgentLimit public int AgentLimit
{ {
@ -105,7 +105,7 @@ namespace OpenSim.Framework
set { m_AgentLimit = value; } set { m_AgentLimit = value; }
} }
private double m_ObjectBonus; private double m_ObjectBonus = 1.0;
public double ObjectBonus public double ObjectBonus
{ {
@ -113,7 +113,7 @@ namespace OpenSim.Framework
set { m_ObjectBonus = value; } set { m_ObjectBonus = value; }
} }
private int m_Maturity; private int m_Maturity = 1;
public int Maturity public int Maturity
{ {
@ -121,7 +121,7 @@ namespace OpenSim.Framework
set { m_Maturity = value; } set { m_Maturity = value; }
} }
private bool m_DisableScripts; private bool m_DisableScripts = false;
public bool DisableScripts public bool DisableScripts
{ {
@ -129,7 +129,7 @@ namespace OpenSim.Framework
set { m_DisableScripts = value; } set { m_DisableScripts = value; }
} }
private bool m_DisableCollisions; private bool m_DisableCollisions = false;
public bool DisableCollisions public bool DisableCollisions
{ {
@ -137,7 +137,7 @@ namespace OpenSim.Framework
set { m_DisableCollisions = value; } set { m_DisableCollisions = value; }
} }
private bool m_DisablePhysics; private bool m_DisablePhysics = false;
public bool DisablePhysics public bool DisablePhysics
{ {
@ -145,7 +145,7 @@ namespace OpenSim.Framework
set { m_DisablePhysics = value; } set { m_DisablePhysics = value; }
} }
private LLUUID m_TerrainTexture1; private LLUUID m_TerrainTexture1 = LLUUID.Zero;
public LLUUID TerrainTexture1 public LLUUID TerrainTexture1
{ {
@ -153,7 +153,7 @@ namespace OpenSim.Framework
set { m_TerrainTexture1 = value; } set { m_TerrainTexture1 = value; }
} }
private LLUUID m_TerrainTexture2; private LLUUID m_TerrainTexture2 = LLUUID.Zero;
public LLUUID TerrainTexture2 public LLUUID TerrainTexture2
{ {
@ -161,7 +161,7 @@ namespace OpenSim.Framework
set { m_TerrainTexture2 = value; } set { m_TerrainTexture2 = value; }
} }
private LLUUID m_TerrainTexture3; private LLUUID m_TerrainTexture3 = LLUUID.Zero;
public LLUUID TerrainTexture3 public LLUUID TerrainTexture3
{ {
@ -169,7 +169,7 @@ namespace OpenSim.Framework
set { m_TerrainTexture3 = value; } set { m_TerrainTexture3 = value; }
} }
private LLUUID m_TerrainTexture4; private LLUUID m_TerrainTexture4 = LLUUID.Zero;
public LLUUID TerrainTexture4 public LLUUID TerrainTexture4
{ {
@ -177,7 +177,7 @@ namespace OpenSim.Framework
set { m_TerrainTexture4 = value; } set { m_TerrainTexture4 = value; }
} }
private double m_Elevation1NW; private double m_Elevation1NW = 10;
public double Elevation1NW public double Elevation1NW
{ {
@ -185,7 +185,7 @@ namespace OpenSim.Framework
set { m_Elevation1NW = value; } set { m_Elevation1NW = value; }
} }
private double m_Elevation2NW; private double m_Elevation2NW = 60;
public double Elevation2NW public double Elevation2NW
{ {
@ -193,7 +193,7 @@ namespace OpenSim.Framework
set { m_Elevation2NW = value; } set { m_Elevation2NW = value; }
} }
private double m_Elevation1NE; private double m_Elevation1NE = 10;
public double Elevation1NE public double Elevation1NE
{ {
@ -201,7 +201,7 @@ namespace OpenSim.Framework
set { m_Elevation1NE = value; } set { m_Elevation1NE = value; }
} }
private double m_Elevation2NE; private double m_Elevation2NE = 60;
public double Elevation2NE public double Elevation2NE
{ {
@ -209,7 +209,7 @@ namespace OpenSim.Framework
set { m_Elevation2NE = value; } set { m_Elevation2NE = value; }
} }
private double m_Elevation1SE; private double m_Elevation1SE = 10;
public double Elevation1SE public double Elevation1SE
{ {
@ -217,7 +217,7 @@ namespace OpenSim.Framework
set { m_Elevation1SE = value; } set { m_Elevation1SE = value; }
} }
private double m_Elevation2SE; private double m_Elevation2SE = 60;
public double Elevation2SE public double Elevation2SE
{ {
@ -225,7 +225,7 @@ namespace OpenSim.Framework
set { m_Elevation2SE = value; } set { m_Elevation2SE = value; }
} }
private double m_Elevation1SW; private double m_Elevation1SW = 10;
public double Elevation1SW public double Elevation1SW
{ {
@ -233,7 +233,7 @@ namespace OpenSim.Framework
set { m_Elevation1SW = value; } set { m_Elevation1SW = value; }
} }
private double m_Elevation2SW; private double m_Elevation2SW = 60;
public double Elevation2SW public double Elevation2SW
{ {
@ -241,7 +241,7 @@ namespace OpenSim.Framework
set { m_Elevation2SW = value; } set { m_Elevation2SW = value; }
} }
private double m_WaterHeight; private double m_WaterHeight = 20;
public double WaterHeight public double WaterHeight
{ {
@ -249,7 +249,7 @@ namespace OpenSim.Framework
set { m_WaterHeight = value; } set { m_WaterHeight = value; }
} }
private double m_TerrainRaiseLimit; private double m_TerrainRaiseLimit = 100;
public double TerrainRaiseLimit public double TerrainRaiseLimit
{ {
@ -257,7 +257,7 @@ namespace OpenSim.Framework
set { m_TerrainRaiseLimit = value; } set { m_TerrainRaiseLimit = value; }
} }
private double m_TerrainLowerLimit; private double m_TerrainLowerLimit = 100;
public double TerrainLowerLimit public double TerrainLowerLimit
{ {
@ -265,7 +265,7 @@ namespace OpenSim.Framework
set { m_TerrainLowerLimit = value; } set { m_TerrainLowerLimit = value; }
} }
private bool m_UseEstateSun; private bool m_UseEstateSun = true;
public bool UseEstateSun public bool UseEstateSun
{ {
@ -273,7 +273,7 @@ namespace OpenSim.Framework
set { m_UseEstateSun = value; } set { m_UseEstateSun = value; }
} }
private bool m_FixedSun; private bool m_FixedSun = false;
public bool FixedSun public bool FixedSun
{ {
@ -281,7 +281,7 @@ namespace OpenSim.Framework
set { m_FixedSun = value; } set { m_FixedSun = value; }
} }
private double m_SunPosition; private double m_SunPosition = 0.0;
public double SunPosition public double SunPosition
{ {
@ -289,7 +289,7 @@ namespace OpenSim.Framework
set { m_SunPosition = value; } set { m_SunPosition = value; }
} }
private LLUUID m_Covenant; private LLUUID m_Covenant = LLUUID.Zero;
public LLUUID Covenant public LLUUID Covenant
{ {

View File

@ -264,6 +264,14 @@ namespace OpenSim.Region.Environment.Scenes
m_eventManager = new EventManager(); m_eventManager = new EventManager();
m_externalChecks = new SceneExternalChecks(this); m_externalChecks = new SceneExternalChecks(this);
// Load region settings
// First try database
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
// If the database access failed, this will create defaults
m_regInfo.RegionSettings.RegionUUID = m_regInfo.RegionID;
// Finally, save the defaults
m_storageManager.DataStore.StoreRegionSettings(m_regInfo.RegionSettings);
//Bind Storage Manager functions to some land manager functions for this scene //Bind Storage Manager functions to some land manager functions for this scene
EventManager.OnLandObjectAdded += EventManager.OnLandObjectAdded +=
new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject);