Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
bash
2025-10-25 20:37:41 +02:00
committed by GitHub
26 changed files with 637 additions and 138 deletions
+2 -1
View File
@@ -278,7 +278,8 @@ variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile)
("help,h", "print usage message")
("version,v", "print version build info")
("dry-run,d", "Dry run")
("config,c", value<fs::path>(&configFile)->default_value(fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_REALM_CONFIG))), "use <arg> as configuration file");
("config,c", value<fs::path>(&configFile)->default_value(fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_REALM_CONFIG))), "use <arg> as configuration file")
("config-policy", value<std::string>()->value_name("policy"), "override config severity policy (e.g. default=skip,critical_option=fatal)");
variables_map variablesMap;
+4 -3
View File
@@ -423,7 +423,7 @@ bool StartDB()
MySQL::Library_Init();
// Load databases
DatabaseLoader loader("server.worldserver", DatabaseLoader::DATABASE_NONE, AC_MODULES_LIST);
DatabaseLoader loader("server.worldserver", DatabaseLoader::DATABASE_MASK_ALL, AC_MODULES_LIST);
loader
.AddDatabase(LoginDatabase, "Login")
.AddDatabase(CharacterDatabase, "Character")
@@ -438,7 +438,7 @@ bool StartDB()
}
///- Get the realm Id from the configuration file
realm.Id.Realm = sConfigMgr->GetOption<uint32>("RealmID", 0);
realm.Id.Realm = sConfigMgr->GetOption<uint32>("RealmID", 1);
if (!realm.Id.Realm)
{
LOG_ERROR("server.worldserver", "Realm ID not defined in configuration file");
@@ -721,7 +721,8 @@ variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, [
("help,h", "print usage message")
("version,v", "print version build info")
("dry-run,d", "Dry run")
("config,c", value<fs::path>(&configFile)->default_value(fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_CORE_CONFIG))), "use <arg> as configuration file");
("config,c", value<fs::path>(&configFile)->default_value(fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_CORE_CONFIG))), "use <arg> as configuration file")
("config-policy", value<std::string>()->value_name("policy"), "override config severity policy (e.g. default=skip,critical_option=fatal)");
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
options_description win("Windows platform specific options");
@@ -24,6 +24,24 @@
#include <errmsg.h>
#include <mysqld_error.h>
#include <thread>
#include <string_view>
namespace
{
std::string const EMPTY_DATABASE_INFO;
std::string const LOGIN_DATABASE_INFO_DEFAULT = "127.0.0.1;3306;acore;acore;acore_auth";
std::string const WORLD_DATABASE_INFO_DEFAULT = "127.0.0.1;3306;acore;acore;acore_world";
std::string const CHARACTER_DATABASE_INFO_DEFAULT = "127.0.0.1;3306;acore;acore;acore_characters";
std::string const& GetDefaultDatabaseInfo(std::string_view name)
{
if (name == "Login")
return LOGIN_DATABASE_INFO_DEFAULT;
if (name == "World")
return WORLD_DATABASE_INFO_DEFAULT;
if (name == "Character")
return CHARACTER_DATABASE_INFO_DEFAULT;
return EMPTY_DATABASE_INFO;
}
}
DatabaseLoader::DatabaseLoader(std::string const& logger, uint32 const defaultUpdateMask, std::string_view modulesList)
: _logger(logger),
@@ -38,7 +56,8 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool<T>& pool, std::st
_open.push([this, name, updatesEnabledForThis, &pool]() -> bool
{
std::string const dbString = sConfigMgr->GetOption<std::string>(name + "DatabaseInfo", "");
std::string const& defaultDatabaseInfo = GetDefaultDatabaseInfo(name);
std::string const dbString = sConfigMgr->GetOption<std::string>(name + "DatabaseInfo", defaultDatabaseInfo);
if (dbString.empty())
{
LOG_ERROR(_logger, "Database {} not specified in configuration file!", name);
@@ -1466,7 +1466,7 @@ void GameObject::Use(Unit* user)
// by default spell caster is user
Unit* spellCaster = user;
uint32 spellId = 0;
bool triggered = false;
uint32 triggeredFlags = TRIGGERED_NONE;
if (Player* playerUser = user->ToPlayer())
{
@@ -1486,6 +1486,10 @@ void GameObject::Use(Unit* user)
m_cooldownTime = GameTime::GetGameTimeMS().count() + cooldown * IN_MILLISECONDS;
}
if (user->IsPlayer() && GetGoType() != GAMEOBJECT_TYPE_TRAP) // workaround for GO casting
if (!m_goInfo->IsUsableMounted())
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
switch (GetGoType())
{
case GAMEOBJECT_TYPE_DOOR: //0
@@ -1886,7 +1890,6 @@ void GameObject::Use(Unit* user)
}
}
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
spellId = info->spellcaster.spellId;
break;
}
@@ -2056,12 +2059,15 @@ void GameObject::Use(Unit* user)
return;
}
if (m_goInfo->IsUsableMounted())
triggeredFlags |= TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE;
if (Player* player = user->ToPlayer())
sOutdoorPvPMgr->HandleCustomSpell(player, spellId, this);
if (spellCaster)
{
if ((spellCaster->CastSpell(user, spellInfo, triggered) == SPELL_CAST_OK) && GetGoType() == GAMEOBJECT_TYPE_SPELLCASTER)
if ((spellCaster->CastSpell(user, spellInfo, TriggerCastFlags(triggeredFlags)) == SPELL_CAST_OK) && GetGoType() == GAMEOBJECT_TYPE_SPELLCASTER)
AddUse();
}
else
@@ -1573,17 +1573,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (oldmap)
oldmap->RemovePlayerFromMap(this, false);
// xinef: do this before setting fall information!
if (IsMounted() && (!GetMap()->GetEntry()->IsDungeon() && !GetMap()->GetEntry()->IsBattlegroundOrArena()) && !m_transport)
{
AuraEffectList const& auras = GetAuraEffectsByType(SPELL_AURA_MOUNTED);
if (!auras.empty())
{
SetMountBlockId((*auras.begin())->GetId());
RemoveAurasByType(SPELL_AURA_MOUNTED);
}
}
teleportStore_dest = WorldLocation(mapid, x, y, z, orientation);
SetFallInformation(GameTime::GetGameTime().count(), z);
// if the player is saved before worldportack (at logout for example)