diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-25 00:47:48 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-25 00:47:48 -0500 |
commit | e13a6eab810ebbb0574d2791682caed7acddd8ca (patch) | |
tree | ece1c27b5d725a15989e78b409290e8dd698de23 /discord/objects.hpp | |
parent | 092cd3291b3123cd137eaf22bd0422395255585c (diff) | |
download | abaddon-portaudio-e13a6eab810ebbb0574d2791682caed7acddd8ca.tar.gz abaddon-portaudio-e13a6eab810ebbb0574d2791682caed7acddd8ca.zip |
handle opcode 9 invalid session and improve handling socket closure
Diffstat (limited to 'discord/objects.hpp')
-rw-r--r-- | discord/objects.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/discord/objects.hpp b/discord/objects.hpp index 575ee85..e7e574c 100644 --- a/discord/objects.hpp +++ b/discord/objects.hpp @@ -28,6 +28,7 @@ enum class GatewayOp : int { UpdateStatus = 3, Resume = 6, Reconnect = 7, + InvalidSession = 9, Hello = 10, HeartbeatAck = 11, LazyLoadRequest = 14, @@ -62,6 +63,28 @@ enum class GatewayEvent : int { INVITE_DELETE, }; +enum class GatewayCloseCode : uint16_t { + // discord + UnknownError = 4000, + UnknownOpcode = 4001, + DecodeError = 4002, + NotAuthenticated = 4003, + AuthenticationFailed = 4004, + AlreadyAuthenticated = 4005, + InvalidSequence = 4007, + RateLimited = 4008, + SessionTimedOut = 4009, + InvalidShard = 4010, + ShardingRequired = 4011, + InvalidAPIVersion = 4012, + InvalidIntents = 4013, + DisallowedIntents = 4014, + + // internal + UserDisconnect = 4091, + Reconnecting = 4092, +}; + struct GatewayMessage { GatewayOp Opcode; nlohmann::json Data; |