From 8050a295c1e2d7d8cb1f01d43ad9e0508df554f0 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 10 Feb 2023 07:28:36 +0100 Subject: [PATCH] Updated protocol documentation to indicate that IDs should not be treated as numbers. --- Protocol.md | 40 ++++++++++++++++++---------------------- SharpChat/ChatChannel.cs | 2 +- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Protocol.md b/Protocol.md index f4e69c1..96918d0 100644 --- a/Protocol.md +++ b/Protocol.md @@ -29,10 +29,6 @@ Extends `int`, contains a second based UNIX timestamp. A `string` containing only alphanumeric characters (any case), `-` or `_`. -### `session id` -A `string` containing only alphanumeric characters (any case), `-` or `_`. - - ### `color` Any valid value for the CSS `color` property. Further documentation can be found [on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). @@ -93,7 +89,7 @@ Used to prevent the client from closing the session due to inactivity. - + @@ -119,7 +115,7 @@ Commands are described lower in the document.
intstring User ID
- + @@ -159,7 +155,7 @@ Informs the client that authentication has succeeded. - + @@ -231,7 +227,7 @@ Informs the client that a user has joined. - + @@ -251,7 +247,7 @@ Informs the client that a user has joined. - + @@ -268,7 +264,7 @@ Informs the client that a chat message has been received. - + - + @@ -323,7 +319,7 @@ Informs the client that a user has disconnected.
intstring User ID
intstring User ID
intstring User ID
intstring Sequence ID
intstring User ID. If -1 this message is an informational message from the server and the next field takes on a special form. @@ -306,7 +302,7 @@ Informs the client that a chat message has been received.
intstring Sequence ID
- + @@ -351,7 +347,7 @@ Informs the client that a user has disconnected. - + @@ -462,7 +458,7 @@ Informs the client that a user has joined the channel.
intstring User ID
intstring Sequence ID
- + @@ -482,7 +478,7 @@ Informs the client that a user has joined the channel. - + @@ -494,12 +490,12 @@ Informs the client that a user has left the channel.
intstring User ID
intstring Sequence ID
- + - + @@ -523,7 +519,7 @@ Informs the client that a message has been deleted.
intstring User ID
intstring Sequence ID
- + @@ -568,7 +564,7 @@ Informs the client about users already present in the channel.
intstring Sequence ID of the deleted message
- + @@ -605,7 +601,7 @@ Informs the client about an existing message in a channel. - + @@ -630,7 +626,7 @@ Informs the client about an existing message in a channel. - + @@ -732,7 +728,7 @@ Informs that another user's details have been updated.
intstring User ID
intstring User ID
intstring Sequence ID
- + diff --git a/SharpChat/ChatChannel.cs b/SharpChat/ChatChannel.cs index c239497..2c6bb5e 100644 --- a/SharpChat/ChatChannel.cs +++ b/SharpChat/ChatChannel.cs @@ -85,7 +85,7 @@ namespace SharpChat { } public static bool CheckNameChar(char c) { - return char.IsLetter(c) || char.IsNumber(c) || c == '-'; + return char.IsLetter(c) || char.IsNumber(c) || c == '-' || c == '_'; } } }
intstring User ID of the affected user