Skip to content

Commit

Permalink
fix(client): prevent client from leveling non-logged in account
Browse files Browse the repository at this point in the history
  • Loading branch information
iholston committed Dec 5, 2023
1 parent 6eef35d commit 9f9004a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lolbot/bot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def account_loop(self) -> None:
self.account = self.account_manager.get_account(self.max_level)
self.launcher.launch_league(self.account.username, self.account.password)
self.leveling_loop()
self.account_manager.set_account_as_leveled(self.account, self.max_level)
if self.launcher.verify_account():
self.account_manager.set_account_as_leveled(self.account, self.max_level)
utils.close_all_processes()
self.client_errors = 0
except ClientError as ce:
Expand Down
1 change: 1 addition & 0 deletions lolbot/bot/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def play_game(self) -> bool:
except GameError as e:
self.log.warning(e.__str__())
utils.close_game()
sleep(30)
return False
except (utils.WindowNotFound, pyautogui.FailSafeException):
self.log.info("Game Complete. Game Time: {}".format(self.formatted_game_time))
Expand Down
2 changes: 1 addition & 1 deletion lolbot/common/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self) -> None:
self.session = requests.session()
self.config = config.ConfigRW()
self.log = logging.getLogger(__name__)
logging.getLogger('urllib3').setLevel(logging.INFO)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

def set_rc_headers(self) -> None:
Expand Down Expand Up @@ -114,7 +115,6 @@ def connect_lcu(self, verbose: bool = True) -> None:
except:
continue
if r.json()['state'] == 'SUCCEEDED':
self.log.debug(r.json())
if verbose:
self.log.info("Connection Successful")
else:
Expand Down

0 comments on commit 9f9004a

Please sign in to comment.