public ServerRoom(Lobby lobby, User host, string roomName, bool isEncrypted, string password) : base(host, roomName, isEncrypted, password) { this.lobby = lobby; roomCount++; id = roomCount; }
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; }
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; }
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; }
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; } }
public override void UserExit(User user) { if(users.ContainsKey(user.userName)) users.Remove(user.userName); }
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); }
public virtual void UserExit(User user) { users.Remove(user.userName); }
public virtual void UserEnter(User user) { users.Add(user.userName, user); }
public override void UserEnter(User user) { users.Add(user.userName, user); user.ready = false; }