Example #1
0
        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();
            }
        }
Example #2
0
 private void ConnectButton_Click(object sender, EventArgs e)
 {
     _broker.ConnectFromScratch(HostnameTextBox.Text, int.Parse(PortTextBox.Text));
 }