Browse Source

Some fixes in the steamcmd installation.
Needs agent update.

DieFeM 12 years ago
parent
commit
3d9a0971b3
2 changed files with 11 additions and 4 deletions
  1. 2 2
      includes/lib_remote.php
  2. 9 2
      modules/gamemanager/update_server.php

+ 2 - 2
includes/lib_remote.php

@@ -291,9 +291,9 @@ class OGPRemoteLibrary
     /// \return 1 If update started successfully
     /// \return 0 If error
     /// \return -1 In case of connection error.
-    public function steam_cmd($home_id,$game_home,$mod,$modname,$betaname,$betapwd,$user,$pass,$guard,$exec_folder_path,$exec_path,$precmd,$postcmd)
+    public function steam_cmd($home_id,$game_home,$mod,$modname,$betaname,$betapwd,$user,$pass,$guard,$exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os)
     {
-        $params = $this->encrypt_params($home_id,$game_home,$mod,$modname,$betaname,$betapwd,$user,$pass,$guard,$exec_folder_path,$exec_path,$precmd,$postcmd);
+        $params = $this->encrypt_params($home_id,$game_home,$mod,$modname,$betaname,$betapwd,$user,$pass,$guard,$exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os);
         $request = xmlrpc_encode_request("steam_cmd", $params);
         $response = $this->sendRequest($request);
 

+ 9 - 2
modules/gamemanager/update_server.php

@@ -136,6 +136,11 @@ function exec_ogp_module() {
 		}
 		else
 		{
+			if( preg_match("/win32/", $server_xml->game_key) OR preg_match("/win64/", $server_xml->game_key) ) 
+				$cfg_os = "windows";
+			elseif( preg_match("/linux/", $server_xml->game_key) )
+				$cfg_os = "linux";
+			
 			$settings = $db->getSettings();
 			
 			// Some games like L4D2 require anonymous login
@@ -150,8 +155,10 @@ function exec_ogp_module() {
 			$modname = ( $installer_name == '90' and !preg_match("/(cstrike|valve)/", $modkey) ) ? $modkey : '';
 			$betaname = isset($mod_xml->betaname) ? $mod_xml->betaname : '';
 			$betapwd = isset($mod_xml->betapwd) ? $mod_xml->betapwd : '';
-							
-			$steam_out = $remote->steam_cmd( $home_id,$home_info['home_path'],$installer_name,$modname,$betaname,$betapwd,$login,$pass,$settings['steam_guard'],$exec_folder_path,$exec_path,$precmd,$postcmd );
+			
+			$steam_out = $remote->steam_cmd( $home_id,$home_info['home_path'],$installer_name,$modname,
+											 $betaname,$betapwd,$login,$pass,$settings['steam_guard'],
+											 $exec_folder_path,$exec_path,$precmd,$postcmd,$cfg_os );
 		}
 		
         if( $steam_out === 0 )