-
Notifications
You must be signed in to change notification settings - Fork 15
Confederation Message Specification
This document is a specification of the message syntax used by the GreenWall add-on. This is intended as a reference for developers who wish to extend GreenWall, write their own client, or write another add-on which communicates directly with GreenWall.
The message format is specified in Augmented Backus-Naur Form (ABNF).
message = opcode "#" guild-id "#" reserved "#" data
guild-id = *( TAGCHAR )
opcode = "C" / "A" / "B" / "N" / "R" / "M"
reserved = ""
data = *( CMCHAR )
TAGCHAR = %x20-22 / %24-7B / %x7D-7E
CMCHAR = %x01-09 / %x0B-7B / %x7C-7E
-
message : The entire message must be 255 characters or shorter.
-
opcode : A single character indicating the type of message.
-
C
: Normal chat text. -
A
: Achievement text. -
B
: Broadcast text. This is used for system messages (e.g. "Eggloas has gone offline."). -
N
: GreenWall client notice. Not shown to the user. -
R
: GreenWall client request. This initiates an action by other GreenWall clients. -
M
: Addon chat text. Not currently implemented. -
E
: External, used by the GreenWall API.
-
-
guild-id : This is a short identifier (or tag) for the co-guild which the sender is a member of.
-
reserved : Reserved for future use. This should be an empty string.
-
data : The content of the message, without extra encoding.
-
TAGCHAR : ASCII character accepted for chat messages by the WoW API and excluding the separator character ("#").
-
CMCHAR : ASCII character accepted for chat messages by the WoW API.
message = *( segment )
segment = version "#" guild-id "#" conf-id "#" flags sequence "#" data
version = "2"
guild-id = *24( TAGCHAR )
conf-id = *24( TAGCHAR )
flags = B32H
sequence = B32H
data = *( B64BCA )
TAGCHAR = %x20-22 / %24-7B / %x7D-7E
B32H = %x30-39 / %x41-56
B64BCA = %x24 / %x2A / %x2D / %x30-39 / %x41-5A / %x5F / %x61-7A
-
message, segment : A single message may be sent in multiple segments, which prevents clipping of large strings in guild chat..
-
version : This is always set to "2".
-
conf-id : This is a short identifier (or tag) for the confederation to which a guild belongs. This allows multiplexing of traffic for multiple confederations on a single channel.
-
guild-id : This is a short identifier (or tag) for the guild. This may be used by the receiver for filtering purposes.
-
flags : A set of segment options represented as a 5-bit vector and encoded using base32hex encoding without padding representing the following boolean flags.
Bit Decimal Octal Hexadecimal Constant Use 0 16 020 0x10 GW_SEG_END
Last segment in the message 1 8 010 0x08 GW_SEG_CTL
Administrative control message 2 4 004 0x04 GW_SEG_REQ
Administrative request message 3 2 002 0x02 GW_SEG_RES
Administrative response message 4 1 001 0x01 - Reserved -
sequence : A sequence number between 0 and 31, inclusive, representing the position of the segment within the message. This field is encoded using base32hex encoding without padding.
-
data : The content of the message, encoded using base64url with a modified alphabet described in the next section.
-
TAGCHAR : ASCII character accepted for chat messages by the WoW API and excluding the separator character,
#
. -
B32H : A 5-bit integer encoded using base32hex encoding without padding.
-
B64BCA : A character in the base64url alphabet described in the next section.
message = header data
header = 3B32H
payload = *6400( B64BCA )
-
header : A 15-bit field encoded in three ASCII characters using base32hex. The header contains two fields.
-
control : The two highest order bits are control bits.
Bit Decimal Octal Hexadecimal Constant Use 0 2 002 0x2 GW_ALC_ENC
Data is encrypted 1 1 001 0x1 GW_ALC_RES
Reserved -
length : The remaining 13 bits are an unsigned integer value representing the length of the payload.
-
-
payload : A sequence of up to 6,400 characters representing a base64url encoded payload.
Data carried within the message segments is encoded using Base64URL encoding in order to protect the integrity of the data and allow for encryption of the data.
The segment flag vector, a 5-bit boolean vector, and the segment sequence number, an unsigned integer from 0 to 31, are both encoded in a single ASCII character using base32hex encoding without padding.
Value | Char | Value | Char | Value | Char | Value | Char |
---|---|---|---|---|---|---|---|
0 | 0 |
8 | 8 |
16 | G |
24 | O |
1 | 1 |
9 | 9 |
17 | H |
25 | P |
2 | 2 |
10 | A |
18 | I |
26 | Q |
3 | 3 |
11 | B |
19 | J |
27 | R |
4 | 4 |
12 | C |
20 | K |
28 | S |
5 | 5 |
13 | D |
21 | L |
29 | T |
6 | 6 |
14 | E |
22 | M |
30 | U |
7 | 7 |
15 | F |
23 | N |
31 | V |
This does not differ from the standard, but the mapping has been included here for reference.
Data carried within the message segments is encoded using base64url in order to protect the integrity of the data and allow for encryption of the data. The alphabet used for the encoding, called the Booze Compensation Alphabet (BCA), is slightly different from the standard alphabet to prevent corruption of the data when a character which is intoxicated sends a message.
Value | Char | Value | Char | Value | Char | Value | Char |
---|---|---|---|---|---|---|---|
0 | A |
16 | Q |
32 | g |
48 | w |
1 | B |
17 | R |
33 | h |
49 | x |
2 | C |
18 | $ |
34 | i |
50 | y |
3 | D |
19 | T |
35 | j |
51 | z |
4 | E |
20 | U |
36 | k |
52 | 0 |
5 | F |
21 | V |
37 | l |
53 | 1 |
6 | G |
22 | W |
38 | m |
54 | 2 |
7 | H |
23 | X |
39 | n |
55 | 3 |
8 | I |
24 | Y |
40 | o |
56 | 4 |
9 | J |
25 | Z |
41 | p |
57 | 5 |
10 | K |
26 | a |
42 | q |
58 | 6 |
11 | L |
27 | b |
43 | r |
59 | 7 |
12 | M |
28 | c |
44 | * |
60 | 8 |
13 | N |
29 | d |
45 | t |
61 | 9 |
14 | O |
30 | e |
46 | u |
62 | - |
15 | P |
31 | f |
47 | v |
63 | _ |
The only differences from the standard are the substitution of $
for S
and *
for s
, but the entire mapping has been included here for reference.