====== S2C Packet 2: Message Add ====== Informs the client that a message has been added. May also contain a formatted [[sockchat:notices|notice]]. ===== Format ===== ^ Index ^ Type ^ Description ^ | 0 | ''%%2%%'' | Message Add packet ID | | 1 | [[sockchat:types#timestamp|timestamp]] | Timestamp at which this message was received by the server | | 2 | [[sockchat:types#string|string]] | User ID of the author. ''%%-1%%'' indicates that the message was sent by the server itself and is a formatted [[sockchat:notices|notice]]. | | 3 | [[sockchat:types#string|string]] | Message body. If this isn't an informational message, it is sanitised by the server: ''%%<%%'', ''%%>%%'' and ''%%\n%%'' are replaced by ''%%<%%'', ''%%>%%'' and ''%%\s
\s%%'' (where ''%%\s%%'' is a space/''%%0x20%%''). | | 4 | [[sockchat:types#string|string]] | Message ID | | 5 | [[sockchat:types#message_flags|message flags]] | Message flags | ===== Notice formatting ===== The formatting of index 3 if index 2 is set to ''%%-1%%'' is described here. It is concatenated by the form feed character ''%%\f%%'', respresented in ASCII by ''%%0x0C%%''. All notice formats are describe in the [[sockchat:notices|notices]] section. ^ Index ^ Type ^ Description ^ | 0 | [[sockchat:types#bool|bool]] | Whether the notice is an error | | 1 | [[sockchat:types#string|string]] | Notice format name | | Any number of additional parameters defined by the notice. ||| ===== Examples ===== A non-sensical message sent by user 186, presented with a bold user name and colon separator with ID 39991463245213 sent at Monday, 14 April 2025 01:30:53 GMT: 2\t1744594253\t186\tit is just smells teamspeak my lift skid i just black_jacked up to go townhill be a cd lmao\t39991463245213\t10010 An informational notice containing a [[sockchat:notices:say|broadcast message]]. 2\t1744594374\t-1\t0\fsay\fmeow\t39991494240500\t10010 An error notice containing a [[sockchat:notices:usernf|user not found]] error for user name no-one. 2\t1744594454\t-1\t1\fusernf\fno-one\t39991514755369\t10010 ===== See Also ===== * [[sockchat:s2c:message-remove|S2C Packet 6: Message Remove]] - A message has been removed. * [[sockchat:s2c:context-message-add|S2C Packet 7.1: Context Message Add]] - Informs the client about an existing message. * [[sockchat:notices|Notices]] - Notice formats that may appear.