static void Main(string[] args) { AgentCommandLineOptions options = CommandLineParser.ParseArgs <AgentCommandLineOptions>(args, new AgentCommandLineOptions()); GameMasterSettings settings = Configuration.FromFile <GameMasterSettings>(options.Conf); GameMasterClient client = new GameMasterClient(new Connection(options.Address, options.Port), settings, new Logger(UniqueNameGenerator.GetUniqueName(settings.GameDefinition.GameName)), new Game(), new Ranking()); client.Connect(); client.Disconnect(); }
private Common.SchemaWrapper.Player addPlayer(GameMasterClient gm, ulong id, PlayerType role, Common.Schema.TeamColour team, Common.Schema.Location location, GameMaster.Net.Game game) { var message = new JoinGame() { playerIdSpecified = true, playerId = id, preferredRole = role, preferredTeam = team }; gm.MessageHandler.HandleMessage(message, new Socket(new SocketType(), new ProtocolType())); var player = game.Players.Where(p => p.Id == id).Single(); player.Location = location; var oldField = game.Board.Fields.Cast <Common.SchemaWrapper.Field>().Where(f => f.PlayerId == id).Single(); oldField.PlayerId = null; game.Board.Fields[location.x, location.y].PlayerId = id; return(player); }