Merge pull request #46 from MasterDurron/configurable-server-port

Server port is now configurable
This commit is contained in:
Drew DeVault 2015-05-01 21:54:56 -06:00
commit 9a2b0a6547
2 changed files with 9 additions and 1 deletions

View File

@ -25,11 +25,19 @@ namespace TrueCraft
{
MOTD = ChatColor.Red + "Welcome to TrueCraft!";
Debug = new DebugConfiguration();
ServerPort = 25565;
ServerAddress = "0.0.0.0";
}
[YamlMember(Alias="motd")]
public string MOTD { get; set; }
[YamlMember(Alias="serverPort")]
public int ServerPort {get; set; }
[YamlMember(Alias="serverAddress")]
public string ServerAddress{get; set; }
[YamlMember(Alias="debug")]
public DebugConfiguration Debug { get; set; }
}

View File

@ -67,7 +67,7 @@ namespace TrueCraft
#endif
CommandManager = new CommandManager();
Server.ChatMessageReceived += HandleChatMessageReceived;
Server.Start(new IPEndPoint(IPAddress.Any, 25565));
Server.Start(new IPEndPoint(IPAddress.Parse(Configuration.ServerAddress), Configuration.ServerPort));
Console.CancelKeyPress += HandleCancelKeyPress;
while (true)
{