ソースを参照

Added subroutine send_steam_guard_code

Added a subroutine that enters the steam guard code to the update screen.
DieFeM 8 年 前
コミット
10952c76d7
1 ファイル変更15 行追加1 行削除
  1. 15 1
      OGP/ogp_agent.pl

+ 15 - 1
OGP/ogp_agent.pl

@@ -329,7 +329,8 @@ my $d = Frontier::Daemon::OGP::Forking->new(
 				 get_file_part					=> \&get_file_part,
 				 stop_update					=> \&stop_update,
 				 shell_action					=> \&shell_action,
-				 remote_query					=> \&remote_query
+				 remote_query					=> \&remote_query,
+				 send_steam_guard_code  		=> \&send_steam_guard_code
 			 },
 			 debug	 => 4,
 			 LocalPort => AGENT_PORT,
@@ -3963,3 +3964,16 @@ sub remote_query
 	}
 	return -1;
 }
+
+sub send_steam_guard_code
+{
+	return "Bad Encryption Key" unless(decrypt_param(pop(@_)) eq "Encryption checking OK");
+	my ($home_id, $sgc) = decrypt_params(@_);
+	my $screen_id = create_screen_id(SCREEN_TYPE_UPDATE, $home_id);
+	system('screen -S '.$screen_id.' -p 0 -X stuff "'.$sgc.'$(printf \\\\r)"');
+	if ($? == 0)
+	{
+		return 0;
+	}
+	return 1
+}