예제 #1
0
        public ISession NewSession(IChannel c)
        {
            ChatSession session = new ChatSession(Server, c, protocolProvider, this);

            Server.SessionRegistry.Add(session);
            return(session);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public void Add(ChatSession session)
 {
     sessions.TryAdd(session.SessionID, session);
 }