diff --git a/discordgsm/games.csv b/discordgsm/games.csv index 31132a1..2872738 100644 --- a/discordgsm/games.csv +++ b/discordgsm/games.csv @@ -234,7 +234,7 @@ rune,Rune (2000),gamespy1,port=7777;port_query_offset=1 rust,Rust (2018),source,port=28015 samp,San Andreas Multiplayer (2006),samp,port=7777 -satisfactory,Satisfactory (2019),satisfactory,port_query=15777 +satisfactory,Satisfactory (2019),satisfactory,port_query=7777 scpsl,SCP: Secret Laboratory (2017),scpsl, scum,SCUM (2018),scum,port=27015 shatteredhorizon,Shattered Horizon (2009),source,port=27015 diff --git a/discordgsm/main.py b/discordgsm/main.py index fa3f6c2..c5b72a4 100644 --- a/discordgsm/main.py +++ b/discordgsm/main.py @@ -253,6 +253,9 @@ def query_server_modal(game: GamedigGame, locale: Locale): modal.add_item(query_extra['_api_key']) modal.remove_item(query_param['port']) query_param['port']._value = '0' + elif game['id'] == 'satisfactory': + query_extra['_token'] = TextInput(label='Application Token', placeholder='Server Application token') + modal.add_item(query_extra['_token']) elif game['id'] == 'gportal': query_extra['serverId'] = TextInput(label='GPORTAL server id') modal.add_item(query_extra['serverId']) diff --git a/discordgsm/protocols/satisfactory.py b/discordgsm/protocols/satisfactory.py index 12924ec..88e7a6c 100644 --- a/discordgsm/protocols/satisfactory.py +++ b/discordgsm/protocols/satisfactory.py @@ -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}", diff --git a/requirements.txt b/requirements.txt index c5d9bb7..dccf855 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,4 @@ pymongo==4.7.3 python-dotenv==1.0.1 pywin32==306;platform_system=="Windows" typing-extensions==4.8.0;python_version<"3.10" -tzdata==2024.1 +tzdata==2024.1 \ No newline at end of file