test[net]: protocol config test

This commit is contained in:
jaysunxiao committed 2026-01-05 17:54:29 +08:00
1 parent c380149954
commit e6d35b0a7e
1 file changed
+10 -11
+10 -11
View File
@@ -3,22 +3,21 @@
<!-- native为内部消息,common是公共消息每个模块都能使用,js是web通信用的协议会生成js协议文件 -->
<protocols>
<!-- 配置包名称,会扫描包底下所有被@Protocol注解标注的协议 -->
<module id="1" name="native">
<protocol location="com.zfoo.net.router.attachment.SignalAttachment"/>
<protocol location="com.zfoo.net.router.attachment.GatewayAttachment"/>
<protocol location="com.zfoo.net.router.attachment.UdpAttachment"/>
<protocol location="com.zfoo.net.router.attachment.HttpAttachment"/>
<protocol location="com.zfoo.net.router.attachment.NoAnswerAttachment"/>
<protocol location="com.zfoo.net.router.attachment"/>
</module>
<!-- 在xml文件中写协议号是为了统一规划协议号,更加直观;不写协议号也没有影响 -->
<!-- 在xml文件中写协议号是为了统一规划协议号,更加直观 -->
<module id="2" name="common">
<protocol id="100" location="com.zfoo.net.packet.common.Message"/>
<protocol id="101" location="com.zfoo.net.packet.common.Error"/>
<protocol id="102" location="com.zfoo.net.packet.common.Heartbeat"/>
<protocol id="103" location="com.zfoo.net.packet.common.Ping"/>
<protocol id="104" location="com.zfoo.net.packet.common.Pong"/>
<!-- 不写协议号,会使用协议里的@Protocol注解的id当做协议号 -->
<protocol location="com.zfoo.net.packet.common.Message"/>
<protocol location="com.zfoo.net.packet.common.Error"/>
<protocol location="com.zfoo.net.packet.common.Heartbeat"/>
<protocol location="com.zfoo.net.packet.common.Ping"/>
<protocol location="com.zfoo.net.packet.common.Pong"/>
<!-- 写协议号更加直观,必须和协议里的@Protocol注解的id相等 -->
<protocol id="110" location="com.zfoo.net.packet.common.PairIntLong"/>
<protocol id="111" location="com.zfoo.net.packet.common.PairLong"/>
<protocol id="112" location="com.zfoo.net.packet.common.PairString"/>