Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
move checklimit exceeded check
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio1988 committed Sep 12, 2023
1 parent bc84ac7 commit 99a525d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
12 changes: 0 additions & 12 deletions routes/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,6 @@ func handleGetJob(c *gin.Context, req ControllerBody, workerState *worker.State)
return
}

if workerState.CheckLimitExceeded() {
log.Warnf("[CONTROLLER] [%s] GetJob would exceed soft limits - DISABLED ACCOUNT: [%s]", req.Uuid, req.Username)
accountManager.MarkDisabled(req.Username)
workerState.ResetUsername()
respondWithData(c, &map[string]any{
"action": SwitchAccount.String(),
"min_level": 30,
"max_level": 40,
})
return
}

if workerState.AreaId == math.MaxInt {
task := map[string]any{
"action": ScanPokemon.String(),
Expand Down
5 changes: 5 additions & 0 deletions routes/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func Raw(c *gin.Context) {
log.Debugf("[RAW] [%s] Account '%s' updated with information from Game", res.Uuid, res.Username)
}
}
if ws.CheckLimitExceeded() {
log.Warnf("[RAW] [%s] GetJob would exceed soft limits - DISABLED ACCOUNT: [%s]", res.Uuid, res.Username)
accountManager.MarkDisabled(res.Username)

}
}()
}

Expand Down

0 comments on commit 99a525d

Please sign in to comment.