aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLPresenceData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLPresenceData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs36
1 files changed, 19 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index fc625f0..7808060 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -63,13 +63,14 @@ namespace OpenSim.Data.MySQL
63 63
64 public void LogoutRegionAgents(UUID regionID) 64 public void LogoutRegionAgents(UUID regionID)
65 { 65 {
66 MySqlCommand cmd = new MySqlCommand(); 66 using (MySqlCommand cmd = new MySqlCommand())
67 67 {
68 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm); 68 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
69 69
70 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 70 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
71 71
72 ExecuteNonQuery(cmd); 72 ExecuteNonQuery(cmd);
73 }
73 } 74 }
74 75
75 public bool ReportAgent(UUID sessionID, UUID regionID) 76 public bool ReportAgent(UUID sessionID, UUID regionID)
@@ -81,17 +82,18 @@ namespace OpenSim.Data.MySQL
81 if (regionID == UUID.Zero) 82 if (regionID == UUID.Zero)
82 return false; 83 return false;
83 84
84 MySqlCommand cmd = new MySqlCommand(); 85 using (MySqlCommand cmd = new MySqlCommand())
85 86 {
86 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm); 87 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
87 88
88 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); 89 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
89 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 90 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
90 91
91 if (ExecuteNonQuery(cmd) == 0) 92 if (ExecuteNonQuery(cmd) == 0)
92 return false; 93 return false;
94 }
93 95
94 return true; 96 return true;
95 } 97 }
96 } 98 }
97} 99} \ No newline at end of file