Skip to content

Commit

Permalink
Reduced sleep after server connect
Browse files Browse the repository at this point in the history
  • Loading branch information
cetteup committed Apr 2, 2020
1 parent 60537ba commit d8d5a84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,14 +815,15 @@ def toggle_hud(direction: int):
win32gui.SetForegroundWindow(bf2Window['handle'])

# Connect to server
print_log('Connecting to server')
connect_to_server(
bf2Window['rect'][0],
bf2Window['rect'][1],
gameInstanceState.get_server_ip(),
gameInstanceState.get_server_port(),
gameInstanceState.get_server_password()
)
time.sleep(10)
time.sleep(5)
gameInstanceState.set_spectator_on_server(True)
except Exception as e:
print_log('BF2 window is gone, restart required')
Expand Down Expand Up @@ -935,7 +936,7 @@ def toggle_hud(direction: int):
connect_to_server(bf2Window['rect'][0], bf2Window['rect'][1], args.server_ip, args.server_port)
# Treat re-connecting as map rotation (state wise)
gameInstanceState.map_rotation_reset()
time.sleep(10)
time.sleep(5)
# Update state
gameInstanceState.set_spectator_on_server(True)
continue
Expand Down

0 comments on commit d8d5a84

Please sign in to comment.