瀏覽代碼

Added steam_workshop subroutine

Added a new subroutine to download mods from the steam workshop. The module is in testing stage.
DieFeM 8 年之前
父節點
當前提交
2fdf755912
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      includes/lib_remote.php

+ 19 - 0
includes/lib_remote.php

@@ -1124,5 +1124,24 @@ class OGPRemoteLibrary
 		
 		return 1;
 	}
+	
+	/// Updates the mod located in the game home with steamCmd.
+	/// \return 1 If update started successfully
+	/// \return 0 If error
+	/// \return -1 In case of connection error.
+	public function steam_workshop($home_id, $mods_path, $workshop_id, $workshop_mod_id)
+	{
+		$params = $this->encrypt_params($home_id, $mods_path, $workshop_id, $workshop_mod_id);
+		$this->add_enc_chk($params);
+		$request = xmlrpc_encode_request("steam_workshop", $params);
+		$response = $this->sendRequest($request);
+
+		if ( $response === -1 )
+			return 0;
+		else if ( $response === 1 )
+			return 1;
+		else
+			return -1;
+	}
 }
 ?>