Re-Implement file check for db_update.pl in Database::CheckDatabaseConversions() so when the file exists it isn't re-downloaded

Increment db_update.pl current version to version 2
Update Database::CheckDatabaseConversions() to check for version 2 of db_update.pl
This commit is contained in:
Akkadius 2015-01-25 20:48:30 -06:00
parent d51271dc6d
commit 9d9df6931e
2 changed files with 7 additions and 7 deletions

View File

@ -463,14 +463,14 @@ bool Database::CheckDatabaseConversions() {
CheckDatabaseConvertCorpseDeblob();
/* Fetch Automatic Database Upgrade Script */
// if (!std::ifstream("db_update.pl")){
std::cout << "Pulling down automatic database upgrade script...\n" << std::endl;
if (!std::ifstream("db_update.pl")){
std::cout << "Pulling down automatic database upgrade script...\n" << std::endl;
#ifdef _WIN32
system("perl -MLWP::UserAgent -e \"require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_update.pl'); if ($response->is_success){ open(FILE, '> db_update.pl'); print FILE $response->decoded_content; close(FILE); }\"");
system("perl -MLWP::UserAgent -e \"require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_update.pl'); if ($response->is_success){ open(FILE, '> db_update.pl'); print FILE $response->decoded_content; close(FILE); }\"");
#else
system("wget -O db_update.pl https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_update.pl");
system("wget --no-check-certificate -O db_update.pl https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_update.pl");
#endif
// }
}
/*
Automatic Database Upgrade Script
@ -483,7 +483,7 @@ bool Database::CheckDatabaseConversions() {
/* Check for a new version of this script, the arg passed
would have to be higher than the copy they have downloaded
locally and they will re fetch */
system("perl db_update.pl V 1");
system("perl db_update.pl V 2");
/* Run Automatic Database Upgrade Script */
system("perl db_update.pl ran_from_world");

View File

@ -9,7 +9,7 @@
$menu_displayed = 0;
#::: If current version is less than what world is reporting, then download a new one...
$current_version = 1;
$current_version = 2;
if($ARGV[0] eq "V"){
if($ARGV[1] > $current_version){