Exemple #1
0
 public GameServer(int port)
 {
     var configuration = new NetPeerConfiguration("HORSEGLUERTS");
     configuration.Port = port;
     sendBuffer = new List<byte>();
     server = new NetServer(configuration);
     ServerState = ServerStates.InLobby;
     gameMode = null;
     lobby = new Lobby(this);
 }
Exemple #2
0
        protected EntityBase(GameServer _server, Player player)
        {
            HotkeyString = "";
            UseCount = 0;
            Server = _server;
            MyPlayer = player;

            Neutral = false;
            BoundsSize = new Vector2f(10, 10);
            RemoveOnNoHealth = true;

            EntityToUse = null;
            MyGameMode = null;
            rallyPoints = new List<Entity.RallyPoint>();
            Health = 0;
            MaxHealth = 0;
            Energy = 0;
            EnergyRegenRate = 0;
            MaxEnergy = 0;

            Position = new Vector2f();

            spells = new Dictionary<string, SpellData>();
        }
Exemple #3
0
        public void SwitchToGame(GameModeBase gameMode)
        {
            if(ServerState != ServerStates.InLobby) return;
            ServerState = ServerStates.InGame;
            SetGame(gameMode);

            foreach (var netConnection in lobby.clients)
            {
                gameMode.AddConnection(netConnection);
            }
        }
Exemple #4
0
 public void SetGame(GameModeBase game)
 {
     gameMode = game;
 }