Esempio n. 1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     GF = this;
     game = new TSGame(this);
     Program.client = new SocketClient();
     Program.client.BinaryInput = new ClientBinaryInputHandler(ClientBinaryInputHandler); //设置数据包处理回调方法
     Program.client.MessageInput = new ClientMessageInputHandler(ClientMessageInputHandler);//断开处理
     if (Program.client.Connect("10.211.55.4", 9901)) //连接到服务器
     {
         Program.client.StartRead(); //开始监听读取
     }
 }
Esempio n. 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     GF                          = this;
     game                        = new TSGame(this);
     Program.client              = new SocketClient();
     Program.client.BinaryInput  = new ClientBinaryInputHandler(ClientBinaryInputHandler);   //设置数据包处理回调方法
     Program.client.MessageInput = new ClientMessageInputHandler(ClientMessageInputHandler); //断开处理
     if (Program.client.Connect("10.211.55.4", 9901))                                        //连接到服务器
     {
         Program.client.StartRead();                                                         //开始监听读取
     }
 }