public ISession NewSession(IChannel c) { ChatSession session = new ChatSession(Server, c, protocolProvider, this); Server.SessionRegistry.Add(session); return(session); }
public void SessionInactivated(ISession session) { ChatSession chatSession = session as ChatSession; Server.SessionRegistry.Remove(chatSession.SessionID); if (chatSession.Owner == null) { return; } chatSession.Owner.sessions.Remove(chatSession); Server.Logger.Info(String.Format("Session {0} of user {1} has disconnected.", chatSession.getAddress(), chatSession.Owner.Email)); if (!chatSession.Owner.IsOnline()) { ChatUserManager.MakeOffline(chatSession.Owner); } }
public void Add(ChatSession session) { sessions.TryAdd(session.SessionID, session); }