diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 574e328c..9c407894 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -680,6 +680,27 @@ namespace TShockAPI Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck."); FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); } + HandleCommandLine(Environment.GetCommandLineArgs()); + } + + void HandleCommandLine(string[] parms) + { + for (int i = 0; i < parms.Length; i++) + { + if (parms[i].ToLower() == "-ip") + { + IPAddress ip; + if (IPAddress.TryParse(parms[++i], out ip)) + { + Netplay.serverListenIP = ip; + Console.Write("Using IP: {0}", ip); + } + else + { + Console.WriteLine("Bad IP: {0}", parms[i]); + } + } + } } private void OnUpdate(GameTime time) diff --git a/TShockAPI/TerrariaServer.exe b/TShockAPI/TerrariaServer.exe index c5feedec..0df42858 100644 Binary files a/TShockAPI/TerrariaServer.exe and b/TShockAPI/TerrariaServer.exe differ