aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AgentCircuitManager.cs26
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs12
-rw-r--r--OpenSim/Framework/IScene.cs2
-rw-r--r--OpenSim/Framework/Servers/MessageServerInfo.cs48
4 files changed, 38 insertions, 50 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs
index e5dbb5a..49d7822 100644
--- a/OpenSim/Framework/AgentCircuitManager.cs
+++ b/OpenSim/Framework/AgentCircuitManager.cs
@@ -36,6 +36,7 @@ namespace OpenSim.Framework
36 public class AgentCircuitManager 36 public class AgentCircuitManager
37 { 37 {
38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); 38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
39 public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
39 40
40 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) 41 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
41 { 42 {
@@ -86,10 +87,12 @@ namespace OpenSim.Framework
86 if (AgentCircuits.ContainsKey(circuitCode)) 87 if (AgentCircuits.ContainsKey(circuitCode))
87 { 88 {
88 AgentCircuits[circuitCode] = agentData; 89 AgentCircuits[circuitCode] = agentData;
90 AgentCircuitsByUUID[agentData.AgentID] = agentData;
89 } 91 }
90 else 92 else
91 { 93 {
92 AgentCircuits.Add(circuitCode, agentData); 94 AgentCircuits.Add(circuitCode, agentData);
95 AgentCircuitsByUUID.Add(agentData.AgentID, agentData);
93 } 96 }
94 } 97 }
95 } 98 }
@@ -99,10 +102,26 @@ namespace OpenSim.Framework
99 lock (AgentCircuits) 102 lock (AgentCircuits)
100 { 103 {
101 if (AgentCircuits.ContainsKey(circuitCode)) 104 if (AgentCircuits.ContainsKey(circuitCode))
105 {
106 UUID agentID = AgentCircuits[circuitCode].AgentID;
102 AgentCircuits.Remove(circuitCode); 107 AgentCircuits.Remove(circuitCode);
108 AgentCircuitsByUUID.Remove(agentID);
109 }
103 } 110 }
104 } 111 }
105 112
113 public virtual void RemoveCircuit(UUID agentID)
114 {
115 lock (AgentCircuits)
116 {
117 if (AgentCircuitsByUUID.ContainsKey(agentID))
118 {
119 uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
120 AgentCircuits.Remove(circuitCode);
121 AgentCircuitsByUUID.Remove(agentID);
122 }
123 }
124 }
106 public AgentCircuitData GetAgentCircuitData(uint circuitCode) 125 public AgentCircuitData GetAgentCircuitData(uint circuitCode)
107 { 126 {
108 AgentCircuitData agentCircuit = null; 127 AgentCircuitData agentCircuit = null;
@@ -110,6 +129,13 @@ namespace OpenSim.Framework
110 return agentCircuit; 129 return agentCircuit;
111 } 130 }
112 131
132 public AgentCircuitData GetAgentCircuitData(UUID agentID)
133 {
134 AgentCircuitData agentCircuit = null;
135 AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
136 return agentCircuit;
137 }
138
113 public void UpdateAgentData(AgentCircuitData agentData) 139 public void UpdateAgentData(AgentCircuitData agentData)
114 { 140 {
115 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) 141 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index b27d011..62a1e17 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -99,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
100 100
101 //private string eventQueue = "0100/"; 101 //private string eventQueue = "0100/";
102 private IScene m_Scene;
102 private IHttpServer m_httpListener; 103 private IHttpServer m_httpListener;
103 private UUID m_agentID; 104 private UUID m_agentID;
104 private IAssetService m_assetCache; 105 private IAssetService m_assetCache;
@@ -130,9 +131,10 @@ namespace OpenSim.Framework.Capabilities
130 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null; 131 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
131 public GetClientDelegate GetClient = null; 132 public GetClientDelegate GetClient = null;
132 133
133 public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, 134 public Caps(IScene scene, IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
134 UUID agent, bool dumpAssetsToFile, string regionName) 135 UUID agent, bool dumpAssetsToFile, string regionName)
135 { 136 {
137 m_Scene = scene;
136 m_assetCache = assetCache; 138 m_assetCache = assetCache;
137 m_capsObjectPath = capsPath; 139 m_capsObjectPath = capsPath;
138 m_httpListener = httpServer; 140 m_httpListener = httpServer;
@@ -278,7 +280,13 @@ namespace OpenSim.Framework.Capabilities
278 public string CapsRequest(string request, string path, string param, 280 public string CapsRequest(string request, string path, string param,
279 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 281 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
280 { 282 {
281 //m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); 283 m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
284
285 if (!m_Scene.CheckClient(m_agentID, httpRequest.RemoteIPEndPoint))
286 {
287 m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
288 return string.Empty;
289 }
282 290
283 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails); 291 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
284 292
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 19ab409..6798b7b 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -102,5 +102,7 @@ namespace OpenSim.Framework
102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback); 102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
103 103
104 ISceneObject DeserializeObject(string representation); 104 ISceneObject DeserializeObject(string representation);
105
106 bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
105 } 107 }
106} 108}
diff --git a/OpenSim/Framework/Servers/MessageServerInfo.cs b/OpenSim/Framework/Servers/MessageServerInfo.cs
deleted file mode 100644
index 57ceb71..0000000
--- a/OpenSim/Framework/Servers/MessageServerInfo.cs
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29
30namespace OpenSim.Framework.Servers
31{
32 public class MessageServerInfo
33 {
34 public string URI;
35 public string sendkey;
36 public string recvkey;
37 public List<ulong> responsibleForRegions;
38
39 public MessageServerInfo()
40 {
41 }
42
43 public override string ToString()
44 {
45 return URI;
46 }
47 }
48}