mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
handle opcode 9 invalid session and improve handling socket closure
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user