Skip to content

Commit

Permalink
Update satisfactory.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xLeviNx authored Oct 31, 2024
1 parent 85886ac commit 94df445
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions discordgsm/protocols/satisfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ class Satisfactory(Protocol):
name = "satisfactory"

async def query(self):
host, port = str(self.kv["host"]), int(str(self.kv["port"]))
satisfactory = opengsq.Satisfactory(host, port, self.timeout)
host, port, app_token = (
str(self.kv["host"]),
int(str(self.kv["port"])),
str(self.kv["_token"]),
)

satisfactory = opengsq.Satisfactory(host, port, app_token, self.timeout)
start = time.time()
status = await satisfactory.get_status()
ping = int((time.time() - start) * 1000)

result: GamedigResult = {
"name": "",
"name": status.server_name,
"map": "",
"password": False,
"numplayers": 0,
"numplayers": status.num_players,
"numbots": 0,
"maxplayers": 0,
"maxplayers": status.server_max_nb_players,
"players": None,
"bots": None,
"connect": f"{host}:{port}",
Expand Down

0 comments on commit 94df445

Please sign in to comment.