Example #1
0
 internal void AddUser(ServerUser user)
 {
     lock (Locker)
     {
         user.Network.Sender.Send(GetCII(user.Id).ToPack());
         Send(Commands.UserS2C.AddUser(user.Id, user.User.Name, user.User.Avatar));
         Users.Add(user.Id, user);
     }
     Console.WriteLine("({0}) {1} has entered the lobby.", DateTime.Now, user.User.Name);
 }
Example #2
0
 internal void RemoveUser(ServerUser user)
 {
     lock (Locker)
     {
         if (user.Room != null)
         {
             user.Room.RemoveUser(user);
         }
         Users.Remove(user.Id);
         Send(Commands.UserS2C.RemoveUser(user.Id));
     }
     Login.RemoveName(user.User.Name);
     Console.WriteLine("({0}) {1} has left the lobby.", DateTime.Now, user.User.Name);
 }