Skip to content

Commit

Permalink
Adicionando as Session em uma lista.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian-Sknz committed Oct 7, 2020
1 parent 24db561 commit 265e878
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/me/skiincraft/api/paladins/Paladins.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ public boolean wasRequested() {
}

public Session get() {
if (wasRequested()){
return session;
}

Session s = sessions.stream()
.filter(bb -> bb.getSessionId().equalsIgnoreCase(sessionId))
.findAny()
Expand All @@ -141,8 +145,10 @@ public Session get() {
session = null;
throw new RequestException("You tried to resume an invalid session.", json);
}

return new Session(sessionId, "", json, api);
this.session = new Session(sessionId, "", json, api);
sessions.add(session);

return session;
}

public void getWithJson(BiConsumer<Session, String> biConsumer) {
Expand Down

0 comments on commit 265e878

Please sign in to comment.