Răsfoiți Sursa

Changes to Remote Calls

own3mall 8 ani în urmă
părinte
comite
ed07c2efde

+ 7 - 7
includes/lib_remote.php

@@ -381,13 +381,13 @@ class OGPRemoteLibrary
 						$home_id, $home_path, $server_ip, $server_port, $exec_path, $exec_folder_path,
 						$control_protocol, $control_password, $control_type,
 						$appId, $modname, $betaname, $betapwd, $user, $pass, $guard, $precmd, $postcmd, $cfg_os, $filesToLockUnlock,
-						$startup_cmd, $cpu, $nice, $preStart, $envVars
+						$startup_cmd, $cpu, $nice, $preStart, $envVars, $game_key
 	)
 	{
 		$params = $this->encrypt_params($home_id, $home_path, $server_ip, $server_port, $exec_path, $exec_folder_path,
 						$control_protocol, $control_password, $control_type,
 						$appId, $modname, $betaname, $betapwd, $user, $pass, $guard, $precmd, $postcmd, $cfg_os, $filesToLockUnlock,
-						$startup_cmd, $cpu, $nice, $preStart, $envVars);
+						$startup_cmd, $cpu, $nice, $preStart, $envVars, $game_key);
 
 		$this->add_enc_chk($params);
 		$request = xmlrpc_encode_request("automatic_steam_update", $params);
@@ -576,10 +576,10 @@ class OGPRemoteLibrary
 	/// \return -2 In other errors.
 	/// \todo Other return values?
 	public function universal_start($home_id, $game_home, $game_binary, $run_dir, $startup_cmd,
-		$server_port, $server_ip, $cpu, $nice, $preStart = "", $envVars = "")
+		$server_port, $server_ip, $cpu, $nice, $preStart, $envVars, $game_key)
 	{
 		$params_array = $this->encrypt_params($home_id, $game_home, $game_binary,
-			$run_dir, $startup_cmd, $server_port, $server_ip, $cpu, $nice, $preStart, $envVars);
+			$run_dir, $startup_cmd, $server_port, $server_ip, $cpu, $nice, $preStart, $envVars, $game_key);
 		$this->add_enc_chk($params_array);
 		$request = xmlrpc_encode_request("universal_start", $params_array);
 		$response = $this->sendRequest($request);
@@ -723,11 +723,11 @@ class OGPRemoteLibrary
 
 	public function remote_restart_server($home_id,$server_ip,$server_port, 
 			$control_protocol,$control_password,$control_type,
-			$home_path,$server_exe,$run_dir,$cmd,$cpu,$nice,$preStart = "", $envVars = "")
+			$home_path,$server_exe,$run_dir,$cmd,$cpu,$nice,$preStart, $envVars, $game_key)
 	{
 		$params_array = $this->encrypt_params($home_id,$server_ip,$server_port,
 			$control_protocol,$control_password,$control_type,
-			$home_path,$server_exe,$run_dir,$cmd,$cpu,$nice,$preStart,$envVars);
+			$home_path,$server_exe,$run_dir,$cmd,$cpu,$nice,$preStart,$envVars, $game_key);
 		$this->add_enc_chk($params_array);
 		$request = xmlrpc_encode_request("restart_server", $params_array);
 
@@ -1105,4 +1105,4 @@ class OGPRemoteLibrary
 		return base64_decode($response);
 	}
 }
-?>
+?>

+ 7 - 3
modules/gamemanager/home_handling_functions.php

@@ -316,7 +316,8 @@ function exec_operation( $action, $home_id, $mod_id, $ip, $port )
 														$home_info['mods'][$mod_id]['cpu_affinity'],
 														$home_info['mods'][$mod_id]['nice'],
 														$preStart,
-														$envVars);
+														$envVars,
+														$server_xml->game_key);
 		$db->logger(get_lang_f('server_restarted', $home_info['home_name']) . "($ip:$port)");
 		if ( $remote_retval === -1 )
 			return FALSE;
@@ -374,12 +375,15 @@ function exec_operation( $action, $home_id, $mod_id, $ip, $port )
 		
 		$start_retval = $remote->universal_start($home_info['home_id'],
 												 $home_info['home_path'],
-												 $server_xml->server_exec_name, $server_xml->exe_location,
+												 $server_xml->server_exec_name, 
+												 $server_xml->exe_location,
 												 $start_cmd, $port, $ip,
 												 $home_info['mods'][$mod_id]['cpu_affinity'],
 												 $home_info['mods'][$mod_id]['nice'],
 												 $preStart,
-												 $envVars);
+												 $envVars,
+												 $server_xml->game_key
+												 );
 		$db->logger(get_lang('server_started') . " (".$home_info['home_name']." $ip:$port)");
 		if( $start_retval == AGENT_ERROR_NOT_EXECUTABLE or $start_retval <= 0)
 			return FALSE;

+ 5 - 2
modules/gamemanager/mini_start.php

@@ -587,12 +587,15 @@ elseif($server_home['home_id'] == $_POST['home_id'])
 	
 	$start_retval = $remote->universal_start($server_home['home_id'],
 		$server_home['home_path'],
-		$server_xml->server_exec_name, $server_xml->exe_location,
+		$server_xml->server_exec_name, 
+		$server_xml->exe_location,
 		$start_cmd, $port, $ip,
 		$server_home['cpu_affinity'],
 		$server_home['nice'],
 		$preStart,
-		$envVars);
+		$envVars,
+		$server_xml->game_key
+		);
 	$db->logger(  server_started  . " (".$server_home['home_name']." $ip:$port)" );
 	if ( $start_retval == AGENT_ERROR_NOT_EXECUTABLE )
 	{

+ 1 - 1
modules/gamemanager/restart_server.php

@@ -406,7 +406,7 @@ function exec_ogp_module() {
 			$remote_retval = $remote->remote_restart_server($home_id,$ip,$port,$server_xml->control_protocol,
 															$home_info['control_password'],$control_type,$home_info['home_path'],
 															$server_xml->server_exec_name,$run_dir,$start_cmd,
-															$home_info['cpu_affinity'],$home_info['nice'],$preStart,$envVars);
+															$home_info['cpu_affinity'],$home_info['nice'],$preStart,$envVars, $server_xml->game_key);
 			
 			$db->logger(get_lang_f('server_restarted', $home_info['home_name']) . "($ip:$port)");
 				

+ 1 - 1
ogp_api.php

@@ -68,7 +68,7 @@ function runSteamAutoUpdate(){
 		$appId, $modname, $betaname, $betapwd, $login, $pass, $settings['steam_guard'], $precmd, $postcmd, $cfg_os, $lockFiles,
 							  
 		//start
-		$startup_cmd, $server_home['mods'][$mod_id]['cpu_affinity'], $server_home['mods'][$mod_id]['nice'], $preStart, $envVars
+		$startup_cmd, $server_home['mods'][$mod_id]['cpu_affinity'], $server_home['mods'][$mod_id]['nice'], $preStart, $envVars, $server_xml->game_key
 	);
 
 	if($update == 1){