Database and presence changes. Untested
parent
f43a648052
commit
92a40129b5
|
@ -35,7 +35,7 @@ namespace OpenSim.Data
|
|||
// This MUST be a ref type!
|
||||
public class PresenceData
|
||||
{
|
||||
public UUID PrincipalID;
|
||||
public string UserID;
|
||||
public UUID RegionID;
|
||||
public UUID SessionID;
|
||||
public Dictionary<string, string> Data;
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
|||
|
||||
#region IPresenceService
|
||||
|
||||
public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID)
|
||||
public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
|
||||
{
|
||||
m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
|
||||
return false;
|
||||
|
@ -175,9 +175,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
|||
return m_PresenceService.GetAgent(sessionID);
|
||||
}
|
||||
|
||||
public PresenceInfo[] GetAgents(string[] principalIDs)
|
||||
public PresenceInfo[] GetAgents(string[] userIDs)
|
||||
{
|
||||
return m_PresenceService.GetAgents(principalIDs);
|
||||
return m_PresenceService.GetAgents(userIDs);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
|||
|
||||
#region IPresenceService
|
||||
|
||||
public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID)
|
||||
public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
|
||||
{
|
||||
m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
|
||||
return false;
|
||||
|
@ -148,9 +148,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
|||
return m_RemoteConnector.GetAgent(sessionID);
|
||||
}
|
||||
|
||||
public PresenceInfo[] GetAgents(string[] principalIDs)
|
||||
public PresenceInfo[] GetAgents(string[] userIDs)
|
||||
{
|
||||
return m_RemoteConnector.GetAgents(principalIDs);
|
||||
return m_RemoteConnector.GetAgents(userIDs);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -104,15 +104,14 @@ namespace OpenSim.Server.Handlers.Presence
|
|||
|
||||
byte[] LoginAgent(Dictionary<string, object> request)
|
||||
{
|
||||
UUID principal = UUID.Zero;
|
||||
string user = String.Empty;
|
||||
UUID session = UUID.Zero;
|
||||
UUID ssession = UUID.Zero;
|
||||
|
||||
if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("SessionID"))
|
||||
if (!request.ContainsKey("UserID") || !request.ContainsKey("SessionID"))
|
||||
return FailureResult();
|
||||
|
||||
if (!UUID.TryParse(request["PrincipalID"].ToString(), out principal))
|
||||
return FailureResult();
|
||||
user = request["UserID"].ToString();
|
||||
|
||||
if (!UUID.TryParse(request["SessionID"].ToString(), out session))
|
||||
return FailureResult();
|
||||
|
@ -121,7 +120,7 @@ namespace OpenSim.Server.Handlers.Presence
|
|||
// If it's malformed, we go on with a Zero on it
|
||||
UUID.TryParse(request["SecureSessionID"].ToString(), out ssession);
|
||||
|
||||
if (m_PresenceService.LoginAgent(principal, session, ssession))
|
||||
if (m_PresenceService.LoginAgent(user, session, ssession))
|
||||
return SuccessResult();
|
||||
|
||||
return FailureResult();
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
#region IPresenceService
|
||||
|
||||
public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID)
|
||||
public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
//sendData["SCOPEID"] = scopeID.ToString();
|
||||
|
@ -94,7 +94,7 @@ namespace OpenSim.Services.Connectors
|
|||
sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
|
||||
sendData["METHOD"] = "login";
|
||||
|
||||
sendData["PrincipalID"] = principalID.ToString();
|
||||
sendData["UserID"] = userID;
|
||||
sendData["SessionID"] = sessionID.ToString();
|
||||
sendData["SecureSessionID"] = secureSessionID.ToString();
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace OpenSim.Services.Interfaces
|
|||
{
|
||||
public class PresenceInfo
|
||||
{
|
||||
public UUID PrincipalID;
|
||||
public string UserID;
|
||||
public UUID RegionID;
|
||||
public bool Online;
|
||||
public DateTime Login;
|
||||
|
@ -48,8 +48,8 @@ namespace OpenSim.Services.Interfaces
|
|||
|
||||
public PresenceInfo(Dictionary<string, object> kvp)
|
||||
{
|
||||
if (kvp.ContainsKey("PrincipalID"))
|
||||
UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID);
|
||||
if (kvp.ContainsKey("UserID"))
|
||||
UserID = kvp["UserID"].ToString();
|
||||
if (kvp.ContainsKey("RegionID"))
|
||||
UUID.TryParse(kvp["RegionID"].ToString(), out RegionID);
|
||||
if (kvp.ContainsKey("login"))
|
||||
|
@ -68,7 +68,7 @@ namespace OpenSim.Services.Interfaces
|
|||
public Dictionary<string, object> ToKeyValuePairs()
|
||||
{
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
result["PrincipalID"] = PrincipalID.ToString();
|
||||
result["UserID"] = UserID;
|
||||
result["RegionID"] = RegionID.ToString();
|
||||
result["online"] = Online.ToString();
|
||||
result["login"] = Login.ToString();
|
||||
|
@ -82,7 +82,7 @@ namespace OpenSim.Services.Interfaces
|
|||
|
||||
public interface IPresenceService
|
||||
{
|
||||
bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID);
|
||||
bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID);
|
||||
bool LogoutAgent(UUID sessionID);
|
||||
bool LogoutRegionAgents(UUID regionID);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenSim.Services.PresenceService
|
|||
{
|
||||
}
|
||||
|
||||
public bool LoginAgent(UUID principalID, UUID sessionID,
|
||||
public bool LoginAgent(string userID, UUID sessionID,
|
||||
UUID secureSessionID)
|
||||
{
|
||||
// We have just logged in. If there is any info in the table
|
||||
|
@ -58,7 +58,7 @@ namespace OpenSim.Services.PresenceService
|
|||
//
|
||||
PresenceData data = new PresenceData();
|
||||
|
||||
data.PrincipalID = principalID;
|
||||
data.UserID = userID;
|
||||
data.RegionID = UUID.Zero;
|
||||
data.SessionID = sessionID;
|
||||
data.Data["SecureSessionID"] = secureSessionID.ToString();
|
||||
|
@ -105,7 +105,7 @@ namespace OpenSim.Services.PresenceService
|
|||
if (data == null)
|
||||
return null;
|
||||
|
||||
ret.PrincipalID = data.PrincipalID;
|
||||
ret.UserID = data.UserID;
|
||||
ret.RegionID = data.RegionID;
|
||||
ret.Online = bool.Parse(data.Data["Online"]);
|
||||
ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"]));
|
||||
|
@ -116,23 +116,20 @@ namespace OpenSim.Services.PresenceService
|
|||
return ret;
|
||||
}
|
||||
|
||||
public PresenceInfo[] GetAgents(string[] principalIDs)
|
||||
public PresenceInfo[] GetAgents(string[] userIDs)
|
||||
{
|
||||
List<PresenceInfo> info = new List<PresenceInfo>();
|
||||
|
||||
foreach (string principalIDStr in principalIDs)
|
||||
foreach (string userIDStr in userIDs)
|
||||
{
|
||||
UUID principalID = UUID.Zero;
|
||||
if (UUID.TryParse(principalIDStr, out principalID))
|
||||
{
|
||||
PresenceData[] data = m_Database.Get("PrincipalID",
|
||||
principalID.ToString());
|
||||
PresenceData[] data = m_Database.Get("UserID",
|
||||
userIDStr);
|
||||
|
||||
foreach (PresenceData d in data)
|
||||
{
|
||||
PresenceInfo ret = new PresenceInfo();
|
||||
|
||||
ret.PrincipalID = d.PrincipalID;
|
||||
ret.UserID = d.UserID;
|
||||
ret.RegionID = d.RegionID;
|
||||
ret.Online = bool.Parse(d.Data["Online"]);
|
||||
ret.Login = Util.ToDateTime(Convert.ToInt32(
|
||||
|
@ -145,7 +142,6 @@ namespace OpenSim.Services.PresenceService
|
|||
info.Add(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return info.ToArray();
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Services.PresenceService
|
|||
{
|
||||
string dllName = String.Empty;
|
||||
string connString = String.Empty;
|
||||
string realm = "agents";
|
||||
string realm = "Presence";
|
||||
|
||||
//
|
||||
// Try reading the [DatabaseService] section, if it exists
|
||||
|
|
Loading…
Reference in New Issue