-port works

This commit is contained in:
Lucas Nicodemus 2011-07-13 17:25:20 -06:00
parent fa8bf82e35
commit 18ee7eccab

View file

@ -67,6 +67,7 @@ namespace TShockAPI
public static IDbConnection DB; public static IDbConnection DB;
public static Process p; public static Process p;
public static bool OverridePort = false;
public override Version Version public override Version Version
{ {
@ -265,6 +266,14 @@ namespace TShockAPI
Log.ConsoleInfo("World path has been set to " + path); Log.ConsoleInfo("World path has been set to " + path);
} }
} }
if (parms[i].ToLower() == "-port")
{
int port = Convert.ToInt32(parms[++i]);
Netplay.serverPort = port;
Config.ServerPort = port;
OverridePort = true;
Log.ConsoleInfo("Port overridden by startup argument. Set to " + port);
}
} }
} }
@ -701,8 +710,10 @@ namespace TShockAPI
Main.autoSave = file.AutoSave; Main.autoSave = file.AutoSave;
Backups.KeepFor = file.BackupKeepFor; Backups.KeepFor = file.BackupKeepFor;
Backups.Interval = file.BackupInterval; Backups.Interval = file.BackupInterval;
if (!OverridePort)
Netplay.serverPort = file.ServerPort; {
Netplay.serverPort = file.ServerPort;
}
Netplay.spamCheck = file.SpamChecks; Netplay.spamCheck = file.SpamChecks;