Skip to content

Commit

Permalink
Update protocol.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed May 16, 2019
1 parent 610ef4f commit 06a455d
Showing 1 changed file with 78 additions and 78 deletions.
156 changes: 78 additions & 78 deletions tools/protocol.xml
@@ -1,86 +1,86 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!-- APPLICATION LYAER PROTOCOL AUTO GENERATOR DESCRIPTION FILE
Field Supported Attributes:
command_id,
length_specifier
present_condition
zlib: 1: compress message body use zlib, 0: no zlib used.
mode:
encode: generate encode code only,
encodelua: generate encode c++ message to lua
decodelua: generate decode lua table to c++ message.
decode: generate decode only,
all: generate all
lua.encode: pure lua binary protocol
lua.decode: pure lua binary protocol
c++ protocol header code header:
End User should implement: "obinarystream pcode_autog_begin_encode(uint16_t command_id);"
such as:
obinarystream pcode_autog_begin_encode(uint16_t command_id)
{
messages::MsgHeader header;
header.length = 0;
header.command_id = command_id;
header.version = 1;
header.reserved = 0x5a5a;
header.reserved2 = microtime();
return header.encode();
}
-->
<protocol name="client" version="1.18" author="halx99" release_date="2018.12.2">

<header desc="16 bytes header, unused for generator, on for description protocol">
<field name="length" type="uint16_t" />
<field name="command_id" type="uint16_t" />
<field name="version" type="uint16_t" />
<field name="reserved" type="uint16_t" /> <!-- magic number For packet check, such as 0x5a5a-->
<field name="reserved2" type="uint64_t" /> <!-- May be timestamp -->
</header>

<structures>

<structure name="UserInfo">
<field name="user_id" type="uint32_t" />
<field name="user_name" type="std::string" />
<field name="equip_id" type="uint32_t" />
<field name="hero_id" type="uint32_t" />
<field name="hero_lv" type="uint16_t" />
<field name="hero_hp" type="uint32_t" />
<field name="hero_mp" type="uint32_t" />
</structure>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!-- APPLICATION LYAER PROTOCOL AUTO GENERATOR DESCRIPTION FILE
Field Supported Attributes:
command_id,
length_specifier
present_condition
zlib: 1: compress message body use zlib, 0: no zlib used.
mode:
encode: generate encode code only,
encodelua: generate encode c++ message to lua
decodelua: generate decode lua table to c++ message.
decode: generate decode only,
all: generate all
lua.encode: pure lua binary protocol
lua.decode: pure lua binary protocol
c++ protocol header code header:
End User should implement: "obinarystream pcode_autog_begin_encode(uint16_t command_id);"
such as:
obinarystream pcode_autog_begin_encode(uint16_t command_id)
{
messages::MsgHeader header;
header.length = 0;
header.command_id = command_id;
header.version = 1;
header.reserved = 0x5a5a;
header.reserved2 = microtime();
return header.encode();
}
-->
<protocol name="client" version="1.19.5" author="halx99" release_date="2019.5.16">

<header desc="16 bytes header, unused for generator, on for description protocol">
<field name="length" type="uint16_t" />
<field name="command_id" type="uint16_t" />
<field name="version" type="uint16_t" />
<field name="reserved" type="uint16_t" /> <!-- magic number For packet check, such as 0x5a5a-->
<field name="reserved2" type="uint64_t" /> <!-- May be timestamp -->
</header>

<structures>

<structure name="UserInfo">
<field name="user_id" type="uint32_t" />
<field name="user_name" type="std::string" />
<field name="equip_id" type="uint32_t" />
<field name="hero_id" type="uint32_t" />
<field name="hero_lv" type="uint16_t" />
<field name="hero_hp" type="uint32_t" />
<field name="hero_mp" type="uint32_t" />
</structure>

<structure name="Extension">
<field name="extension_type" type="uint8_t" />
<field name="extension_data_length" type="uint16_t" />
<field name="extension_data" type="uint8_t*" length_specifier="extension_data_length" />
</structure>

</structures>

<messages>

<message name="MsgHeader" is_header="1" >
<field name="length" type="uint16_t" />
<field name="command_id" type="uint16_t" />
<field name="version" type="uint16_t" />
<field name="reserved" type="uint16_t" /> <!-- magic number For packet check, such as 0x5a5a-->
<field name="reserved2" type="uint64_t" /> <!-- May be timestamp -->

</structures>

<messages>

<message name="MsgHeader" is_header="1" >
<field name="length" type="uint16_t" />
<field name="command_id" type="uint16_t" />
<field name="version" type="uint16_t" />
<field name="reserved" type="uint16_t" /> <!-- magic number For packet check, such as 0x5a5a-->
<field name="reserved2" type="uint64_t" /> <!-- May be timestamp -->
</message>

<message name="MessageSimple1" command_id="CID_SIMPLE1 = 101" mode="lua.all"> <!-- 登陆请求 -->

<message name="MessageSimple1" command_id="CID_SIMPLE1 = 101" mode="lua.all">
<field name="id" type="int8_t" />
<field name="value1" type="uint16_t" />
<field name="value2" type="int32_t" />
<field name="value3" type="bool" />
<field name="value4" type="float" />
<field name="value6" type="double" />
<field name="uname" type="std::string" />
<field name="passwd" type="std::string" />
<field name="value6" type="double" />
<field name="uname" type="std::string" />
<field name="passwd" type="std::string" />
</message>

<!-- TSL v1.3 protocol
Expand All @@ -100,10 +100,10 @@ obinarystream pcode_autog_begin_encode(uint16_t command_id)
<field name="legacy_compression_methods" type="uint8_t" value="0" />
<field name="extensions_length" type="uint16_t" />
<field name="extensions" type="Extension*" length_specifier="extensions_length"/>
</message>
-->
</messages>

</protocol>


</message>
-->
</messages>

</protocol>


0 comments on commit 06a455d

Please sign in to comment.