aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs37
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs2
2 files changed, 23 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index 4950f7f..fcbe3d6 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -122,26 +122,33 @@ namespace OpenSim.Data.MySQL
122 cmd.CommandText = String.Format("select * from {0} where UserID=?UserID", m_Realm); 122 cmd.CommandText = String.Format("select * from {0} where UserID=?UserID", m_Realm);
123 123
124 cmd.Parameters.AddWithValue("?UserID", userID); 124 cmd.Parameters.AddWithValue("?UserID", userID);
125;
126 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
127 {
128 dbcon.Open();
125 129
126 using (IDataReader reader = cmd.ExecuteReader()) 130 cmd.Connection = dbcon;
127 {
128 131
129 List<UUID> deleteSessions = new List<UUID>(); 132 using (IDataReader reader = cmd.ExecuteReader())
130 int online = 0;
131
132 while(reader.Read())
133 { 133 {
134 if (bool.Parse(reader["Online"].ToString()))
135 online++;
136 else
137 deleteSessions.Add(new UUID(reader["SessionID"].ToString()));
138 }
139 134
140 if (online == 0 && deleteSessions.Count > 0) 135 List<UUID> deleteSessions = new List<UUID>();
141 deleteSessions.RemoveAt(0); 136 int online = 0;
137
138 while(reader.Read())
139 {
140 if (bool.Parse(reader["Online"].ToString()))
141 online++;
142 else
143 deleteSessions.Add(new UUID(reader["SessionID"].ToString()));
144 }
142 145
143 foreach (UUID s in deleteSessions) 146 if (online == 0 && deleteSessions.Count > 0)
144 Delete("SessionID", s.ToString()); 147 deleteSessions.RemoveAt(0);
148
149 foreach (UUID s in deleteSessions)
150 Delete("SessionID", s.ToString());
151 }
145 } 152 }
146 } 153 }
147 } 154 }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index a3f52ff..ba50e3f 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -240,7 +240,7 @@ namespace OpenSim.Services.LLLoginService
240 } 240 }
241 catch (Exception e) 241 catch (Exception e)
242 { 242 {
243 m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2}", firstName, lastName, e.StackTrace); 243 m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2}", firstName, lastName, e.ToString());
244 if (m_PresenceService != null) 244 if (m_PresenceService != null)
245 m_PresenceService.LogoutAgent(session, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); 245 m_PresenceService.LogoutAgent(session, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
246 return LLFailedLoginResponse.InternalError; 246 return LLFailedLoginResponse.InternalError;