Преглед на файлове

Added Steamcmd set_download_throttle Config Setting

own3mall преди 6 години
родител
ревизия
4ba3aeb925
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 1 0
      agent_conf.sh
  2. 9 0
      ogp_agent.pl

+ 1 - 0
agent_conf.sh

@@ -204,6 +204,7 @@ then
 	sudo_password => '${sudo_password}',
 	web_admin_api_key => '{your_admin_ogp_web_api_key_here}',
 	web_api_url => '{your_url_to_ogp_api.php}',
+	steam_dl_limit => '0',
 	);" > $cfgfile
 	
 	if [ $? != 0 ]

+ 9 - 0
ogp_agent.pl

@@ -61,6 +61,7 @@ use constant AGENT_PORT	 => $Cfg::Config{listen_port};
 use constant AGENT_VERSION  => $Cfg::Config{version};
 use constant WEB_ADMIN_API_KEY  => $Cfg::Config{web_admin_api_key};
 use constant WEB_API_URL => $Cfg::Config{web_api_url};
+use constant STEAM_DL_LIMIT => $Cfg::Config{steam_dl_limit};
 use constant SCREEN_LOG_LOCAL  => $Cfg::Preferences{screen_log_local};
 use constant DELETE_LOGS_AFTER  => $Cfg::Preferences{delete_logs_after};
 use constant AGENT_PID_FILE =>
@@ -2231,6 +2232,10 @@ sub steam_cmd_without_decrypt
 		print FILE "\@sSteamCmdForcePlatformBitness " . $arch_bits . "\n";
 	}
 	
+	if(defined STEAM_DL_LIMIT && STEAM_DL_LIMIT ne "" && is_integer(STEAM_DL_LIMIT) && STEAM_DL_LIMIT > 0){
+		print FILE "set_download_throttle " . STEAM_DL_LIMIT . "\n";
+	}
+	
 	if($guard ne '')
 	{
 		print FILE "set_steam_guard_code $guard\n";
@@ -4384,3 +4389,7 @@ sub get_setting_using_api
 	
 	return -1;
 }
+
+sub is_integer {
+   defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
+}