| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| gamedev:dnp [2024/03/14 16:33] – dragonlord | gamedev:dnp [2026/04/10 19:09] (current) – [Drag[en]gine Network Protocol Specification] dragonlord |
|---|
| |
| <WRAP center round important 60%> | <WRAP center round important 60%> |
| Network protocols typically use //Network Byte Order// as defined by the TCP standard which is //Big Endian//. The message writing and reading of DNP is implemented to match Drag[en]gine #@LinkApiDocDE2_HTML~classdecBaseFileReader.html,File Reader/Writer~@# system. This allows all data written by game scripts to be stored to file, written to memory and transmitted across the network without changing the data. Since this system uses //Little Endian// DNP uses //Little Endian// too. Hence throughout this specification //Little Endian// byte ordering is used unless marked otherwise. | Network protocols typically use //Network Byte Order// as defined by the TCP standard which is //Big Endian//. The message writing and reading of DNP is implemented to match Drag[en]gine #@LinkApiDocDE2_HTML~classdecBaseFileReader.html,File Reader/Writer~@# system. This allows all data written by game scripts to be stored to file, written to memory and transmitted across the network without changing the data. Since this system uses //Little Endian// DNP uses //Little Endian// too. |
| | |
| | Hence throughout this specification **__Little Endian__** byte ordering is used unless marked otherwise. |
| </WRAP> | </WRAP> |
| |
| | [[#data_types|Byte]] | Type | [[#state_value_data_type|Data Type]] of value. | | | [[#data_types|Byte]] | Type | [[#state_value_data_type|Data Type]] of value. | |
| | * | Data | Updated value. The count of bytes required by //Data// is defined by the //Length// attribute in [[#state_value_data_types|State Value Data Type]]. | | | * | Data | Updated value. The count of bytes required by //Data// is defined by the //Length// attribute in [[#state_value_data_types|State Value Data Type]]. | |
| | |
| | ===== Long reliable message ===== |
| | |
| | Same as [[#reliable_message|Reliable Message]] but for use with large data. The message is split up into smaller parts by the server. A typical size is 1357 to make sure the packages are not fragmented. Each package is processed like a reliable message hence they are acknowledged and transmitted in the order they are send. |
| | |
| | The command has this format: |
| | |
| | ^ Type ^ Name ^ Description ^ |
| | | [[#data_types|Byte]] | CommandCode | Command code. Is value ''10'' | |
| | | [[#data_types|UInt16]] | Number | Command sequence number. See [[#reliable_communication|Reliable Communication]]. | |
| | | [[#data_types|Byte]] | Flags | <WRAP> |
| | Flags type value. Flags have to be values from this list: |
| | * ''1'': Message is the first part of the original message. |
| | * ''2'': Message is the last part of the original message. |
| | </WRAP> | |
| | | [[#data_types|Byte]][*] | Data | Next message data. The length of the data is the remaining count of bytes in the UDP package. | |
| | |
| | ===== Long link state ===== |
| | |
| | Same as [[#link_state|Link state]] but for use with large data or lots of state values to initialize. The message is split up into smaller parts by the server. A typical size is 1357 to make sure the packages are not fragmented. Each package is processed like a reliable message hence they are acknowledged and transmitted in the order they are send. Each part of the original link state can contain any combination of remaining message or state values. Typically the first packages contain the message parts with no state values. Then packages with no message but state values packaged into them are send. |
| | |
| | The command has this format: |
| | |
| | ^ Type ^ Name ^ Description ^ |
| | | [[#data_types|Byte]] | CommandCode | Command code. Is value ''11'' | |
| | | [[#data_types|UInt16]] | Number | Command sequence number. See [[#reliable_communication|Reliable Communication]]. | |
| | | [[#data_types|UInt16]] | LinkId | Identifier of link. | |
| | | [[#data_types|Byte]] | Flags | <WRAP> |
| | Flags type value. Flags have to be values from this list: |
| | * ''1'': The state link is read only. |
| | * ''2'': Message is the first part of the original link state. |
| | * ''4'': Message is the last part of the original link state. |
| | </WRAP> | |
| | | [[#data_types|UInt16]] | MessageLength | Length of next message data in bytes. | |
| | | [[#data_types|Byte]][MessageLength] | Message | Next message data. | |
| | | [[#data_types|UInt16]] | ValueCount | Count of next values. | |
| | | ValueData[ValueCount] | Values | Initial value of all next values in the state. | |
| | |
| | ValueData has this format: |
| | |
| | ^ Type ^ Name ^ Description ^ |
| | | [[#data_types|Byte]] | Type | [[#state_value_data_type|Data Type]] of value. | |
| | | * | Data | Initial value. The count of bytes required by //Data// is defined by the //Length// attribute in [[#state_value_data_types|State Value Data Type]]. | |
| |