aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs56
1 files changed, 16 insertions, 40 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index fc76086..b517c13 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -105,7 +105,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
105 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); 105 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>();
106 106
107 protected IScene m_scene; 107 protected IScene m_scene;
108 protected AgentCircuitManager m_authenticateSessionsHandler;
109 108
110 protected LLPacketServer m_networkServer; 109 protected LLPacketServer m_networkServer;
111 110
@@ -409,7 +408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
409 /// <param name="proxyEP"></param> 408 /// <param name="proxyEP"></param>
410 public LLClientView( 409 public LLClientView(
411 EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer, 410 EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer,
412 AgentCircuitManager authenSessions, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP, 411 AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP,
413 ClientStackUserSettings userSettings) 412 ClientStackUserSettings userSettings)
414 { 413 {
415 m_moneyBalance = 1000; 414 m_moneyBalance = 1000;
@@ -422,17 +421,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
422 m_assetCache = assetCache; 421 m_assetCache = assetCache;
423 422
424 m_networkServer = packServer; 423 m_networkServer = packServer;
425 // m_inventoryCache = inventoryCache;
426 m_authenticateSessionsHandler = authenSessions;
427 424
428 m_agentId = agentId; 425 m_agentId = agentId;
429 m_sessionId = sessionId; 426 m_sessionId = sessionId;
430 m_circuitCode = circuitCode; 427 m_circuitCode = circuitCode;
431 428
432 m_userEndPoint = remoteEP; 429 m_userEndPoint = remoteEP;
433 m_proxyEndPoint = proxyEP; 430 m_proxyEndPoint = proxyEP;
431
432 m_firstName = sessionInfo.LoginInfo.First;
433 m_lastName = sessionInfo.LoginInfo.Last;
434 m_startpos = sessionInfo.LoginInfo.StartPos;
434 435
435 m_startpos = m_authenticateSessionsHandler.GetPosition(circuitCode); 436 if (sessionInfo.LoginInfo.SecureSession != UUID.Zero)
437 {
438 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
439 }
436 440
437 // While working on this, the BlockingQueue had me fooled for a bit. 441 // While working on this, the BlockingQueue had me fooled for a bit.
438 // The Blocking queue causes the thread to stop until there's something 442 // The Blocking queue causes the thread to stop until there's something
@@ -444,7 +448,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
444 448
445 RegisterLocalPacketHandlers(); 449 RegisterLocalPacketHandlers();
446 450
447 m_clientThread = new Thread(new ThreadStart(AuthUser)); 451 m_clientThread = new Thread(new ThreadStart(Start));
448 m_clientThread.Name = "ClientThread"; 452 m_clientThread.Name = "ClientThread";
449 m_clientThread.IsBackground = true; 453 m_clientThread.IsBackground = true;
450 m_clientThread.Start(); 454 m_clientThread.Start();
@@ -759,9 +763,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
759 } 763 }
760 764
761 /// <summary> 765 /// <summary>
762 /// Authorize an incoming user session. This method lies at the base of the entire client thread. 766 /// Start a user session. This method lies at the base of the entire client thread.
763 /// </summary> 767 /// </summary>
764 protected virtual void AuthUser() 768 protected virtual void Start()
765 { 769 {
766 //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) 770 //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US)
767 //otherwise it will override this and use the system default 771 //otherwise it will override this and use the system default
@@ -769,37 +773,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
769 773
770 try 774 try
771 { 775 {
772 // AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(m_cirpack.m_circuitCode.m_sessionId, m_cirpack.m_circuitCode.ID, m_cirpack.m_circuitCode.Code); 776 // This sets up all the timers
773 AuthenticateResponse sessionInfo = 777 InitNewClient();
774 m_authenticateSessionsHandler.AuthenticateSession(m_sessionId, m_agentId, m_circuitCode); 778 ClientLoop();
775
776 if (!sessionInfo.Authorised)
777 {
778 //session/circuit not authorised
779 m_log.WarnFormat(
780 "[CLIENT]: New user request denied to avatar {0} connecting with circuit code {1} from {2}",
781 m_agentId, m_circuitCode, m_userEndPoint);
782
783 m_PacketHandler.Stop();
784 m_clientThread.Abort();
785 }
786 else
787 {
788 m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString());
789 //session is authorised
790 m_firstName = sessionInfo.LoginInfo.First;
791 m_lastName = sessionInfo.LoginInfo.Last;
792
793 if (sessionInfo.LoginInfo.SecureSession != UUID.Zero)
794 {
795 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
796 }
797
798 // This sets up all the timers
799 InitNewClient();
800
801 ClientLoop();
802 }
803 } 779 }
804 catch (System.Exception e) 780 catch (System.Exception e)
805 { 781 {