mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 18:55:39 +08:00
Restrict IPresenceData.VerifyAgent
Restrict IPresenceData.VerifyAgent to only return bool result
This commit is contained in:
@@ -53,6 +53,6 @@ namespace OpenSim.Data
|
||||
bool ReportAgent(UUID sessionID, UUID regionID);
|
||||
PresenceData[] Get(string field, string data);
|
||||
bool Delete(string field, string val);
|
||||
PresenceData VerifyAgent(UUID secureSessionID);
|
||||
bool VerifyAgent(UUID agentId, UUID secureSessionID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,16 +100,18 @@ namespace OpenSim.Data.MSSQL
|
||||
return true;
|
||||
}
|
||||
|
||||
public PresenceData VerifyAgent(UUID secureSessionID)
|
||||
public bool VerifyAgent(UUID agentId, UUID secureSessionID)
|
||||
{
|
||||
PresenceData[] ret = Get("SecureSessionID",
|
||||
secureSessionID.ToString());
|
||||
|
||||
|
||||
if (ret.Length == 0)
|
||||
return null;
|
||||
return false;
|
||||
|
||||
return ret[0];
|
||||
if(ret[0].UserID != agentId.ToString())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,15 +96,18 @@ namespace OpenSim.Data.MySQL
|
||||
return true;
|
||||
}
|
||||
|
||||
public PresenceData VerifyAgent(UUID secureSessionID)
|
||||
public bool VerifyAgent(UUID agentId, UUID secureSessionID)
|
||||
{
|
||||
PresenceData[] ret = Get("SecureSessionID",
|
||||
secureSessionID.ToString());
|
||||
|
||||
if (ret.Length == 0)
|
||||
return null;
|
||||
return false;
|
||||
|
||||
return ret[0];
|
||||
if(ret[0].UserID != agentId.ToString())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,17 +222,12 @@ namespace OpenSim.Data.Null
|
||||
return true;
|
||||
}
|
||||
|
||||
public PresenceData VerifyAgent(UUID secureSessionID)
|
||||
public bool VerifyAgent(UUID agentId, UUID secureSessionID)
|
||||
{
|
||||
if (Instance != this)
|
||||
return Instance.VerifyAgent(secureSessionID);
|
||||
return Instance.VerifyAgent(agentId, secureSessionID);
|
||||
|
||||
if (m_presenceData.ContainsKey(secureSessionID))
|
||||
{
|
||||
return m_presenceData[secureSessionID];
|
||||
}
|
||||
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user