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); }
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>(); }
public void SwitchToGame(GameModeBase gameMode) { if(ServerState != ServerStates.InLobby) return; ServerState = ServerStates.InGame; SetGame(gameMode); foreach (var netConnection in lobby.clients) { gameMode.AddConnection(netConnection); } }
public void SetGame(GameModeBase game) { gameMode = game; }