aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-04-10 14:37:17 +0000
committerSean Dague2008-04-10 14:37:17 +0000
commitef7dfae41c728d10cfe835cb256958c354449f1b (patch)
tree98affd8fd75500ece10eb471ba405709e2d389f4
parentfurther renaming of properties for clarity (diff)
downloadopensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.zip
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.gz
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.bz2
opensim-SC_OLD-ef7dfae41c728d10cfe835cb256958c354449f1b.tar.xz
changing UserAgentData to use properties. This caused more
grief than expected, as monodevelop doesn't like to refactor properties of properties.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLManager.cs25
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs74
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs52
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs14
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs62
-rw-r--r--OpenSim/Framework/UserAgentData.cs133
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs49
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs8
8 files changed, 276 insertions, 141 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs
index e327c46..524efc4 100644
--- a/OpenSim/Data/MSSQL/MSSQLManager.cs
+++ b/OpenSim/Data/MSSQL/MSSQLManager.cs
@@ -352,23 +352,26 @@ namespace OpenSim.Data.MSSQL
352 if (reader.Read()) 352 if (reader.Read())
353 { 353 {
354 // Agent IDs 354 // Agent IDs
355 retval.UUID = new LLUUID((string)reader["UUID"]); 355 retval.ProfileID = new LLUUID((string)reader["UUID"]);
356 retval.sessionID = new LLUUID((string)reader["sessionID"]); 356 retval.SessionID = new LLUUID((string)reader["sessionID"]);
357 retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]); 357 retval.SecureSessionID = new LLUUID((string)reader["secureSessionID"]);
358 358
359 // Agent Who? 359 // Agent Who?
360 retval.agentIP = (string)reader["agentIP"]; 360 retval.AgentIP = (string)reader["agentIP"];
361 retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); 361 retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString());
362 retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); 362 retval.AgentOnline = Convert.ToBoolean(reader["agentOnline"].ToString());
363 363
364 // Login/Logout times (UNIX Epoch) 364 // Login/Logout times (UNIX Epoch)
365 retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); 365 retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString());
366 retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); 366 retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
367 367
368 // Current position 368 // Current position
369 retval.currentRegion = (string)reader["currentRegion"]; 369 retval.CurrentRegion = (string)reader["currentRegion"];
370 retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); 370 retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
371 LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); 371 LLVector3 tmp_v;
372 LLVector3.TryParse((string)reader["currentPos"], out tmp_v);
373 retval.CurrentPos = tmp_v;
374
372 } 375 }
373 else 376 else
374 { 377 {
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
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 815c1bb..3ee0c03 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -674,18 +674,18 @@ namespace OpenSim.Data.SQLite
674 { 674 {
675 UserAgentData ua = new UserAgentData(); 675 UserAgentData ua = new UserAgentData();
676 676
677 ua.UUID = new LLUUID((String) row["UUID"]); 677 ua.ProfileID = new LLUUID((String) row["UUID"]);
678 ua.agentIP = (String) row["agentIP"]; 678 ua.AgentIP = (String) row["agentIP"];
679 ua.agentPort = Convert.ToUInt32(row["agentPort"]); 679 ua.AgentPort = Convert.ToUInt32(row["agentPort"]);
680 ua.agentOnline = Convert.ToBoolean(row["agentOnline"]); 680 ua.AgentOnline = Convert.ToBoolean(row["agentOnline"]);
681 ua.sessionID = new LLUUID((String) row["sessionID"]); 681 ua.SessionID = new LLUUID((String) row["sessionID"]);
682 ua.secureSessionID = new LLUUID((String) row["secureSessionID"]); 682 ua.SecureSessionID = new LLUUID((String) row["secureSessionID"]);
683 ua.regionID = new LLUUID((String) row["regionID"]); 683 ua.RegionID = new LLUUID((String) row["regionID"]);
684 ua.loginTime = Convert.ToInt32(row["loginTime"]); 684 ua.LoginTime = Convert.ToInt32(row["loginTime"]);
685 ua.logoutTime = Convert.ToInt32(row["logoutTime"]); 685 ua.LogoutTime = Convert.ToInt32(row["logoutTime"]);
686 ua.currentRegion = new LLUUID((String) row["currentRegion"]); 686 ua.CurrentRegion = new LLUUID((String) row["currentRegion"]);
687 ua.currentHandle = Convert.ToUInt64(row["currentHandle"]); 687 ua.CurrentHandle = Convert.ToUInt64(row["currentHandle"]);
688 ua.currentPos = new LLVector3( 688 ua.CurrentPos = new LLVector3(
689 Convert.ToSingle(row["currentPosX"]), 689 Convert.ToSingle(row["currentPosX"]),
690 Convert.ToSingle(row["currentPosY"]), 690 Convert.ToSingle(row["currentPosY"]),
691 Convert.ToSingle(row["currentPosZ"]) 691 Convert.ToSingle(row["currentPosZ"])
@@ -695,21 +695,21 @@ namespace OpenSim.Data.SQLite
695 695
696 private static void fillUserAgentRow(DataRow row, UserAgentData ua) 696 private static void fillUserAgentRow(DataRow row, UserAgentData ua)
697 { 697 {
698 row["UUID"] = ua.UUID; 698 row["UUID"] = ua.ProfileID;
699 row["agentIP"] = ua.agentIP; 699 row["agentIP"] = ua.AgentIP;
700 row["agentPort"] = ua.agentPort; 700 row["agentPort"] = ua.AgentPort;
701 row["agentOnline"] = ua.agentOnline; 701 row["agentOnline"] = ua.AgentOnline;
702 row["sessionID"] = ua.sessionID; 702 row["sessionID"] = ua.SessionID;
703 row["secureSessionID"] = ua.secureSessionID; 703 row["secureSessionID"] = ua.SecureSessionID;
704 row["regionID"] = ua.regionID; 704 row["regionID"] = ua.RegionID;
705 row["loginTime"] = ua.loginTime; 705 row["loginTime"] = ua.LoginTime;
706 row["logoutTime"] = ua.logoutTime; 706 row["logoutTime"] = ua.LogoutTime;
707 row["currentRegion"] = ua.currentRegion; 707 row["currentRegion"] = ua.CurrentRegion;
708 row["currentHandle"] = ua.currentHandle.ToString(); 708 row["currentHandle"] = ua.CurrentHandle.ToString();
709 // vectors 709 // vectors
710 row["currentPosX"] = ua.currentPos.X; 710 row["currentPosX"] = ua.CurrentPos.X;
711 row["currentPosY"] = ua.currentPos.Y; 711 row["currentPosY"] = ua.CurrentPos.Y;
712 row["currentPosZ"] = ua.currentPos.Z; 712 row["currentPosZ"] = ua.CurrentPos.Z;
713 } 713 }
714 714
715 /*********************************************************************** 715 /***********************************************************************
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 4f314bc..afe7359 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -184,13 +184,13 @@ namespace OpenSim.Framework.UserManagement
184 else 184 else
185 { 185 {
186 // If we already have a session... 186 // If we already have a session...
187 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) 187 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline)
188 { 188 {
189 //TODO: The following statements can cause trouble: 189 //TODO: The following statements can cause trouble:
190 // If agentOnline could not turn from true back to false normally 190 // If agentOnline could not turn from true back to false normally
191 // because of some problem, for instance, the crashment of server or client, 191 // because of some problem, for instance, the crashment of server or client,
192 // the user cannot log in any longer. 192 // the user cannot log in any longer.
193 userProfile.CurrentAgent.agentOnline = false; 193 userProfile.CurrentAgent.AgentOnline = false;
194 m_userManager.CommitAgent(ref userProfile); 194 m_userManager.CommitAgent(ref userProfile);
195 195
196 // Reject the login 196 // Reject the login
@@ -225,8 +225,8 @@ namespace OpenSim.Framework.UserManagement
225 logResponse.Lastname = userProfile.SurName; 225 logResponse.Lastname = userProfile.SurName;
226 logResponse.Firstname = userProfile.FirstName; 226 logResponse.Firstname = userProfile.FirstName;
227 logResponse.AgentID = agentID.ToString(); 227 logResponse.AgentID = agentID.ToString();
228 logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); 228 logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString();
229 logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); 229 logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString();
230 logResponse.InventoryRoot = InventoryRoot; 230 logResponse.InventoryRoot = InventoryRoot;
231 logResponse.InventorySkeleton = AgentInventoryArray; 231 logResponse.InventorySkeleton = AgentInventoryArray;
232 logResponse.InventoryLibrary = GetInventoryLibrary(); 232 logResponse.InventoryLibrary = GetInventoryLibrary();
@@ -334,7 +334,7 @@ namespace OpenSim.Framework.UserManagement
334 else 334 else
335 { 335 {
336 // If we already have a session... 336 // If we already have a session...
337 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) 337 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline)
338 { 338 {
339 userProfile.CurrentAgent = null; 339 userProfile.CurrentAgent = null;
340 m_userManager.CommitAgent(ref userProfile); 340 m_userManager.CommitAgent(ref userProfile);
@@ -367,8 +367,8 @@ namespace OpenSim.Framework.UserManagement
367 logResponse.Lastname = userProfile.SurName; 367 logResponse.Lastname = userProfile.SurName;
368 logResponse.Firstname = userProfile.FirstName; 368 logResponse.Firstname = userProfile.FirstName;
369 logResponse.AgentID = agentID.ToString(); 369 logResponse.AgentID = agentID.ToString();
370 logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); 370 logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString();
371 logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); 371 logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString();
372 logResponse.InventoryRoot = InventoryRoot; 372 logResponse.InventoryRoot = InventoryRoot;
373 logResponse.InventorySkeleton = AgentInventoryArray; 373 logResponse.InventorySkeleton = AgentInventoryArray;
374 logResponse.InventoryLibrary = GetInventoryLibrary(); 374 logResponse.InventoryLibrary = GetInventoryLibrary();
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 91c284c..0473701 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -342,7 +342,7 @@ namespace OpenSim.Framework.UserManagement
342 UserAgentData agent = new UserAgentData(); 342 UserAgentData agent = new UserAgentData();
343 343
344 // User connection 344 // User connection
345 agent.agentOnline = true; 345 agent.AgentOnline = true;
346 346
347 // Generate sessions 347 // Generate sessions
348 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); 348 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
@@ -351,15 +351,15 @@ namespace OpenSim.Framework.UserManagement
351 rand.GetBytes(randDataS); 351 rand.GetBytes(randDataS);
352 rand.GetBytes(randDataSS); 352 rand.GetBytes(randDataSS);
353 353
354 agent.secureSessionID = new LLUUID(randDataSS, 0); 354 agent.SecureSessionID = new LLUUID(randDataSS, 0);
355 agent.sessionID = new LLUUID(randDataS, 0); 355 agent.SessionID = new LLUUID(randDataS, 0);
356 356
357 // Profile UUID 357 // Profile UUID
358 agent.UUID = profile.ID; 358 agent.ProfileID = profile.ID;
359 359
360 // Current position (from Home) 360 // Current position (from Home)
361 agent.currentHandle = profile.HomeRegion; 361 agent.CurrentHandle = profile.HomeRegion;
362 agent.currentPos = profile.HomeLocation; 362 agent.CurrentPos = profile.HomeLocation;
363 363
364 // If user specified additional start, use that 364 // If user specified additional start, use that
365 if (requestData.ContainsKey("start")) 365 if (requestData.ContainsKey("start"))
@@ -367,16 +367,16 @@ namespace OpenSim.Framework.UserManagement
367 string startLoc = ((string)requestData["start"]).Trim(); 367 string startLoc = ((string)requestData["start"]).Trim();
368 if (("last" == startLoc) && (profile.CurrentAgent != null)) 368 if (("last" == startLoc) && (profile.CurrentAgent != null))
369 { 369 {
370 if ((profile.CurrentAgent.currentPos.X > 0) 370 if ((profile.CurrentAgent.CurrentPos.X > 0)
371 && (profile.CurrentAgent.currentPos.Y > 0) 371 && (profile.CurrentAgent.CurrentPos.Y > 0)
372 && (profile.CurrentAgent.currentPos.Z > 0) 372 && (profile.CurrentAgent.CurrentPos.Z > 0)
373 ) 373 )
374 { 374 {
375 // TODO: Right now, currentRegion has not been used in GridServer for requesting region. 375 // TODO: Right now, currentRegion has not been used in GridServer for requesting region.
376 // TODO: It is only using currentHandle. 376 // TODO: It is only using currentHandle.
377 agent.currentRegion = profile.CurrentAgent.currentRegion; 377 agent.CurrentRegion = profile.CurrentAgent.CurrentRegion;
378 agent.currentHandle = profile.CurrentAgent.currentHandle; 378 agent.CurrentHandle = profile.CurrentAgent.CurrentHandle;
379 agent.currentPos = profile.CurrentAgent.currentPos; 379 agent.CurrentPos = profile.CurrentAgent.CurrentPos;
380 } 380 }
381 } 381 }
382 382
@@ -399,12 +399,12 @@ namespace OpenSim.Framework.UserManagement
399 } 399 }
400 400
401 // What time did the user login? 401 // What time did the user login?
402 agent.loginTime = Util.UnixTimeSinceEpoch(); 402 agent.LoginTime = Util.UnixTimeSinceEpoch();
403 agent.logoutTime = 0; 403 agent.LogoutTime = 0;
404 404
405 // Current location 405 // Current location
406 agent.regionID = LLUUID.Zero; // Fill in later 406 agent.RegionID = LLUUID.Zero; // Fill in later
407 agent.currentRegion = LLUUID.Zero; // Fill in later 407 agent.CurrentRegion = LLUUID.Zero; // Fill in later
408 408
409 profile.CurrentAgent = agent; 409 profile.CurrentAgent = agent;
410 } 410 }
@@ -437,16 +437,16 @@ namespace OpenSim.Framework.UserManagement
437 userAgent = userProfile.CurrentAgent; 437 userAgent = userProfile.CurrentAgent;
438 if (userAgent != null) 438 if (userAgent != null)
439 { 439 {
440 userAgent.agentOnline = false; 440 userAgent.AgentOnline = false;
441 userAgent.logoutTime = Util.UnixTimeSinceEpoch(); 441 userAgent.LogoutTime = Util.UnixTimeSinceEpoch();
442 //userAgent.sessionID = LLUUID.Zero; 442 //userAgent.sessionID = LLUUID.Zero;
443 if (regionid != LLUUID.Zero) 443 if (regionid != LLUUID.Zero)
444 { 444 {
445 userAgent.currentRegion = regionid; 445 userAgent.CurrentRegion = regionid;
446 } 446 }
447 447
448 userAgent.currentHandle = regionhandle; 448 userAgent.CurrentHandle = regionhandle;
449 userAgent.currentPos = currentPos; 449 userAgent.CurrentPos = currentPos;
450 userProfile.CurrentAgent = userAgent; 450 userProfile.CurrentAgent = userAgent;
451 451
452 CommitAgent(ref userProfile); 452 CommitAgent(ref userProfile);
@@ -468,7 +468,7 @@ namespace OpenSim.Framework.UserManagement
468 UserAgentData agent = new UserAgentData(); 468 UserAgentData agent = new UserAgentData();
469 469
470 // User connection 470 // User connection
471 agent.agentOnline = true; 471 agent.AgentOnline = true;
472 472
473 // Generate sessions 473 // Generate sessions
474 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); 474 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
@@ -477,23 +477,23 @@ namespace OpenSim.Framework.UserManagement
477 rand.GetBytes(randDataS); 477 rand.GetBytes(randDataS);
478 rand.GetBytes(randDataSS); 478 rand.GetBytes(randDataSS);
479 479
480 agent.secureSessionID = new LLUUID(randDataSS, 0); 480 agent.SecureSessionID = new LLUUID(randDataSS, 0);
481 agent.sessionID = new LLUUID(randDataS, 0); 481 agent.SessionID = new LLUUID(randDataS, 0);
482 482
483 // Profile UUID 483 // Profile UUID
484 agent.UUID = profile.ID; 484 agent.ProfileID = profile.ID;
485 485
486 // Current position (from Home) 486 // Current position (from Home)
487 agent.currentHandle = profile.HomeRegion; 487 agent.CurrentHandle = profile.HomeRegion;
488 agent.currentPos = profile.HomeLocation; 488 agent.CurrentPos = profile.HomeLocation;
489 489
490 // What time did the user login? 490 // What time did the user login?
491 agent.loginTime = Util.UnixTimeSinceEpoch(); 491 agent.LoginTime = Util.UnixTimeSinceEpoch();
492 agent.logoutTime = 0; 492 agent.LogoutTime = 0;
493 493
494 // Current location 494 // Current location
495 agent.regionID = LLUUID.Zero; // Fill in later 495 agent.RegionID = LLUUID.Zero; // Fill in later
496 agent.currentRegion = LLUUID.Zero; // Fill in later 496 agent.CurrentRegion = LLUUID.Zero; // Fill in later
497 497
498 profile.CurrentAgent = agent; 498 profile.CurrentAgent = agent;
499 } 499 }
diff --git a/OpenSim/Framework/UserAgentData.cs b/OpenSim/Framework/UserAgentData.cs
index 8c6baf0..18e8580 100644
--- a/OpenSim/Framework/UserAgentData.cs
+++ b/OpenSim/Framework/UserAgentData.cs
@@ -38,62 +38,171 @@ namespace OpenSim.Framework
38 /// <summary> 38 /// <summary>
39 /// The UUID of the users avatar (not the agent!) 39 /// The UUID of the users avatar (not the agent!)
40 /// </summary> 40 /// </summary>
41 public LLUUID UUID; 41 private LLUUID UUID;
42 42
43 /// <summary> 43 /// <summary>
44 /// The IP address of the user 44 /// The IP address of the user
45 /// </summary> 45 /// </summary>
46 public string agentIP = String.Empty; 46 private string agentIP = String.Empty;
47 47
48 /// <summary> 48 /// <summary>
49 /// The port of the user 49 /// The port of the user
50
50 /// </summary> 51 /// </summary>
51 public uint agentPort; 52 private uint agentPort;
52 53
53 /// <summary> 54 /// <summary>
54 /// Is the user online? 55 /// Is the user online?
55 /// </summary> 56 /// </summary>
56 public bool agentOnline; 57 private bool agentOnline;
57 58
58 /// <summary> 59 /// <summary>
59 /// The session ID for the user (also the agent ID) 60 /// The session ID for the user (also the agent ID)
60 /// </summary> 61 /// </summary>
61 public LLUUID sessionID; 62 private LLUUID sessionID;
62 63
63 /// <summary> 64 /// <summary>
64 /// The "secure" session ID for the user 65 /// The "secure" session ID for the user
65 /// </summary> 66 /// </summary>
66 /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> 67 /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
67 public LLUUID secureSessionID; 68 private LLUUID secureSessionID;
68 69
69 /// <summary> 70 /// <summary>
70 /// The region the user logged into initially 71 /// The region the user logged into initially
71 /// </summary> 72 /// </summary>
72 public LLUUID regionID; 73 private LLUUID regionID;
73 74
74 /// <summary> 75 /// <summary>
75 /// A unix timestamp from when the user logged in 76 /// A unix timestamp from when the user logged in
76 /// </summary> 77 /// </summary>
77 public int loginTime; 78 private int loginTime;
78 79
79 /// <summary> 80 /// <summary>
80 /// When this agent expired and logged out, 0 if still online 81 /// When this agent expired and logged out, 0 if still online
81 /// </summary> 82 /// </summary>
82 public int logoutTime; 83 private int logoutTime;
83 84
84 /// <summary> 85 /// <summary>
85 /// Current region the user is logged into 86 /// Current region the user is logged into
86 /// </summary> 87 /// </summary>
87 public LLUUID currentRegion; 88 private LLUUID currentRegion;
88 89
89 /// <summary> 90 /// <summary>
90 /// Region handle of the current region the user is in 91 /// Region handle of the current region the user is in
91 /// </summary> 92 /// </summary>
92 public ulong currentHandle; 93 private ulong currentHandle;
93 94
94 /// <summary> 95 /// <summary>
95 /// The position of the user within the region 96 /// The position of the user within the region
96 /// </summary> 97 /// </summary>
97 public LLVector3 currentPos; 98 private LLVector3 currentPos;
99
100 public LLUUID ProfileID {
101 get {
102 return UUID;
103 }
104 set {
105 UUID = value;
106 }
107 }
108
109 public string AgentIP {
110 get {
111 return agentIP;
112 }
113 set {
114 agentIP = value;
115 }
116 }
117
118 public uint AgentPort {
119 get {
120 return agentPort;
121 }
122 set {
123 agentPort = value;
124 }
125 }
126
127 public bool AgentOnline {
128 get {
129 return agentOnline;
130 }
131 set {
132 agentOnline = value;
133 }
134 }
135
136 public LLUUID SessionID {
137 get {
138 return sessionID;
139 }
140 set {
141 sessionID = value;
142 }
143 }
144
145 public LLUUID SecureSessionID {
146 get {
147 return secureSessionID;
148 }
149 set {
150 secureSessionID = value;
151 }
152 }
153
154 public LLUUID RegionID {
155 get {
156 return regionID;
157 }
158 set {
159 regionID = value;
160 }
161 }
162
163 public int LoginTime {
164 get {
165 return loginTime;
166 }
167 set {
168 loginTime = value;
169 }
170 }
171
172 public int LogoutTime {
173 get {
174 return logoutTime;
175 }
176 set {
177 logoutTime = value;
178 }
179 }
180
181 public LLUUID CurrentRegion {
182 get {
183 return currentRegion;
184 }
185 set {
186 currentRegion = value;
187 }
188 }
189
190 public ulong CurrentHandle {
191 get {
192 return currentHandle;
193 }
194 set {
195 currentHandle = value;
196 }
197 }
198
199 public LLVector3 CurrentPos {
200 get {
201 return currentPos;
202 }
203 set {
204 currentPos = value;
205 }
206 }
98 } 207 }
99} 208}
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 141aa3e..ce08ee2 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Grid.UserServer
85 { 85 {
86 SimInfo = 86 SimInfo =
87 RegionProfileData.RequestSimProfileData( 87 RegionProfileData.RequestSimProfileData(
88 theUser.CurrentAgent.currentHandle, m_config.GridServerURL, 88 theUser.CurrentAgent.CurrentHandle, m_config.GridServerURL,
89 m_config.GridSendKey, m_config.GridRecvKey); 89 m_config.GridSendKey, m_config.GridRecvKey);
90 } 90 }
91 else if (startLocationRequest == "home") 91 else if (startLocationRequest == "home")
@@ -104,7 +104,7 @@ namespace OpenSim.Grid.UserServer
104 // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' 104 // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z'
105 SimInfo = 105 SimInfo =
106 RegionProfileData.RequestSimProfileData( 106 RegionProfileData.RequestSimProfileData(
107 theUser.CurrentAgent.currentHandle, m_config.GridServerURL, 107 theUser.CurrentAgent.CurrentHandle, m_config.GridServerURL,
108 m_config.GridSendKey, m_config.GridRecvKey); 108 m_config.GridSendKey, m_config.GridRecvKey);
109 } 109 }
110 else 110 else
@@ -164,25 +164,24 @@ namespace OpenSim.Grid.UserServer
164 //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + 164 //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " +
165 //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); 165 //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY);
166 166
167 theUser.CurrentAgent.currentRegion = SimInfo.UUID; 167 theUser.CurrentAgent.CurrentRegion = SimInfo.UUID;
168 theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; 168 theUser.CurrentAgent.CurrentHandle = SimInfo.regionHandle;
169 if (start_x >= 0 && start_y >= 0 && start_z >= 0) { 169 if (start_x >= 0 && start_y >= 0 && start_z >= 0) {
170 theUser.CurrentAgent.currentPos.X = start_x; 170 LLVector3 tmp_v = new LLVector3(start_x, start_y, start_z);
171 theUser.CurrentAgent.currentPos.Y = start_y; 171 theUser.CurrentAgent.CurrentPos = tmp_v;
172 theUser.CurrentAgent.currentPos.Z = start_z;
173 } 172 }
174 // Prepare notification 173 // Prepare notification
175 Hashtable SimParams = new Hashtable(); 174 Hashtable SimParams = new Hashtable();
176 SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); 175 SimParams["session_id"] = theUser.CurrentAgent.SessionID.ToString();
177 SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); 176 SimParams["secure_session_id"] = theUser.CurrentAgent.SecureSessionID.ToString();
178 SimParams["firstname"] = theUser.FirstName; 177 SimParams["firstname"] = theUser.FirstName;
179 SimParams["lastname"] = theUser.SurName; 178 SimParams["lastname"] = theUser.SurName;
180 SimParams["agent_id"] = theUser.ID.ToString(); 179 SimParams["agent_id"] = theUser.ID.ToString();
181 SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); 180 SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode);
182 SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); 181 SimParams["startpos_x"] = theUser.CurrentAgent.CurrentPos.X.ToString();
183 SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); 182 SimParams["startpos_y"] = theUser.CurrentAgent.CurrentPos.Y.ToString();
184 SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); 183 SimParams["startpos_z"] = theUser.CurrentAgent.CurrentPos.Z.ToString();
185 SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); 184 SimParams["regionhandle"] = theUser.CurrentAgent.CurrentHandle.ToString();
186 SimParams["caps_path"] = capsPath; 185 SimParams["caps_path"] = capsPath;
187 ArrayList SendParams = new ArrayList(); 186 ArrayList SendParams = new ArrayList();
188 SendParams.Add(SimParams); 187 SendParams.Add(SimParams);
@@ -206,8 +205,8 @@ namespace OpenSim.Grid.UserServer
206 if (handlerUserLoggedInAtLocation != null) 205 if (handlerUserLoggedInAtLocation != null)
207 { 206 {
208 m_log.Info("[LOGIN]: Letting other objects know about login"); 207 m_log.Info("[LOGIN]: Letting other objects know about login");
209 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, 208 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.CurrentRegion,
210 theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X,theUser.CurrentAgent.currentPos.Y,theUser.CurrentAgent.currentPos.Z, 209 theUser.CurrentAgent.CurrentHandle, theUser.CurrentAgent.CurrentPos.X,theUser.CurrentAgent.CurrentPos.Y,theUser.CurrentAgent.CurrentPos.Z,
211 theUser.FirstName,theUser.SurName); 210 theUser.FirstName,theUser.SurName);
212 } 211 }
213 } 212 }
@@ -259,21 +258,21 @@ namespace OpenSim.Grid.UserServer
259 m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); 258 m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")");
260 259
261 // Update agent with target sim 260 // Update agent with target sim
262 theUser.CurrentAgent.currentRegion = SimInfo.UUID; 261 theUser.CurrentAgent.CurrentRegion = SimInfo.UUID;
263 theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; 262 theUser.CurrentAgent.CurrentHandle = SimInfo.regionHandle;
264 263
265 // Prepare notification 264 // Prepare notification
266 Hashtable SimParams = new Hashtable(); 265 Hashtable SimParams = new Hashtable();
267 SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); 266 SimParams["session_id"] = theUser.CurrentAgent.SessionID.ToString();
268 SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); 267 SimParams["secure_session_id"] = theUser.CurrentAgent.SecureSessionID.ToString();
269 SimParams["firstname"] = theUser.FirstName; 268 SimParams["firstname"] = theUser.FirstName;
270 SimParams["lastname"] = theUser.SurName; 269 SimParams["lastname"] = theUser.SurName;
271 SimParams["agent_id"] = theUser.ID.ToString(); 270 SimParams["agent_id"] = theUser.ID.ToString();
272 SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); 271 SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode);
273 SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); 272 SimParams["startpos_x"] = theUser.CurrentAgent.CurrentPos.X.ToString();
274 SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); 273 SimParams["startpos_y"] = theUser.CurrentAgent.CurrentPos.Y.ToString();
275 SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); 274 SimParams["startpos_z"] = theUser.CurrentAgent.CurrentPos.Z.ToString();
276 SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); 275 SimParams["regionhandle"] = theUser.CurrentAgent.CurrentHandle.ToString();
277 SimParams["caps_path"] = capsPath; 276 SimParams["caps_path"] = capsPath;
278 ArrayList SendParams = new ArrayList(); 277 ArrayList SendParams = new ArrayList();
279 SendParams.Add(SimParams); 278 SendParams.Add(SimParams);
@@ -286,8 +285,8 @@ namespace OpenSim.Grid.UserServer
286 if (handlerUserLoggedInAtLocation != null) 285 if (handlerUserLoggedInAtLocation != null)
287 { 286 {
288 m_log.Info("[LOGIN]: Letting other objects know about login"); 287 m_log.Info("[LOGIN]: Letting other objects know about login");
289 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, 288 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.CurrentRegion,
290 theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X, theUser.CurrentAgent.currentPos.Y, theUser.CurrentAgent.currentPos.Z, 289 theUser.CurrentAgent.CurrentHandle, theUser.CurrentAgent.CurrentPos.X, theUser.CurrentAgent.CurrentPos.Y, theUser.CurrentAgent.CurrentPos.Z,
291 theUser.FirstName, theUser.SurName); 290 theUser.FirstName, theUser.SurName);
292 } 291 }
293 } 292 }
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 8895c6e..4aad93c 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Communications.Local
127 ulong currentRegion = 0; 127 ulong currentRegion = 0;
128 if (startLocationRequest == "last") 128 if (startLocationRequest == "last")
129 { 129 {
130 currentRegion = theUser.CurrentAgent.currentHandle; 130 currentRegion = theUser.CurrentAgent.CurrentHandle;
131 } 131 }
132 else if (startLocationRequest == "home") 132 else if (startLocationRequest == "home")
133 { 133 {
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Communications.Local
138 m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it"); 138 m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it");
139 // LocalBackEndServices can't possibly look up a region by name :( 139 // LocalBackEndServices can't possibly look up a region by name :(
140 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z' 140 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
141 currentRegion = theUser.CurrentAgent.currentHandle; 141 currentRegion = theUser.CurrentAgent.CurrentHandle;
142 } 142 }
143 143
144 RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); 144 RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
@@ -164,8 +164,8 @@ namespace OpenSim.Region.Communications.Local
164 "[CAPS]: Sending new CAPS seed url {0} to client {1}", 164 "[CAPS]: Sending new CAPS seed url {0} to client {1}",
165 response.SeedCapability, response.AgentID); 165 response.SeedCapability, response.AgentID);
166 166
167 theUser.CurrentAgent.currentRegion = reg.RegionID; 167 theUser.CurrentAgent.CurrentRegion = reg.RegionID;
168 theUser.CurrentAgent.currentHandle = reg.RegionHandle; 168 theUser.CurrentAgent.CurrentHandle = reg.RegionHandle;
169 169
170 LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); 170 LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList();
171 171