From 08f198ef4f71defd1914554c6d29febf363b4bbb Mon Sep 17 00:00:00 2001 From: godotg Date: Sun, 15 Oct 2023 13:31:29 +0800 Subject: [PATCH] doc[protocol]: update doc --- protocol/README.md | 16 +++++++++++++++- protocol/README_CN.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/protocol/README.md b/protocol/README.md index 93bb5cef..b6089ad3 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -141,7 +141,6 @@ your protocol number a little more compactly, so that your protocol number will } ``` - - The second use: Register the agreement through Protocol Manager.initProtocolAuto() without writing the protocol number ``` @@ -153,6 +152,21 @@ your protocol number a little more compactly, so that your protocol number will } ``` + + - The third use: Register the protocol through ProtocolManager.initProtocol(xmlProtocols) in the protocol.xml file + ``` + + + + + + + + + + + + ``` - If you add a field for version compatibility, you need to add a Compatible annotation, and the order needs to be naturally increased, so as to ensure that the old and new protocols can be compatible with each other diff --git a/protocol/README_CN.md b/protocol/README_CN.md index 62390ce2..2d593984 100644 --- a/protocol/README_CN.md +++ b/protocol/README_CN.md @@ -129,6 +129,21 @@ cpu: i9900k } ``` + + - 第三种使用:通过ProtocolManagerinitProtocol(xmlProtocols)去注册协议,把协议号写在protocol.xml文件 + ``` + + + + + + + + + + + + ``` - 如果为了版本兼容,增加字段,需要加上Compatible注解,order需要自然增大,这样就可以保证新老协议可以互相兼容 - 正式环境为了版本兼容,避免修改字段名称,内部默认使用字段的名称按照字符串的自然顺序来依次读写的(也可以自定义),所以会导致序列化出现异常