mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 22:15:02 +00:00
perf[cs]: get protocolId by class type
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user