mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 10:46:00 +08:00
Merge branch 'master' into careminster-presence-refactor
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
public class MessageServerInfo
|
||||
{
|
||||
public string URI;
|
||||
public string sendkey;
|
||||
public string recvkey;
|
||||
public List<ulong> responsibleForRegions;
|
||||
|
||||
public MessageServerInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return URI;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user