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