-port works
This commit is contained in:
parent
fa8bf82e35
commit
18ee7eccab
1 changed files with 13 additions and 2 deletions
|
|
@ -67,6 +67,7 @@ namespace TShockAPI
|
|||
public static IDbConnection DB;
|
||||
|
||||
public static Process p;
|
||||
public static bool OverridePort = false;
|
||||
|
||||
public override Version Version
|
||||
{
|
||||
|
|
@ -265,6 +266,14 @@ namespace TShockAPI
|
|||
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;
|
||||
Backups.KeepFor = file.BackupKeepFor;
|
||||
Backups.Interval = file.BackupInterval;
|
||||
|
||||
Netplay.serverPort = file.ServerPort;
|
||||
if (!OverridePort)
|
||||
{
|
||||
Netplay.serverPort = file.ServerPort;
|
||||
}
|
||||
|
||||
Netplay.spamCheck = file.SpamChecks;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue