Skip to content

Commit

Permalink
feat(bfv): add query for bfv (#4740)
Browse files Browse the repository at this point in the history
* fix quake2 and formatted

* correct bfv ports

* update bf config info

* remove curl

* tidy

* fix jc2mp query name
  • Loading branch information
dgibbs64 authored Jan 5, 2025
1 parent 0616604 commit f49c2b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lgsm/config-default/config-lgsm/bfvserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ stopmode="3"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
querymode="3"
querytype="protocol-gamespy2"

## Console type
consoleverbose="yes"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/jc2server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="2"
querytype="jc2m"
querytype="jc2mp"

## Console type
consoleverbose="yes"
Expand Down
6 changes: 4 additions & 2 deletions lgsm/modules/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"
}
Expand All @@ -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"}"
}
Expand Down
14 changes: 7 additions & 7 deletions lgsm/modules/query_gsquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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:
Expand All @@ -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')
Expand All @@ -40,7 +40,7 @@ def __init__(self, arguments):
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'
Expand Down

0 comments on commit f49c2b3

Please sign in to comment.