aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorSean Dague2008-09-24 20:43:27 +0000
committerSean Dague2008-09-24 20:43:27 +0000
commit70d6cb8570ef05eddeda627575c217517f2673b8 (patch)
treeec7626874f59ff2de41b1890f98d23a66a39096d /OpenSim/Data
parentRename lots of stuff in DNE to reduce source code differences in the (diff)
downloadopensim-SC_OLD-70d6cb8570ef05eddeda627575c217517f2673b8.zip
opensim-SC_OLD-70d6cb8570ef05eddeda627575c217517f2673b8.tar.gz
opensim-SC_OLD-70d6cb8570ef05eddeda627575c217517f2673b8.tar.bz2
opensim-SC_OLD-70d6cb8570ef05eddeda627575c217517f2673b8.tar.xz
remove a bunch of out of date inline ALTER table commands that would only
confuse people.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs101
1 files changed, 17 insertions, 84 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 13f9938..7eeefbd 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -1150,48 +1150,20 @@ namespace OpenSim.Data.SQLite
1150 Convert.ToSingle(row["RotationW"]) 1150 Convert.ToSingle(row["RotationW"])
1151 ); 1151 );
1152 1152
1153 try 1153 prim.SitTargetPositionLL = new Vector3(
1154 { 1154 Convert.ToSingle(row["SitTargetOffsetX"]),
1155 prim.SitTargetPositionLL = new Vector3( 1155 Convert.ToSingle(row["SitTargetOffsetY"]),
1156 Convert.ToSingle(row["SitTargetOffsetX"]), 1156 Convert.ToSingle(row["SitTargetOffsetZ"]));
1157 Convert.ToSingle(row["SitTargetOffsetY"]), 1157 prim.SitTargetOrientationLL = new Quaternion(
1158 Convert.ToSingle(row["SitTargetOffsetZ"])); 1158 Convert.ToSingle(
1159 prim.SitTargetOrientationLL = new Quaternion( 1159 row["SitTargetOrientX"]),
1160 Convert.ToSingle( 1160 Convert.ToSingle(
1161 row["SitTargetOrientX"]), 1161 row["SitTargetOrientY"]),
1162 Convert.ToSingle( 1162 Convert.ToSingle(
1163 row["SitTargetOrientY"]), 1163 row["SitTargetOrientZ"]),
1164 Convert.ToSingle( 1164 Convert.ToSingle(
1165 row["SitTargetOrientZ"]), 1165 row["SitTargetOrientW"]));
1166 Convert.ToSingle( 1166
1167 row["SitTargetOrientW"]));
1168 }
1169 catch (InvalidCastException)
1170 {
1171 // Database table was created before we got here and now has null values :P
1172 m_conn.Open();
1173 SqliteCommand cmd =
1174 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetX float NOT NULL default 0;", m_conn);
1175 cmd.ExecuteNonQuery();
1176 cmd =
1177 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetY float NOT NULL default 0;", m_conn);
1178 cmd.ExecuteNonQuery();
1179 cmd =
1180 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOffsetZ float NOT NULL default 0;", m_conn);
1181 cmd.ExecuteNonQuery();
1182 cmd =
1183 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientW float NOT NULL default 0;", m_conn);
1184 cmd.ExecuteNonQuery();
1185 cmd =
1186 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientX float NOT NULL default 0;", m_conn);
1187 cmd.ExecuteNonQuery();
1188 cmd =
1189 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientY float NOT NULL default 0;", m_conn);
1190 cmd.ExecuteNonQuery();
1191 cmd =
1192 new SqliteCommand("ALTER TABLE prims ADD COLUMN SitTargetOrientZ float NOT NULL default 0;", m_conn);
1193 cmd.ExecuteNonQuery();
1194 }
1195 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorR"]), Convert.ToInt32(row["ColorB"]), Convert.ToInt32(row["ColorG"])); 1167 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorR"]), Convert.ToInt32(row["ColorB"]), Convert.ToInt32(row["ColorG"]));
1196 1168
1197 prim.ClickAction = Convert.ToByte(row["ClickAction"]); 1169 prim.ClickAction = Convert.ToByte(row["ClickAction"]);
@@ -1337,37 +1309,7 @@ namespace OpenSim.Data.SQLite
1337 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1309 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
1338 UUID authBuyerID = UUID.Zero; 1310 UUID authBuyerID = UUID.Zero;
1339 1311
1340 try 1312 UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);
1341 {
1342 UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);
1343 }
1344 catch (InvalidCastException)
1345 {
1346 // Database table was created before we got here and now has null values :P
1347 try
1348 {
1349 m_conn.Open();
1350 SqliteCommand cmd =
1351 new SqliteCommand("ALTER TABLE land ADD COLUMN AuthbuyerID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';", m_conn);
1352 cmd.ExecuteNonQuery();
1353 m_conn.Close();
1354 m_conn.Dispose();
1355
1356 m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator. Exiting now.");
1357
1358 Thread.Sleep(10000);
1359
1360 // ICK! but it's better then A thousand red SQLITE error messages!
1361 Environment.Exit(0);
1362
1363 }
1364 catch (Exception)
1365 {
1366 // ICK! but it's better then A thousand red SQLITE error messages!
1367 m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator");
1368 Environment.Exit(0);
1369 }
1370 }
1371 1313
1372 return newData; 1314 return newData;
1373 } 1315 }
@@ -1749,17 +1691,8 @@ namespace OpenSim.Data.SQLite
1749 s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); 1691 s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]);
1750 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); 1692 s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]);
1751 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); 1693 s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]);
1752 try 1694 s.State = Convert.ToByte(row["State"]);
1753 { 1695
1754 s.State = Convert.ToByte(row["State"]);
1755 }
1756 catch (InvalidCastException)
1757 {
1758 m_conn.Open();
1759 SqliteCommand cmd =
1760 new SqliteCommand("ALTER TABLE primshapes ADD COLUMN State Integer NOT NULL default 0;", m_conn);
1761 cmd.ExecuteNonQuery();
1762 }
1763 // text TODO: this isn't right] = but I'm not sure the right 1696 // text TODO: this isn't right] = but I'm not sure the right
1764 // way to specify this as a blob atm 1697 // way to specify this as a blob atm
1765 1698