private void TestEcho(Packet packet) { //echo to client mChannel.Send( SendBuf.From(Encoding.UTF8.GetBytes("echo ")), SendBuf.From(packet.Bytes, 0, packet.Length)); }
public void OnMsg(Packet packet) { //首次连接第一个协议必须是user token var protoPacket = ProtoPacket.FromRecvBuf(packet.Bytes, 0, packet.Length); if (protoPacket.ProtoObj is PTestDemoClsReq req) { var f1 = req.F1; if (f1 == null) { DCLog.Log("default is null"); } } //echo to client mChannel.Send( SendBuf.From(Encoding.UTF8.GetBytes("echo ")), SendBuf.From(packet.Bytes, 0, packet.Length)); }
private void Send(int id, byte[] content) { mChannel.Send(SendBuf.From(DCGameProtocol.GetIntBuf(id)), SendBuf.From(content)); }