support battle

This commit is contained in:
moux23333
2024-01-31 12:30:49 +08:00
parent 855fc2c9bb
commit d38e3f0af4
3 changed files with 244 additions and 15 deletions

View File

@@ -28,20 +28,5 @@
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);
}
}
}