Explorar el Código

EHCP Integration Fixes and Using Readable Gamekey

own3mall hace 8 años
padre
commit
e44a5b0491
Se han modificado 3 ficheros con 4 adiciones y 3 borrados
  1. 1 1
      EHCP/addAccount.php
  2. 1 1
      EHCP/updateInfo.php
  3. 2 1
      ogp_agent.pl

+ 1 - 1
EHCP/addAccount.php

@@ -63,7 +63,7 @@ if (isset($ftp_username) && isset($ftp_pass) && isset($rDir)) {
     // If the last character in the path is a slash (/) - Remove it from the string
     
     if (substr_count($rDir, '/') >= 2 && $rDir[strlen($rDir) - 1] == "/") {
-        $end = strlen($rDir) - 2;
+        $end = strlen($rDir) - 1;
         $rDir = substr($rDir, 0, $end);
     }
     

+ 1 - 1
EHCP/updateInfo.php

@@ -85,7 +85,7 @@ if (!isset($ftp_username) || !isset($update_dir)) {
     // If the last character in the path is a slash (/) - Remove it from the string
     
     if (substr_count($update_dir, '/') > 2 && $update_dir[strlen($update_dir) - 1] == "/") {
-        $end = strlen($update_dir) - 2;
+        $end = strlen($update_dir) - 1;
         $update_dir = substr($update_dir, 0, $end);
     }
     

+ 2 - 1
ogp_agent.pl

@@ -573,7 +573,8 @@ sub replace_OGP_Env_Vars{
 	
 	# Handle global game shared directory replacement
 	if(defined $game_key && $game_key ne ""){
-		my $shared_path = Path::Class::Dir->new(SHARED_GAME_TMP_DIR, $game_key);
+		my $readable_game_key = lc(substr($game_key, 0, rindex($game_key,"_")));		
+		my $shared_path = Path::Class::Dir->new(SHARED_GAME_TMP_DIR, $readable_game_key);
 		# Create the folder if it doesn't exist
 		if (!-d $shared_path && !mkdir $shared_path)
 		{