diff options
-rw-r--r-- | OpenSim/Framework/AgentCircuitManager.cs | 13 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 66 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 8 |
7 files changed, 113 insertions, 61 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs index 96a7816..027d0c6 100644 --- a/OpenSim/Framework/AgentCircuitManager.cs +++ b/OpenSim/Framework/AgentCircuitManager.cs | |||
@@ -30,14 +30,13 @@ using OpenMetaverse; | |||
30 | 30 | ||
31 | namespace OpenSim.Framework | 31 | namespace OpenSim.Framework |
32 | { | 32 | { |
33 | /// <summary> | ||
34 | /// Manage client circuits | ||
35 | /// </summary> | ||
33 | public class AgentCircuitManager | 36 | public class AgentCircuitManager |
34 | { | 37 | { |
35 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); | 38 | public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); |
36 | 39 | ||
37 | public AgentCircuitManager() | ||
38 | { | ||
39 | } | ||
40 | |||
41 | public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) | 40 | public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) |
42 | { | 41 | { |
43 | AgentCircuitData validcircuit = null; | 42 | AgentCircuitData validcircuit = null; |
@@ -74,6 +73,11 @@ namespace OpenSim.Framework | |||
74 | return (user); | 73 | return (user); |
75 | } | 74 | } |
76 | 75 | ||
76 | /// <summary> | ||
77 | /// Add information about a new circuit. | ||
78 | /// </summary> | ||
79 | /// <param name="circuitCode"></param> | ||
80 | /// <param name="agentData"></param> | ||
77 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) | 81 | public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData) |
78 | { | 82 | { |
79 | if (AgentCircuits.ContainsKey(circuitCode)) | 83 | if (AgentCircuits.ContainsKey(circuitCode)) |
@@ -118,7 +122,6 @@ namespace OpenSim.Framework | |||
118 | /// </summary> | 122 | /// </summary> |
119 | /// <param name="circuitcode"></param> | 123 | /// <param name="circuitcode"></param> |
120 | /// <param name="newcircuitcode"></param> | 124 | /// <param name="newcircuitcode"></param> |
121 | |||
122 | public bool TryChangeCiruitCode(uint circuitcode, uint newcircuitcode) | 125 | public bool TryChangeCiruitCode(uint circuitcode, uint newcircuitcode) |
123 | { | 126 | { |
124 | lock (AgentCircuits) | 127 | lock (AgentCircuits) |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 10490a6..06a68ae 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -309,7 +309,6 @@ namespace OpenSim.Grid.UserServer | |||
309 | { | 309 | { |
310 | bool responseSuccess = true; | 310 | bool responseSuccess = true; |
311 | 311 | ||
312 | |||
313 | if (GridResp.Value != null) | 312 | if (GridResp.Value != null) |
314 | { | 313 | { |
315 | Hashtable resp = (Hashtable) GridResp.Value; | 314 | Hashtable resp = (Hashtable) GridResp.Value; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5e22e2d..b721fa3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -376,6 +376,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
376 | 376 | ||
377 | /* METHODS */ | 377 | /* METHODS */ |
378 | 378 | ||
379 | /// <summary> | ||
380 | /// Constructor | ||
381 | /// </summary> | ||
382 | /// <param name="remoteEP"></param> | ||
383 | /// <param name="scene"></param> | ||
384 | /// <param name="assetCache"></param> | ||
385 | /// <param name="packServer"></param> | ||
386 | /// <param name="authenSessions"></param> | ||
387 | /// <param name="agentId"></param> | ||
388 | /// <param name="sessionId"></param> | ||
389 | /// <param name="circuitCode"></param> | ||
390 | /// <param name="proxyEP"></param> | ||
379 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, | 391 | public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, |
380 | AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) | 392 | AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) |
381 | { | 393 | { |
@@ -417,7 +429,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
417 | m_clientThread.Start(); | 429 | m_clientThread.Start(); |
418 | ThreadTracker.Add(m_clientThread); | 430 | ThreadTracker.Add(m_clientThread); |
419 | 431 | ||
420 | m_log.Info("[CLIENT]: Started up new thread to handle client UDP session"); | 432 | m_log.DebugFormat("[CLIENT]: Started new UDP session thread for agent {0}, circuit {1}", agentId, circuitCode); |
421 | } | 433 | } |
422 | 434 | ||
423 | public void SetDebug(int newDebug) | 435 | public void SetDebug(int newDebug) |
@@ -634,7 +646,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
634 | 646 | ||
635 | protected virtual void ClientLoop() | 647 | protected virtual void ClientLoop() |
636 | { | 648 | { |
637 | m_log.Info("[CLIENT]: Entered loop"); | 649 | m_log.Info("[CLIENT]: Entered main packet processing loop"); |
650 | |||
638 | while (true) | 651 | while (true) |
639 | { | 652 | { |
640 | LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); | 653 | LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); |
@@ -729,7 +742,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
729 | /// </summary> | 742 | /// </summary> |
730 | protected virtual void AuthUser() | 743 | protected virtual void AuthUser() |
731 | { | 744 | { |
732 | |||
733 | //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) | 745 | //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) |
734 | //otherwise it will override this and use the system default | 746 | //otherwise it will override this and use the system default |
735 | Culture.SetCurrentCulture(); | 747 | Culture.SetCurrentCulture(); |
@@ -738,8 +750,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
738 | { | 750 | { |
739 | // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code); | 751 | // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code); |
740 | AuthenticateResponse sessionInfo = | 752 | AuthenticateResponse sessionInfo = |
741 | m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId, | 753 | m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId, m_circuitCode); |
742 | m_circuitCode); | 754 | |
743 | if (!sessionInfo.Authorised) | 755 | if (!sessionInfo.Authorised) |
744 | { | 756 | { |
745 | //session/circuit not authorised | 757 | //session/circuit not authorised |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index 07d3c45..c36a238 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs | |||
@@ -70,17 +70,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
70 | m_scene.ClientManager.InPacket(circuitCode, packet); | 70 | m_scene.ClientManager.InPacket(circuitCode, packet); |
71 | } | 71 | } |
72 | 72 | ||
73 | protected virtual IClientAPI CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, | 73 | /// <summary> |
74 | ClientManager clientManager, IScene scene, AssetCache assetCache, | 74 | /// Create a new client circuit |
75 | LLPacketServer packServer, AgentCircuitManager authenSessions, | 75 | /// </summary> |
76 | UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) | 76 | /// <param name="remoteEP"></param> |
77 | /// <param name="initialcirpack"></param> | ||
78 | /// <param name="clientManager"></param> | ||
79 | /// <param name="scene"></param> | ||
80 | /// <param name="assetCache"></param> | ||
81 | /// <param name="packServer"></param> | ||
82 | /// <param name="authenSessions"></param> | ||
83 | /// <param name="agentId"></param> | ||
84 | /// <param name="sessionId"></param> | ||
85 | /// <param name="circuitCode"></param> | ||
86 | /// <param name="proxyEP"></param> | ||
87 | /// <returns></returns> | ||
88 | protected virtual IClientAPI CreateNewCircuit(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, | ||
89 | ClientManager clientManager, IScene scene, AssetCache assetCache, | ||
90 | LLPacketServer packServer, AgentCircuitManager authenSessions, | ||
91 | UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) | ||
77 | { | 92 | { |
78 | return | 93 | return |
79 | new LLClientView(remoteEP, scene, assetCache, packServer, authenSessions, agentId, sessionId, circuitCode, proxyEP); | 94 | new LLClientView(remoteEP, scene, assetCache, packServer, authenSessions, agentId, sessionId, circuitCode, proxyEP); |
80 | } | 95 | } |
81 | 96 | ||
97 | /// <summary> | ||
98 | /// Add a new client circuit | ||
99 | /// </summary> | ||
100 | /// <param name="epSender"></param> | ||
101 | /// <param name="useCircuit"></param> | ||
102 | /// <param name="assetCache"></param> | ||
103 | /// <param name="circuitManager"></param> | ||
104 | /// <param name="proxyEP"></param> | ||
105 | /// <returns> | ||
106 | /// true if a new circuit was created, false if a circuit with the given circuit code already existed | ||
107 | /// </returns> | ||
82 | public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, | 108 | public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, |
83 | AgentCircuitManager authenticateSessionsClass, EndPoint proxyEP) | 109 | AgentCircuitManager circuitManager, EndPoint proxyEP) |
84 | { | 110 | { |
85 | IClientAPI newuser; | 111 | IClientAPI newuser; |
86 | 112 | ||
@@ -90,9 +116,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
90 | } | 116 | } |
91 | else | 117 | else |
92 | { | 118 | { |
93 | newuser = CreateNewClient(epSender, useCircuit, m_scene.ClientManager, m_scene, assetCache, this, | 119 | newuser = CreateNewCircuit(epSender, useCircuit, m_scene.ClientManager, m_scene, assetCache, this, |
94 | authenticateSessionsClass, useCircuit.CircuitCode.ID, | 120 | circuitManager, useCircuit.CircuitCode.ID, |
95 | useCircuit.CircuitCode.SessionID, useCircuit.CircuitCode.Code, proxyEP); | 121 | useCircuit.CircuitCode.SessionID, useCircuit.CircuitCode.Code, proxyEP); |
96 | 122 | ||
97 | m_scene.ClientManager.Add(useCircuit.CircuitCode.Code, newuser); | 123 | m_scene.ClientManager.Add(useCircuit.CircuitCode.Code, newuser); |
98 | 124 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index ceb99ae..5625854 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -75,7 +75,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
75 | protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); | 75 | protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); |
76 | protected IScene m_localScene; | 76 | protected IScene m_localScene; |
77 | protected AssetCache m_assetCache; | 77 | protected AssetCache m_assetCache; |
78 | protected AgentCircuitManager m_authenticateSessionsClass; | 78 | |
79 | /// <value> | ||
80 | /// Manages authentication for agent circuits | ||
81 | /// </value> | ||
82 | protected AgentCircuitManager m_circuitManager; | ||
79 | 83 | ||
80 | public LLPacketServer PacketServer | 84 | public LLPacketServer PacketServer |
81 | { | 85 | { |
@@ -132,14 +136,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
132 | Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, assetCache, authenticateClass); | 136 | Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, assetCache, authenticateClass); |
133 | } | 137 | } |
134 | 138 | ||
135 | public void Initialise(IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager authenticateClass) | 139 | /// <summary> |
140 | /// Initialize the server | ||
141 | /// </summary> | ||
142 | /// <param name="_listenIP"></param> | ||
143 | /// <param name="port"></param> | ||
144 | /// <param name="proxyPortOffset"></param> | ||
145 | /// <param name="allow_alternate_port"></param> | ||
146 | /// <param name="assetCache"></param> | ||
147 | /// <param name="circuitManager"></param> | ||
148 | public void Initialise( | ||
149 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager circuitManager) | ||
136 | { | 150 | { |
137 | this.proxyPortOffset = proxyPortOffset; | 151 | this.proxyPortOffset = proxyPortOffset; |
138 | listenPort = (uint) (port + proxyPortOffset); | 152 | listenPort = (uint) (port + proxyPortOffset); |
139 | listenIP = _listenIP; | 153 | listenIP = _listenIP; |
140 | Allow_Alternate_Port = allow_alternate_port; | 154 | Allow_Alternate_Port = allow_alternate_port; |
141 | m_assetCache = assetCache; | 155 | m_assetCache = assetCache; |
142 | m_authenticateSessionsClass = authenticateClass; | 156 | m_circuitManager = circuitManager; |
143 | CreatePacketServer(); | 157 | CreatePacketServer(); |
144 | 158 | ||
145 | // Return new port | 159 | // Return new port |
@@ -177,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
177 | { | 191 | { |
178 | // TODO : Actually only handle those states that we have control over, re-throw everything else, | 192 | // TODO : Actually only handle those states that we have control over, re-throw everything else, |
179 | // TODO: implement cases as we encounter them. | 193 | // TODO: implement cases as we encounter them. |
180 | //m_log.Error("[UDPSERVER]: Connection Error! - " + e.ToString()); | 194 | //m_log.Error("[[CLIENT]: ]: Connection Error! - " + e.ToString()); |
181 | switch (e.SocketErrorCode) | 195 | switch (e.SocketErrorCode) |
182 | { | 196 | { |
183 | case SocketError.AlreadyInProgress: | 197 | case SocketError.AlreadyInProgress: |
@@ -193,7 +207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
193 | } | 207 | } |
194 | catch (ObjectDisposedException e) | 208 | catch (ObjectDisposedException e) |
195 | { | 209 | { |
196 | m_log.DebugFormat("ObjectDisposedException: Object {0} disposed.", e.ObjectName); | 210 | m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName); |
197 | // Uhh, what object, and why? this needs better handling. | 211 | // Uhh, what object, and why? this needs better handling. |
198 | } | 212 | } |
199 | 213 | ||
@@ -213,15 +227,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
213 | } | 227 | } |
214 | catch (MalformedDataException e) | 228 | catch (MalformedDataException e) |
215 | { | 229 | { |
216 | m_log.DebugFormat("Dropped Malformed Packet due to MalformedDataException: {0}", e.StackTrace); | 230 | m_log.DebugFormat("[CLIENT]: Dropped Malformed Packet due to MalformedDataException: {0}", e.StackTrace); |
217 | } | 231 | } |
218 | catch (IndexOutOfRangeException e) | 232 | catch (IndexOutOfRangeException e) |
219 | { | 233 | { |
220 | m_log.DebugFormat("Dropped Malformed Packet due to IndexOutOfRangeException: {0}", e.StackTrace); | 234 | m_log.DebugFormat("[CLIENT]: Dropped Malformed Packet due to IndexOutOfRangeException: {0}", e.StackTrace); |
221 | } | 235 | } |
222 | catch (Exception e) | 236 | catch (Exception e) |
223 | { | 237 | { |
224 | m_log.Debug("[UDPSERVER]: " + e.ToString()); | 238 | m_log.Debug("[CLIENT]: " + e.ToString()); |
225 | } | 239 | } |
226 | } | 240 | } |
227 | 241 | ||
@@ -249,8 +263,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
249 | } | 263 | } |
250 | else if (packet.Type == PacketType.UseCircuitCode) | 264 | else if (packet.Type == PacketType.UseCircuitCode) |
251 | { | 265 | { |
252 | // new client | ||
253 | m_log.Debug("[UDPSERVER]: Adding New Client"); | ||
254 | AddNewClient(packet); | 266 | AddNewClient(packet); |
255 | 267 | ||
256 | UseCircuitCodePacket p = (UseCircuitCodePacket)packet; | 268 | UseCircuitCodePacket p = (UseCircuitCodePacket)packet; |
@@ -267,7 +279,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
267 | } | 279 | } |
268 | catch (Exception e) | 280 | catch (Exception e) |
269 | { | 281 | { |
270 | m_log.Error("[UDPSERVER]: Exception in processing packet - ignoring: ", e); | 282 | m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e); |
271 | } | 283 | } |
272 | } | 284 | } |
273 | } | 285 | } |
@@ -280,7 +292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
280 | } | 292 | } |
281 | catch (SocketException e) | 293 | catch (SocketException e) |
282 | { | 294 | { |
283 | m_log.ErrorFormat("[UDPSERVER]: BeginRecieve threw exception " + e.Message + ": " + e.StackTrace ); | 295 | m_log.ErrorFormat("[CLIENT]: BeginRecieve threw exception " + e.Message + ": " + e.StackTrace ); |
284 | ResetEndPoint(); | 296 | ResetEndPoint(); |
285 | } | 297 | } |
286 | } | 298 | } |
@@ -339,19 +351,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
339 | return; | 351 | return; |
340 | 352 | ||
341 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; | 353 | UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; |
354 | |||
355 | m_log.DebugFormat("[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); | ||
356 | |||
342 | lock (clientCircuits) | 357 | lock (clientCircuits) |
343 | { | 358 | { |
344 | if (!clientCircuits.ContainsKey(epSender)) | 359 | if (!clientCircuits.ContainsKey(epSender)) |
345 | clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); | 360 | clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); |
346 | else | 361 | else |
347 | m_log.Error("[UDPSERVER]: clientCircuits already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); | 362 | m_log.Error("[CLIENT]: clientCircuits already contains entry for user " + useCircuit.CircuitCode.Code + ". NOT adding."); |
348 | } | 363 | } |
349 | 364 | ||
350 | // This doesn't need locking as it's synchronized data | 365 | // This doesn't need locking as it's synchronized data |
351 | if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code)) | 366 | if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code)) |
352 | clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, epSender); | 367 | clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, epSender); |
353 | else | 368 | else |
354 | m_log.Error("[UDPSERVER]: clientCurcuits_reverse already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); | 369 | m_log.Error("[CLIENT]: clientCurcuits_reverse already contains entry for user " + useCircuit.CircuitCode.Code + ". NOT adding."); |
355 | 370 | ||
356 | 371 | ||
357 | lock (proxyCircuits) | 372 | lock (proxyCircuits) |
@@ -359,10 +374,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
359 | if (!proxyCircuits.ContainsKey(useCircuit.CircuitCode.Code)) | 374 | if (!proxyCircuits.ContainsKey(useCircuit.CircuitCode.Code)) |
360 | proxyCircuits.Add(useCircuit.CircuitCode.Code, epProxy); | 375 | proxyCircuits.Add(useCircuit.CircuitCode.Code, epProxy); |
361 | else | 376 | else |
362 | m_log.Error("[UDPSERVER]: proxyCircuits already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); | 377 | m_log.Error("[CLIENT]: proxyCircuits already contains entry for user " + useCircuit.CircuitCode.Code + ". NOT adding."); |
363 | } | 378 | } |
364 | 379 | ||
365 | PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_authenticateSessionsClass, epProxy); | 380 | if (!PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy)) |
381 | m_log.ErrorFormat( | ||
382 | "[CLIENT]: A circuit already existed for agent {0}, circuit {1}", | ||
383 | useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); | ||
366 | } | 384 | } |
367 | 385 | ||
368 | PacketPool.Instance.ReturnPacket(packet); | 386 | PacketPool.Instance.ReturnPacket(packet); |
@@ -371,7 +389,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
371 | public void ServerListener() | 389 | public void ServerListener() |
372 | { | 390 | { |
373 | uint newPort = listenPort; | 391 | uint newPort = listenPort; |
374 | m_log.Info("[SERVER]: Opening UDP socket on " + listenIP + " " + newPort + "."); | 392 | m_log.Info("[UDPSERVER]: Opening UDP socket on " + listenIP + " " + newPort + "."); |
375 | 393 | ||
376 | ServerIncoming = new IPEndPoint(listenIP, (int)newPort); | 394 | ServerIncoming = new IPEndPoint(listenIP, (int)newPort); |
377 | m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); | 395 | m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
@@ -385,14 +403,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
385 | 403 | ||
386 | listenPort = newPort; | 404 | listenPort = newPort; |
387 | 405 | ||
388 | m_log.Info("[SERVER]: UDP socket bound, getting ready to listen"); | 406 | m_log.Info("[UDPSERVER]: UDP socket bound, getting ready to listen"); |
389 | 407 | ||
390 | ipeSender = new IPEndPoint(listenIP, 0); | 408 | ipeSender = new IPEndPoint(listenIP, 0); |
391 | epSender = (EndPoint)ipeSender; | 409 | epSender = (EndPoint)ipeSender; |
392 | ReceivedData = new AsyncCallback(OnReceivedData); | 410 | ReceivedData = new AsyncCallback(OnReceivedData); |
393 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 411 | m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
394 | 412 | ||
395 | m_log.Info("[SERVER]: Listening on port " + newPort); | 413 | m_log.Info("[UDPSERVER]: Listening on port " + newPort); |
396 | } | 414 | } |
397 | 415 | ||
398 | public virtual void RegisterPacketServer(LLPacketServer server) | 416 | public virtual void RegisterPacketServer(LLPacketServer server) |
@@ -409,7 +427,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
409 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; | 427 | sendto = (EndPoint)clientCircuits_reverse[circuitcode]; |
410 | } catch { | 428 | } catch { |
411 | // Exceptions here mean there is no circuit | 429 | // Exceptions here mean there is no circuit |
412 | m_log.Warn("Circuit not found, not sending packet"); | 430 | m_log.Warn("[CLIENT]: Circuit not found, not sending packet"); |
413 | return; | 431 | return; |
414 | } | 432 | } |
415 | 433 | ||
@@ -448,7 +466,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
448 | else | 466 | else |
449 | { | 467 | { |
450 | m_log.DebugFormat( | 468 | m_log.DebugFormat( |
451 | "[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); | 469 | "[CLIENT]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode); |
452 | } | 470 | } |
453 | } | 471 | } |
454 | lock (proxyCircuits) | 472 | lock (proxyCircuits) |
@@ -472,14 +490,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
472 | if (!clientCircuits.ContainsKey(userEP)) | 490 | if (!clientCircuits.ContainsKey(userEP)) |
473 | clientCircuits.Add(userEP, useCircuit.CircuitCode.Code); | 491 | clientCircuits.Add(userEP, useCircuit.CircuitCode.Code); |
474 | else | 492 | else |
475 | m_log.Error("[UDPSERVER]: clientCircuits already contans entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); | 493 | m_log.Error("[CLIENT]: clientCircuits already contans entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); |
476 | } | 494 | } |
477 | 495 | ||
478 | // This data structure is synchronized, so we don't need the lock | 496 | // This data structure is synchronized, so we don't need the lock |
479 | if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code)) | 497 | if (!clientCircuits_reverse.ContainsKey(useCircuit.CircuitCode.Code)) |
480 | clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, userEP); | 498 | clientCircuits_reverse.Add(useCircuit.CircuitCode.Code, userEP); |
481 | else | 499 | else |
482 | m_log.Error("[UDPSERVER]: clientCurcuits_reverse already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); | 500 | m_log.Error("[CLIENT]: clientCurcuits_reverse already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); |
483 | 501 | ||
484 | lock (proxyCircuits) | 502 | lock (proxyCircuits) |
485 | { | 503 | { |
@@ -495,7 +513,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
495 | } | 513 | } |
496 | } | 514 | } |
497 | 515 | ||
498 | PacketServer.AddNewClient(userEP, useCircuit, m_assetCache, m_authenticateSessionsClass, proxyEP); | 516 | PacketServer.AddNewClient(userEP, useCircuit, m_assetCache, m_circuitManager, proxyEP); |
499 | } | 517 | } |
500 | } | 518 | } |
501 | } | 519 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index a3bcc26..4443de9 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -593,7 +593,6 @@ namespace OpenSim.Region.Communications.OGS1 | |||
593 | return response; | 593 | return response; |
594 | } | 594 | } |
595 | 595 | ||
596 | // Grid Request Processing | ||
597 | /// <summary> | 596 | /// <summary> |
598 | /// Received from the user server when a user starts logging in. This call allows | 597 | /// Received from the user server when a user starts logging in. This call allows |
599 | /// the region to prepare for direct communication from the client. Sends back an empty | 598 | /// the region to prepare for direct communication from the client. Sends back an empty |
@@ -602,8 +601,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
602 | /// <param name="request"></param> | 601 | /// <param name="request"></param> |
603 | /// <returns></returns> | 602 | /// <returns></returns> |
604 | public XmlRpcResponse ExpectUser(XmlRpcRequest request) | 603 | public XmlRpcResponse ExpectUser(XmlRpcRequest request) |
605 | { | 604 | { |
606 | m_log.Debug("[CONNECTION DEBUGGING]: Expect User called, starting agent setup ... "); | ||
607 | Hashtable requestData = (Hashtable) request.Params[0]; | 605 | Hashtable requestData = (Hashtable) request.Params[0]; |
608 | AgentCircuitData agentData = new AgentCircuitData(); | 606 | AgentCircuitData agentData = new AgentCircuitData(); |
609 | agentData.SessionID = new UUID((string) requestData["session_id"]); | 607 | agentData.SessionID = new UUID((string) requestData["session_id"]); |
@@ -613,15 +611,20 @@ namespace OpenSim.Region.Communications.OGS1 | |||
613 | agentData.AgentID = new UUID((string) requestData["agent_id"]); | 611 | agentData.AgentID = new UUID((string) requestData["agent_id"]); |
614 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | 612 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); |
615 | agentData.CapsPath = (string) requestData["caps_path"]; | 613 | agentData.CapsPath = (string) requestData["caps_path"]; |
614 | ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]); | ||
615 | |||
616 | m_log.DebugFormat( | ||
617 | "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}", | ||
618 | agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); | ||
616 | 619 | ||
617 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) | 620 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) |
618 | { | 621 | { |
619 | m_log.Debug("[CONNECTION DEBUGGING]: Child agent detected"); | 622 | m_log.Debug("[CLIENT]: Child agent detected"); |
620 | agentData.child = true; | 623 | agentData.child = true; |
621 | } | 624 | } |
622 | else | 625 | else |
623 | { | 626 | { |
624 | m_log.Debug("[CONNECTION DEBUGGING]: Main agent detected"); | 627 | m_log.Debug("[CLIENT]: Main agent detected"); |
625 | agentData.startpos = | 628 | agentData.startpos = |
626 | new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]), | 629 | new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]), |
627 | (float)Convert.ToDecimal((string)requestData["startpos_y"]), | 630 | (float)Convert.ToDecimal((string)requestData["startpos_y"]), |
@@ -629,9 +632,6 @@ namespace OpenSim.Region.Communications.OGS1 | |||
629 | agentData.child = false; | 632 | agentData.child = false; |
630 | } | 633 | } |
631 | 634 | ||
632 | ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]); | ||
633 | |||
634 | |||
635 | RegionInfo[] regions = m_regionsOnInstance.ToArray(); | 635 | RegionInfo[] regions = m_regionsOnInstance.ToArray(); |
636 | bool banned = false; | 636 | bool banned = false; |
637 | 637 | ||
@@ -654,7 +654,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
654 | 654 | ||
655 | if (banned) | 655 | if (banned) |
656 | { | 656 | { |
657 | m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); | 657 | m_log.InfoFormat("[CLIENT]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); |
658 | 658 | ||
659 | Hashtable respdata = new Hashtable(); | 659 | Hashtable respdata = new Hashtable(); |
660 | respdata["success"] = "FALSE"; | 660 | respdata["success"] = "FALSE"; |
@@ -663,14 +663,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
663 | } | 663 | } |
664 | else | 664 | else |
665 | { | 665 | { |
666 | m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString()); | ||
667 | m_localBackend.TriggerExpectUser(regionHandle, agentData); | 666 | m_localBackend.TriggerExpectUser(regionHandle, agentData); |
668 | m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); | ||
669 | Hashtable respdata = new Hashtable(); | 667 | Hashtable respdata = new Hashtable(); |
670 | respdata["success"] = "TRUE"; | 668 | respdata["success"] = "TRUE"; |
671 | resp.Value = respdata; | 669 | resp.Value = respdata; |
672 | |||
673 | } | 670 | } |
671 | |||
674 | return resp; | 672 | return resp; |
675 | } | 673 | } |
676 | // Grid Request Processing | 674 | // Grid Request Processing |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 9e784d6..d8ce3f0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2513,7 +2513,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2513 | #region RegionComms | 2513 | #region RegionComms |
2514 | 2514 | ||
2515 | /// <summary> | 2515 | /// <summary> |
2516 | /// | 2516 | /// Register the methods that should be invoked when this scene receives various incoming events |
2517 | /// </summary> | 2517 | /// </summary> |
2518 | public void RegisterCommsEvents() | 2518 | public void RegisterCommsEvents() |
2519 | { | 2519 | { |
@@ -2549,7 +2549,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2549 | } | 2549 | } |
2550 | 2550 | ||
2551 | /// <summary> | 2551 | /// <summary> |
2552 | /// Do the work necessary to initiate a new user connection. | 2552 | /// Do the work necessary to initiate a new user connection for a particular scene. |
2553 | /// At the moment, this consists of setting up the caps infrastructure | 2553 | /// At the moment, this consists of setting up the caps infrastructure |
2554 | /// </summary> | 2554 | /// </summary> |
2555 | /// <param name="regionHandle"></param> | 2555 | /// <param name="regionHandle"></param> |
@@ -2582,10 +2582,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2582 | } | 2582 | } |
2583 | } | 2583 | } |
2584 | 2584 | ||
2585 | m_log.DebugFormat( | ||
2586 | "[CONNECTION DEBUGGING]: Creating new circuit code ({0}) for avatar {1} at {2}", | ||
2587 | agent.circuitcode, agent.AgentID, RegionInfo.RegionName); | ||
2588 | |||
2589 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | 2585 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); |
2590 | // rewrite session_id | 2586 | // rewrite session_id |
2591 | CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); | 2587 | CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); |