mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Finalized the client's TCP IP address verification process for HG1.5.
This commit is contained in:
@@ -36,6 +36,7 @@ namespace OpenSim.Framework
|
||||
public class AgentCircuitManager
|
||||
{
|
||||
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
|
||||
public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
|
||||
|
||||
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
|
||||
{
|
||||
@@ -86,10 +87,12 @@ namespace OpenSim.Framework
|
||||
if (AgentCircuits.ContainsKey(circuitCode))
|
||||
{
|
||||
AgentCircuits[circuitCode] = agentData;
|
||||
AgentCircuitsByUUID[agentData.AgentID] = agentData;
|
||||
}
|
||||
else
|
||||
{
|
||||
AgentCircuits.Add(circuitCode, agentData);
|
||||
AgentCircuitsByUUID.Add(agentData.AgentID, agentData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,10 +102,26 @@ namespace OpenSim.Framework
|
||||
lock (AgentCircuits)
|
||||
{
|
||||
if (AgentCircuits.ContainsKey(circuitCode))
|
||||
{
|
||||
UUID agentID = AgentCircuits[circuitCode].AgentID;
|
||||
AgentCircuits.Remove(circuitCode);
|
||||
AgentCircuitsByUUID.Remove(agentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void RemoveCircuit(UUID agentID)
|
||||
{
|
||||
lock (AgentCircuits)
|
||||
{
|
||||
if (AgentCircuitsByUUID.ContainsKey(agentID))
|
||||
{
|
||||
uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
|
||||
AgentCircuits.Remove(circuitCode);
|
||||
AgentCircuitsByUUID.Remove(agentID);
|
||||
}
|
||||
}
|
||||
}
|
||||
public AgentCircuitData GetAgentCircuitData(uint circuitCode)
|
||||
{
|
||||
AgentCircuitData agentCircuit = null;
|
||||
@@ -110,6 +129,13 @@ namespace OpenSim.Framework
|
||||
return agentCircuit;
|
||||
}
|
||||
|
||||
public AgentCircuitData GetAgentCircuitData(UUID agentID)
|
||||
{
|
||||
AgentCircuitData agentCircuit = null;
|
||||
AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
|
||||
return agentCircuit;
|
||||
}
|
||||
|
||||
public void UpdateAgentData(AgentCircuitData agentData)
|
||||
{
|
||||
if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
|
||||
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
|
||||
|
||||
//private string eventQueue = "0100/";
|
||||
private IScene m_Scene;
|
||||
private IHttpServer m_httpListener;
|
||||
private UUID m_agentID;
|
||||
private IAssetService m_assetCache;
|
||||
@@ -130,9 +131,10 @@ namespace OpenSim.Framework.Capabilities
|
||||
public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
|
||||
public GetClientDelegate GetClient = null;
|
||||
|
||||
public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
|
||||
public Caps(IScene scene, IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
|
||||
UUID agent, bool dumpAssetsToFile, string regionName)
|
||||
{
|
||||
m_Scene = scene;
|
||||
m_assetCache = assetCache;
|
||||
m_capsObjectPath = capsPath;
|
||||
m_httpListener = httpServer;
|
||||
@@ -278,7 +280,13 @@ namespace OpenSim.Framework.Capabilities
|
||||
public string CapsRequest(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
//m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||
m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||
|
||||
if (!m_Scene.CheckClient(m_agentID, httpRequest.RemoteIPEndPoint))
|
||||
{
|
||||
m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
|
||||
|
||||
|
||||
@@ -102,5 +102,7 @@ namespace OpenSim.Framework
|
||||
void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
|
||||
|
||||
ISceneObject DeserializeObject(string representation);
|
||||
|
||||
bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user