mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
eqemu_update.pl minor adjustment, v10 [skip ci]
This commit is contained in:
parent
9bf4f399da
commit
bcf2a5c852
@ -494,7 +494,7 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
/* Check for a new version of this script, the arg passed
|
/* Check for a new version of this script, the arg passed
|
||||||
would have to be higher than the copy they have downloaded
|
would have to be higher than the copy they have downloaded
|
||||||
locally and they will re fetch */
|
locally and they will re fetch */
|
||||||
system("perl eqemu_update.pl V 9");
|
system("perl eqemu_update.pl V 10");
|
||||||
|
|
||||||
/* Run Automatic Database Upgrade Script */
|
/* Run Automatic Database Upgrade Script */
|
||||||
system("perl eqemu_update.pl ran_from_world");
|
system("perl eqemu_update.pl ran_from_world");
|
||||||
|
|||||||
@ -22,7 +22,7 @@ if($Config{osname}=~/linux/i){ $OS = "Linux"; }
|
|||||||
if($Config{osname}=~/Win|MS/i){ $OS = "Windows"; }
|
if($Config{osname}=~/Win|MS/i){ $OS = "Windows"; }
|
||||||
|
|
||||||
#::: If current version is less than what world is reporting, then download a new one...
|
#::: If current version is less than what world is reporting, then download a new one...
|
||||||
$current_version = 9;
|
$current_version = 10;
|
||||||
|
|
||||||
if($ARGV[0] eq "V"){
|
if($ARGV[0] eq "V"){
|
||||||
if($ARGV[1] > $current_version){
|
if($ARGV[1] > $current_version){
|
||||||
@ -146,10 +146,13 @@ if($db){
|
|||||||
print " Binary Revision / Local: (" . $bin_db_ver . " / " . $local_db_ver . ")\n";
|
print " Binary Revision / Local: (" . $bin_db_ver . " / " . $local_db_ver . ")\n";
|
||||||
|
|
||||||
#::: Bots
|
#::: Bots
|
||||||
$bots_local_db_version = trim(get_mysql_result("SELECT bots_version FROM db_version LIMIT 1"));
|
#::: Make sure we're running a bots binary to begin with
|
||||||
|
if(trim($db_version[2]) > 0){
|
||||||
|
$bots_local_db_version = get_bots_db_version();
|
||||||
if($bots_local_db_version > 0){
|
if($bots_local_db_version > 0){
|
||||||
print " (Bots) Binary Revision / Local: (" . trim($db_version[2]) . " / " . $bots_local_db_version . ")\n";
|
print " (Bots) Binary Revision / Local: (" . trim($db_version[2]) . " / " . $bots_local_db_version . ")\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#::: If World ran this script, and our version is up to date, continue...
|
#::: 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"){
|
if($bin_db_ver <= $local_db_ver && $ARGV[0] eq "ran_from_world"){
|
||||||
@ -707,6 +710,16 @@ sub are_file_sizes_different{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_bots_db_version{
|
||||||
|
#::: Check if bots_version column exists...
|
||||||
|
if(get_mysql_result("SHOW COLUMNS FROM db_version LIKE 'bots_version'") eq "" && $db){
|
||||||
|
print get_mysql_result("ALTER TABLE db_version ADD bots_version int(11) DEFAULT '0' AFTER version;");
|
||||||
|
print "\nColumn 'bots_version' does not exists.... Adding to 'db_version' table...\n\n";
|
||||||
|
}
|
||||||
|
$bots_local_db_version = trim(get_mysql_result("SELECT bots_version FROM db_version LIMIT 1"));
|
||||||
|
return $bots_local_db_version;
|
||||||
|
}
|
||||||
|
|
||||||
sub bots_db_management{
|
sub bots_db_management{
|
||||||
#::: Main Binary Database version
|
#::: Main Binary Database version
|
||||||
$bin_db_ver = trim($db_version[2]);
|
$bin_db_ver = trim($db_version[2]);
|
||||||
@ -724,13 +737,7 @@ sub bots_db_management{
|
|||||||
#::: Set on flag for running bot updates...
|
#::: Set on flag for running bot updates...
|
||||||
$bots_db_management = 1;
|
$bots_db_management = 1;
|
||||||
|
|
||||||
#::: Check if bots_version column exists...
|
$bots_local_db_version = get_bots_db_version();
|
||||||
if(get_mysql_result("SHOW COLUMNS FROM db_version LIKE 'bots_version'") eq "" && $db){
|
|
||||||
print get_mysql_result("ALTER TABLE db_version ADD bots_version int(11) DEFAULT '0' AFTER version;");
|
|
||||||
print "Column 'bots_version' does not exists.... Adding to 'db_version' table...\n\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$bots_local_db_version = trim(get_mysql_result("SELECT bots_version FROM db_version LIMIT 1"));
|
|
||||||
|
|
||||||
run_database_check();
|
run_database_check();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user