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())
|
||||
{
|
||||
// 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
|
||||
{
|
||||
|
|
|
@ -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<string, string> parameters = new Dictionary<string, string>();
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -38,62 +38,171 @@ namespace OpenSim.Framework
|
|||
/// <summary>
|
||||
/// The UUID of the users avatar (not the agent!)
|
||||
/// </summary>
|
||||
public LLUUID UUID;
|
||||
private LLUUID UUID;
|
||||
|
||||
/// <summary>
|
||||
/// The IP address of the user
|
||||
/// </summary>
|
||||
public string agentIP = String.Empty;
|
||||
private string agentIP = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The port of the user
|
||||
|
||||
/// </summary>
|
||||
public uint agentPort;
|
||||
private uint agentPort;
|
||||
|
||||
/// <summary>
|
||||
/// Is the user online?
|
||||
/// </summary>
|
||||
public bool agentOnline;
|
||||
private bool agentOnline;
|
||||
|
||||
/// <summary>
|
||||
/// The session ID for the user (also the agent ID)
|
||||
/// </summary>
|
||||
public LLUUID sessionID;
|
||||
private LLUUID sessionID;
|
||||
|
||||
/// <summary>
|
||||
/// The "secure" session ID for the user
|
||||
/// </summary>
|
||||
/// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
|
||||
public LLUUID secureSessionID;
|
||||
private LLUUID secureSessionID;
|
||||
|
||||
/// <summary>
|
||||
/// The region the user logged into initially
|
||||
/// </summary>
|
||||
public LLUUID regionID;
|
||||
private LLUUID regionID;
|
||||
|
||||
/// <summary>
|
||||
/// A unix timestamp from when the user logged in
|
||||
/// </summary>
|
||||
public int loginTime;
|
||||
private int loginTime;
|
||||
|
||||
/// <summary>
|
||||
/// When this agent expired and logged out, 0 if still online
|
||||
/// </summary>
|
||||
public int logoutTime;
|
||||
private int logoutTime;
|
||||
|
||||
/// <summary>
|
||||
/// Current region the user is logged into
|
||||
/// </summary>
|
||||
public LLUUID currentRegion;
|
||||
private LLUUID currentRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Region handle of the current region the user is in
|
||||
/// </summary>
|
||||
public ulong currentHandle;
|
||||
private ulong currentHandle;
|
||||
|
||||
/// <summary>
|
||||
/// The position of the user within the region
|
||||
/// </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 =
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue