perf[cs]: get protocolId by class type

This commit is contained in:
godotg committed 2024-01-25 15:45:32 +08:00
1 parent 61eea4418d
commit d48777b1dd
1 file changed
+2 -2
@@ -41,9 +41,9 @@ namespace zfoocs
public static void Write(ByteBuffer buffer, object packet)
{
var protocolId = protocolIdMap[packet.GetType()];
// 写入协议号
// write protocol id to buffer
buffer.WriteShort(protocolId);
// 写入包体
// write packet
GetProtocol(protocolId).Write(buffer, packet);
}