Overview
The Lurk protocol is intended to support text-based MMORPG-style games, also known as MUDs (Multi-User Dimension). It consists of 14 types of message, some of which are primarily sent by servers and some by clients. Behavior and game rules are primarily defined by the server, and clients should expect that their character may be updated with different health, location, and wealth at any time. The server is responsible for all computation related to game rules, results of battles, or collecting gold. The client is responsible for communicating with the server and interacting with the player. The lurk protocol does not specifically contain support for increasing the experience of players. However, the server can allow players to increase their stats. For example, a server could allow an initial stat total of 150, but then for each 1,000 gold collected, increase the player's stats. This behavior is not required, but would allow gold to take on a role more like XP.All protocol message begin with an 8-bit type, followed by 0 or more bytes of further information. The amount of bytes to be read can be determined by the type, and in some cases a message length field further into the message. Messages are listed below by type. Notes:
- Variable-length text fields are sent without a null terminator. This doesn't include fixed-length text fields like room and player names. Fixed-length text fields must be null-terminated unless they are exactly the maximum size.
- All numbers are sent little-endian. This makes things easy for x86 users at the expense of being unusual.
- Except as noted (health), all integer fields are unsigned.
Protocol Messages
Message
Sent by the client to message other players. Can also be used by the server to send "presentable" information to the client (information that can be displayed to the user with no further processing). Clients should expect to receive this type of message at any time, and servers should expect to relay messages for clients at any time. If using this to send game information, the server should mark the message as narration.Byte | Meaning |
---|---|
0 | Type, 1 |
1-2 | Message Length, 16 bits unsigned. |
3-34 | Recipient Name, 32 bytes total. |
35-64 | Sender Name, 30 bytes total. |
65-66 | End of sender name, or narration marker. |
67+ | Message. Length was specified earlier. |
Narration marking: For messages which are related to game narration, as opposed to from one player to another, the last two bytes of the sender name should be 0, then 1 (bytes 65 and 66). This does disallow narrator names longer than 30 characters. When relaying a message from one player to another, server authors should be careful to set byte 66 to 0 unless it is the last character of the player name. The recipient name is either 32 characters or null-terminated in the normal manner.