diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLManager.cs | 74 |
1 files changed, 49 insertions, 25 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index f4ef172..f2ec6be 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs | |||
@@ -295,10 +295,24 @@ namespace OpenSim.Data.MySQL | |||
295 | if (reader.Read()) | 295 | if (reader.Read()) |
296 | { | 296 | { |
297 | // Region Main gotta-have-or-we-return-null parts | 297 | // Region Main gotta-have-or-we-return-null parts |
298 | if (!UInt64.TryParse(reader["regionHandle"].ToString(), out retval.regionHandle)) | 298 | UInt64 tmp64; |
299 | if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64)) | ||
300 | { | ||
299 | return null; | 301 | return null; |
300 | if (!LLUUID.TryParse((string)reader["uuid"], out retval.UUID)) | 302 | } |
303 | else | ||
304 | { | ||
305 | retval.regionHandle = tmp64; | ||
306 | } | ||
307 | LLUUID tmp_uuid; | ||
308 | if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) | ||
309 | { | ||
301 | return null; | 310 | return null; |
311 | } | ||
312 | else | ||
313 | { | ||
314 | retval.UUID = tmp_uuid; | ||
315 | } | ||
302 | 316 | ||
303 | // non-critical parts | 317 | // non-critical parts |
304 | retval.regionName = (string)reader["regionName"]; | 318 | retval.regionName = (string)reader["regionName"]; |
@@ -369,7 +383,9 @@ namespace OpenSim.Data.MySQL | |||
369 | retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); | 383 | retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); |
370 | retval.reservationName = (string) reader["resName"]; | 384 | retval.reservationName = (string) reader["resName"]; |
371 | retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; | 385 | retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; |
372 | LLUUID.TryParse((string) reader["userUUID"], out retval.userUUID); | 386 | LLUUID tmp; |
387 | LLUUID.TryParse((string) reader["userUUID"], out tmp); | ||
388 | retval.userUUID = tmp; | ||
373 | } | 389 | } |
374 | else | 390 | else |
375 | { | 391 | { |
@@ -390,24 +406,32 @@ namespace OpenSim.Data.MySQL | |||
390 | if (reader.Read()) | 406 | if (reader.Read()) |
391 | { | 407 | { |
392 | // Agent IDs | 408 | // Agent IDs |
393 | if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) | 409 | LLUUID tmp; |
410 | if (!LLUUID.TryParse((string)reader["UUID"], out tmp)) | ||
394 | return null; | 411 | return null; |
395 | LLUUID.TryParse((string) reader["sessionID"], out retval.sessionID); | 412 | retval.ProfileID = tmp; |
396 | LLUUID.TryParse((string)reader["secureSessionID"], out retval.secureSessionID); | 413 | |
414 | LLUUID.TryParse((string) reader["sessionID"], out tmp); | ||
415 | retval.SessionID = tmp; | ||
416 | |||
417 | LLUUID.TryParse((string)reader["secureSessionID"], out tmp); | ||
418 | retval.SecureSessionID = tmp; | ||
397 | 419 | ||
398 | // Agent Who? | 420 | // Agent Who? |
399 | retval.agentIP = (string) reader["agentIP"]; | 421 | retval.AgentIP = (string) reader["agentIP"]; |
400 | retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); | 422 | retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString()); |
401 | retval.agentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString())); | 423 | retval.AgentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString())); |
402 | 424 | ||
403 | // Login/Logout times (UNIX Epoch) | 425 | // Login/Logout times (UNIX Epoch) |
404 | retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); | 426 | retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString()); |
405 | retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); | 427 | retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); |
406 | 428 | ||
407 | // Current position | 429 | // Current position |
408 | retval.currentRegion = new LLUUID((string)reader["currentRegion"]); | 430 | retval.CurrentRegion = new LLUUID((string)reader["currentRegion"]); |
409 | retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); | 431 | retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); |
410 | LLVector3.TryParse((string) reader["currentPos"], out retval.currentPos); | 432 | LLVector3 tmp_v; |
433 | LLVector3.TryParse((string) reader["currentPos"], out tmp_v); | ||
434 | retval.CurrentPos = tmp_v; | ||
411 | } | 435 | } |
412 | else | 436 | else |
413 | { | 437 | { |
@@ -883,17 +907,17 @@ namespace OpenSim.Data.MySQL | |||
883 | sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);"; | 907 | sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);"; |
884 | Dictionary<string, string> parameters = new Dictionary<string, string>(); | 908 | Dictionary<string, string> parameters = new Dictionary<string, string>(); |
885 | 909 | ||
886 | parameters["?UUID"] = agentdata.UUID.ToString(); | 910 | parameters["?UUID"] = agentdata.ProfileID.ToString(); |
887 | parameters["?sessionID"] = agentdata.sessionID.ToString(); | 911 | parameters["?sessionID"] = agentdata.SessionID.ToString(); |
888 | parameters["?secureSessionID"] = agentdata.secureSessionID.ToString(); | 912 | parameters["?secureSessionID"] = agentdata.SecureSessionID.ToString(); |
889 | parameters["?agentIP"] = agentdata.agentIP.ToString(); | 913 | parameters["?agentIP"] = agentdata.AgentIP.ToString(); |
890 | parameters["?agentPort"] = agentdata.agentPort.ToString(); | 914 | parameters["?agentPort"] = agentdata.AgentPort.ToString(); |
891 | parameters["?agentOnline"] = (agentdata.agentOnline == true) ? "1" : "0"; | 915 | parameters["?agentOnline"] = (agentdata.AgentOnline == true) ? "1" : "0"; |
892 | parameters["?loginTime"] = agentdata.loginTime.ToString(); | 916 | parameters["?loginTime"] = agentdata.LoginTime.ToString(); |
893 | parameters["?logoutTime"] = agentdata.logoutTime.ToString(); | 917 | parameters["?logoutTime"] = agentdata.LogoutTime.ToString(); |
894 | parameters["?currentRegion"] = agentdata.currentRegion.ToString(); | 918 | parameters["?currentRegion"] = agentdata.CurrentRegion.ToString(); |
895 | parameters["?currentHandle"] = agentdata.currentHandle.ToString(); | 919 | parameters["?currentHandle"] = agentdata.CurrentHandle.ToString(); |
896 | parameters["?currentPos"] = "<" + ((int)agentdata.currentPos.X).ToString() + "," + ((int)agentdata.currentPos.Y).ToString() + "," + ((int)agentdata.currentPos.Z).ToString() + ">"; | 920 | parameters["?currentPos"] = "<" + ((int)agentdata.CurrentPos.X).ToString() + "," + ((int)agentdata.CurrentPos.Y).ToString() + "," + ((int)agentdata.CurrentPos.Z).ToString() + ">"; |
897 | 921 | ||
898 | bool returnval = false; | 922 | bool returnval = false; |
899 | 923 | ||