Ejemplo n.º 1
0
        public Room(ConnectionsHandler connections, Player owner, SettingsLoader settings, string password = "")
        {
            ConnectionsHandler = connections;
            connections.AddMessageListener(this);

            Settings = settings;
            Settings.OnSettingsChanged += OnSettingsChanged;

            Owner = owner;

            RoomIdPool = new IdPool(MaxPlayers);

            RoomData = new RoomData();
            RoomData.ID = Guid.NewGuid().ToString().Substring(0, GuidSize);
            RoomData.Password = password;
            RoomData.Players = new List<PlayerData>();
            RoomData.Owner = Owner.Data;
            RoomData.MinPlayers = settings.Values.Server.MinPlayers;

            Players = new List<Player>();

            if (string.IsNullOrEmpty(password))
            {
                Logger.Log(this, "Creating room for {0}", Owner.Data.Name);
            }
            else
            {
                Logger.Log(this, "Creating room for {0} with password {1}", Owner.Data.Name, password);
            }

            Join(Owner);
        }
Ejemplo n.º 2
0
 public RoomUpdate(RoomData roomData)
 {
     RoomData = roomData;
 }
Ejemplo n.º 3
0
 public RoomUpdate(RoomData roomData)
 {
     RoomData = roomData;
 }