Skip to content

Commit 7f3c59d

Browse files
Merge pull request #119 from The-Padi/main
Satisfactory 1.0 update + opengsq
2 parents 504c838 + c1de910 commit 7f3c59d

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

discordgsm/games.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ rune,Rune (2000),gamespy1,port=7777;port_query_offset=1
234234
rust,Rust (2018),source,port=28015
235235

236236
samp,San Andreas Multiplayer (2006),samp,port=7777
237-
satisfactory,Satisfactory (2019),satisfactory,port_query=15777
237+
satisfactory,Satisfactory (2019),satisfactory,port_query=7777
238238
scpsl,SCP: Secret Laboratory (2017),scpsl,
239239
scum,SCUM (2018),scum,port=27015
240240
shatteredhorizon,Shattered Horizon (2009),source,port=27015

discordgsm/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def query_server_modal(game: GamedigGame, locale: Locale):
253253
modal.add_item(query_extra['_api_key'])
254254
modal.remove_item(query_param['port'])
255255
query_param['port']._value = '0'
256+
elif game['id'] == 'satisfactory':
257+
query_extra['_token'] = TextInput(label='Application Token', placeholder='Server Application token')
258+
modal.add_item(query_extra['_token'])
256259
elif game['id'] == 'gportal':
257260
query_extra['serverId'] = TextInput(label='GPORTAL server id')
258261
modal.add_item(query_extra['serverId'])

discordgsm/protocols/satisfactory.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ class Satisfactory(Protocol):
1313
name = "satisfactory"
1414

1515
async def query(self):
16-
host, port = str(self.kv["host"]), int(str(self.kv["port"]))
17-
satisfactory = opengsq.Satisfactory(host, port, self.timeout)
16+
host, port, app_token = (
17+
str(self.kv["host"]),
18+
int(str(self.kv["port"])),
19+
str(self.kv["_token"]),
20+
)
21+
22+
satisfactory = opengsq.Satisfactory(host, port, app_token, self.timeout)
1823
start = time.time()
1924
status = await satisfactory.get_status()
2025
ping = int((time.time() - start) * 1000)
2126

2227
result: GamedigResult = {
23-
"name": "",
28+
"name": status.server_name,
2429
"map": "",
2530
"password": False,
26-
"numplayers": 0,
31+
"numplayers": status.num_players,
2732
"numbots": 0,
28-
"maxplayers": 0,
33+
"maxplayers": status.server_max_nb_players,
2934
"players": None,
3035
"bots": None,
3136
"connect": f"{host}:{port}",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ pymongo==4.7.3
99
python-dotenv==1.0.1
1010
pywin32==306;platform_system=="Windows"
1111
typing-extensions==4.8.0;python_version<"3.10"
12-
tzdata==2024.1
12+
tzdata==2024.1

0 commit comments

Comments
 (0)