Primitive Types¶
All serialization is done in network format big-endian.
Serialization of basic types is trivial and will not be discussed here.
string8
is used to refer to UTF-8 encoded Strings, string16
is used to
refer to UTF-16BE encoded strings, string8-null
is used to refer to UTF-8
encoded strings with trailing null byte
Primitive types are serialized by serializing each of their fields sequentially.
String¶
Strings are serialized as a signed int of the length in bytes (plus 1 for
string8-null
) plus their content in the specified encoding (plus one
null-byte for string8-null
).
If the length is -1, the String is to be considered equivalent to NULL
.
StringList¶
StringLists are serialized as an int32
of the amount of elements, and a
string16
for each element.
Variant¶
First, an int32
for the type, then an uint8
for an unknown value, then,
if the type is a usertype, the typename as string8-null
, and then the
value in its own format.
List¶
VariantLists are serialized as an int32
of the length, and a Variant
for
each element.
Map¶
VariantMaps are serialized as an int32
of the amount of keys, and then
for each key a string16
for the key and a Variant
for each element.
Type¶
Warning: string8
uses the id of QByteArray in the serialization.
Enum | Value |
---|---|
Void | 0x00000000 |
Bool | 0x00000001 |
Int | 0x00000002 |
UInt | 0x00000003 |
QVariantMap | 0x00000008 |
QVariantList | 0x00000009 |
QString | 0x0000000a |
QStringList | 0x0000000b |
QByteArray | 0x0000000c |
QDate | 0x0000000e |
QTime | 0x0000000f |
QDateTime | 0x00000010 |
QRegExp | 0x0000002b |
UserType | 0x0000007f |
Long | 0x00000081 |
Short | 0x00000082 |
Char | 0x00000083 |
ULong | 0x00000084 |
UShort | 0x00000085 |
UChar | 0x00000086 |
QVariant | 0x00000090 |
User | 0x00000100 |
LastType | 0xffffffff |
DateTime¶
Type | Field | Description |
---|---|---|
int32 |
julianDay | Day in Julian calendar, unknown if signed or unsigned |
int32 |
millisOfDay | Milliseconds since start of day |
uint8 |
zone | Timezone of DateTime, 0x00 is local, 0x01 is UTC |
Time¶
Type | Field | Description |
---|---|---|
int32 |
millisOfDay | Milliseconds since start of day |
Protocol¶
Type | Field | Description |
---|---|---|
uint8 |
flags | See below |
int16 |
extra | Extra data, depends on the protocol |
int8 |
version | Protocol Version |
Flags¶
Type | Value |
---|---|
ssl | 0x01 |
compression | 0x02 |
BufferInfo¶
Type | Field | Description |
---|---|---|
int32 |
id | BufferId, a unique, sequential id for the buffer |
int32 |
networkId | NetworkId of the network the buffer belongs to |
int16 |
type | See below |
string8 |
name | BufferName as displayed to the user |
Type¶
Enum | Value |
---|---|
Status | 0x01 |
Channel | 0x02 |
Query | 0x04 |
Group | 0x08 |
Message¶
Type | Field | Description |
---|---|---|
int32 |
messageId | The unique, sequential id for the message |
ìnt32 |
timestamp | The timestamp of the message in UNIX time (32-bit, seconds) |
int32 |
type | See below |
uint8 |
flags | See below |
BufferInfo |
buffer | The buffer the message belongs to, usually everything but BufferId is set to NULL |
string8 |
sender | The sender as nick!ident@host |
string8 |
content | The message content, already stripped from CTCP formatting, but containing mIRC format codes |
Type¶
Enum | Value |
---|---|
Plain | 0x00000001 |
Notice | 0x00000002 |
Action | 0x00000004 |
Nick | 0x00000008 |
Mode | 0x00000010 |
Join | 0x00000020 |
Part | 0x00000040 |
Quit | 0x00000080 |
Kick | 0x00000100 |
Kill | 0x00000200 |
Server | 0x00000400 |
Info | 0x00000800 |
Error | 0x00001000 |
DayChange | 0x00002000 |
Topic | 0x00004000 |
NetsplitJoin | 0x00008000 |
NetsplitQuit | 0x00010000 |
Invite | 0x00020000 |
Flags¶
Type | Value |
---|---|
Self | 0x00000001 |
Highlight | 0x00000002 |
Redirected | 0x00000004 |
ServerMsg | 0x00000008 |
Backlog | 0x00000080 |