Skip to content

Bot crashes when trying to join a zone that is already captured #5

@masonelmore

Description

@masonelmore
03-07-18 13:20:11 display  INFO     --- Active Planets ---
03-07-18 13:20:11 display  INFO     Planet  Progress  Boss  High  Medium  Low
03-07-18 13:20:11 display  INFO     527       92.68%     0     0       0   20
03-07-18 13:20:11 display  INFO     529       71.99%     0     0       0   41
03-07-18 13:20:11 display  INFO     530       68.51%     0     0       0   37
03-07-18 13:20:11 display  INFO     532       52.47%     0     2      18   33
03-07-18 13:20:11 display  INFO     533       37.79%     0     0      22   43
03-07-18 13:20:11 bot      DEBUG    Joining Zone 67 on Planet 532
03-07-18 13:20:12 urllib3.connectionpool DEBUG    https://community.steam-api.com:443 "POST /ITerritoryControlMinigameService/JoinZone/v0001/ HTTP/1.1" 200 15
03-07-18 13:20:12 bot      DEBUG    Calling join_zone() gave eresult: 2 - Failed to join game 83804 10
03-07-18 13:20:12 bot      DEBUG    Retrying API call in 1 seconds...
03-07-18 13:20:13 urllib3.connectionpool DEBUG    https://community.steam-api.com:443 "POST /ITerritoryControlMinigameService/JoinZone/v0001/ HTTP/1.1" 200 15
03-07-18 13:20:13 bot      DEBUG    Calling join_zone() gave eresult: 2 - Failed to join game 83804 10
03-07-18 13:20:13 bot      DEBUG    Retrying API call in 2 seconds...
03-07-18 13:20:15 urllib3.connectionpool DEBUG    https://community.steam-api.com:443 "POST /ITerritoryControlMinigameService/JoinZone/v0001/ HTTP/1.1" 200 15
03-07-18 13:20:15 bot      DEBUG    Calling join_zone() gave eresult: 2 - Failed to join game 83804 10
03-07-18 13:20:15 bot      DEBUG    Retrying API call in 4 seconds...
03-07-18 13:20:19 urllib3.connectionpool DEBUG    https://community.steam-api.com:443 "POST /ITerritoryControlMinigameService/JoinZone/v0001/ HTTP/1.1" 200 15
03-07-18 13:20:19 bot      DEBUG    Calling join_zone() gave eresult: 2 - Failed to join game 83804 10
03-07-18 13:20:19 bot      DEBUG    Retrying API call in 8 seconds...
03-07-18 13:20:28 urllib3.connectionpool DEBUG    https://community.steam-api.com:443 "POST /ITerritoryControlMinigameService/JoinZone/v0001/ HTTP/1.1" 200 15
03-07-18 13:20:28 bot      DEBUG    Calling join_zone() gave eresult: 27 - That zone is captured
03-07-18 13:20:28 bot      DEBUG    Retrying API call in 16 seconds...
03-07-18 13:20:44 root     ERROR    ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * !
03-07-18 13:20:44 root     ERROR    ! Something went horribly wrong.  Restarting bot... !
03-07-18 13:20:44 root     ERROR    ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * !
03-07-18 13:20:44 root     DEBUG    Unhandled exception:
Traceback (most recent call last):
  File "main.py", line 48, in <module>
    bot.run()
  File "D:\Programming\Python\salienbot\bot.py", line 64, in run
    self._call_api(self.api.join_zone, self.zone.id)
  File "D:\Programming\Python\salienbot\bot.py", line 91, in _call_api
    raise Exception('Unable to recover from failed API call attempts')

I assume this happens when the zone gets captured between the time we decide to join the zone and we send the request to join. Fixing this will require me to rework the bot's error handling (which I have been putting off for a while now).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions