public CoolRanchContext(ElDorado game, SessionInfoExchanger broker, string[] args) { _game = game; _broker = broker; _connectForm = new ConnectForm(_broker); _browserForm = new BrowserForm(_broker); new Thread(_broker.ReceiveLoop).Start(); _game.ProcessLaunched += _game_ProcessLaunched; _game.ProcessClosed += _game_ProcessClosed; Application.ApplicationExit += OnApplicationExit; InitializeComponent(); _trayIcon.Visible = true; _trayIcon.ShowBalloonTip(5000, "CoolRanch", "To begin, please launch Halo Online.", ToolTipIcon.Info); UpdateState(); _game.MonitorProcesses(); if (args.Length > 1) { char[] delimiterChars = { ':' }; string[] split = args[0].Split(delimiterChars); _broker.ConnectFromScratch(split[1], int.Parse(split[2])); System.Threading.Thread.Sleep(500); Application.Exit(); } }
static void Main(string[] args) { var game = new ElDorado(); var broker = new SessionInfoExchanger(game); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new CoolRanchContext(game, broker, args)); }
public SessionInfoExchanger(ElDorado game) { _game = game; _udp = new UdpClient(new IPEndPoint(IPAddress.Any, 11770)); _udp.Client.IOControl(-1744830452, new byte[] { 0, 0, 0, 0 }, null); _challengeHmac = new HMACMD5(); _masterServer = new IPEndPoint(Array.Find(Dns.GetHostAddresses("coolranch.ax.lt"), a => a.AddressFamily == AddressFamily.InterNetwork), 8080); _challengeCache = new Dictionary <IPEndPoint, byte[]>(); }
public CoolRanchContext(ElDorado game, SessionInfoExchanger broker) { _broker = broker; _connectForm = new ConnectForm(_broker); _browserForm = new BrowserForm(_broker); new Thread(_broker.ReceiveLoop).Start(); game.ProcessLaunched += _game_ProcessLaunched; game.ProcessClosed += _game_ProcessClosed; Application.ApplicationExit += OnApplicationExit; InitializeComponent(); _trayIcon.Visible = true; _trayIcon.ShowBalloonTip(5000, "CoolRanch", "To begin, please launch Halo Online.", ToolTipIcon.Info); UpdateState(); game.MonitorProcesses(); }