/// <summary> /// 向客户端发送数据 /// </summary> /// <param name="client">客户端</param> /// <param name="cmd1">指令1</param> /// <param name="cmd2">指令2</param> /// <param name="data">数据</param> public void Send(Client client, ushort cmd1, ushort cmd2, byte[] data) { byte[] packData = NetworkUtils.PackTCPMessage(cmd1, cmd2, data); messagesToBeSend.Enqueue(new ClientMessage(client, packData)); }
/// <summary> /// 向服务器发送数据 /// </summary> /// <param name="cmd1">指令1</param> /// <param name="cmd2">指令2</param> /// <param name="data">数据</param> public void Send(ushort cmd1, ushort cmd2, byte[] data) { byte[] packData = NetworkUtils.PackTCPMessage(cmd1, cmd2, data); messagesToBeSend.Enqueue(packData); }