diff --git a/changelog.txt b/changelog.txt index ad6b6f5d5..30cdf9ba7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 03/12/2015 == +Akkadius: [eqemu_update.pl V7] Add Option 9) LUA Modules - Download latest LUA Modules (Required for Lua) + == 03/11/2015 == Akkadius: [eqemu_update.pl] Add Option 7) Plugins - Download latest Perl plugins Akkadius: [eqemu_update.pl] Add Option 8) Quests - Download latest PEQ quests and stage updates diff --git a/common/database_conversions.cpp b/common/database_conversions.cpp index 7213e3a50..a96f51967 100644 --- a/common/database_conversions.cpp +++ b/common/database_conversions.cpp @@ -494,7 +494,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 eqemu_update.pl V 6"); + system("perl eqemu_update.pl V 7"); /* Run Automatic Database Upgrade Script */ system("perl eqemu_update.pl ran_from_world"); diff --git a/utils/scripts/eqemu_update.pl b/utils/scripts/eqemu_update.pl index d5dddd407..f1ec5b688 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 = 6; +$current_version = 7; if($ARGV[0] eq "V"){ if($ARGV[1] > $current_version){ @@ -177,6 +177,7 @@ sub ShowMenuPrompt { 6 => \&MapFiles_Fetch, 7 => \&Plugins_Fetch, 8 => \&QuestFiles_Fetch, + 9 => \&LUA_Modules_Fetch, 20 => \&UpdateSelf, 0 => \&Exit, ); @@ -233,6 +234,7 @@ Database Management Menu (Please Select): 6) Maps - Download latest map and water files 7) Plugins - Download latest Perl plugins 8) Quests - Download latest PEQ quests and stage updates + 9) LUA Modules - Download latest LUA Modules (Required for Lua) 20) Force update this script (Redownload) 0) Exit @@ -485,6 +487,7 @@ sub QuestFiles_Fetch{ if (!-e $dest_file) { CopyFile($staged_file, $dest_file); print "Installing :: '" . $dest_file . "'\n"; + $fc++; } else{ $diff = Diff($dest_file, $staged_file); @@ -517,6 +520,66 @@ sub QuestFiles_Fetch{ } } +sub LUA_Modules_Fetch{ + print "\n --- Fetching Latest LUA Modules --- \n"; + + GetRemoteFile("https://github.com/EQEmu/Quests-Plugins/archive/master.zip", "updates_staged/Quests-Plugins-master.zip", 1); + + print "\nFetched latest LUA Modules...\n"; + + UnZip('updates_staged/Quests-Plugins-master.zip', 'updates_staged/'); + + $fc = 0; + use File::Find; + use File::Compare; + + my @files; + my $start_dir = "updates_staged/Quests-Plugins-master/quests/lua_modules/"; + find( + sub { push @files, $File::Find::name unless -d; }, + $start_dir + ); + for my $file (@files) { + if($file=~/\.pl|\.lua|\.ext/i){ + $staged_file = $file; + $dest_file = $file; + $dest_file =~s/updates_staged\/Quests-Plugins-master\/quests\///g; + + if (!-e $dest_file) { + CopyFile($staged_file, $dest_file); + print "Installing :: '" . $dest_file . "'\n"; + $fc++; + } + else{ + $diff = Diff($dest_file, $staged_file); + if($diff ne ""){ + $backup_dest = "updates_backups/" . $time_stamp . "/" . $dest_file; + print $diff . "\n"; + print "\nFile Different :: '" . $dest_file . "'\n"; + print "\nDo you wish to update this LUA Module? '" . $dest_file . "' [Yes (Enter) - No (N)] - A backup will be found in '" . $backup_dest . "'\n"; + my $input = ; + if($input=~/N/i){} + else{ + #::: Make a backup + CopyFile($dest_file, $backup_dest); + #::: Copy staged to running + copy($staged_file, $dest_file); + print "Installing :: '" . $dest_file . "'\n\n"; + } + $fc++; + } + } + } + } + + #::: Cleanup staged folder... + rmtree("updates_staged/"); + + if($fc == 0){ + print "\nNo LUA Modules Updates found... \n\n"; + } +} + sub Plugins_Fetch{ print "\n --- Fetching Latest Plugins --- \n"; @@ -545,6 +608,7 @@ sub Plugins_Fetch{ if (!-e $dest_file) { CopyFile($staged_file, $dest_file); print "Installing :: '" . $dest_file . "'\n"; + $fc++; } else{ $diff = Diff($dest_file, $staged_file);