Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions GameRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
var seedOption = CreateOption<ulong?>("--seed", "Specify RNG seed.", null, "-s");
var logFileDestination = CreateLogFileOption("--log-destination", "Directory for log files.", "-d");
var timeoutOption = CreateOption<int>("--timeout", "Game timeout in seconds.", 30, "-to");
var clientPortOption = CreateOption<int>("--client-port", "Base client port for gRPC bots.", 50000, "-cp");
var serverPortOption = CreateOption<int>("--server-port", "Base server port for gRPC bots.", 49000, "-sp");

var bot1NameArgument = CreateBotArgument("bot1", "Name of the first bot or command.");
var bot2NameArgument = CreateBotArgument("bot2", "Name of the second bot or command.");
Expand All @@ -45,6 +47,8 @@
logFileDestination,
seedOption,
timeoutOption,
clientPortOption,
serverPortOption,
bot1NameArgument,
bot2NameArgument,
};
Expand Down Expand Up @@ -197,6 +201,8 @@ ScriptsOfTribute.AI.ScriptsOfTribute PrepareGame(AI bot1, AI bot2, LogsEnabled e
LogFileNameProvider? logProvider = context.ParseResult.GetValueForOption(logFileDestination);
ulong? seed = context.ParseResult.GetValueForOption(seedOption);
int timeout = context.ParseResult.GetValueForOption(timeoutOption);
int baseClientPort = context.ParseResult.GetValueForOption(clientPortOption);
int baseServerPort = context.ParseResult.GetValueForOption(serverPortOption);
BotInfo? bot1Info = context.ParseResult.GetValueForArgument(bot1NameArgument);
BotInfo? bot2Info = context.ParseResult.GetValueForArgument(bot2NameArgument);

Expand All @@ -207,9 +213,6 @@ ScriptsOfTribute.AI.ScriptsOfTribute PrepareGame(AI bot1, AI bot2, LogsEnabled e
return;
}

//TODO allow users to set these up in the future
int baseClientPort = 50000;
int baseServerPort = 49000;
string baseHost = "localhost";

if (!ValidateInputs(threads, timeout)) return;
Expand Down
Loading