Skip to content

Commit

Permalink
explore_jumpgate_network now properly sleeps and releases connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Ctri-The-Third committed Feb 5, 2024
1 parent f81d708 commit eb624e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions behaviours/explore_jumpgate_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def _run(self):
self.st.ship_jump(ship, next_gate)
self.st.ship_create_chart(ship)
self.pathfinder.validate_and_refresh_jump_graph(starting_gate_sys, next_gate)
self.sleep_until_ready()
# find the jumpgate in the system

# your code goes here
Expand Down
9 changes: 8 additions & 1 deletion behaviours/generic_behaviour.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ def __init__(
)
saved_data = json.load(open(config_file_name, "r+"))
token = None
self.priority = self.behaviour_params.get("priority", 5)
try:
self.priority = int(self.behaviour_params.get("priority", 5))
except ValueError:
self.priority = 5
self.logger.error(
"priority value is invalid, defaulting to 5. Value was %s",
self.behaviour_params.get("priority", 5),
)
for agent in saved_data["agents"]:
if agent.get("username", "") == agent_name:
token = agent["token"]
Expand Down

0 comments on commit eb624e1

Please sign in to comment.