send sequences in heartbeat like we should

This commit is contained in:
ouwou 2020-09-30 00:28:20 -04:00
parent 4ac27e9140
commit 7965b788b1
3 changed files with 5 additions and 0 deletions

View File

@ -412,6 +412,9 @@ void DiscordClient::HandleGatewayMessage(std::string str) {
return;
}
if (m.Sequence != -1)
m_last_sequence = m.Sequence;
try {
switch (m.Opcode) {
case GatewayOp::Hello: {

View File

@ -5,6 +5,7 @@ void from_json(const nlohmann::json &j, GatewayMessage &m) {
m.Data = j.at("d");
JS_ON("t", m.Type);
JS_ON("s", m.Sequence);
}
void from_json(const nlohmann::json &j, HelloMessageData &m) {

View File

@ -39,6 +39,7 @@ struct GatewayMessage {
GatewayOp Opcode;
nlohmann::json Data;
std::string Type;
int Sequence = -1;
friend void from_json(const nlohmann::json &j, GatewayMessage &m);
};