Merge branch 'justincc-master'

0.8.0.3
Justin Clark-Casey (justincc) 2014-02-15 01:18:10 +00:00
commit f6913e911e
1 changed files with 19 additions and 6 deletions

View File

@ -120,11 +120,13 @@ namespace OpenSim.Services.UserAccountService
MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount);
}
public virtual GridUserInfo GetGridUserInfo(string userID)
private GridUserData GetGridUserData(string userID)
{
GridUserData d = null;
if (userID.Length > 36) // it's a UUI
{
d = m_Database.Get(userID);
}
else // it's a UUID
{
GridUserData[] ds = m_Database.GetAll(userID);
@ -140,6 +142,13 @@ namespace OpenSim.Services.UserAccountService
}
}
return d;
}
public virtual GridUserInfo GetGridUserInfo(string userID)
{
GridUserData d = GetGridUserData(userID);
if (d == null)
return null;
@ -173,7 +182,8 @@ namespace OpenSim.Services.UserAccountService
public GridUserInfo LoggedIn(string userID)
{
m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID);
GridUserData d = m_Database.Get(userID);
GridUserData d = GetGridUserData(userID);
if (d == null)
{
@ -192,7 +202,8 @@ namespace OpenSim.Services.UserAccountService
public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
{
m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID);
GridUserData d = m_Database.Get(userID);
GridUserData d = GetGridUserData(userID);
if (d == null)
{
@ -211,7 +222,8 @@ namespace OpenSim.Services.UserAccountService
public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt)
{
GridUserData d = m_Database.Get(userID);
GridUserData d = GetGridUserData(userID);
if (d == null)
{
d = new GridUserData();
@ -229,7 +241,8 @@ namespace OpenSim.Services.UserAccountService
{
// m_log.DebugFormat("[GRID USER SERVICE]: SetLastPosition for {0}", userID);
GridUserData d = m_Database.Get(userID);
GridUserData d = GetGridUserData(userID);
if (d == null)
{
d = new GridUserData();
@ -243,4 +256,4 @@ namespace OpenSim.Services.UserAccountService
return m_Database.Store(d);
}
}
}
}