Both sides previous revisionPrevious revisionNext revision | Previous revision |
sockchat:types [2025/04/13 19:54] – flash | sockchat:types [2025/04/20 00:42] (current) – type links flash |
---|
====== Types ====== | ====== Types ====== |
| |
Below is a list of field types that can occur in a Sock Chat packet. | This is a list of all data types that appear in Sock Chat packet fields. |
| |
===== bool ===== | ===== bool ===== |
===== string ===== | ===== string ===== |
| |
Any UTF-8 character, except ''%%\t%%'' which is used to separate packets. | Any UTF-8 codepoint, except ''%%\t%%'' which is used to separate packets. |
| |
| ===== collection ===== |
| |
| A set of [[#string|string]] values, separated by ''%%\f%%''. |
| |
===== timestamp ===== | ===== timestamp ===== |
| |
Extends ''%%int%%'', contains the current UNIX timestamp as seconds since January 1st, 1970 0:00:00 UTC. | Extends [[#int|int]], contains the current UNIX timestamp as seconds since January 1st, 1970 0:00:00 UTC. |
| |
===== user name ===== | ===== user name ===== |
| |
A ''%%string%%'' containing a user’s name. | A [[#string|string]] containing a user’s name. |
| |
If the user currently has an AFK tag set through the ''%%/afk%%'', it is prefixed by ''%%<AFK>_%%''. The ''%%AFK%%'' text can be replaced by any text supplied to the ''%%/afk%%'' command as an argument, the original PHP Sock Chat and SharpChat force this text to uppercase and limit it to 5 characters. | If the user currently has an AFK tag set through the ''%%/afk%%'', it is prefixed by ''%%<AFK>_%%''. The ''%%AFK%%'' text can be replaced by any text supplied to the ''%%/afk%%'' command as an argument, the original PHP Sock Chat and SharpChat force this text to uppercase and limit it to 5 unicode grapheme clusters. |
| |
If prefixed by a ''%%~%%'', it is not the user’s actual name but a nick name. | If prefixed by a ''%%~%%'', it is not the user’s actual name but a nick name. |
===== channel name ===== | ===== channel name ===== |
| |
A ''%%string%%'' containing only alphanumeric characters (any case), ''%%-%%'' or ''%%_%%''. | A [[#string|string]] containing only alphanumeric characters (any case), ''%%-%%'' or ''%%_%%''. |
| |
===== colour ===== | ===== colour ===== |
| |
Any valid value for the CSS ''%%colour%%'' property. Further documentation can be found [[https://developer.mozilla.org/en-US/docs/Web/CSS/color_value|on MDN]]. | Any valid value for the CSS ''%%color%%'' property. Further documentation can be found [[https://developer.mozilla.org/en-US/docs/Web/CSS/color_value|on MDN]]. |
| |
===== message flags ===== | ===== message flags ===== |
| |
Message flags alter how a message should be displayed to the client, these are all ''%%bool%%'' values. The parts are as follows: | Message flags alter how a message should be displayed to the client, these are all [[#bool|bool]] values. The parts are as follows: |
| |
* Username should appear using a **bold** font. | * Username should appear using a **bold** font. |
| |
^ Type ^Description ^ | ^ Type ^Description ^ |
| ''%%int%%'' |Rank of the user. Used to determine what channels a user can access or what other users the user can moderate. | | | [[#int|int]] |Rank of the user. Used to determine what channels a user can access or what other users the user can moderate. | |
| ''%%bool%%'' |Indicates whether the user the ability kick/ban/unban others. | | | [[#bool|bool]] |Indicates whether the user the ability kick/ban/unban others. | |
| ''%%bool%%'' |Indicates whether the user can access the logs. This should always be ''%%0%%'', unless the client has a dedicated log view that can be accessed without connecting to the chat server. | | | [[#bool|bool]] |Indicates whether the user can access the logs. This should always be ''%%0%%'', unless the client has a dedicated log view that can be accessed without connecting to the chat server. | |
| ''%%bool%%'' |Indicates whether the user can set an alternate display name. | | | [[#bool|bool]] |Indicates whether the user can set an alternate display name. | |
| ''%%int%%'' |Indicates whether the user can create channel. If ''%%0%%'' the user cannot create channels, if ''%%1%%'' the user can create channels but they are to disappear when all users have left it and if ''%%2%%'' the user can create channels that permanently stay in the channel assortment.| | | [[#int|int]] |Indicates whether the user can create channel. If ''%%0%%'' the user cannot create channels, if ''%%1%%'' the user can create channels but they are to disappear when all users have left it and if ''%%2%%'' the user can create channels that permanently stay in the channel assortment.| |
| |