Fixed MySQL and SQLite so they will save the

variable sun vector, adding 3 new fields on both.

From: Arthur Rodrigo S Valadares <arthursv@linux.vnet.ibm.com>
This commit is contained in:
Sean Dague
2008-11-18 12:48:36 +00:00
parent 99fb0d7b33
commit 5517ea3dfd
5 changed files with 177 additions and 9 deletions

View File

@@ -868,6 +868,9 @@ namespace OpenSim.Data.MySQL
createCol(regionsettings, "terrain_lower_limit", typeof (Double));
createCol(regionsettings, "use_estate_sun", typeof (Int32));
createCol(regionsettings, "sandbox", typeof (Int32));
createCol(regionsettings, "sunvectorx",typeof (Double));
createCol(regionsettings, "sunvectory",typeof (Double));
createCol(regionsettings, "sunvectorz",typeof (Double));
createCol(regionsettings, "fixed_sun", typeof (Int32));
createCol(regionsettings, "sun_position", typeof (Double));
createCol(regionsettings, "covenant", typeof(String));
@@ -1342,6 +1345,11 @@ namespace OpenSim.Data.MySQL
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
newSettings.SunVector = new Vector3 (
Convert.ToSingle(row["sunvectorx"]),
Convert.ToSingle(row["sunvectory"]),
Convert.ToSingle(row["sunvectorz"])
);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = new UUID((String) row["covenant"]);
@@ -1649,6 +1657,9 @@ namespace OpenSim.Data.MySQL
row["terrain_lower_limit"] = settings.TerrainLowerLimit;
row["use_estate_sun"] = settings.UseEstateSun;
row["sandbox"] = settings.Sandbox;
row["sunvectorx"] = settings.SunVector.X;
row["sunvectory"] = settings.SunVector.Y;
row["sunvectorz"] = settings.SunVector.Z;
row["fixed_sun"] = settings.FixedSun;
row["sun_position"] = settings.SunPosition;
row["covenant"] = settings.Covenant.ToString();