Skip to content

DML Message Structure

Joshua Scott edited this page Oct 5, 2018 · 3 revisions

When a DML message is being transferred inside a KINP message as application data, there is a header structure to tell the recipient which Service ID and Message Type should be used to find the message template for deserializing the message into a Record.

Name Type Description
serviceId uint8_t Determines which message module/service the message template is from.
messageType uint8_t Determines which message template from the module was used to construct the data preceding this header.
length uint16_t The length of the entire message (including this header).

A binary serialization of a DML record that follows the same structure as the message template then follows.

Example

Given the message template:

<MSG_CHAT>
  <RECORD>
    <Name TYPE="STR"></Name>
    <Message TYPE="STR"></Message>
  </RECORD>
</MSG_CHAT>

With the ServiceID 0x0A, and the MessageType 0x21, a binary representation may look like this:

0A 21 15 00 08 00 4A 6F 73 68 73 6F 72 61 05 00 48 65 6C 6C 6F

With the values:
serviceId: 10 (0A)
messageType: 33 (21)
length: 21 (15 00)
Name: "Joshsora" (08 00 4A 6F 73 68 73 6F 72 61)
Message: "Hello" (05 00 48 65 6C 6C 6F)

  1. Introduction
  2. Data Markup Language (DML)
    1. What is DML?
    2. DML Syntax
    3. DML Data Types
    4. DML Examples
  3. Property Class System
    1. Work in Progress
  4. KingsIsle Networking Protocol (KINP)
    1. Sessions
    2. Message Framing
    3. Message Structure
    4. Control Messages
      1. Session Offer
      2. Session Accept
      3. Keep Alive
    5. DML Messages
      1. Message Modules
      2. Binary Structure

Clone this wiki locally