Bläddra i källkod

Additional Fixes for Stopping Game Server

own3mall 6 månader sedan
förälder
incheckning
ace5f3a99e
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12 0
      OGP/ogp_agent.pl

+ 12 - 0
OGP/ogp_agent.pl

@@ -1172,11 +1172,23 @@ sub stop_server_without_decrypt
 	
 	chomp $screen_pid;
 	
+	# One more check (happens if exactly one and only one screen session is running)
+	if ($screen_pid =~ /^\s*$/)
+	{
+		$get_screen_pid = "ls -A /home/cyg_server/.screen | grep $screen_id | cut -f1 -d'.' | sed '".'s/\W//g'."' | head -1";
+		$screen_pid = `$get_screen_pid`;
+		chomp $screen_pid;
+	}
+	
+	#logger "Screen pid is $screen_pid";
+	
 	my $windows_pid_command = "ps -W | grep '" . $screen_pid . "' | head -1 | awk '{print \$4}'";
 	my $windows_pid = `$windows_pid_command`;
 	
 	chomp $windows_pid;
 	
+	#logger "Windows pid is $screen_pid";
+	
 	# Some validation checks for the variables.
 	if ($server_ip =~ /^\s*$/ || $server_port < 0 || $server_port > 65535)
 	{