diff --git a/Protocol.md b/Protocol.md index 597fab0..07f792d 100644 --- a/Protocol.md +++ b/Protocol.md @@ -56,27 +56,22 @@ Which of the methods is used remains consistent per server however, so the resul 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 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. - 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. - @@ -91,7 +86,6 @@ Used to prevent the client from closing the session due to inactivity. string User ID - @@ -103,7 +97,6 @@ Takes a variable number of parameters that are fed into the authentication scrip ...string Any amount of data required to complete authentication - @@ -117,12 +110,10 @@ Commands are described lower in the document. string User ID - string Message text, may not contain \t - @@ -135,9 +126,8 @@ Response to client packet `0`: Ping. - - - + +
timestampTime the packet was sent to the clientOriginally this field contained the string pong, but this value was completely unused and can be safely replaced.stringAny arbitrary string, do not rely on the data sent here. Original client sent pong, SharpChat currently sends the current Unix epoch timestamp in seconds.
@@ -152,37 +142,30 @@ Informs the client that authentication has succeeded. string y - string User ID - string Username - color Username color - user permissions User permissions - channel name Default channel the user will join following this packet - int Maximum length for messages sent by the client - @@ -194,7 +177,6 @@ Informs the client that authentication has failed. string n - string @@ -207,12 +189,10 @@ Informs the client that authentication has failed.
  • joinfail: User attempting to authenticate is banned.
  • - timestamp If joinfail this contains expiration time of the ban, otherwise it is empty. - @@ -224,32 +204,26 @@ Informs the client that a user has joined. timestamp Time the user joined - string User ID - string Username - colour Username color - user permissions User permissions - string - Sequence ID - + Message ID @@ -261,7 +235,6 @@ Informs the client that a chat message has been received. timestamp Time when the message was received by the server - string @@ -269,7 +242,6 @@ Informs the client that a chat message has been received. User ID. If -1 this message is an informational message from the server and the next field takes on a special form. - string @@ -299,17 +271,14 @@ Informs the client that a chat message has been received.

    - string - Sequence ID - + Message ID message flags Message flags - @@ -321,12 +290,10 @@ Informs the client that a user has disconnected. string User ID - string Username - string @@ -339,17 +306,14 @@ Informs the client that a user has disconnected.
  • flood: The user has been kicked for exceeding the flood protection limit, e.g. "x has been kicked for spam".
  • - timestamp Time when the user disconnected - string - Sequence ID - + Message ID @@ -368,7 +332,6 @@ This packet informs the user about channel related updates. The only consistent
  • 2: A channel has been deleted.
  • - @@ -380,17 +343,14 @@ Informs the client that a channel has been created. channel name The name of the new channel - bool Indicates whether the channel is password protected - bool Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs - @@ -402,22 +362,18 @@ Informs the client that details of a channel has changed. channel name Old/current name of the channel - channel name New name of the channel - bool Indicates whether the channel is password protected - bool Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs - @@ -429,7 +385,6 @@ Informs the client that a channel has been deleted channel name Name of the channel that has been deleted - @@ -448,7 +403,6 @@ This packet informs the client about channel switching.
  • 2: The client is to forcibly join a channel.
  • - @@ -460,27 +414,22 @@ Informs the client that a user has joined the channel. string User ID - string Username - color Username color - user permissions User permissions - string - Sequence ID - + Message ID @@ -492,12 +441,10 @@ Informs the client that a user has left the channel. string User ID - string - Sequence ID - + Message ID @@ -509,7 +456,6 @@ Informs the client that it has been forcibly switched to a different channel. channel name The name of the channel that the user has been switched to - @@ -520,8 +466,7 @@ Informs the client that a message has been deleted. - - +
    stringSequence ID of the deleted messageMessage ID of the deleted message
    @@ -540,7 +485,6 @@ Informs the client about the context of a channel before the client was present.
  • 2: Channels on the server.
  • - @@ -551,12 +495,10 @@ Informs the client about users already present in the channel. int Amount of users present in the channel - Context User An amount of repetitions of this object based on the number in the previous param, the object is described below - @@ -566,27 +508,22 @@ Informs the client about users already present in the channel. string User ID - string Username - color Username color - user permissions User permissions - bool Whether the user should be visible in the users list - @@ -598,47 +535,38 @@ Informs the client about an existing message in a channel. timestamp Time when the message was received by the server - string User ID - string Username - color Username color - user permissions User permissions - string Message text, functions the same as described in Packet 2: Chat message - string - Sequence ID - + Message ID bool Whether the client should notify the user about this message - message flags Message flags - @@ -650,12 +578,10 @@ Informs the client about the channels on the server. int Amount of channels on the channel - Context Channel An amount of repetitions of this object based on the number in the previous param, the object is described below - @@ -665,17 +591,14 @@ Informs the client about the channels on the server. channel name Name of the channel - bool Indicates whether the channel is password protected - bool Indicates whether the channel is temporary, meaning the channel will be deleted after the last person departs - @@ -696,7 +619,6 @@ Informs the client that the context has been cleared.
  • 4: The message, user and channel listing have all been cleared.
  • - @@ -713,12 +635,10 @@ Informs the client that they have either been banned or kicked from the server.
  • 1: The client has been banned, can reconnect after the timestamp (documented below) in the next param has expired.
  • - timestamp Ban expiration time, not present when the first argument is 0. - @@ -730,22 +650,18 @@ Informs that another user's details have been updated. string User ID of the affected user - string New username - color New username color - user permissions User permissions -