Updated Pong packet documentation, removed column used for version info and reverted 'Sequence ID' back to 'Message ID'.

This commit is contained in:
flash 2024-04-17 20:41:15 +00:00
parent cd32995367
commit e291a17705

View file

@ -56,27 +56,22 @@ Which of the methods is used remains consistent per server however, so the resul
<tr>
<td><code>int</code></td>
<td>Rank of the user. Used to determine what channels a user can access or what other users the user can moderate.</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the user the ability kick/ban/unban others.</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the user can access the logs. This should always be <code>0</code>, unless the client has a dedicated log view that can be accessed without connecting to the chat server.</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the user can set an alternate display name.</td>
<td></td>
</tr>
<tr>
<td><code>int</code></td>
<td>Indicates whether the user can create channel. If <code>0</code> the user cannot create channels, if <code>1</code> the user can create channels but they are to disappear when all users have left it and if <code>2</code> the user can create channels that permanently stay in the channel assortment.</td>
<td></td>
</tr>
</table>
@ -91,7 +86,6 @@ Used to prevent the client from closing the session due to inactivity.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
</table>
@ -103,7 +97,6 @@ Takes a variable number of parameters that are fed into the authentication scrip
<tr>
<td><code>...string</code></td>
<td>Any amount of data required to complete authentication</td>
<td></td>
</tr>
</table>
@ -117,12 +110,10 @@ Commands are described lower in the document.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Message text, may not contain <code>\t</code></td>
<td></td>
</tr>
</table>
@ -135,9 +126,8 @@ Response to client packet `0`: Ping.
<table>
<tr>
<td><code>timestamp</code></td>
<td>Time the packet was sent to the client</td>
<td>Originally this field contained the string <code>pong</code>, but this value was completely unused and can be safely replaced.</td>
<td><code>string</code></td>
<td>Any arbitrary string, do not rely on the data sent here. Original client sent <code>pong</code>, SharpChat currently sends the current Unix epoch timestamp in seconds.</td>
</tr>
</table>
@ -152,37 +142,30 @@ Informs the client that authentication has succeeded.
<tr>
<td><code>string</code></td>
<td><code>y</code></td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>color</code></td>
<td>Username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
<tr>
<td><code>channel name</code></td>
<td>Default channel the user will join following this packet</td>
<td></td>
</tr>
<tr>
<td><code>int</code></td>
<td>Maximum length for messages sent by the client</td>
<td></td>
</tr>
</table>
@ -194,7 +177,6 @@ Informs the client that authentication has failed.
<tr>
<td><code>string</code></td>
<td><code>n</code></td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
@ -207,12 +189,10 @@ Informs the client that authentication has failed.
<li><code>joinfail</code>: User attempting to authenticate is banned.</li>
</ul>
</td>
<td></td>
</tr>
<tr>
<td><code>timestamp</code></td>
<td>If <code>joinfail</code> this contains expiration time of the ban, otherwise it is empty.</td>
<td></td>
</tr>
</table>
@ -224,32 +204,26 @@ Informs the client that a user has joined.
<tr>
<td><code>timestamp</code></td>
<td>Time the user joined</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>colour</code></td>
<td>Username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
</table>
@ -261,7 +235,6 @@ Informs the client that a chat message has been received.
<tr>
<td><code>timestamp</code></td>
<td>Time when the message was received by the server</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
@ -269,7 +242,6 @@ Informs the client that a chat message has been received.
User ID.
If <code>-1</code> this message is an informational message from the server and the next field takes on a special form.
</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
@ -299,17 +271,14 @@ Informs the client that a chat message has been received.
</table>
</p>
</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
<tr>
<td><code>message flags</code></td>
<td>Message flags</td>
<td></td>
</tr>
</table>
@ -321,12 +290,10 @@ Informs the client that a user has disconnected.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
@ -339,17 +306,14 @@ Informs the client that a user has disconnected.
<li><code>flood</code>: The user has been kicked for exceeding the flood protection limit, e.g. "x has been kicked for spam".</li>
</ul>
</td>
<td></td>
</tr>
<tr>
<td><code>timestamp</code></td>
<td>Time when the user disconnected</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
</table>
@ -368,7 +332,6 @@ This packet informs the user about channel related updates. The only consistent
<li><code>2</code>: A channel has been deleted.</li>
</ul>
</td>
<td></td>
</tr>
</table>
@ -380,17 +343,14 @@ Informs the client that a channel has been created.
<tr>
<td><code>channel name</code></td>
<td>The name of the new channel</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is password protected</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs</td>
<td></td>
</tr>
</table>
@ -402,22 +362,18 @@ Informs the client that details of a channel has changed.
<tr>
<td><code>channel name</code></td>
<td>Old/current name of the channel</td>
<td></td>
</tr>
<tr>
<td><code>channel name</code></td>
<td>New name of the channel</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is password protected</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs</td>
<td></td>
</tr>
</table>
@ -429,7 +385,6 @@ Informs the client that a channel has been deleted
<tr>
<td><code>channel name</code></td>
<td>Name of the channel that has been deleted</td>
<td></td>
</tr>
</table>
@ -448,7 +403,6 @@ This packet informs the client about channel switching.
<li><code>2</code>: The client is to forcibly join a channel.</li>
</ul>
</td>
<td></td>
</tr>
</table>
@ -460,27 +414,22 @@ Informs the client that a user has joined the channel.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>color</code></td>
<td>Username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
</table>
@ -492,12 +441,10 @@ Informs the client that a user has left the channel.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
</table>
@ -509,7 +456,6 @@ Informs the client that it has been forcibly switched to a different channel.
<tr>
<td><code>channel name</code></td>
<td>The name of the channel that the user has been switched to</td>
<td></td>
</tr>
</table>
@ -520,8 +466,7 @@ Informs the client that a message has been deleted.
<table>
<tr>
<td><code>string</code></td>
<td>Sequence ID of the deleted message</td>
<td></td>
<td>Message ID of the deleted message</td>
</tr>
</table>
@ -540,7 +485,6 @@ Informs the client about the context of a channel before the client was present.
<li><code>2</code>: Channels on the server.</li>
</ul>
</td>
<td></td>
</tr>
</table>
@ -551,12 +495,10 @@ Informs the client about users already present in the channel.
<tr>
<td><code>int</code></td>
<td>Amount of users present in the channel</td>
<td></td>
</tr>
<tr>
<td><code>Context User</code></td>
<td>An amount of repetitions of this object based on the number in the previous param, the object is described below</td>
<td></td>
</tr>
</table>
@ -566,27 +508,22 @@ Informs the client about users already present in the channel.
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>color</code></td>
<td>Username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Whether the user should be visible in the users list</td>
<td></td>
</tr>
</table>
@ -598,47 +535,38 @@ Informs the client about an existing message in a channel.
<tr>
<td><code>timestamp</code></td>
<td>Time when the message was received by the server</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>User ID</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Username</td>
<td></td>
</tr>
<tr>
<td><code>color</code></td>
<td>Username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Message text, functions the same as described in Packet <code>2</code>: Chat message</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>Sequence ID</td>
<td></td>
<td>Message ID</td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Whether the client should notify the user about this message</td>
<td></td>
</tr>
<tr>
<td><code>message flags</code></td>
<td>Message flags</td>
<td></td>
</tr>
</table>
@ -650,12 +578,10 @@ Informs the client about the channels on the server.
<tr>
<td><code>int</code></td>
<td>Amount of channels on the channel</td>
<td></td>
</tr>
<tr>
<td><code>Context Channel</code></td>
<td>An amount of repetitions of this object based on the number in the previous param, the object is described below</td>
<td></td>
</tr>
</table>
@ -665,17 +591,14 @@ Informs the client about the channels on the server.
<tr>
<td><code>channel name</code></td>
<td>Name of the channel</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is password protected</td>
<td></td>
</tr>
<tr>
<td><code>bool</code></td>
<td>Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs</td>
<td></td>
</tr>
</table>
@ -696,7 +619,6 @@ Informs the client that the context has been cleared.
<li><code>4</code>: The message, user and channel listing have all been cleared.</li>
</ul>
</td>
<td></td>
</tr>
</table>
@ -713,12 +635,10 @@ Informs the client that they have either been banned or kicked from the server.
<li><code>1</code>: The client has been banned, can reconnect after the timestamp (documented below) in the next param has expired.</li>
</ul>
</td>
<td></td>
</tr>
<tr>
<td><code>timestamp</code></td>
<td>Ban expiration time, not present when the first argument is <code>0</code>.</td>
<td></td>
</tr>
</table>
@ -730,22 +650,18 @@ Informs that another user's details have been updated.
<tr>
<td><code>string</code></td>
<td>User ID of the affected user</td>
<td></td>
</tr>
<tr>
<td><code>string</code></td>
<td>New username</td>
<td></td>
</tr>
<tr>
<td><code>color</code></td>
<td>New username color</td>
<td></td>
</tr>
<tr>
<td><code>user permissions</code></td>
<td>User permissions</td>
<td></td>
</tr>
</table>