diff --git a/utils/scripts/eqemu_update.pl b/utils/scripts/eqemu_update.pl index f1ec5b688..c60a1bc3b 100644 --- a/utils/scripts/eqemu_update.pl +++ b/utils/scripts/eqemu_update.pl @@ -22,7 +22,7 @@ if($Config{osname}=~/linux/i){ $OS = "Linux"; } if($Config{osname}=~/Win|MS/i){ $OS = "Windows"; } #::: If current version is less than what world is reporting, then download a new one... -$current_version = 7; +$current_version = 6; if($ARGV[0] eq "V"){ if($ARGV[1] > $current_version){ @@ -46,8 +46,11 @@ no warnings; ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(); +#::: Cleanup staged folder... +rmtree("updates_staged/"); + my $confile = "eqemu_config.xml"; #default -open(F, "<$confile") or die "Unable to open config: $confile\n"; +open(F, "<$confile"); my $indb = 0; while() { s/\r//g; @@ -107,12 +110,12 @@ if($path eq ""){ mkdir('db_update'); #::: Check if db_version table exists... -if(trim(GetMySQLResult("SHOW COLUMNS FROM db_version LIKE 'Revision'")) ne ""){ +if(trim(GetMySQLResult("SHOW COLUMNS FROM db_version LIKE 'Revision'")) ne "" && $db){ print GetMySQLResult("DROP TABLE db_version"); print "Old db_version table present, dropping...\n\n"; } -if(GetMySQLResult("SHOW TABLES LIKE 'db_version'") eq ""){ +if(GetMySQLResult("SHOW TABLES LIKE 'db_version'") eq "" && $db){ print GetMySQLResult(" CREATE TABLE db_version ( version int(11) DEFAULT '0' @@ -133,24 +136,24 @@ if($bin_db_ver == $local_db_ver && $ARGV[0] eq "ran_from_start"){ exit; } else{ - print $console_output; + print $console_output if $db; } +if($db){ + print " Binary Database Version: (" . $bin_db_ver . ")\n"; + print " Local Database Version: (" . $local_db_ver . ")\n\n"; -print " Binary Database Version: (" . $bin_db_ver . ")\n"; -print " Local Database Version: (" . $local_db_ver . ")\n\n"; + #::: If World ran this script, and our version is up to date, continue... + if($bin_db_ver <= $local_db_ver && $ARGV[0] eq "ran_from_world"){ + print " Database up to Date: Continuing World Bootup...\n"; + print "============================================================\n"; + exit; + } -#::: If World ran this script, and our version is up to date, continue... -if($bin_db_ver <= $local_db_ver && $ARGV[0] eq "ran_from_world"){ - print " Database up to Date: Continuing World Bootup...\n"; - print "============================================================\n"; - exit; + print "Retrieving latest database manifest...\n"; + GetRemoteFile("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt", "db_update/db_update_manifest.txt"); } -print "Retrieving latest database manifest...\n"; -GetRemoteFile("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt", "db_update/db_update_manifest.txt"); -# GetRemoteFile("https://dl.dropboxusercontent.com/u/50023467/dl/db_update_manifest.txt", "db_update/db_update_manifest.txt"); - if($local_db_ver < $bin_db_ver && $ARGV[0] eq "ran_from_world"){ print "You have missing database updates, type 1 or 2 to backup your database before running them as recommended...\n\n"; #::: Display Menu @@ -217,6 +220,7 @@ sub ShowMenuPrompt { } sub MenuOptions { + if(@total_updates){ $option[3] = "Run pending REQUIRED updates... (" . scalar (@total_updates) . ")"; } @@ -225,7 +229,7 @@ sub MenuOptions { } return <