From ef7dfae41c728d10cfe835cb256958c354449f1b Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 10 Apr 2008 14:37:17 +0000 Subject: changing UserAgentData to use properties. This caused more grief than expected, as monodevelop doesn't like to refactor properties of properties. --- OpenSim/Data/MSSQL/MSSQLManager.cs | 25 ++-- OpenSim/Data/MySQL/MySQLManager.cs | 74 ++++++++---- OpenSim/Data/SQLite/SQLiteUserData.cs | 52 ++++---- OpenSim/Framework/Communications/LoginService.cs | 14 +-- .../Framework/Communications/UserManagerBase.cs | 62 +++++----- OpenSim/Framework/UserAgentData.cs | 133 +++++++++++++++++++-- OpenSim/Grid/UserServer/UserLoginService.cs | 49 ++++---- .../Communications/Local/LocalLoginService.cs | 8 +- 8 files changed, 276 insertions(+), 141 deletions(-) (limited to 'OpenSim') 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 if (reader.Read()) { // Agent IDs - retval.UUID = new LLUUID((string)reader["UUID"]); - retval.sessionID = new LLUUID((string)reader["sessionID"]); - retval.secureSessionID = new LLUUID((string)reader["secureSessionID"]); + retval.ProfileID = new LLUUID((string)reader["UUID"]); + retval.SessionID = new LLUUID((string)reader["sessionID"]); + retval.SecureSessionID = new LLUUID((string)reader["secureSessionID"]); // Agent Who? - retval.agentIP = (string)reader["agentIP"]; - retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); - retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); + retval.AgentIP = (string)reader["agentIP"]; + retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString()); + retval.AgentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); // Login/Logout times (UNIX Epoch) - retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); - retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); + retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString()); + retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); // Current position - retval.currentRegion = (string)reader["currentRegion"]; - retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); - LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); + retval.CurrentRegion = (string)reader["currentRegion"]; + retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); + LLVector3 tmp_v; + LLVector3.TryParse((string)reader["currentPos"], out tmp_v); + retval.CurrentPos = tmp_v; + } else { 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 if (reader.Read()) { // Region Main gotta-have-or-we-return-null parts - if (!UInt64.TryParse(reader["regionHandle"].ToString(), out retval.regionHandle)) + UInt64 tmp64; + if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64)) + { return null; - if (!LLUUID.TryParse((string)reader["uuid"], out retval.UUID)) + } + else + { + retval.regionHandle = tmp64; + } + LLUUID tmp_uuid; + if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) + { return null; + } + else + { + retval.UUID = tmp_uuid; + } // non-critical parts retval.regionName = (string)reader["regionName"]; @@ -369,7 +383,9 @@ namespace OpenSim.Data.MySQL retval.reservationMinY = Convert.ToInt32(reader["resYMin"].ToString()); retval.reservationName = (string) reader["resName"]; retval.status = Convert.ToInt32(reader["status"].ToString()) == 1; - LLUUID.TryParse((string) reader["userUUID"], out retval.userUUID); + LLUUID tmp; + LLUUID.TryParse((string) reader["userUUID"], out tmp); + retval.userUUID = tmp; } else { @@ -390,24 +406,32 @@ namespace OpenSim.Data.MySQL if (reader.Read()) { // Agent IDs - if (!LLUUID.TryParse((string)reader["UUID"], out retval.UUID)) + LLUUID tmp; + if (!LLUUID.TryParse((string)reader["UUID"], out tmp)) return null; - LLUUID.TryParse((string) reader["sessionID"], out retval.sessionID); - LLUUID.TryParse((string)reader["secureSessionID"], out retval.secureSessionID); + retval.ProfileID = tmp; + + LLUUID.TryParse((string) reader["sessionID"], out tmp); + retval.SessionID = tmp; + + LLUUID.TryParse((string)reader["secureSessionID"], out tmp); + retval.SecureSessionID = tmp; // Agent Who? - retval.agentIP = (string) reader["agentIP"]; - retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); - retval.agentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString())); + retval.AgentIP = (string) reader["agentIP"]; + retval.AgentPort = Convert.ToUInt32(reader["agentPort"].ToString()); + retval.AgentOnline = Convert.ToBoolean(Convert.ToInt16(reader["agentOnline"].ToString())); // Login/Logout times (UNIX Epoch) - retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); - retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); + retval.LoginTime = Convert.ToInt32(reader["loginTime"].ToString()); + retval.LogoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); // Current position - retval.currentRegion = new LLUUID((string)reader["currentRegion"]); - retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); - LLVector3.TryParse((string) reader["currentPos"], out retval.currentPos); + retval.CurrentRegion = new LLUUID((string)reader["currentRegion"]); + retval.CurrentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); + LLVector3 tmp_v; + LLVector3.TryParse((string) reader["currentPos"], out tmp_v); + retval.CurrentPos = tmp_v; } else { @@ -883,17 +907,17 @@ namespace OpenSim.Data.MySQL sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);"; Dictionary parameters = new Dictionary(); - parameters["?UUID"] = agentdata.UUID.ToString(); - parameters["?sessionID"] = agentdata.sessionID.ToString(); - parameters["?secureSessionID"] = agentdata.secureSessionID.ToString(); - parameters["?agentIP"] = agentdata.agentIP.ToString(); - parameters["?agentPort"] = agentdata.agentPort.ToString(); - parameters["?agentOnline"] = (agentdata.agentOnline == true) ? "1" : "0"; - parameters["?loginTime"] = agentdata.loginTime.ToString(); - parameters["?logoutTime"] = agentdata.logoutTime.ToString(); - parameters["?currentRegion"] = agentdata.currentRegion.ToString(); - parameters["?currentHandle"] = agentdata.currentHandle.ToString(); - parameters["?currentPos"] = "<" + ((int)agentdata.currentPos.X).ToString() + "," + ((int)agentdata.currentPos.Y).ToString() + "," + ((int)agentdata.currentPos.Z).ToString() + ">"; + parameters["?UUID"] = agentdata.ProfileID.ToString(); + parameters["?sessionID"] = agentdata.SessionID.ToString(); + parameters["?secureSessionID"] = agentdata.SecureSessionID.ToString(); + parameters["?agentIP"] = agentdata.AgentIP.ToString(); + parameters["?agentPort"] = agentdata.AgentPort.ToString(); + parameters["?agentOnline"] = (agentdata.AgentOnline == true) ? "1" : "0"; + parameters["?loginTime"] = agentdata.LoginTime.ToString(); + parameters["?logoutTime"] = agentdata.LogoutTime.ToString(); + parameters["?currentRegion"] = agentdata.CurrentRegion.ToString(); + parameters["?currentHandle"] = agentdata.CurrentHandle.ToString(); + parameters["?currentPos"] = "<" + ((int)agentdata.CurrentPos.X).ToString() + "," + ((int)agentdata.CurrentPos.Y).ToString() + "," + ((int)agentdata.CurrentPos.Z).ToString() + ">"; bool returnval = false; 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 { UserAgentData ua = new UserAgentData(); - ua.UUID = new LLUUID((String) row["UUID"]); - ua.agentIP = (String) row["agentIP"]; - ua.agentPort = Convert.ToUInt32(row["agentPort"]); - ua.agentOnline = Convert.ToBoolean(row["agentOnline"]); - ua.sessionID = new LLUUID((String) row["sessionID"]); - ua.secureSessionID = new LLUUID((String) row["secureSessionID"]); - ua.regionID = new LLUUID((String) row["regionID"]); - ua.loginTime = Convert.ToInt32(row["loginTime"]); - ua.logoutTime = Convert.ToInt32(row["logoutTime"]); - ua.currentRegion = new LLUUID((String) row["currentRegion"]); - ua.currentHandle = Convert.ToUInt64(row["currentHandle"]); - ua.currentPos = new LLVector3( + ua.ProfileID = new LLUUID((String) row["UUID"]); + ua.AgentIP = (String) row["agentIP"]; + ua.AgentPort = Convert.ToUInt32(row["agentPort"]); + ua.AgentOnline = Convert.ToBoolean(row["agentOnline"]); + ua.SessionID = new LLUUID((String) row["sessionID"]); + ua.SecureSessionID = new LLUUID((String) row["secureSessionID"]); + ua.RegionID = new LLUUID((String) row["regionID"]); + ua.LoginTime = Convert.ToInt32(row["loginTime"]); + ua.LogoutTime = Convert.ToInt32(row["logoutTime"]); + ua.CurrentRegion = new LLUUID((String) row["currentRegion"]); + ua.CurrentHandle = Convert.ToUInt64(row["currentHandle"]); + ua.CurrentPos = new LLVector3( Convert.ToSingle(row["currentPosX"]), Convert.ToSingle(row["currentPosY"]), Convert.ToSingle(row["currentPosZ"]) @@ -695,21 +695,21 @@ namespace OpenSim.Data.SQLite private static void fillUserAgentRow(DataRow row, UserAgentData ua) { - row["UUID"] = ua.UUID; - row["agentIP"] = ua.agentIP; - row["agentPort"] = ua.agentPort; - row["agentOnline"] = ua.agentOnline; - row["sessionID"] = ua.sessionID; - row["secureSessionID"] = ua.secureSessionID; - row["regionID"] = ua.regionID; - row["loginTime"] = ua.loginTime; - row["logoutTime"] = ua.logoutTime; - row["currentRegion"] = ua.currentRegion; - row["currentHandle"] = ua.currentHandle.ToString(); + row["UUID"] = ua.ProfileID; + row["agentIP"] = ua.AgentIP; + row["agentPort"] = ua.AgentPort; + row["agentOnline"] = ua.AgentOnline; + row["sessionID"] = ua.SessionID; + row["secureSessionID"] = ua.SecureSessionID; + row["regionID"] = ua.RegionID; + row["loginTime"] = ua.LoginTime; + row["logoutTime"] = ua.LogoutTime; + row["currentRegion"] = ua.CurrentRegion; + row["currentHandle"] = ua.CurrentHandle.ToString(); // vectors - row["currentPosX"] = ua.currentPos.X; - row["currentPosY"] = ua.currentPos.Y; - row["currentPosZ"] = ua.currentPos.Z; + row["currentPosX"] = ua.CurrentPos.X; + row["currentPosY"] = ua.CurrentPos.Y; + row["currentPosZ"] = ua.CurrentPos.Z; } /*********************************************************************** 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 else { // If we already have a session... - if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) + if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline) { //TODO: The following statements can cause trouble: // If agentOnline could not turn from true back to false normally // because of some problem, for instance, the crashment of server or client, // the user cannot log in any longer. - userProfile.CurrentAgent.agentOnline = false; + userProfile.CurrentAgent.AgentOnline = false; m_userManager.CommitAgent(ref userProfile); // Reject the login @@ -225,8 +225,8 @@ namespace OpenSim.Framework.UserManagement logResponse.Lastname = userProfile.SurName; logResponse.Firstname = userProfile.FirstName; logResponse.AgentID = agentID.ToString(); - logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); - logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); + logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString(); + logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString(); logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; logResponse.InventoryLibrary = GetInventoryLibrary(); @@ -334,7 +334,7 @@ namespace OpenSim.Framework.UserManagement else { // If we already have a session... - if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) + if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline) { userProfile.CurrentAgent = null; m_userManager.CommitAgent(ref userProfile); @@ -367,8 +367,8 @@ namespace OpenSim.Framework.UserManagement logResponse.Lastname = userProfile.SurName; logResponse.Firstname = userProfile.FirstName; logResponse.AgentID = agentID.ToString(); - logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); - logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); + logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString(); + logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString(); logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; 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 UserAgentData agent = new UserAgentData(); // User connection - agent.agentOnline = true; + agent.AgentOnline = true; // Generate sessions RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); @@ -351,15 +351,15 @@ namespace OpenSim.Framework.UserManagement rand.GetBytes(randDataS); rand.GetBytes(randDataSS); - agent.secureSessionID = new LLUUID(randDataSS, 0); - agent.sessionID = new LLUUID(randDataS, 0); + agent.SecureSessionID = new LLUUID(randDataSS, 0); + agent.SessionID = new LLUUID(randDataS, 0); // Profile UUID - agent.UUID = profile.ID; + agent.ProfileID = profile.ID; // Current position (from Home) - agent.currentHandle = profile.HomeRegion; - agent.currentPos = profile.HomeLocation; + agent.CurrentHandle = profile.HomeRegion; + agent.CurrentPos = profile.HomeLocation; // If user specified additional start, use that if (requestData.ContainsKey("start")) @@ -367,16 +367,16 @@ namespace OpenSim.Framework.UserManagement string startLoc = ((string)requestData["start"]).Trim(); if (("last" == startLoc) && (profile.CurrentAgent != null)) { - if ((profile.CurrentAgent.currentPos.X > 0) - && (profile.CurrentAgent.currentPos.Y > 0) - && (profile.CurrentAgent.currentPos.Z > 0) + if ((profile.CurrentAgent.CurrentPos.X > 0) + && (profile.CurrentAgent.CurrentPos.Y > 0) + && (profile.CurrentAgent.CurrentPos.Z > 0) ) { // TODO: Right now, currentRegion has not been used in GridServer for requesting region. // TODO: It is only using currentHandle. - agent.currentRegion = profile.CurrentAgent.currentRegion; - agent.currentHandle = profile.CurrentAgent.currentHandle; - agent.currentPos = profile.CurrentAgent.currentPos; + agent.CurrentRegion = profile.CurrentAgent.CurrentRegion; + agent.CurrentHandle = profile.CurrentAgent.CurrentHandle; + agent.CurrentPos = profile.CurrentAgent.CurrentPos; } } @@ -399,12 +399,12 @@ namespace OpenSim.Framework.UserManagement } // What time did the user login? - agent.loginTime = Util.UnixTimeSinceEpoch(); - agent.logoutTime = 0; + agent.LoginTime = Util.UnixTimeSinceEpoch(); + agent.LogoutTime = 0; // Current location - agent.regionID = LLUUID.Zero; // Fill in later - agent.currentRegion = LLUUID.Zero; // Fill in later + agent.RegionID = LLUUID.Zero; // Fill in later + agent.CurrentRegion = LLUUID.Zero; // Fill in later profile.CurrentAgent = agent; } @@ -437,16 +437,16 @@ namespace OpenSim.Framework.UserManagement userAgent = userProfile.CurrentAgent; if (userAgent != null) { - userAgent.agentOnline = false; - userAgent.logoutTime = Util.UnixTimeSinceEpoch(); + userAgent.AgentOnline = false; + userAgent.LogoutTime = Util.UnixTimeSinceEpoch(); //userAgent.sessionID = LLUUID.Zero; if (regionid != LLUUID.Zero) { - userAgent.currentRegion = regionid; + userAgent.CurrentRegion = regionid; } - userAgent.currentHandle = regionhandle; - userAgent.currentPos = currentPos; + userAgent.CurrentHandle = regionhandle; + userAgent.CurrentPos = currentPos; userProfile.CurrentAgent = userAgent; CommitAgent(ref userProfile); @@ -468,7 +468,7 @@ namespace OpenSim.Framework.UserManagement UserAgentData agent = new UserAgentData(); // User connection - agent.agentOnline = true; + agent.AgentOnline = true; // Generate sessions RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); @@ -477,23 +477,23 @@ namespace OpenSim.Framework.UserManagement rand.GetBytes(randDataS); rand.GetBytes(randDataSS); - agent.secureSessionID = new LLUUID(randDataSS, 0); - agent.sessionID = new LLUUID(randDataS, 0); + agent.SecureSessionID = new LLUUID(randDataSS, 0); + agent.SessionID = new LLUUID(randDataS, 0); // Profile UUID - agent.UUID = profile.ID; + agent.ProfileID = profile.ID; // Current position (from Home) - agent.currentHandle = profile.HomeRegion; - agent.currentPos = profile.HomeLocation; + agent.CurrentHandle = profile.HomeRegion; + agent.CurrentPos = profile.HomeLocation; // What time did the user login? - agent.loginTime = Util.UnixTimeSinceEpoch(); - agent.logoutTime = 0; + agent.LoginTime = Util.UnixTimeSinceEpoch(); + agent.LogoutTime = 0; // Current location - agent.regionID = LLUUID.Zero; // Fill in later - agent.currentRegion = LLUUID.Zero; // Fill in later + agent.RegionID = LLUUID.Zero; // Fill in later + agent.CurrentRegion = LLUUID.Zero; // Fill in later profile.CurrentAgent = agent; } 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 /// /// The UUID of the users avatar (not the agent!) /// - public LLUUID UUID; + private LLUUID UUID; /// /// The IP address of the user /// - public string agentIP = String.Empty; + private string agentIP = String.Empty; /// /// The port of the user + /// - public uint agentPort; + private uint agentPort; /// /// Is the user online? /// - public bool agentOnline; + private bool agentOnline; /// /// The session ID for the user (also the agent ID) /// - public LLUUID sessionID; + private LLUUID sessionID; /// /// The "secure" session ID for the user /// /// Not very secure. Dont rely on it for anything more than Linden Lab does. - public LLUUID secureSessionID; + private LLUUID secureSessionID; /// /// The region the user logged into initially /// - public LLUUID regionID; + private LLUUID regionID; /// /// A unix timestamp from when the user logged in /// - public int loginTime; + private int loginTime; /// /// When this agent expired and logged out, 0 if still online /// - public int logoutTime; + private int logoutTime; /// /// Current region the user is logged into /// - public LLUUID currentRegion; + private LLUUID currentRegion; /// /// Region handle of the current region the user is in /// - public ulong currentHandle; + private ulong currentHandle; /// /// The position of the user within the region /// - public LLVector3 currentPos; + private LLVector3 currentPos; + + public LLUUID ProfileID { + get { + return UUID; + } + set { + UUID = value; + } + } + + public string AgentIP { + get { + return agentIP; + } + set { + agentIP = value; + } + } + + public uint AgentPort { + get { + return agentPort; + } + set { + agentPort = value; + } + } + + public bool AgentOnline { + get { + return agentOnline; + } + set { + agentOnline = value; + } + } + + public LLUUID SessionID { + get { + return sessionID; + } + set { + sessionID = value; + } + } + + public LLUUID SecureSessionID { + get { + return secureSessionID; + } + set { + secureSessionID = value; + } + } + + public LLUUID RegionID { + get { + return regionID; + } + set { + regionID = value; + } + } + + public int LoginTime { + get { + return loginTime; + } + set { + loginTime = value; + } + } + + public int LogoutTime { + get { + return logoutTime; + } + set { + logoutTime = value; + } + } + + public LLUUID CurrentRegion { + get { + return currentRegion; + } + set { + currentRegion = value; + } + } + + public ulong CurrentHandle { + get { + return currentHandle; + } + set { + currentHandle = value; + } + } + + public LLVector3 CurrentPos { + get { + return currentPos; + } + set { + currentPos = value; + } + } } } 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 { SimInfo = RegionProfileData.RequestSimProfileData( - theUser.CurrentAgent.currentHandle, m_config.GridServerURL, + theUser.CurrentAgent.CurrentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else if (startLocationRequest == "home") @@ -104,7 +104,7 @@ namespace OpenSim.Grid.UserServer // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' SimInfo = RegionProfileData.RequestSimProfileData( - theUser.CurrentAgent.currentHandle, m_config.GridServerURL, + theUser.CurrentAgent.CurrentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); } else @@ -164,25 +164,24 @@ namespace OpenSim.Grid.UserServer //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); - theUser.CurrentAgent.currentRegion = SimInfo.UUID; - theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; + theUser.CurrentAgent.CurrentRegion = SimInfo.UUID; + theUser.CurrentAgent.CurrentHandle = SimInfo.regionHandle; if (start_x >= 0 && start_y >= 0 && start_z >= 0) { - theUser.CurrentAgent.currentPos.X = start_x; - theUser.CurrentAgent.currentPos.Y = start_y; - theUser.CurrentAgent.currentPos.Z = start_z; + LLVector3 tmp_v = new LLVector3(start_x, start_y, start_z); + theUser.CurrentAgent.CurrentPos = tmp_v; } // Prepare notification Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); - SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); + SimParams["session_id"] = theUser.CurrentAgent.SessionID.ToString(); + SimParams["secure_session_id"] = theUser.CurrentAgent.SecureSessionID.ToString(); SimParams["firstname"] = theUser.FirstName; SimParams["lastname"] = theUser.SurName; SimParams["agent_id"] = theUser.ID.ToString(); SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); - SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); - SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); - SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); - SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); + SimParams["startpos_x"] = theUser.CurrentAgent.CurrentPos.X.ToString(); + SimParams["startpos_y"] = theUser.CurrentAgent.CurrentPos.Y.ToString(); + SimParams["startpos_z"] = theUser.CurrentAgent.CurrentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.CurrentAgent.CurrentHandle.ToString(); SimParams["caps_path"] = capsPath; ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams); @@ -206,8 +205,8 @@ namespace OpenSim.Grid.UserServer if (handlerUserLoggedInAtLocation != null) { m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, - theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X,theUser.CurrentAgent.currentPos.Y,theUser.CurrentAgent.currentPos.Z, + handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.CurrentRegion, + theUser.CurrentAgent.CurrentHandle, theUser.CurrentAgent.CurrentPos.X,theUser.CurrentAgent.CurrentPos.Y,theUser.CurrentAgent.CurrentPos.Z, theUser.FirstName,theUser.SurName); } } @@ -259,21 +258,21 @@ namespace OpenSim.Grid.UserServer m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); // Update agent with target sim - theUser.CurrentAgent.currentRegion = SimInfo.UUID; - theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; + theUser.CurrentAgent.CurrentRegion = SimInfo.UUID; + theUser.CurrentAgent.CurrentHandle = SimInfo.regionHandle; // Prepare notification Hashtable SimParams = new Hashtable(); - SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); - SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); + SimParams["session_id"] = theUser.CurrentAgent.SessionID.ToString(); + SimParams["secure_session_id"] = theUser.CurrentAgent.SecureSessionID.ToString(); SimParams["firstname"] = theUser.FirstName; SimParams["lastname"] = theUser.SurName; SimParams["agent_id"] = theUser.ID.ToString(); SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); - SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); - SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); - SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); - SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); + SimParams["startpos_x"] = theUser.CurrentAgent.CurrentPos.X.ToString(); + SimParams["startpos_y"] = theUser.CurrentAgent.CurrentPos.Y.ToString(); + SimParams["startpos_z"] = theUser.CurrentAgent.CurrentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.CurrentAgent.CurrentHandle.ToString(); SimParams["caps_path"] = capsPath; ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams); @@ -286,8 +285,8 @@ namespace OpenSim.Grid.UserServer if (handlerUserLoggedInAtLocation != null) { m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.sessionID, theUser.CurrentAgent.currentRegion, - theUser.CurrentAgent.currentHandle, theUser.CurrentAgent.currentPos.X, theUser.CurrentAgent.currentPos.Y, theUser.CurrentAgent.currentPos.Z, + handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.CurrentRegion, + theUser.CurrentAgent.CurrentHandle, theUser.CurrentAgent.CurrentPos.X, theUser.CurrentAgent.CurrentPos.Y, theUser.CurrentAgent.CurrentPos.Z, theUser.FirstName, theUser.SurName); } } 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 ulong currentRegion = 0; if (startLocationRequest == "last") { - currentRegion = theUser.CurrentAgent.currentHandle; + currentRegion = theUser.CurrentAgent.CurrentHandle; } else if (startLocationRequest == "home") { @@ -138,7 +138,7 @@ namespace OpenSim.Region.Communications.Local m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it"); // LocalBackEndServices can't possibly look up a region by name :( // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z' - currentRegion = theUser.CurrentAgent.currentHandle; + currentRegion = theUser.CurrentAgent.CurrentHandle; } RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); @@ -164,8 +164,8 @@ namespace OpenSim.Region.Communications.Local "[CAPS]: Sending new CAPS seed url {0} to client {1}", response.SeedCapability, response.AgentID); - theUser.CurrentAgent.currentRegion = reg.RegionID; - theUser.CurrentAgent.currentHandle = reg.RegionHandle; + theUser.CurrentAgent.CurrentRegion = reg.RegionID; + theUser.CurrentAgent.CurrentHandle = reg.RegionHandle; LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); -- cgit v1.1