private void Pingtimer_Tick(object sender, EventArgs e) { byte[] pingpacket = new byte[2]; pingpacket[0] = 0x73; pingpacket[1] = 0x00; if (!uonet.bConnected) { Pingtimer.Stop(); } uonet.Send(pingpacket); }
private void btnConnect_Click(object sender, EventArgs e) { ip = txtIP.Text; user = txtUsername.Text; pass = txtPassword.Text; port = Convert.ToInt32(txtPort.Text); uonet = new uonetwork(ip, port, user, pass, Convert.ToInt32(txtCharSlot.Text)); mythread = new Thread(new ThreadStart(uonet.main)); mythread.IsBackground = true; mythread.Start(); timer1.Interval = 100; timer1.Start(); Pingtimer.Interval = 30000; Pingtimer.Start(); }