From 9121ce729a46d8962d7ea70fe6182586e56a50f0 Mon Sep 17 00:00:00 2001 From: high Date: Mon, 13 Jun 2011 09:32:12 -0400 Subject: [PATCH] Added -ip commandline Updated binary --- TShockAPI/TShock.cs | 21 +++++++++++++++++++++ TShockAPI/TerrariaServer.exe | Bin 751616 -> 751616 bytes 2 files changed, 21 insertions(+) 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 c5feedec28d0e209a935561f2aedd9ec52d6da1d..0df42858544650d7f5acf8e27d4bdce5851736cd 100644 GIT binary patch delta 104 zcmZqppxf|4cR~k~reI@NYZqf{7gK8&b88n%YZq&47h7u=dutcR)-F!JYSy}91_qYx zcdI$sIRxq!GBdE``!g_bi8ssxGTXm2b8i3A%$0Ik;QGU!biE^fo*f7HOQtUPV7)yf IoO^}>0KpX|zyJUM delta 104 zcmV-u0GI!O@GXGwEs%%;3JQUWg^B@%iUNg-1BHqNg^C4*iUx&>2Zf3VwTcN&dj%l> z0002D-FpcK2oM*5o&x{`exU;Z1aD6O01Aing9*3vg9>ER5ZVg$Sqin?Nv`>~p!B~f Kqqk^R3z#6ts3-XV