This commit is contained in:
moux23333
2024-01-27 21:08:24 +08:00
parent 22fc0b0848
commit 396cf2de7f
30 changed files with 34183 additions and 1593 deletions

View File

@@ -28,5 +28,20 @@
await _channel.WriteAndFlushAsync(packet);
}
public async void Send<T>(int cmdId, T data) where T : class
{
var packet = new NetPacket()
{
CmdId = cmdId,
Data = data
};
var buffer = Unpooled.Buffer();
packet.Serialize<T>(buffer);
packet.Buf = buffer;
await _channel.WriteAndFlushAsync(packet);
}
}
}