static void Main(string[] args) { if (args.Length != 1) { Console.WriteLine("Usage: wc3proxy ipaddress"); return; } IPHostEntry serverhost; serverhost = new IPHostEntry(); serverhost.HostName = args[0]; serverhost.AddressList = new IPAddress[] { IPAddress.Parse(args[0]) }; // List of different values for different versions. // 0x15 = , "1.21" // 0x16 = , "1.22" // 0x17 = , "1.23" // 0x18 = , "1.24" // 0x19 = , "1.25" // 0x1a = , "1.26" // 0x1b = , "1.27" // 0x1c = , "1.28" // 0x1d = , "1.29" // 0x1e = , "1.30" // 0x1f = , "1.31" byte version = 0x1f; bool expansion = true; // For Reign of Chaos, put false. For Frozen Throne, put true. MainProxy mainform = new MainProxy(serverhost, version, expansion); mainform.CleanupReplays(); mainform.StartTcpProxy(); mainform.StartBrowser(); while (true) { Thread.Sleep(5000); } }
static void Main(string[] args) { if (args.Length < 1 || args.Length > 3) { Console.WriteLine("Usage: wc3proxy <ip> [version] [game]"); return; } if (args.Length < 2) { Array.Resize(ref args, 2); args[1] = "1.28"; } if (args.Length < 3) { Array.Resize(ref args, 3); args[2] = "TFT"; } IPHostEntry serverhost; serverhost = new IPHostEntry(); serverhost.HostName = args[0]; serverhost.AddressList = new IPAddress[] { IPAddress.Parse(args[0]) }; byte version = (byte)Math.Round((float.Parse(args[1]) - 1) * 100); bool expansion = args[2].ToLower() != "roc"; MainProxy mainform = new MainProxy(serverhost, version, expansion); mainform.CompilerWorkaround(); mainform.Banner(); mainform.StartTcpProxy(); mainform.StartBrowser(); while (true) { Thread.Sleep(5000); } }