private static void OnServerStop(Client client, PacketReader reader) { MessageBox.Show("服务器关闭"); try { client.Close(true); } catch { } client.ServerStop(); }
private static void OnError(Client client, PacketReader reader){ //错误 string err = reader.ReadUnicode(256); // int code = reader.ReadByte(); MessageBox.Show(err); //if(!client.IsLogin){ try{ client.Close(client.IsLogin); }catch{} //} }