feat(bfv): add query for bfv (#4740)

* fix quake2 and formatted

* correct bfv ports

* update bf config info

* remove curl

* tidy

* fix jc2mp query name
This commit is contained in:
Daniel Gibbs 2025-01-05 23:38:17 +00:00 committed by GitHub
parent 06166045bc
commit f49c2b3aa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 12 deletions

View File

@ -123,8 +123,8 @@ stopmode="3"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
querymode="3"
querytype="protocol-gamespy2"
## Console type
consoleverbose="yes"

View File

@ -134,7 +134,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="2"
querytype="jc2m"
querytype="jc2mp"
## Console type
consoleverbose="yes"

View File

@ -959,13 +959,14 @@ fn_info_game_bf1942() {
fn_info_game_keyvalue_pairs_space "configip" "game.serverIP"
fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers"
fn_info_game_keyvalue_pairs_space "port" "game.serverPort"
fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort"
fn_info_game_keyvalue_pairs_space "servername" "game.serverName"
fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword"
fi
configip="${configip:-"0.0.0.0"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
queryport="22000"
queryport="${queryport:-"0"}"
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
}
@ -982,11 +983,12 @@ fn_info_game_bfv() {
fn_info_game_keyvalue_pairs_space "port" "game.serverPort"
fn_info_game_keyvalue_pairs_space "servername" "game.serverName"
fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword"
fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort"
fi
configip="${configip:-"0.0.0.0"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
queryport="22000"
queryport="${queryport:-"0"}"
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
}

View File

@ -11,7 +11,7 @@ import socket
import sys
engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1',
'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds')
'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2mp', 'mumbleping', 'soldat', 'teeworlds')
class gsquery:
@ -22,11 +22,11 @@ class gsquery:
idtech2query = ('protocol-quake2', 'idtech2', 'quake', 'iw2.0')
idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion')
minecraftquery = ('minecraft', 'lwjgl2')
minecraftbequery = ('minecraftbe',)
jc2mquery = ('jc2m',)
mumblequery = ('mumbleping',)
soldatquery = ('soldat',)
twquery = ('teeworlds',)
minecraftbequery = ('minecraftbe')
jc2mpquery = ('jc2mp')
mumblequery = ('mumbleping')
soldatquery = ('soldat')
twquery = ('teeworlds')
unrealquery = ('protocol-gamespy1', 'unreal')
unreal2query = ('protocol-unreal2', 'unreal2')
unreal3query = ('ut3', 'unreal3')
@ -40,7 +40,7 @@ class gsquery:
self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
elif self.argument.engine in self.idtech3query:
self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
elif self.argument.engine in self.jc2mquery:
elif self.argument.engine in self.jc2mpquery:
self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
elif self.argument.engine in self.minecraftquery:
self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93'