From 9acaf1c27938cba28d46530cc70a13318afc7577 Mon Sep 17 00:00:00 2001 From: Jarno Date: Fri, 29 Jul 2022 01:11:52 +0200 Subject: [PATCH] [Docs] Further explained the mythical `InvalidPacket` (#828) * [Docs] Further explained the mythical `InvalidPacket` * Fixed header category * Update docs/network protocol.md Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Update docs/network protocol.md Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Hussein Farran Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> Co-authored-by: Hussein Farran --- docs/network protocol.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/network protocol.md b/docs/network protocol.md index b5553c37..05a58d05 100644 --- a/docs/network protocol.md +++ b/docs/network protocol.md @@ -191,8 +191,23 @@ Sent to clients after a client requested this message be sent to them, more info ### InvalidPacket Sent to clients if the server caught a problem with a packet. This only occurs for errors that are explicitly checked for. +#### Arguments +| Name | Type | Notes | +| ---- | ---- | ----- | +| type | str | The [PacketProblemType](#PacketProblemType) that was detected in the packet. | +| original_cmd | Optional[str] | The `cmd` argument of the faulty packet, will be `None` if the `cmd` failed to be parsed. | +| text | str | A descriptive message of the problem at hand. | + +##### PacketProblemType +`PacketProblemType` indicates the type of problem that was detected in the faulty packet, the known problem types are below but others may be added in the future. + +| Type | Notes | +| ---- | ----- | +| cmd | `cmd` argument of the faulty packet that could not be parsed correctly. | +| arguments | Arguments of the faulty packet which were not correct. | + ### Retrieved -Sent to clients as a response the a [Get](#Get) package +Sent to clients as a response the a [Get](#Get) package. #### Arguments | Name | Type | Notes | | ---- | ---- | ----- |