changing UserAgentData to use properties. This caused more

grief than expected, as monodevelop doesn't like to refactor 
properties of properties.
This commit is contained in:
Sean Dague
2008-04-10 14:37:17 +00:00
parent 25fea01b92
commit ef7dfae41c
8 changed files with 276 additions and 141 deletions

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -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;
}
}
}
}