* Updated UserAgentData class, adding new properties, modifying existing ones datatypes.

* Added read-only support for new userserver to MySQL Data Interface. (TODO: Add write capabilities to the Agent table.)
* Added new regionMapTextureID support to MySQL Data server. (thanks MorphW!)
zircon^2
Adam Frisby 2007-05-20 14:21:55 +00:00
parent 5413fac008
commit 601beec8b3
2 changed files with 89 additions and 5 deletions

View File

@ -118,6 +118,87 @@ namespace OpenGrid.Framework.Data.MySQL
retval.regionUserURI = (string)reader["regionUserURI"];
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
// World Map Addition
retval.regionMapTextureID = new libsecondlife.LLUUID((string)reader["regionMapTexture"]);
}
else
{
return null;
}
return retval;
}
public UserAgentData getAgentRow(IDataReader reader)
{
UserAgentData retval = new UserAgentData();
if (reader.Read())
{
// Agent IDs
retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]);
retval.secureSessionID = new libsecondlife.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());
// Login/Logout times (UNIX Epoch)
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());
libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
}
else
{
return null;
}
return retval;
}
public UserProfileData getUserRow(IDataReader reader)
{
UserProfileData retval = new UserProfileData();
if (reader.Read())
{
retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
retval.username = (string)reader["username"];
retval.surname = (string)reader["lastname"];
retval.passwordHash = (string)reader["passwordHash"];
retval.passwordSalt = (string)reader["passwordSalt"];
retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
retval.homeLocation = new libsecondlife.LLVector3(
Convert.ToSingle(reader["homeLocationX"].ToString()),
Convert.ToSingle(reader["homeLocationY"].ToString()),
Convert.ToSingle(reader["homeLocationZ"].ToString()));
retval.homeLookAt = new libsecondlife.LLVector3(
Convert.ToSingle(reader["homeLookAtX"].ToString()),
Convert.ToSingle(reader["homeLookAtY"].ToString()),
Convert.ToSingle(reader["homeLookAtZ"].ToString()));
retval.created = Convert.ToInt32(reader["created"].ToString());
retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
retval.userInventoryURI = (string)reader["userInventoryURI"];
retval.userAssetURI = (string)reader["userAssetURI"];
retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
retval.profileAboutText = (string)reader["profileAboutText"];
retval.profileFirstText = (string)reader["profileFirstText"];
retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]);
retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]);
}
else
{

View File

@ -38,14 +38,17 @@ namespace OpenGrid.Framework.Data
public class UserAgentData
{
public LLUUID UUID; // Internal session ID
public string agentIP; // The IP of the agent
public uint agentPort; // The port of the agent
public bool agentOnline; // The online status of the agent
public LLUUID sessionID; // The session ID for the agent
public LLUUID secureSessionID; // The secure session ID for the agent
public LLUUID sessionID; // The session ID for the agent (used by client)
public LLUUID secureSessionID; // The secure session ID for the agent (used by client)
public LLUUID regionID; // The region ID the agent occupies
public uint loginTime; // EPOCH based Timestamp
public uint logoutTime; // Timestamp or 0 if N/A
public int loginTime; // EPOCH based Timestamp
public int logoutTime; // Timestamp or 0 if N/A
public LLUUID currentRegion; // UUID of the users current region
public ulong currentHandle; // RegionHandle of the users current region
public LLVector3 currentPos; // Current position in the region
}
}