Remote testing and some final updates

This commit is contained in:
Uleat 2015-10-12 17:17:07 -04:00
parent c508b48b42
commit 79eb2d3d4b
5 changed files with 63 additions and 58 deletions

View File

@ -32,7 +32,7 @@
#define CURRENT_BINARY_DATABASE_VERSION 9087 #define CURRENT_BINARY_DATABASE_VERSION 9087
#ifdef BOTS #ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // temporarily disabled #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9000
#else #else
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0
#endif #endif

View File

@ -30,7 +30,8 @@ if($ARGV[0] eq "V"){
print "eqemu_update.pl Automatic Database Upgrade Needs updating...\n"; print "eqemu_update.pl Automatic Database Upgrade Needs updating...\n";
print " Current version: " . $current_version . "\n"; print " Current version: " . $current_version . "\n";
print " New version: " . $ARGV[1] . "\n"; print " New version: " . $ARGV[1] . "\n";
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl", "eqemu_update.pl"); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl", "eqemu_update.pl");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/scripts/eqemu_update.pl", "eqemu_update.pl");
exit; exit;
} }
else{ else{
@ -205,7 +206,8 @@ else{
} }
sub do_update_self{ sub do_update_self{
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl", "eqemu_update.pl"); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl", "eqemu_update.pl");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/scripts/eqemu_update.pl", "eqemu_update.pl");
die "Rerun eqemu_update.pl"; die "Rerun eqemu_update.pl";
} }
@ -308,7 +310,8 @@ sub check_for_database_dump_script{
} }
else{ else{
print "db_dumper.pl not found... retrieving...\n\n"; print "db_dumper.pl not found... retrieving...\n\n";
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_dumper.pl", "db_dumper.pl"); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/db_dumper.pl", "db_dumper.pl");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/scripts/db_dumper.pl", "db_dumper.pl");
} }
} }
@ -897,12 +900,14 @@ sub run_database_check{
#::: Pull down bots database manifest #::: Pull down bots database manifest
if($bots_db_management == 1){ if($bots_db_management == 1){
print "Retrieving latest bots database manifest...\n"; print "Retrieving latest bots database manifest...\n";
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/bots/bots_db_update_manifest.txt", "db_update/db_update_manifest.txt"); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/bots/bots_db_update_manifest.txt", "db_update/db_update_manifest.txt");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/sql/git/bots/bots_db_update_manifest.txt", "db_update/db_update_manifest.txt");
} }
#::: Pull down mainstream database manifest #::: Pull down mainstream database manifest
else{ else{
print "Retrieving latest database manifest...\n"; print "Retrieving latest database manifest...\n";
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt", "db_update/db_update_manifest.txt"); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt", "db_update/db_update_manifest.txt");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/sql/db_update_manifest.txt", "db_update/db_update_manifest.txt");
} }
} }
@ -1017,10 +1022,12 @@ sub fetch_missing_db_update{
$update_file = $_[1]; $update_file = $_[1];
if($db_update >= 9000){ if($db_update >= 9000){
if($bots_db_management == 1){ if($bots_db_management == 1){
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/bots/required/" . $update_file, "db_update/" . $update_file . ""); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/bots/required/" . $update_file, "db_update/" . $update_file . "");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/sql/git/bots/required/" . $update_file, "db_update/" . $update_file . "");
} }
else{ else{
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/" . $update_file, "db_update/" . $update_file . ""); #get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/" . $update_file, "db_update/" . $update_file . "");
get_remote_file("https://raw.githubusercontent.com/EQEmu/Server/bots_updater/utils/sql/git/required/" . $update_file, "db_update/" . $update_file . "");
} }
} }
elsif($db_update >= 5000 && $db_update <= 9000){ elsif($db_update >= 5000 && $db_update <= 9000){

View File

@ -3,4 +3,4 @@ Use the eqemu_update.pl script to source/update bot information into your databa
Developers: Please prefix 'bots_' to sql file description (after the date) in order to prevent issues naming conflicts. Developers: Please prefix 'bots_' to sql file description (after the date) in order to prevent issues naming conflicts.
Example: 1980_01_01_bots_file_description.sql Example: 1970_01_01_bots_file_description.sql

View File

@ -124,9 +124,9 @@ BEGIN
`class` TINYINT(2) NOT NULL DEFAULT '0', `class` TINYINT(2) NOT NULL DEFAULT '0',
`level` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0', `level` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
`deity` INT(11) UNSIGNED NOT NULL DEFAULT '0', -- Unused `deity` INT(11) UNSIGNED NOT NULL DEFAULT '0', -- Unused
`creation_day` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `creation_day` INT(11) UNSIGNED NOT NULL DEFAULT UNIX_TIMESTAMP,
`last_spawn` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `last_spawn` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`time_spawned` INT(10) UNSIGNED NOT NULL DEFAULT '0', `time_spawned` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`size` FLOAT NOT NULL DEFAULT '0', `size` FLOAT NOT NULL DEFAULT '0',
`face` INT(10) NOT NULL DEFAULT '1', `face` INT(10) NOT NULL DEFAULT '1',
`hair_color` INT(10) NOT NULL DEFAULT '1', `hair_color` INT(10) NOT NULL DEFAULT '1',
@ -156,6 +156,7 @@ BEGIN
`disease` SMALLINT(5) NOT NULL DEFAULT '0', `disease` SMALLINT(5) NOT NULL DEFAULT '0',
`corruption` SMALLINT(5) NOT NULL DEFAULT '0', `corruption` SMALLINT(5) NOT NULL DEFAULT '0',
`show_helm` INT(11) UNSIGNED NOT NULL DEFAULT '0', -- Unused `show_helm` INT(11) UNSIGNED NOT NULL DEFAULT '0', -- Unused
`follow_distance` INT(11) UNSIGNED NOT NULL DEFAULT '200', -- Unused
PRIMARY KEY (`bot_id`) PRIMARY KEY (`bot_id`)
) ENGINE=InnoDB; ) ENGINE=InnoDB;
CREATE TABLE `bot_inspect_messages` ( CREATE TABLE `bot_inspect_messages` (
@ -219,8 +220,8 @@ BEGIN
`Race`, `Race`,
`Class`, `Class`,
`BotLevel`, `BotLevel`,
`BotCreateDate`, UNIX_TIMESTAMP(`BotCreateDate`),
`LastSpawnDate`, UNIX_TIMESTAMP(`LastSpawnDate`),
`TotalPlayTime`, `TotalPlayTime`,
`Size`, `Size`,
`Face`, `Face`,
@ -655,7 +656,7 @@ DROP PROCEDURE IF EXISTS `LoadBotsSchema`;
-- Functions -- Functions
DELIMITER $$ DELIMITER $$
-- (no code references) -- (no code references - see `vw_groups` below)
CREATE FUNCTION `GetMobType` (mob_name VARCHAR(64)) RETURNS CHAR(1) CREATE FUNCTION `GetMobType` (mob_name VARCHAR(64)) RETURNS CHAR(1)
BEGIN BEGIN
DECLARE Result CHAR(1); DECLARE Result CHAR(1);

View File

@ -1563,7 +1563,6 @@ bool Bot::Save()
" `race`," " `race`,"
" `class`," " `class`,"
" `level`," " `level`,"
/*creation_day - not needed for bot creation*/
" `last_spawn`," " `last_spawn`,"
" `time_spawned`," " `time_spawned`,"
" `size`," " `size`,"
@ -1605,8 +1604,7 @@ bool Bot::Save()
" '%i'," /*race*/ " '%i'," /*race*/
" '%i'," /*class*/ " '%i'," /*class*/
" '%u'," /*level*/ " '%u'," /*level*/
/*creation_day*/ " UNIX_TIMESTAMP(),"/*last_spawn*/
" NOW()," /*last_spawn*/
" 0," /*time_spawned*/ " 0," /*time_spawned*/
" '%f'," /*size*/ " '%f'," /*size*/
" '%i'," /*face*/ " '%i'," /*face*/
@ -1705,8 +1703,7 @@ bool Bot::Save()
" `race` = '%i'," " `race` = '%i',"
" `class` = '%i'," " `class` = '%i',"
" `level` = '%u'," " `level` = '%u',"
/*creation_day - check to see how client is handled*/ " `last_spawn` = UNIX_TIMESTAMP(),"
" `last_spawn` = NOW(),"
" `time_spawned` = '%u'," " `time_spawned` = '%u',"
" `size` = '%f'," " `size` = '%f',"
" `face` = '%i'," " `face` = '%i',"
@ -1735,7 +1732,7 @@ bool Bot::Save()
" `magic` = '%i'," " `magic` = '%i',"
" `poison` = '%i'," " `poison` = '%i',"
" `disease` = '%i'," " `disease` = '%i',"
" `corruption` = '%i'," " `corruption` = '%i'"
" WHERE `bot_id` = '%u'", " WHERE `bot_id` = '%u'",
_botOwnerCharacterID, _botOwnerCharacterID,
this->GetBotSpellID(), this->GetBotSpellID(),
@ -1746,7 +1743,6 @@ bool Bot::Save()
_baseRace, _baseRace,
this->GetClass(), this->GetClass(),
this->GetLevel(), this->GetLevel(),
/*creation_day*/
GetTotalPlayTime(), GetTotalPlayTime(),
GetSize(), GetSize(),
this->GetLuclinFace(), this->GetLuclinFace(),
@ -1892,7 +1888,7 @@ void Bot::LoadBuffs()
" `duration_formula`," " `duration_formula`,"
" `tics_remaining`," " `tics_remaining`,"
" `poison_counters`," " `poison_counters`,"
" `disease_counters," " `disease_counters`,"
" `curse_counters`," " `curse_counters`,"
" `corruption_counters`," " `corruption_counters`,"
" `numhits`," " `numhits`,"
@ -1905,7 +1901,7 @@ void Bot::LoadBuffs()
" `caston_z`," " `caston_z`,"
" `extra_di_chance`" " `extra_di_chance`"
" FROM `bot_buffs`" " FROM `bot_buffs`"
" WHERE `bot_id` = %u", " WHERE `bot_id` = '%u'",
GetBotID() GetBotID()
); );
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
@ -2091,7 +2087,7 @@ uint32 Bot::SavePetStats(std::string petName, uint32 petMana, uint32 petHitPoint
petHitPoints petHitPoints
); );
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
return 0; return results.LastInsertedID();
} }
void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId)
@ -3421,9 +3417,9 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv)
" `inst_color`," " `inst_color`,"
" `augment_1`," " `augment_1`,"
" `augment_2`," " `augment_2`,"
" `augslot_3`," " `augment_3`,"
" `augslot_4`, " " `augment_4`, "
" `augslot_5`," " `augment_5`,"
" `inst_no_drop`" " `inst_no_drop`"
" FROM `bot_inventories`" " FROM `bot_inventories`"
" WHERE `bot_id` = %i" " WHERE `bot_id` = %i"
@ -3871,38 +3867,39 @@ std::list<SpawnedBotsList> Bot::ListSpawnedBots(uint32 characterID, std::string*
return spawnedBots; return spawnedBots;
} }
void Bot::SaveBotGroup(Group* botGroup, std::string botGroupName, std::string* errorMessage) { void Bot::SaveBotGroup(Group* botGroup, std::string botGroupName, std::string* errorMessage)
{
if(!botGroup || botGroupName.empty()) if(!botGroup || botGroupName.empty())
return; return;
Mob* tempGroupLeader = botGroup->GetLeader(); Mob* tempGroupLeader = botGroup->GetLeader();
if(!tempGroupLeader->IsBot()) if(!tempGroupLeader->IsBot())
return; return;
uint32 botGroupId = 0; uint32 botGroupId = 0;
uint32 botGroupLeaderBotId = tempGroupLeader->CastToBot()->GetBotID(); uint32 botGroupLeaderBotId = tempGroupLeader->CastToBot()->GetBotID();
std::string query = StringFormat("INSERT INTO `bot_groups` (`group_leader_id`, `group_name`) VALUES (%u, '%s')", botGroupLeaderBotId, botGroupName.c_str()); std::string query = StringFormat("INSERT INTO `bot_groups` (`group_leader_id`, `group_name`) VALUES (%u, '%s')", botGroupLeaderBotId, botGroupName.c_str());
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
if(!results.Success()) { if(!results.Success()) {
*errorMessage = std::string(results.ErrorMessage()); *errorMessage = std::string(results.ErrorMessage());
return; return;
} }
if(botGroupId == 0)
return;
for(int groupMemberIndex = 0; groupMemberIndex < botGroup->GroupCount(); groupMemberIndex++) {
Mob* tempBot = botGroup->members[groupMemberIndex];
if(!tempBot || !tempBot->IsBot())
continue;
uint32 botGroupMemberBotId = tempBot->CastToBot()->GetBotID();
query = StringFormat("INSERT INTO `bot_group_members` (`groups_index`, `bot_id`) VALUES (%u, %u)", botGroupId, botGroupMemberBotId);
results = database.QueryDatabase(query);
if(!results.Success())
*errorMessage = std::string(results.ErrorMessage());
}
botGroupId = results.LastInsertedID();
if(botGroupId == 0)
return;
for(int groupMemberIndex = 0; groupMemberIndex < botGroup->GroupCount(); groupMemberIndex++) {
Mob* tempBot = botGroup->members[groupMemberIndex];
if(!tempBot || !tempBot->IsBot())
continue;
uint32 botGroupMemberBotId = tempBot->CastToBot()->GetBotID();
query = StringFormat("INSERT INTO `bot_group_members` (`groups_index`, `bot_id`) VALUES (%u, %u)", botGroupId, botGroupMemberBotId);
results = database.QueryDatabase(query);
if(!results.Success())
*errorMessage = std::string(results.ErrorMessage());
}
} }
void Bot::DeleteBotGroup(std::string botGroupName, std::string* errorMessage) { void Bot::DeleteBotGroup(std::string botGroupName, std::string* errorMessage) {