Example #1
0
        public static void ClientLeft(Client client)
        {
            lock (Program.ConnectedClients)
                if (!Program.ConnectedClients.Contains(client))
                {
                    Program.ConnectedClients.Add(client);
                }


            lock (OnlineUsers)
            {
                if (OnlineUsers.ContainsKey(client))
                {
                    Console.WriteLine("[Info] User {0} left", OnlineUsers[client].Email);
                    OnlineUsers.Remove(client);
                    Packets.UserList().WriteAll();
                }
                else
                {
                    Console.WriteLine("[Info] Client disconnected");
                }
            }
        }
Example #2
0
 /// <summary>
 /// Calls "Handle.PurgeCache" with the specified users id, writes a list update to all clients, and then writes a rank update to all users
 /// </summary>
 /// <param name="user"></param>
 private static void Purge(User user)
 {
     Handle.PurgeCache(user.Id);
     Packets.UserList().WriteAll();
     Program.WriteRankUpdate();
 }