Skip to content

Commit f9d42ff

Browse files
committed
Added port reading for the bot
1 parent bb3c90d commit f9d42ff

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
using RLBotDotNet;
2+
using System.IO;
23

34
namespace RLBotCSharpExample
45
{
56
class Program
67
{
78
static void Main()
89
{
10+
// Read the port from port.cfg.
11+
const string file = "port.cfg";
12+
string text = File.ReadAllLines(file)[0];
13+
int port = int.Parse(text);
14+
915
// BotManager is a generic which takes in your bot as its T type.
1016
BotManager<ExampleBot> botManager = new BotManager<ExampleBot>();
11-
// Start the server on port 45031.
12-
botManager.Start(45031);
17+
// Start the server on the port given in the port.cfg file.
18+
botManager.Start(port);
1319
}
1420
}
1521
}
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
45031

0 commit comments

Comments
 (0)