public RexClientViewCompatible(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId, UUID sessionId, uint circuitCode) : base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId, sessionId, circuitCode) { }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AuthenticateResponse user = new AuthenticateResponse(); if (!m_agentCircuits.TryGetValue(circuitcode, out AgentCircuitData validcircuit) || validcircuit == null) { //don't have this circuit code in our list user.Authorised = false; return(user); } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; user.LoginInfo.StartFar = (float)validcircuit.startfar; } else { // Invalid user.Authorised = false; } return(user); }
public RexClientViewLegacy(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId, UUID sessionId, uint circuitCode) : base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId, sessionId, circuitCode) { AddGenericPacketHandler("RexSkypeStore", HandleOnSkypeStore); }
public NaaliClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId, UUID sessionId, uint circuitCode) : base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId, sessionId, circuitCode) { OnBinaryGenericMessage -= base.RexClientView_BinaryGenericMessage; OnBinaryGenericMessage += ng_BinaryGenericMessage; }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AgentCircuitData validcircuit = null; m_AgentCircuitsLock.AcquireReaderLock(-1); try { if (m_agentCircuits.ContainsKey(circuitcode)) { validcircuit = m_agentCircuits[circuitcode]; } } finally { m_AgentCircuitsLock.ReleaseReaderLock(); } AuthenticateResponse user = new AuthenticateResponse(); if (validcircuit == null) { //don't have this circuit code in our list user.Authorised = false; return(user); } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; } else { // Invalid user.Authorised = false; } return(user); }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AgentCircuitData validcircuit = null; lock (AgentCircuits) { if (AgentCircuits.ContainsKey(circuitcode)) { validcircuit = AgentCircuits[circuitcode]; } } AuthenticateResponse user = new AuthenticateResponse(); if (validcircuit == null) { //don't have this circuit code in our list user.Authorised = false; return(user); } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.FirstName; user.LoginInfo.Last = validcircuit.LastName; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; user.ClientVersion = validcircuit.ClientVersion; } else { // Invalid user.Authorised = false; } return(user); }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AgentCircuitData validcircuit = null; lock (AgentCircuits) { if (AgentCircuits.ContainsKey(circuitcode)) { validcircuit = AgentCircuits[circuitcode]; } } AuthenticateResponse user = new AuthenticateResponse(); if (validcircuit == null) { //don't have this circuit code in our list user.Authorised = false; return (user); } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.FirstName; user.LoginInfo.Last = validcircuit.LastName; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; user.ClientVersion = validcircuit.ClientVersion; } else { // Invalid user.Authorised = false; } return (user); }
protected override void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { // Create the LLUDPClient LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); IClientAPI existingClient; if (!m_scene.TryGetClient(agentID, out existingClient)) { // Create the LLClientView LLClientView client = CreateNewClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; // Start the IClientAPI client.Start(); } else { m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}", udpClient.AgentID, remoteEndPoint, circuitCode); } }
protected LLClientView CreateNewClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo, OpenMetaverse.UUID agentId, OpenMetaverse.UUID sessionId, uint circuitCode) { switch (m_clientToSpawn.ToLower()) { case "ng": case "naali": return new NaaliClientView(remoteEP, scene, udpServer, udpClient, sessionInfo, agentId, sessionId, circuitCode); case "0.4": case "0.40": case "0.41": case "legacy": return new RexClientViewLegacy(remoteEP, scene, udpServer, udpClient, sessionInfo, agentId, sessionId, circuitCode); case "default": case "compatible": default: return new RexClientViewCompatible(remoteEP, scene, udpServer, udpClient, sessionInfo, agentId, sessionId, circuitCode); } }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AgentCircuitData validcircuit = null; AuthenticateResponse user = new AuthenticateResponse(); try { validcircuit = m_agentCircuits[circuitcode]; } catch (KeyNotFoundException) { //don't have this circuit code in our list user.Authorised = false; return(user); } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; } else { // Invalid user.Authorised = false; } return(user); }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) { AgentCircuitData validcircuit = null; AuthenticateResponse user = new AuthenticateResponse(); try { validcircuit = m_agentCircuits[circuitcode]; } catch(KeyNotFoundException) { //don't have this circuit code in our list user.Authorised = false; return user; } if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; } else { // Invalid user.Authorised = false; } return user; }
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode, IPEndPoint IP) { AgentCircuitData validcircuit = null; if (AgentCircuits.ContainsKey(circuitcode)) { validcircuit = AgentCircuits[circuitcode]; } AuthenticateResponse user = new AuthenticateResponse(); //User never logged in... they shouldn't be attempting to connect if (validcircuit == null) { //don't have this circuit code in our list user.Authorised = false; return (user); } //There is a session found... just is the sessionID right if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID)) { user.Authorised = true; user.LoginInfo = new Login(); user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder; user.LoginInfo.BaseFolder = validcircuit.BaseFolder; user.LoginInfo.StartPos = validcircuit.startpos; } else { user.Authorised = false; } return (user); }
protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { // In priciple there shouldn't be more than one thread here, ever. // But in case that happens, we need to synchronize this piece of code // because it's too important lock (this) { IClientAPI existingClient; if (!m_scene.TryGetClient(agentID, out existingClient)) { // Create the LLUDPClient LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); // Create the LLClientView LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; client.DisableFacelights = m_disableFacelights; // Start the IClientAPI client.Start(); } else { m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}", existingClient.AgentId, remoteEndPoint, circuitCode); } } }
/// <summary> /// Add a client. /// </summary> /// <param name="circuitCode"></param> /// <param name="agentID"></param> /// <param name="sessionID"></param> /// <param name="remoteEndPoint"></param> /// <param name="sessionInfo"></param> /// <returns>The client if it was added. Null if the client already existed.</returns> protected virtual IClientAPI AddClient( uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { IClientAPI client = null; // In priciple there shouldn't be more than one thread here, ever. // But in case that happens, we need to synchronize this piece of code // because it's too important lock (this) { if (!m_scene.TryGetClient(agentID, out client)) { LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; ((LLClientView)client).DisableFacelights = m_disableFacelights; client.Start(); } } return client; }
/// <summary> /// Check whether a given client is authorized to connect. /// </summary> /// <param name="useCircuit"></param> /// <param name="circuitManager"></param> /// <param name="sessionInfo"></param> /// <returns></returns> public virtual bool IsClientAuthorized( UseCircuitCodePacket useCircuit, AgentCircuitManager circuitManager, out AuthenticateResponse sessionInfo) { UUID agentId = useCircuit.CircuitCode.ID; UUID sessionId = useCircuit.CircuitCode.SessionID; uint circuitCode = useCircuit.CircuitCode.Code; sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode); if (!sessionInfo.Authorised) return false; return true; }
private bool IsClientAuthorized(UseCircuitCodePacket useCircuitCode, out AuthenticateResponse sessionInfo) { UUID agentID = useCircuitCode.CircuitCode.ID; UUID sessionID = useCircuitCode.CircuitCode.SessionID; uint circuitCode = useCircuitCode.CircuitCode.Code; sessionInfo = m_circuitManager.AuthenticateSession(sessionID, agentID, circuitCode); return sessionInfo.Authorised; }
/// <summary> /// Add a new client circuit. We assume that is has already passed an authorization check /// </summary> /// <param name="epSender"></param> /// <param name="useCircuit"></param> /// <param name="assetCache"></param> /// <param name="sessionInfo"></param> /// <param name="proxyEP"></param> /// <returns> /// true if a new circuit was created, false if a circuit with the given circuit code already existed /// </returns> public virtual bool AddNewClient( EndPoint epSender, UseCircuitCodePacket useCircuit, AuthenticateResponse sessionInfo, EndPoint proxyEP) { IClientAPI newuser; uint circuitCode = useCircuit.CircuitCode.Code; if (m_scene.ClientManager.TryGetClient(circuitCode, out newuser)) { // The circuit is already known to the scene. This not actually a problem since this will currently // occur if a client is crossing borders (hence upgrading its circuit). However, we shouldn't // really by trying to add a new client if this is the case. return false; } UUID agentId = useCircuit.CircuitCode.ID; UUID sessionId = useCircuit.CircuitCode.SessionID; newuser = CreateNewCircuit( epSender, m_scene, this, sessionInfo, agentId, sessionId, circuitCode, proxyEP); m_scene.ClientManager.Add(circuitCode, newuser); newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; newuser.OnLogout += LogoutHandler; newuser.OnConnectionClosed += CloseClient; newuser.Start(); return true; }
/// <summary> /// Create a new client circuit /// </summary> /// <param name="remoteEP"></param> /// <param name="scene"></param> /// <param name="assetCache"></param> /// <param name="packServer"></param> /// <param name="sessionInfo"></param> /// <param name="agentId"></param> /// <param name="sessionId"></param> /// <param name="circuitCode"></param> /// <param name="proxyEP"></param> /// <returns></returns> protected virtual IClientAPI CreateNewCircuit( EndPoint remoteEP, IScene scene, LLPacketServer packServer, AuthenticateResponse sessionInfo, UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) { return new LLClientView( remoteEP, scene, packServer, sessionInfo, agentId, sessionId, circuitCode, proxyEP, m_userSettings); }
/// <summary> /// Add a client. /// </summary> /// <param name="circuitCode"></param> /// <param name="agentID"></param> /// <param name="sessionID"></param> /// <param name="remoteEndPoint"></param> /// <param name="sessionInfo"></param> /// <returns>The client if it was added. Null if the client already existed.</returns> protected virtual IClientAPI AddClient( uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { IClientAPI client = null; // We currently synchronize this code across the whole scene to avoid issues such as // http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done // consistently, this lock could probably be removed. lock (this) { if (!m_scene.TryGetClient(agentID, out client)) { LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); client = new LLClientView(m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; client.DebugPacketLevel = DefaultClientPacketDebugLevel; ((LLClientView)client).DisableFacelights = m_disableFacelights; client.Start(); } } return client; }
protected virtual bool AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { // Create the LLUDPClient LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); IClientAPI existingClient; //Check to make sure we arn't handling two or more circuit codes from the client if we are lagging badly. // The block below this (TryGetClient) works as well, but if it gets locked up before the client is added to the scene, it will break // So we do this check here as well. lock (m_handlingCircuitCodes) { if (m_handlingCircuitCodes.Contains(agentID)) return false; m_handlingCircuitCodes.Add(agentID); } if (!m_scene.TryGetClient(agentID, out existingClient)) { // Create the LLClientView LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; client.DisableFacelights = m_disableFacelights; // Start the IClientAPI client.Start(); //Remove it from the check m_handlingCircuitCodes.Remove(agentID); return true; } else { m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}", udpClient.AgentID, remoteEndPoint, circuitCode); } //Remove it from the check m_handlingCircuitCodes.Remove(agentID); return false; }