public void ProcessReceived(string data)
        {
            if (data == null)
            {
                return;
            }

            ServerMessage sm = new ServerMessage(data);

            if (sm.GetType() == ServerMessageType.JOIN)
            {
                Console.WriteLine("Join: " + sm.GetPlayer());
                Players.Add(sm.GetPlayer());
                if (ControlPanel != null)
                {
                    object[] capsule = new object[1];
                    capsule[0] = sm.GetPlayer();
                    ControlPanel.BeginInvoke(new PlayerJoinDelegate(PlayerJoin), capsule);
                }
            }
            else if (sm.GetType() == ServerMessageType.QUIT)
            {
                Console.WriteLine("Quit: " + sm.GetPlayer());
                Players.Remove(sm.GetPlayer());
                if (ControlPanel != null)
                {
                    object[] capsule = new object[1];
                    capsule[0] = sm.GetPlayer();
                    ControlPanel.BeginInvoke(new PlayerQuitDelegate(PlayerQuit), capsule);
                }
            }
        }
 private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     try { ProcessReceived(e.Data); }
     catch { }
     if (ControlPanel != null)
     {
         object[] data = new object[2];
         data[0] = ControlPanel;
         data[1] = e.Data;
         ControlPanel.BeginInvoke(new MyDelegate(DelegateMethod), data);
     }
 }