Ejemplo n.º 1
0
 public static void RemoveConnection(GameSession s)
 {
     lock (Connections)
     {
         if (Connections.ContainsKey(s.SessionId))
             Connections.Remove(s.SessionId);
         else
             Debug.Assert(false, "Unidentified session");
     }
     OnConnectionLost();
 }
Ejemplo n.º 2
0
        public static void AddConnection(Socket s)
        {
            UInt32 nextId = CreateSessionId();
            GameSession session = new GameSession(new TcpConnection(s) { socketId = ++SocketCount }) { SessionId = nextId };
            lock (Connections)
                Connections.Add(nextId, session);

            if (OnConnectionAdded != null)
                OnConnectionAdded();
            Log.Write("Added new connection: " + s.RemoteEndPoint.ToString());
        }
Ejemplo n.º 3
0
 public static void RemoveConnection(GameSession s)
 {
     lock (Connections)
         Connections.Remove(s);
     OnConnectionLost();
 }