From 19723767a99ae06b2fc6d1c24679648c4d2b4775 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 30 Apr 2008 21:15:48 +0000 Subject: * Adds the AuthbuyerID field to sqlite and makes use of it. * Includes a more user-friendly way of adding it saying, 'Your land table was recently updated. You need to restart the simulator. Exiting' --- OpenSim/Data/SQLite/SQLiteRegionData.cs | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index e075c22..01c63ef 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -763,6 +763,7 @@ namespace OpenSim.Data.SQLite createCol(land, "UserLookAtX", typeof (Double)); createCol(land, "UserLookAtY", typeof (Double)); createCol(land, "UserLookAtZ", typeof (Double)); + createCol(land, "AuthbuyerID", typeof(String)); land.PrimaryKey = new DataColumn[] {land.Columns["UUID"]}; @@ -969,7 +970,40 @@ namespace OpenSim.Data.SQLite new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), Convert.ToSingle(row["UserLookAtZ"])); newData.parcelAccessList = new List(); + LLUUID authBuyerID = LLUUID.Zero; + try + { + Helpers.TryParse((string)row["AuthbuyerID"], out authBuyerID); + } + catch (InvalidCastException) + { + // Database table was created before we got here and now has null values :P + try + { + m_conn.Open(); + SqliteCommand cmd = + new SqliteCommand("ALTER TABLE land ADD COLUMN AuthbuyerID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';", m_conn); + cmd.ExecuteNonQuery(); + m_conn.Close(); + m_conn.Dispose(); + + m_log.Error("[SQLITE]: The land table was recently updated. You need to restart the simulator. Exiting now."); + + System.Threading.Thread.Sleep(10000); + + // ICK! but it's better then A thousand red SQLITE error messages! + Environment.Exit(0); + + } + catch (System.Exception) + { + // ICK! but it's better then A thousand red SQLITE error messages! + m_log.Error("[SQLITE]: The land table was recently updated. You need to restart the simulator"); + Environment.Exit(0); + } + } + return newData; } -- cgit v1.1