Просмотр исходного кода

Medal of Honor Changes - Predictable Query Port (#650)

* Medal of Honor Changes - Predictable Query Port

* Medal of Honor Changes - Predictable Query Port
OwN-3m-All 8 месяцев назад
Родитель
Сommit
ad32981a8a

+ 4 - 0
includes/functions.php

@@ -1018,12 +1018,16 @@ function getRemoteContent($url, $timeout = 5, $referrer = ""){
 
 function getQueryPortOverridesForGame($protocol, $ip, $port, $defaultQueryPort){
 	$q_port = $defaultQueryPort;
+	// Removed since mohaaservers.tk isn't the master server anymore for mohaa
+	// Also, the query port is now defined in the XML, so it will always be plus 97 to the host port
+	/*
 	if(strpos($protocol, 'mohaa') !== false){
 		$realQPort = getRemoteContent("http://mohaaservers.tk/get_query_port_fast.php?ip=" . $ip . ":" . $port);
 		if($realQPort != -1 && is_numeric($realQPort)){
 			$q_port = $realQPort;
 		}
 	}
+	*/
 	return $q_port;
 }
 

+ 2 - 1
modules/config_games/server_configs/mohaa.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Allied Assault</game_name>
   <server_exec_name>mohaa_lnxded</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>

+ 2 - 1
modules/config_games/server_configs/mohaa_win.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Allied Assault (Windows)</game_name>
   <server_exec_name>MOHAA_server.exe</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>

+ 2 - 1
modules/config_games/server_configs/mohbr_win.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Breakthrough (Windows)</game_name>
   <server_exec_name>moh_Breakthrough_server.exe</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>

+ 2 - 1
modules/config_games/server_configs/mohsp.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Spearhead</game_name>
   <server_exec_name>spearhead_lnxded</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set sv_maxrate 20000 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>

+ 2 - 1
modules/config_games/server_configs/mohsp_win.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Spearhead (Windows)</game_name>
   <server_exec_name>moh_spearhead_server.exe</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>

+ 2 - 1
modules/config_games/server_configs/mohspdemo_win.xml

@@ -5,11 +5,12 @@
   <game_name>Medal Of Honor: Spearhead Demo</game_name>
   <server_exec_name>moh_spearhead_demo.exe</server_exec_name>
   <query_port type="add">97</query_port>
-  <cli_template>+set dedicated 1 +set net_noipx 1 +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
+  <cli_template>+set dedicated 1 +set net_noipx 1 %QUERY_PORT% +exec server.cfg %IP% %PORT% %PLAYERS%</cli_template>
   <cli_params>
     <cli_param id="IP" cli_string="+set net_ip" options="s" />
     <cli_param id="PORT" cli_string="+set net_port" options="s" />
     <cli_param id="PLAYERS" cli_string="+set sv_maxclients" options="s" />
+    <cli_param id="QUERY_PORT" cli_string="+set net_gamespy_port" options="s" />
   </cli_params>
   <max_user_amount>64</max_user_amount>
   <mods>