Пример #1
0
 private void OnSessionOpen(BaseServerSession session, string address)
 {
     _ActiveSessions[address] = session;
     _ActiveSessionList       = _ActiveSessionList.ToList();
     _ActiveSessionList.Add(session);
     ConsoleSystem.Log($"[{address}] connected!");
 }
Пример #2
0
 private void OnSessionClose(BaseServerSession sender, SessionDisconnectEventArgs e)
 {
     _ActiveSessions.Remove(sender.RemoteIP.ToString());
     _ActiveSessionList = _ActiveSessionList.ToList();
     _ActiveSessionList.Remove(sender);
     ConsoleSystem.Log($"[{sender.RemoteIP}] disconnected!");
 }
Пример #3
0
        protected virtual BaseServerSession CreateSession(EndPoint client)
        {
            var session = new BaseServerSession();

            session.Disconnected += OnSessionClose;
            session.ServerInit(client);
            return(session);
        }