Skip to content

Commit

Permalink
Fix logic error for when RESUME is received during initializing. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed May 16, 2017
1 parent 850f022 commit 58e7e00
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/net/dv8tion/jda/core/requests/WebSocketClient.java
Expand Up @@ -89,6 +89,7 @@ public class WebSocketClient extends WebSocketAdapter implements WebSocketListen
protected volatile boolean printedRateLimitMessage = false;

protected boolean firstInit = true;
protected boolean processingReady = true;

public WebSocketClient(JDAImpl api)
{
Expand Down Expand Up @@ -121,6 +122,7 @@ public void ready()
if (initiating)
{
initiating = false;
processingReady = false;
if (firstInit)
{
firstInit = false;
Expand Down Expand Up @@ -751,12 +753,16 @@ protected void handleEvent(JSONObject raw)
//INIT types
case "READY":
//LOG.debug(String.format("%s -> %s", type, content.toString())); already logged on trace level
processingReady = true;
sessionId = content.getString("session_id");
handlers.get("READY").handle(responseTotal, raw);
break;
case "RESUMED":
initiating = false;
ready();
if (!processingReady)
{
initiating = false;
ready();
}
break;
default:
SocketHandler handler = handlers.get(type);
Expand Down

0 comments on commit 58e7e00

Please sign in to comment.