Restrict IPresenceData.VerifyAgent

Restrict IPresenceData.VerifyAgent to only return bool result
0.7.5-pf-bulletsim
BlueWall 2012-12-09 15:08:32 -05:00
parent a37040d07a
commit 8efae93b51
4 changed files with 17 additions and 17 deletions

View File

@ -53,6 +53,6 @@ namespace OpenSim.Data
bool ReportAgent(UUID sessionID, UUID regionID); bool ReportAgent(UUID sessionID, UUID regionID);
PresenceData[] Get(string field, string data); PresenceData[] Get(string field, string data);
bool Delete(string field, string val); bool Delete(string field, string val);
PresenceData VerifyAgent(UUID secureSessionID); bool VerifyAgent(UUID agentId, UUID secureSessionID);
} }
} }

View File

@ -100,16 +100,18 @@ namespace OpenSim.Data.MSSQL
return true; return true;
} }
public PresenceData VerifyAgent(UUID secureSessionID) public bool VerifyAgent(UUID agentId, UUID secureSessionID)
{ {
PresenceData[] ret = Get("SecureSessionID", PresenceData[] ret = Get("SecureSessionID",
secureSessionID.ToString()); secureSessionID.ToString());
if (ret.Length == 0) if (ret.Length == 0)
return null; return false;
return ret[0]; if(ret[0].UserID != agentId.ToString())
return false;
return true;
} }
} }
} }

View File

@ -96,15 +96,18 @@ namespace OpenSim.Data.MySQL
return true; return true;
} }
public PresenceData VerifyAgent(UUID secureSessionID) public bool VerifyAgent(UUID agentId, UUID secureSessionID)
{ {
PresenceData[] ret = Get("SecureSessionID", PresenceData[] ret = Get("SecureSessionID",
secureSessionID.ToString()); secureSessionID.ToString());
if (ret.Length == 0) if (ret.Length == 0)
return null; return false;
return ret[0]; if(ret[0].UserID != agentId.ToString())
return false;
return true;
} }
} }
} }

View File

@ -222,17 +222,12 @@ namespace OpenSim.Data.Null
return true; return true;
} }
public PresenceData VerifyAgent(UUID secureSessionID) public bool VerifyAgent(UUID agentId, UUID secureSessionID)
{ {
if (Instance != this) if (Instance != this)
return Instance.VerifyAgent(secureSessionID); return Instance.VerifyAgent(agentId, secureSessionID);
if (m_presenceData.ContainsKey(secureSessionID)) return false;
{
return m_presenceData[secureSessionID];
}
return null;
} }
} }