aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs6
-rw-r--r--OpenSim/Data/MySQL/Resources/Presence.migrations8
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations2
4 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index ed92f3e..0b0a638 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Data.MySQL
153 /// </summary> 153 /// </summary>
154 /// <param name="asset">Asset UUID to create</param> 154 /// <param name="asset">Asset UUID to create</param>
155 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> 155 /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
156 override public void StoreAsset(AssetBase asset) 156 override public bool StoreAsset(AssetBase asset)
157 { 157 {
158 lock (m_dbLock) 158 lock (m_dbLock)
159 { 159 {
@@ -201,12 +201,14 @@ namespace OpenSim.Data.MySQL
201 cmd.Parameters.AddWithValue("?data", asset.Data); 201 cmd.Parameters.AddWithValue("?data", asset.Data);
202 cmd.ExecuteNonQuery(); 202 cmd.ExecuteNonQuery();
203 cmd.Dispose(); 203 cmd.Dispose();
204 return true;
204 } 205 }
205 } 206 }
206 catch (Exception e) 207 catch (Exception e)
207 { 208 {
208 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", 209 m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
209 asset.FullID, asset.Name, e.Message); 210 asset.FullID, asset.Name, e.Message);
211 return false;
210 } 212 }
211 } 213 }
212 } 214 }
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index 71caa1a..2390feb 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -78,9 +78,12 @@ namespace OpenSim.Data.MySQL
78 if (pd.Length == 0) 78 if (pd.Length == 0)
79 return false; 79 return false;
80 80
81 if (regionID == UUID.Zero)
82 return false;
83
81 MySqlCommand cmd = new MySqlCommand(); 84 MySqlCommand cmd = new MySqlCommand();
82 85
83 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID where `SessionID`=?SessionID", m_Realm); 86 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
84 87
85 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); 88 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
86 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 89 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
@@ -90,6 +93,5 @@ namespace OpenSim.Data.MySQL
90 93
91 return true; 94 return true;
92 } 95 }
93
94 } 96 }
95} 97}
diff --git a/OpenSim/Data/MySQL/Resources/Presence.migrations b/OpenSim/Data/MySQL/Resources/Presence.migrations
index 91f7de5..be4030e 100644
--- a/OpenSim/Data/MySQL/Resources/Presence.migrations
+++ b/OpenSim/Data/MySQL/Resources/Presence.migrations
@@ -13,3 +13,11 @@ CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
13CREATE INDEX UserID ON Presence(UserID); 13CREATE INDEX UserID ON Presence(UserID);
14 14
15COMMIT; 15COMMIT;
16
17:VERSION 2 # --------------------------
18
19BEGIN;
20
21ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp;
22
23COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 1405207..5c32209 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
717 717
718COMMIT; 718COMMIT;
719 719
720:VERSION 32 720:VERSION 32 #---------------------
721 721
722BEGIN; 722BEGIN;
723CREATE TABLE `regionwindlight` ( 723CREATE TABLE `regionwindlight` (