Parcourir la source

feat(ut3server): add monitor query and add minor ut3 improvements (#2853)

* added ut3 to gsquery
* updated details
* added gamespy login information
* corrected maxplayers
Daniel Gibbs il y a 6 ans
Parent
commit
0af223d436

+ 10 - 5
lgsm/config-default/config-lgsm/ut3server/_default.cfg

@@ -14,18 +14,23 @@ port="7777"
 queryport="6500"
 defaultmap="VCTF-Suspense"
 game="UTGameContent.UTVehicleCTFGame_Content"
-mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav"
+# Example: mutators="UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav"
+mutators=""
 isdedicated="true"
 islanmatch="false"
 usesstats="false"
 shouldadvertise="true"
 pureserver="1"
 allowjoininprogress="true"
+# Required: GameSpy Username and password
+# https://docs.linuxgsm.com/game-servers/unreal-tournament-3#server-gamespy-login
+gsusername=""
+gspassword=""
 
 ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-# Edit with care | List of game types and mutators : https://docs.linuxgsm.com/game-servers/unreal-tournament-3
+# Edit with care | List of game types and mutators: https://docs.linuxgsm.com/game-servers/unreal-tournament-3
 fn_parms(){
-parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}"
+parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${selfname} -login=${gsusername} -password=${gspassword} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}"
 }
 
 #### LinuxGSM Settings ####
@@ -130,8 +135,8 @@ stopmode="2"
 # 3: gamedig
 # 4: gsquery
 # 5: tcp
-querymode="1"
-querytype=""
+querymode="2"
+querytype="ut3"
 
 ## Game Server Details
 # Do not edit

+ 4 - 1
lgsm/functions/info_config.sh

@@ -1046,13 +1046,16 @@ fn_info_config_unreal3(){
 		servername="${unavailable}"
 		serverpassword="${unavailable}"
 		adminpassword="${unavailable}"
+		maxplayers="${unavailable}"
 		webadminenabled="${unavailable}"
 		webadminport="${zero}"
 		webadminuser="${unavailable}"
 		webadminpass="${unavailable}"
 	else
 		servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]')
 		webadminuser="Admin"
@@ -1062,7 +1065,7 @@ fn_info_config_unreal3(){
 		servername=${servername:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		adminpassword=${adminpassword:-"NOT SET"}
-		port=${port:-"0"}
+		maxplayers=${maxplayers:-"NOT SET"}
 		webadminenabled=${webadminenabled:-"NOT SET"}
 		webadminport=${webadminport:-"0"}
 		webadminuser=${webadminuser:-"NOT SET"}

+ 0 - 2
lgsm/functions/info_parms.sh

@@ -207,8 +207,6 @@ fn_info_parms_unreal3(){
 	port=${port:-"0"}
 	queryport=${queryport:-"0"}
 	defaultmap=${defaultmap:-"NOT SET"}
-	serverpassword=${serverpassword:-"NOT SET"}
-	adminpassword=${adminpassword:-"NOT SET"}
 }
 
 fn_info_parms_unturned(){

+ 4 - 1
lgsm/functions/query_gsquery.py

@@ -28,6 +28,7 @@ class gsquery:
         twquery=['teeworlds']
         unrealquery=['protocol-gamespy1','unreal']
         unreal2query=['protocol-unreal2','unreal2']
+        unreal3query=['ut3','unreal3']
         if self.option.engine in sourcequery:
             self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
         elif self.option.engine in idtech2query:
@@ -50,6 +51,8 @@ class gsquery:
             self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
         elif self.option.engine in unreal2query:
             self.query_prompt_string = b'\x79\x00\x00\x00\x00'
+        elif self.option.engine in unreal3query:
+            self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00'
 
         self.connected = False
         self.response = None
@@ -119,7 +122,7 @@ if __name__ == '__main__':
         action='store',
         dest='engine',
         default=False,
-        help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 minecraft minecraftbe jc2mp mumbleping soldat teeworlds'
+        help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 ut3 minecraft minecraftbe jc2mp mumbleping soldat teeworlds'
     )
     parser.add_option(
         '-v', '--verbose',