public void ShowPanel(string serverIP, string port, DockPanel dockPanel) { this.Text = serverIP + ":" + port; this.serverIP = serverIP; traceDock = new DockContent(); tracePanel = new TracePanel(); tracePanel.Dock = DockStyle.Fill; traceDock.Controls.Add(tracePanel); traceDock.Text = "Network"; traceDock.FormClosing += new FormClosingEventHandler(traceDock_FormClosing); this.FormClosed += new FormClosedEventHandler(FlashPanel_FormClosed); this.Show(dockPanel); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.UseOnlyOverlappedIO = true; socket.Connect("localhost", 7788); evalContext = new TestScriptEvalContext(TraceListViewItem.ProtoSpecModules, socket); }
public void ShowPanel(string serverIP, string playerName, DockPanel dockPanel) { this.Text = playerName + "@" + serverIP; this.serverIP = serverIP; traceDock = new DockContent(); tracePanel = new TracePanel(); tracePanel.Dock = DockStyle.Fill; traceDock.Controls.Add(tracePanel); traceDock.Text = "Network"; traceDock.FormClosing += new FormClosingEventHandler(traceDock_FormClosing); this.FormClosed += new FormClosedEventHandler(FlashPanel_FormClosed); string md5 = null; byte[] md5Bytes = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes("{FE2EA79B-CF9D-42F9-B554-001F9A3942B8}" + playerName)); foreach (byte b in md5Bytes) { md5 += b.ToString("x2"); } string qs = "?player_name=" + playerName + "&hash_code=" + md5; this.Show(dockPanel); axShockwaveFlash1.LoadMovie(0, "http://localhost:8866/Main.swf" + qs); }