예제 #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;
 }