diff options
author | lbsa71 | 2007-09-25 06:33:18 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-25 06:33:18 +0000 |
commit | eb8640f368ab43b27395690404e845f09366c652 (patch) | |
tree | 736cca5f1e34fddfe1291046797547e4367afdb6 | |
parent | * Fixed Culture-variant parsing of config options (diff) | |
download | opensim-SC_OLD-eb8640f368ab43b27395690404e845f09366c652.zip opensim-SC_OLD-eb8640f368ab43b27395690404e845f09366c652.tar.gz opensim-SC_OLD-eb8640f368ab43b27395690404e845f09366c652.tar.bz2 opensim-SC_OLD-eb8640f368ab43b27395690404e845f09366c652.tar.xz |
* Now the OGS1GridServices has a LocalBackEndServices that it forwards intra-instance requests to
* Every Scene has a ClientManager (as every dog it's day) since two scenes can have the same circuit as client.
9 files changed, 135 insertions, 111 deletions
diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs index 4853c3a..a1afe8d 100644 --- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs +++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs | |||
@@ -34,6 +34,6 @@ namespace OpenSim.Framework.Communications | |||
34 | { | 34 | { |
35 | bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); | 35 | bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); |
36 | bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); | 36 | bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); |
37 | bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID); | 37 | bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId); |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs index b032849..7cf0aea 100644 --- a/OpenSim/Framework/General/ClientManager.cs +++ b/OpenSim/Framework/General/ClientManager.cs | |||
@@ -100,5 +100,10 @@ namespace OpenSim.Framework | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | } | 102 | } |
103 | |||
104 | public bool TryGetClient(uint circuitId, out IClientAPI user) | ||
105 | { | ||
106 | return m_clients.TryGetValue(circuitId, out user); | ||
107 | } | ||
103 | } | 108 | } |
104 | } | 109 | } |
diff --git a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs index e4c13ba..e421ba5 100644 --- a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs +++ b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs | |||
@@ -116,7 +116,6 @@ namespace OpenSim.Framework.Configuration | |||
116 | configurationPlugin.LoadData(); | 116 | configurationPlugin.LoadData(); |
117 | useFile = true; | 117 | useFile = true; |
118 | } | 118 | } |
119 | |||
120 | else | 119 | else |
121 | { | 120 | { |
122 | MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); | 121 | MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); |
diff --git a/OpenSim/Framework/General/Interfaces/IScene.cs b/OpenSim/Framework/General/Interfaces/IScene.cs index 6140918..e3e65f1 100644 --- a/OpenSim/Framework/General/Interfaces/IScene.cs +++ b/OpenSim/Framework/General/Interfaces/IScene.cs | |||
@@ -38,5 +38,10 @@ namespace OpenSim.Framework.Interfaces | |||
38 | RegionInfo RegionInfo { get; } | 38 | RegionInfo RegionInfo { get; } |
39 | object SyncRoot { get; } | 39 | object SyncRoot { get; } |
40 | uint NextLocalId { get; } | 40 | uint NextLocalId { get; } |
41 | |||
42 | ClientManager ClientManager | ||
43 | { | ||
44 | get; | ||
45 | } | ||
41 | } | 46 | } |
42 | } | 47 | } |
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 7134ad3..6fd4ba4 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs | |||
@@ -40,12 +40,13 @@ namespace OpenSim.Region.ClientStack | |||
40 | public class PacketServer | 40 | public class PacketServer |
41 | { | 41 | { |
42 | private ClientStackNetworkHandler m_networkHandler; | 42 | private ClientStackNetworkHandler m_networkHandler; |
43 | private IScene _localScene; | 43 | private IScene m_scene; |
44 | private readonly ClientManager m_clientManager = new ClientManager(); | 44 | |
45 | public ClientManager ClientManager | 45 | //private readonly ClientManager m_clientManager = new ClientManager(); |
46 | { | 46 | //public ClientManager ClientManager |
47 | get { return m_clientManager; } | 47 | //{ |
48 | } | 48 | // get { return m_clientManager; } |
49 | //} | ||
49 | 50 | ||
50 | public PacketServer(ClientStackNetworkHandler networkHandler) | 51 | public PacketServer(ClientStackNetworkHandler networkHandler) |
51 | { | 52 | { |
@@ -57,7 +58,7 @@ namespace OpenSim.Region.ClientStack | |||
57 | { | 58 | { |
58 | set | 59 | set |
59 | { | 60 | { |
60 | this._localScene = value; | 61 | this.m_scene = value; |
61 | } | 62 | } |
62 | } | 63 | } |
63 | 64 | ||
@@ -68,7 +69,7 @@ namespace OpenSim.Region.ClientStack | |||
68 | /// <param name="packet"></param> | 69 | /// <param name="packet"></param> |
69 | public virtual void InPacket(uint circuitCode, Packet packet) | 70 | public virtual void InPacket(uint circuitCode, Packet packet) |
70 | { | 71 | { |
71 | m_clientManager.InPacket(circuitCode, packet); | 72 | m_scene.ClientManager.InPacket(circuitCode, packet); |
72 | } | 73 | } |
73 | 74 | ||
74 | protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) | 75 | protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, IScene scene, AssetCache assetCache, PacketServer packServer, AgentCircuitManager authenSessions) |
@@ -76,28 +77,27 @@ namespace OpenSim.Region.ClientStack | |||
76 | return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions ); | 77 | return new ClientView(remoteEP, initialcirpack, clientManager, scene, assetCache, packServer, authenSessions ); |
77 | } | 78 | } |
78 | 79 | ||
79 | /// <summary> | ||
80 | /// | ||
81 | /// </summary> | ||
82 | /// <param name="epSender"></param> | ||
83 | /// <param name="useCircuit"></param> | ||
84 | /// <param name="assetCache"></param> | ||
85 | /// <param name="inventoryCache"></param> | ||
86 | /// <param name="authenticateSessionsClass"></param> | ||
87 | /// <returns></returns> | ||
88 | public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, AgentCircuitManager authenticateSessionsClass) | 80 | public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, AgentCircuitManager authenticateSessionsClass) |
89 | { | 81 | { |
90 | IClientAPI newuser = | 82 | IClientAPI newuser; |
91 | CreateNewClient(epSender, useCircuit, m_clientManager, _localScene, assetCache, this, | ||
92 | authenticateSessionsClass); | ||
93 | 83 | ||
94 | this.m_clientManager.Add(useCircuit.CircuitCode.Code, newuser); | 84 | if (m_scene.ClientManager.TryGetClient(useCircuit.CircuitCode.Code, out newuser)) |
85 | { | ||
86 | return false; | ||
87 | } | ||
88 | else | ||
89 | { | ||
90 | newuser = CreateNewClient(epSender, useCircuit, m_scene.ClientManager, m_scene, assetCache, this, | ||
91 | authenticateSessionsClass); | ||
95 | 92 | ||
96 | newuser.OnViewerEffect += m_clientManager.ViewerEffectHandler; | 93 | m_scene.ClientManager.Add(useCircuit.CircuitCode.Code, newuser); |
97 | newuser.OnLogout += LogoutHandler; | ||
98 | newuser.OnConnectionClosed += CloseClient; | ||
99 | 94 | ||
100 | return true; | 95 | newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; |
96 | newuser.OnLogout += LogoutHandler; | ||
97 | newuser.OnConnectionClosed += CloseClient; | ||
98 | |||
99 | return true; | ||
100 | } | ||
101 | } | 101 | } |
102 | 102 | ||
103 | public void LogoutHandler(IClientAPI client) | 103 | public void LogoutHandler(IClientAPI client) |
@@ -127,7 +127,7 @@ namespace OpenSim.Region.ClientStack | |||
127 | public virtual void CloseCircuit(uint circuitcode) | 127 | public virtual void CloseCircuit(uint circuitcode) |
128 | { | 128 | { |
129 | m_networkHandler.RemoveClientCircuit( circuitcode ); | 129 | m_networkHandler.RemoveClientCircuit( circuitcode ); |
130 | m_clientManager.CloseAllAgents( circuitcode ); | 130 | m_scene.ClientManager.CloseAllAgents(circuitcode); |
131 | } | 131 | } |
132 | 132 | ||
133 | public virtual void CloseClient( IClientAPI client ) | 133 | public virtual void CloseClient( IClientAPI client ) |
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 3e23963..9a6bc82 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -30,14 +30,15 @@ using libsecondlife; | |||
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Framework.Communications; | 31 | using OpenSim.Framework.Communications; |
32 | using OpenSim.Framework.Types; | 32 | using OpenSim.Framework.Types; |
33 | using System.Collections; | ||
33 | 34 | ||
34 | namespace OpenSim.Region.Communications.Local | 35 | namespace OpenSim.Region.Communications.Local |
35 | { | 36 | { |
36 | 37 | ||
37 | public class LocalBackEndServices : IGridServices, IInterRegionCommunications | 38 | public class LocalBackEndServices : IGridServices, IInterRegionCommunications |
38 | { | 39 | { |
39 | protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); | 40 | protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); |
40 | protected Dictionary<ulong, RegionCommsListener> regionHosts = new Dictionary<ulong, RegionCommsListener>(); | 41 | protected Dictionary<ulong, RegionCommsListener> m_regionListeners = new Dictionary<ulong, RegionCommsListener>(); |
41 | 42 | ||
42 | public LocalBackEndServices() | 43 | public LocalBackEndServices() |
43 | { | 44 | { |
@@ -52,12 +53,13 @@ namespace OpenSim.Region.Communications.Local | |||
52 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) | 53 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) |
53 | { | 54 | { |
54 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); | 55 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); |
55 | if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) | 56 | if (!this.m_regions.ContainsKey((uint)regionInfo.RegionHandle)) |
56 | { | 57 | { |
57 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); | 58 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); |
58 | this.regions.Add(regionInfo.RegionHandle, regionInfo); | 59 | this.m_regions.Add(regionInfo.RegionHandle, regionInfo); |
60 | |||
59 | RegionCommsListener regionHost = new RegionCommsListener(); | 61 | RegionCommsListener regionHost = new RegionCommsListener(); |
60 | this.regionHosts.Add(regionInfo.RegionHandle, regionHost); | 62 | this.m_regionListeners.Add(regionInfo.RegionHandle, regionHost); |
61 | 63 | ||
62 | return regionHost; | 64 | return regionHost; |
63 | } | 65 | } |
@@ -75,7 +77,7 @@ namespace OpenSim.Region.Communications.Local | |||
75 | // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); | 77 | // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); |
76 | List<RegionInfo> neighbours = new List<RegionInfo>(); | 78 | List<RegionInfo> neighbours = new List<RegionInfo>(); |
77 | 79 | ||
78 | foreach (RegionInfo reg in this.regions.Values) | 80 | foreach (RegionInfo reg in this.m_regions.Values) |
79 | { | 81 | { |
80 | // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); | 82 | // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); |
81 | if (reg.RegionHandle != regionInfo.RegionHandle) | 83 | if (reg.RegionHandle != regionInfo.RegionHandle) |
@@ -100,9 +102,9 @@ namespace OpenSim.Region.Communications.Local | |||
100 | /// <returns></returns> | 102 | /// <returns></returns> |
101 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) | 103 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) |
102 | { | 104 | { |
103 | if (this.regions.ContainsKey(regionHandle)) | 105 | if (this.m_regions.ContainsKey(regionHandle)) |
104 | { | 106 | { |
105 | return this.regions[regionHandle]; | 107 | return this.m_regions[regionHandle]; |
106 | } | 108 | } |
107 | return null; | 109 | return null; |
108 | } | 110 | } |
@@ -118,7 +120,7 @@ namespace OpenSim.Region.Communications.Local | |||
118 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) | 120 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) |
119 | { | 121 | { |
120 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); | 122 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
121 | foreach(RegionInfo regInfo in this.regions.Values) | 123 | foreach(RegionInfo regInfo in this.m_regions.Values) |
122 | { | 124 | { |
123 | if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) | 125 | if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) |
124 | { | 126 | { |
@@ -145,10 +147,10 @@ namespace OpenSim.Region.Communications.Local | |||
145 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData | 147 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData |
146 | { | 148 | { |
147 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); | 149 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); |
148 | if (this.regionHosts.ContainsKey(regionHandle)) | 150 | if (this.m_regionListeners.ContainsKey(regionHandle)) |
149 | { | 151 | { |
150 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); | 152 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); |
151 | this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); | 153 | this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); |
152 | return true; | 154 | return true; |
153 | } | 155 | } |
154 | return false; | 156 | return false; |
@@ -163,18 +165,18 @@ namespace OpenSim.Region.Communications.Local | |||
163 | /// <returns></returns> | 165 | /// <returns></returns> |
164 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 166 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
165 | { | 167 | { |
166 | if (this.regionHosts.ContainsKey(regionHandle)) | 168 | if (this.m_regionListeners.ContainsKey(regionHandle)) |
167 | { | 169 | { |
168 | // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); | 170 | // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); |
169 | this.regionHosts[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); | 171 | this.m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); |
170 | return true; | 172 | return true; |
171 | } | 173 | } |
172 | return false; | 174 | return false; |
173 | } | 175 | } |
174 | 176 | ||
175 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) | 177 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) |
176 | { | 178 | { |
177 | if (this.regionHosts.ContainsKey(regionHandle)) | 179 | if (this.m_regionListeners.ContainsKey(regionHandle)) |
178 | { | 180 | { |
179 | return true; | 181 | return true; |
180 | } | 182 | } |
@@ -201,11 +203,54 @@ namespace OpenSim.Region.Communications.Local | |||
201 | agent.startpos = new LLVector3(128, 128, 70); | 203 | agent.startpos = new LLVector3(128, 128, 70); |
202 | agent.CapsPath = loginData.CapsPath; | 204 | agent.CapsPath = loginData.CapsPath; |
203 | 205 | ||
204 | if (this.regionHosts.ContainsKey(regionHandle)) | 206 | TriggerExpectUser(regionHandle, agent); |
207 | } | ||
208 | |||
209 | public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | ||
210 | { | ||
211 | if (this.m_regionListeners.ContainsKey(regionHandle)) | ||
212 | { | ||
213 | this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); | ||
214 | } | ||
215 | } | ||
216 | |||
217 | public void PingCheckReply(Hashtable respData) | ||
218 | { | ||
219 | foreach (ulong region in this.m_regions.Keys ) | ||
205 | { | 220 | { |
206 | this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); | 221 | Hashtable regData = new Hashtable(); |
222 | RegionInfo reg = m_regions[region]; | ||
223 | regData["status"] = "active"; | ||
224 | regData["handle"] = region.ToString(); | ||
225 | |||
226 | respData[reg.SimUUID.ToStringHyphenated()] = regData; | ||
207 | } | 227 | } |
208 | } | 228 | } |
229 | |||
230 | public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | ||
231 | { | ||
232 | if ( m_regionListeners.ContainsKey(regionHandle)) | ||
233 | { | ||
234 | return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, | ||
235 | isFlying); | ||
236 | } | ||
237 | |||
238 | return false; | ||
239 | } | ||
240 | |||
241 | public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) | ||
242 | { | ||
243 | if (m_regionListeners.ContainsKey(regionHandle)) | ||
244 | { | ||
245 | TriggerExpectUser(regionHandle, agentData); | ||
246 | return true; | ||
247 | } | ||
248 | |||
249 | return false; | ||
250 | } | ||
251 | |||
252 | |||
253 | |||
209 | } | 254 | } |
210 | } | 255 | } |
211 | 256 | ||
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 91694b5..1b4b54c 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -12,13 +12,13 @@ using OpenSim.Framework.Communications; | |||
12 | using OpenSim.Framework.Console; | 12 | using OpenSim.Framework.Console; |
13 | using OpenSim.Framework.Servers; | 13 | using OpenSim.Framework.Servers; |
14 | using OpenSim.Framework.Types; | 14 | using OpenSim.Framework.Types; |
15 | using OpenSim.Region.Communications.Local; | ||
15 | 16 | ||
16 | namespace OpenSim.Region.Communications.OGS1 | 17 | namespace OpenSim.Region.Communications.OGS1 |
17 | { | 18 | { |
18 | public class OGS1GridServices : IGridServices, IInterRegionCommunications | 19 | public class OGS1GridServices : IGridServices, IInterRegionCommunications |
19 | { | 20 | { |
20 | public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>(); | 21 | private LocalBackEndServices m_localBackend = new LocalBackEndServices(); |
21 | protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); | ||
22 | 22 | ||
23 | public BaseHttpServer httpListener; | 23 | public BaseHttpServer httpListener; |
24 | public NetworkServersInfo serversInfo; | 24 | public NetworkServersInfo serversInfo; |
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
35 | httpServer = httpServe; | 35 | httpServer = httpServe; |
36 | httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); | 36 | httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); |
37 | httpServer.AddXmlRPCHandler("check", this.PingCheckReply); | 37 | httpServer.AddXmlRPCHandler("check", this.PingCheckReply); |
38 | |||
38 | this.StartRemoting(); | 39 | this.StartRemoting(); |
39 | } | 40 | } |
40 | 41 | ||
@@ -45,11 +46,6 @@ namespace OpenSim.Region.Communications.OGS1 | |||
45 | /// <returns></returns> | 46 | /// <returns></returns> |
46 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) | 47 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) |
47 | { | 48 | { |
48 | if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) | ||
49 | { | ||
50 | this.regions.Add(regionInfo.RegionHandle, regionInfo); | ||
51 | } | ||
52 | |||
53 | Hashtable GridParams = new Hashtable(); | 49 | Hashtable GridParams = new Hashtable(); |
54 | // Login / Authentication | 50 | // Login / Authentication |
55 | 51 | ||
@@ -83,18 +79,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
83 | return null; | 79 | return null; |
84 | } | 80 | } |
85 | 81 | ||
86 | // Initialise the background listeners | 82 | return m_localBackend.RegisterRegion(regionInfo); |
87 | RegionCommsListener regListener = new RegionCommsListener(); | ||
88 | if (!this.listeners.ContainsKey(regionInfo.RegionHandle)) | ||
89 | { | ||
90 | this.listeners.Add(regionInfo.RegionHandle, regListener); | ||
91 | } | ||
92 | else | ||
93 | { | ||
94 | listeners[regionInfo.RegionHandle] = regListener; | ||
95 | } | ||
96 | |||
97 | return regListener; | ||
98 | } | 83 | } |
99 | 84 | ||
100 | /// <summary> | 85 | /// <summary> |
@@ -133,7 +118,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
133 | neighbour.RegionName = (string)neighbourData["name"]; | 118 | neighbour.RegionName = (string)neighbourData["name"]; |
134 | 119 | ||
135 | //OGS1+ | 120 | //OGS1+ |
136 | neighbour.SimUUID = new LLUUID((string) neighbourData["uuid"]); | 121 | neighbour.SimUUID = new LLUUID((string)neighbourData["uuid"]); |
137 | 122 | ||
138 | neighbours.Add(neighbour); | 123 | neighbours.Add(neighbour); |
139 | } | 124 | } |
@@ -150,9 +135,11 @@ namespace OpenSim.Region.Communications.OGS1 | |||
150 | /// <returns></returns> | 135 | /// <returns></returns> |
151 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) | 136 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) |
152 | { | 137 | { |
153 | if (this.regions.ContainsKey(regionHandle)) | 138 | RegionInfo regionInfo = m_localBackend.RequestNeighbourInfo(regionHandle); |
139 | |||
140 | if (regionInfo != null) | ||
154 | { | 141 | { |
155 | return this.regions[regionHandle]; | 142 | return regionInfo; |
156 | } | 143 | } |
157 | 144 | ||
158 | Hashtable requestData = new Hashtable(); | 145 | Hashtable requestData = new Hashtable(); |
@@ -179,7 +166,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
179 | 166 | ||
180 | IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); | 167 | IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port); |
181 | string neighbourExternalUri = externalUri; | 168 | string neighbourExternalUri = externalUri; |
182 | RegionInfo regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); | 169 | regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); |
183 | 170 | ||
184 | regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); | 171 | regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); |
185 | regionInfo.RemotingAddress = internalIpStr; | 172 | regionInfo.RemotingAddress = internalIpStr; |
@@ -245,7 +232,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
245 | IList parameters = new ArrayList(); | 232 | IList parameters = new ArrayList(); |
246 | parameters.Add(param); | 233 | parameters.Add(param); |
247 | XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); | 234 | XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); |
248 | XmlRpcResponse resp = req.Send(serversInfo.GridURL, 3000); | 235 | XmlRpcResponse resp = req.Send(serversInfo.GridURL, 10000); |
249 | Hashtable respData = (Hashtable)resp.Value; | 236 | Hashtable respData = (Hashtable)resp.Value; |
250 | return respData; | 237 | return respData; |
251 | } | 238 | } |
@@ -262,15 +249,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
262 | Hashtable respData = new Hashtable(); | 249 | Hashtable respData = new Hashtable(); |
263 | respData["online"] = "true"; | 250 | respData["online"] = "true"; |
264 | 251 | ||
265 | foreach (ulong region in this.listeners.Keys) | 252 | m_localBackend.PingCheckReply(respData); |
266 | { | ||
267 | Hashtable regData = new Hashtable(); | ||
268 | RegionInfo reg = regions[region]; | ||
269 | regData["status"] = "active"; | ||
270 | regData["handle"] = region.ToString(); | ||
271 | |||
272 | respData[reg.SimUUID.ToStringHyphenated()] = regData; | ||
273 | } | ||
274 | 253 | ||
275 | response.Value = respData; | 254 | response.Value = respData; |
276 | 255 | ||
@@ -308,14 +287,9 @@ namespace OpenSim.Region.Communications.OGS1 | |||
308 | 287 | ||
309 | } | 288 | } |
310 | 289 | ||
311 | if (listeners.ContainsKey(Convert.ToUInt64((string)requestData["regionhandle"]))) | 290 | ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); |
312 | { | 291 | |
313 | this.listeners[Convert.ToUInt64((string)requestData["regionhandle"])].TriggerExpectUser(Convert.ToUInt64((string)requestData["regionhandle"]), agentData); | 292 | m_localBackend.TriggerExpectUser(regionHandle, agentData); |
314 | } | ||
315 | else | ||
316 | { | ||
317 | MainLog.Instance.Error("ExpectUser() - Unknown region " + (Convert.ToUInt64(requestData["regionhandle"])).ToString()); | ||
318 | } | ||
319 | 293 | ||
320 | MainLog.Instance.Verbose("ExpectUser() - Welcoming new user..."); | 294 | MainLog.Instance.Verbose("ExpectUser() - Welcoming new user..."); |
321 | 295 | ||
@@ -333,7 +307,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
333 | 307 | ||
334 | WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); | 308 | WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); |
335 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); | 309 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); |
336 | InterRegionSingleton.Instance.OnArrival += this.IncomingArrival; | 310 | InterRegionSingleton.Instance.OnArrival += this.TriggerExpectAvatarCrossing; |
337 | InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; | 311 | InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; |
338 | } | 312 | } |
339 | 313 | ||
@@ -348,11 +322,11 @@ namespace OpenSim.Region.Communications.OGS1 | |||
348 | { | 322 | { |
349 | try | 323 | try |
350 | { | 324 | { |
351 | if (this.listeners.ContainsKey(regionHandle)) | 325 | if (m_localBackend.InformRegionOfChildAgent(regionHandle, agentData)) |
352 | { | 326 | { |
353 | this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); | ||
354 | return true; | 327 | return true; |
355 | } | 328 | } |
329 | |||
356 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); | 330 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); |
357 | if (regInfo != null) | 331 | if (regInfo != null) |
358 | { | 332 | { |
@@ -401,11 +375,11 @@ namespace OpenSim.Region.Communications.OGS1 | |||
401 | { | 375 | { |
402 | try | 376 | try |
403 | { | 377 | { |
404 | if (this.listeners.ContainsKey(regionHandle)) | 378 | if (m_localBackend.TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying)) |
405 | { | 379 | { |
406 | this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); | ||
407 | return true; | 380 | return true; |
408 | } | 381 | } |
382 | |||
409 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); | 383 | RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); |
410 | if (regInfo != null) | 384 | if (regInfo != null) |
411 | { | 385 | { |
@@ -440,14 +414,11 @@ namespace OpenSim.Region.Communications.OGS1 | |||
440 | } | 414 | } |
441 | } | 415 | } |
442 | 416 | ||
443 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) | 417 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) |
444 | { | 418 | { |
445 | if (this.listeners.ContainsKey(regionHandle)) | 419 | return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); |
446 | { | ||
447 | return true; | ||
448 | } | ||
449 | return false; | ||
450 | } | 420 | } |
421 | |||
451 | #endregion | 422 | #endregion |
452 | 423 | ||
453 | #region Methods triggered by calls from external instances | 424 | #region Methods triggered by calls from external instances |
@@ -461,17 +432,13 @@ namespace OpenSim.Region.Communications.OGS1 | |||
461 | { | 432 | { |
462 | try | 433 | try |
463 | { | 434 | { |
464 | if (this.listeners.ContainsKey(regionHandle)) | 435 | return m_localBackend.IncomingChildAgent(regionHandle, agentData); |
465 | { | ||
466 | this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData); | ||
467 | return true; | ||
468 | } | ||
469 | } | 436 | } |
470 | catch (System.Runtime.Remoting.RemotingException e) | 437 | catch (System.Runtime.Remoting.RemotingException e) |
471 | { | 438 | { |
472 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | 439 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); |
440 | return false; | ||
473 | } | 441 | } |
474 | return false; | ||
475 | } | 442 | } |
476 | 443 | ||
477 | /// <summary> | 444 | /// <summary> |
@@ -481,21 +448,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
481 | /// <param name="agentID"></param> | 448 | /// <param name="agentID"></param> |
482 | /// <param name="position"></param> | 449 | /// <param name="position"></param> |
483 | /// <returns></returns> | 450 | /// <returns></returns> |
484 | public bool IncomingArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 451 | public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
485 | { | 452 | { |
453 | |||
486 | try | 454 | try |
487 | { | 455 | { |
488 | if (this.listeners.ContainsKey(regionHandle)) | 456 | return m_localBackend.TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); |
489 | { | ||
490 | this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); | ||
491 | return true; | ||
492 | } | ||
493 | } | 457 | } |
494 | catch (System.Runtime.Remoting.RemotingException e) | 458 | catch (System.Runtime.Remoting.RemotingException e) |
495 | { | 459 | { |
496 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | 460 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); |
461 | return false; | ||
497 | } | 462 | } |
498 | return false; | ||
499 | } | 463 | } |
500 | #endregion | 464 | #endregion |
501 | #endregion | 465 | #endregion |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5fbe918..7381930 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -54,7 +54,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
54 | { | 54 | { |
55 | public partial class Scene : SceneBase | 55 | public partial class Scene : SceneBase |
56 | { | 56 | { |
57 | |||
58 | public delegate bool FilterAvatarList(ScenePresence avatar); | 57 | public delegate bool FilterAvatarList(ScenePresence avatar); |
59 | 58 | ||
60 | protected Timer m_heartbeatTimer = new Timer(); | 59 | protected Timer m_heartbeatTimer = new Timer(); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index b3cd99c..96321c7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -33,11 +33,18 @@ using OpenSim.Framework.Console; | |||
33 | using OpenSim.Framework.Interfaces; | 33 | using OpenSim.Framework.Interfaces; |
34 | using OpenSim.Framework.Types; | 34 | using OpenSim.Framework.Types; |
35 | using OpenSim.Region.Terrain; | 35 | using OpenSim.Region.Terrain; |
36 | using OpenSim.Framework; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.Environment.Scenes | 38 | namespace OpenSim.Region.Environment.Scenes |
38 | { | 39 | { |
39 | public abstract class SceneBase : IScene | 40 | public abstract class SceneBase : IScene |
40 | { | 41 | { |
42 | private readonly ClientManager m_clientManager = new ClientManager(); | ||
43 | public ClientManager ClientManager | ||
44 | { | ||
45 | get { return m_clientManager; } | ||
46 | } | ||
47 | |||
41 | public Dictionary<LLUUID, EntityBase> Entities; | 48 | public Dictionary<LLUUID, EntityBase> Entities; |
42 | protected ulong m_regionHandle; | 49 | protected ulong m_regionHandle; |
43 | protected string m_regionName; | 50 | protected string m_regionName; |