aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLPresenceData.cs
diff options
context:
space:
mode:
authorMelanie2010-02-08 15:53:20 +0000
committerMelanie2010-02-08 15:53:38 +0000
commitbaaf660511214e52ea4ed20b8e80ec8e1ff06a3a (patch)
tree1e90c7a22ea3354d6bfd5d2b3f8f64f199dbd477 /OpenSim/Data/MySQL/MySQLPresenceData.cs
parentAdded missing configs to Standalone.ini (diff)
parentAdding the Careminster "Configger" tool to OpenSim. The tool will, when launched (diff)
downloadopensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.zip
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.gz
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.bz2
opensim-SC_OLD-baaf660511214e52ea4ed20b8e80ec8e1ff06a3a.tar.xz
Merge branch 'master' into presence-refactor
This was a large, heavily conflicted merge and things MAY have got broken. Please check!
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLPresenceData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs33
1 files changed, 16 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index e5dd0e5..4950f7f 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -123,27 +123,26 @@ namespace OpenSim.Data.MySQL
123 123
124 cmd.Parameters.AddWithValue("?UserID", userID); 124 cmd.Parameters.AddWithValue("?UserID", userID);
125 125
126 IDataReader reader = ExecuteReader(cmd); 126 using (IDataReader reader = cmd.ExecuteReader())
127
128 List<UUID> deleteSessions = new List<UUID>();
129 int online = 0;
130
131 while(reader.Read())
132 { 127 {
133 if (bool.Parse(reader["Online"].ToString()))
134 online++;
135 else
136 deleteSessions.Add(new UUID(reader["SessionID"].ToString()));
137 }
138 128
139 if (online == 0 && deleteSessions.Count > 0) 129 List<UUID> deleteSessions = new List<UUID>();
140 deleteSessions.RemoveAt(0); 130 int online = 0;
141 131
142 reader.Close(); 132 while(reader.Read())
143 CloseReaderCommand(cmd); 133 {
134 if (bool.Parse(reader["Online"].ToString()))
135 online++;
136 else
137 deleteSessions.Add(new UUID(reader["SessionID"].ToString()));
138 }
144 139
145 foreach (UUID s in deleteSessions) 140 if (online == 0 && deleteSessions.Count > 0)
146 Delete("SessionID", s.ToString()); 141 deleteSessions.RemoveAt(0);
142
143 foreach (UUID s in deleteSessions)
144 Delete("SessionID", s.ToString());
145 }
147 } 146 }
148 } 147 }
149} 148}