aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLPresenceData.cs
diff options
context:
space:
mode:
authoronefang2019-09-11 16:36:50 +1000
committeronefang2019-09-11 16:36:50 +1000
commit50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch)
tree52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Data/MySQL/MySQLPresenceData.cs
parentRenamed branch to SledjChisl. (diff)
parentBump to release flavour, build 0. (diff)
downloadopensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz
Merge branch 'SledjChisl'
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLPresenceData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index 3f90639..b9114eb 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -52,8 +52,17 @@ namespace OpenSim.Data.MySQL
52 52
53 public PresenceData Get(UUID sessionID) 53 public PresenceData Get(UUID sessionID)
54 { 54 {
55 PresenceData[] ret = Get("SessionID", 55 PresenceData[] ret = Get("SessionID", sessionID.ToString());
56 sessionID.ToString()); 56
57 if (ret.Length == 0)
58 return null;
59
60 return ret[0];
61 }
62
63 public PresenceData GetByUser(UUID userID)
64 {
65 PresenceData[] ret = Get("UserID", userID.ToString());
57 66
58 if (ret.Length == 0) 67 if (ret.Length == 0)
59 return null; 68 return null;
@@ -66,9 +75,9 @@ namespace OpenSim.Data.MySQL
66 using (MySqlCommand cmd = new MySqlCommand()) 75 using (MySqlCommand cmd = new MySqlCommand())
67 { 76 {
68 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm); 77 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
69 78
70 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 79 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
71 80
72 ExecuteNonQuery(cmd); 81 ExecuteNonQuery(cmd);
73 } 82 }
74 } 83 }
@@ -85,10 +94,10 @@ namespace OpenSim.Data.MySQL
85 using (MySqlCommand cmd = new MySqlCommand()) 94 using (MySqlCommand cmd = new MySqlCommand())
86 { 95 {
87 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm); 96 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
88 97
89 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); 98 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
90 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 99 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
91 100
92 if (ExecuteNonQuery(cmd) == 0) 101 if (ExecuteNonQuery(cmd) == 0)
93 return false; 102 return false;
94 } 103 }