Пример #1
0
 public ServerRoom(Lobby lobby, User host, string roomName, bool isEncrypted, string password)
     : base(host, roomName, isEncrypted, password)
 {
     this.lobby = lobby;
     roomCount++;
     id = roomCount;
 }
Пример #2
0
 public Room(User host, string name, bool isEncrypted, string password)
     : base()
 {
     this.host = host;
     this.name = name;
     this.isEncrypted = isEncrypted;
     this.password = password;
     this.isClosed = false;
 }
Пример #3
0
 public Room(User host, int id, string name, bool isEncrypted, string password, Dictionary<string, User> users, bool isClosed)
     : base(users)
 {
     this.host = host;
     this.id = id;
     this.name = name;
     this.isEncrypted = isEncrypted;
     this.password = password;
     this.isClosed = isClosed;
 }
Пример #4
0
 public override void UserExit(User user)
 {
     if (users.ContainsKey(user.userName))
     {
         users.Remove(user.userName);
         if(user == host)
             (lobby as ServerLobby).CloseRoom(id);
     }
     user.ready = false;
 }
Пример #5
0
 public bool CreateRoom(User host, string roomName, bool isEncrypted, string password, out Room room)
 {
     room = null;
     if (rooms.Any(x => x.Value.name == roomName || x.Value.host == host))
         return false;
     else
     {
         room = new ServerRoom(this, host, roomName, isEncrypted, password);
         rooms.Add(room.id, room);
         (host as ServerUser).MoveToUserGroup(room);
         host.ready = true;
         return true;
     }
 }
Пример #6
0
 public override void UserExit(User user)
 {
     if(users.ContainsKey(user.userName))
         users.Remove(user.userName);
 }
Пример #7
0
 public override void UserEnter(User user)
 {
     users.Add(user.userName, user);
 }
 public override void UserExit(User user)
 {
     base.UserExit(user);
     (user as ServerUser).MoveToUserGroup(null);
 }
 public override void UserEnter(User user)
 {
     base.UserEnter(user);
     (user as ServerUser).MoveToUserGroup(this);
 }
Пример #10
0
 public virtual void UserExit(User user)
 {
     users.Remove(user.userName);
 }
Пример #11
0
 public virtual void UserEnter(User user)
 {
     users.Add(user.userName, user);
 }
Пример #12
0
 public override void UserEnter(User user)
 {
     users.Add(user.userName, user);
     user.ready = false;
 }