Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-07-03 16:03:45 +08:00
81 changed files with 889 additions and 415 deletions
+1 -1
View File
@@ -281,7 +281,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
bool ArenaTeam::SetName(std::string const& name)
{
if (TeamName == name || name.empty() || name.length() > 24 || sObjectMgr->IsReservedName(name) || sObjectMgr->IsProfanityName(name) || !ObjectMgr::IsValidCharterName(name))
if (TeamName == name || name.empty() || name.length() > 24 || !ObjectMgr::IsValidCharterName(name))
return false;
TeamName = name;
@@ -116,7 +116,7 @@ namespace lfg
sLFGMgr->LeaveLfg(player->GetGUID());
sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), true);
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->m_homebindO);
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f);
LOG_DEBUG("lfg", "LFGPlayerScript::OnMapChanged, Player {} ({}) is in LFG dungeon map but does not have a valid group! Teleporting to homebind.",
player->GetName(), player->GetGUID().ToString());
return;
+3 -4
View File
@@ -345,7 +345,6 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
m_homebindX = 0;
m_homebindY = 0;
m_homebindZ = 0;
m_homebindO = 0;
m_contestedPvPTimer = 0;
@@ -1606,7 +1605,7 @@ bool Player::TeleportToEntryPoint()
if (loc.m_mapId == MAPID_INVALID)
{
return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
}
return TeleportTo(loc);
@@ -4913,7 +4912,7 @@ void Player::RepopAtGraveyard()
}
}
else if (GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
RemovePlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
}
@@ -11264,7 +11263,7 @@ void Player::SetEntryPoint()
}
if (m_entryPointData.joinPos.m_mapId == MAPID_INVALID)
m_entryPointData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
m_entryPointData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, 0.0f);
}
void Player::LeaveBattleground(Battleground* bg)
-1
View File
@@ -2349,7 +2349,6 @@ public:
float m_homebindX;
float m_homebindY;
float m_homebindZ;
float m_homebindO;
[[nodiscard]] WorldLocation GetStartPosition() const;
@@ -4913,7 +4913,7 @@ bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, flo
void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
{
loc.GetPosition(m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
loc.GetPosition(m_homebindX, m_homebindY, m_homebindZ);
m_homebindMapId = loc.GetMapId();
m_homebindAreaId = areaId;
@@ -4921,11 +4921,10 @@ void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
stmt->SetData(0, m_homebindMapId);
stmt->SetData(1, m_homebindAreaId);
stmt->SetData(2, m_homebindX);
stmt->SetData(3, m_homebindY);
stmt->SetData(4, m_homebindZ);
stmt->SetData(5, m_homebindO);
stmt->SetData(6, GetGUID().GetCounter());
stmt->SetData (2, m_homebindX);
stmt->SetData (3, m_homebindY);
stmt->SetData (4, m_homebindZ);
stmt->SetData(5, GetGUID().GetCounter());
CharacterDatabase.Execute(stmt);
}
@@ -4981,8 +4980,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
m_name = fields[2].Get<std::string>();
// check name limitations
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
(AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && (sObjectMgr->IsReservedName(m_name) || sObjectMgr->IsProfanityName(m_name))))
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS || AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->SetData(0, uint16(AT_LOGIN_RENAME));
@@ -5099,7 +5097,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
std::string taxi_nodes = fields[42].Get<std::string>();
auto RelocateToHomebind = [this, &mapId, &instanceId]() { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ, m_homebindO); };
auto RelocateToHomebind = [this, &mapId, &instanceId]() { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); };
_LoadGroup();
@@ -7014,7 +7012,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
}
bool ok = false;
// SELECT mapId, zoneId, posX, posY, posZ, pozO FROM character_homebind WHERE guid = ?
// SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?
if (result)
{
Field* fields = result->Fetch();
@@ -7024,12 +7022,11 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
m_homebindX = fields[2].Get<float>();
m_homebindY = fields[3].Get<float>();
m_homebindZ = fields[4].Get<float>();
m_homebindO = fields[5].Get<float>();
MapEntry const* bindMapEntry = sMapStore.LookupEntry(m_homebindMapId);
// accept saved data only for valid position (and non instanceable), and accessable
if (MapMgr::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO) &&
if (MapMgr::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ) &&
!bindMapEntry->Instanceable() && GetSession()->Expansion() >= bindMapEntry->Expansion())
ok = true;
else
@@ -7047,20 +7044,19 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
m_homebindX = info->positionX;
m_homebindY = info->positionY;
m_homebindZ = info->positionZ;
m_homebindO = info->orientation;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
stmt->SetData(0, GetGUID().GetCounter());
stmt->SetData(1, m_homebindMapId);
stmt->SetData(2, m_homebindAreaId);
stmt->SetData(3, m_homebindX);
stmt->SetData(4, m_homebindY);
stmt->SetData(5, m_homebindZ);
stmt->SetData(6, m_homebindO);
stmt->SetData (3, m_homebindX);
stmt->SetData (4, m_homebindY);
stmt->SetData (5, m_homebindZ);
CharacterDatabase.Execute(stmt);
}
LOG_DEBUG("entities.player", "Setting player home position - mapid: {}, areaid: {}, X: {}, Y: {}, Z: {}, O: {}",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
LOG_DEBUG("entities.player", "Setting player home position - mapid: {}, areaid: {}, X: {}, Y: {}, Z: {}",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
return true;
}
@@ -1017,7 +1017,7 @@ void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool def
chance = chance < 1.0f ? 1.0f : chance; // minimum chance to increase skill is 1%
LOG_DEBUG("entities.player", "Player::UpdateCombatSkills(defence:{}, playerLevel:{}, moblevel:{}) -> ({}/{}) chance to increase skill is {}%", defence, playerLevel, moblevel, currentSkillValue, currentSkillMax, chance);
LOG_DEBUG("entities.player", "Player::UpdateCombatSkills(defence:{}, playerLevel:{}, moblevel:{}) -> ({}/{}) chance to increase skill is {}\%", defence, playerLevel, moblevel, currentSkillValue, currentSkillMax, chance);
if (roll_chance_f(chance))
{
+79 -120
View File
@@ -36,7 +36,6 @@
#include "LFGMgr.h"
#include "Log.h"
#include "MapMgr.h"
#include <numeric>
#include "Pet.h"
#include "PoolMgr.h"
#include "ReputationMgr.h"
@@ -53,6 +52,7 @@
#include "Vehicle.h"
#include "World.h"
#include <boost/algorithm/string.hpp>
#include <numeric>
ScriptMapMap sSpellScripts;
ScriptMapMap sEventScripts;
@@ -203,62 +203,6 @@ std::string ScriptInfo::GetDebugInfo() const
return std::string(sz);
}
/**
* @name ReservedNames
* @brief Checks NamesReserved.dbc for reserved names
*
* @param name Name to check for match in NamesReserved.dbc
* @return true/false
*/
bool ReservedNames(std::wstring& name)
{
for (NamesReservedEntry const* reservedStore : sNamesReservedStore)
{
std::wstring PatternString;
Utf8toWStr(reservedStore->Pattern, PatternString);
boost::algorithm::replace_all(PatternString, "\\<", "");
boost::algorithm::replace_all(PatternString, "\\>", "");
int stringCompare = name.compare(PatternString);
if (stringCompare == 0)
{
return true;
}
}
return false;
};
/**
* @name ProfanityNames
* @brief Checks NamesProfanity.dbc for reserved names
*
* @param name Name to check for match in NamesProfanity.dbc
* @return true/false
*/
bool ProfanityNames(std::wstring& name)
{
for (NamesProfanityEntry const* profanityStore : sNamesProfanityStore)
{
std::wstring PatternString;
Utf8toWStr(profanityStore->Pattern, PatternString);
boost::algorithm::replace_all(PatternString, "\\<", "");
boost::algorithm::replace_all(PatternString, "\\>", "");
int stringCompare = name.compare(PatternString);
if (stringCompare == 0)
{
return true;
}
}
return false;
}
bool normalizePlayerName(std::string& name)
{
if (name.empty())
@@ -8141,7 +8085,7 @@ void ObjectMgr::LoadCreatureQuestEnders()
}
}
void ObjectMgr::LoadReservedPlayersNames()
void ObjectMgr::LoadReservedPlayerNamesDB()
{
uint32 oldMSTime = getMSTime();
@@ -8151,8 +8095,7 @@ void ObjectMgr::LoadReservedPlayersNames()
if (!result)
{
LOG_WARN("server.loading", ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
LOG_INFO("server.loading", " ");
LOG_WARN("server.loading", ">> Loaded 0 reserved names. DB table `reserved_name` is empty!");
return;
}
@@ -8177,7 +8120,36 @@ void ObjectMgr::LoadReservedPlayersNames()
++count;
} while (result->NextRow());
LOG_INFO("server.loading", ">> Loaded {} reserved player names in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", ">> Loaded {} reserved names from DB in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadReservedPlayerNamesDBC()
{
if (!sWorld->getBoolConfig(CONFIG_STRICT_NAMES_RESERVED))
{
LOG_WARN("server.loading", ">> Loaded 0 reserved names from DBC. Config option disabled.");
return;
}
uint32 oldMSTime = getMSTime();
uint32 count = 0;
for (NamesReservedEntry const* reservedStore : sNamesReservedStore)
{
std::wstring wstr;
Utf8toWStr(reservedStore->Pattern, wstr);
// DBC does not have clean entries, remove the junk.
boost::algorithm::replace_all(wstr, "\\<", "");
boost::algorithm::replace_all(wstr, "\\>", "");
_reservedNamesStore.insert(wstr);
count++;
}
LOG_INFO("server.loading", ">> Loaded {} reserved names from DBC in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
}
@@ -8216,7 +8188,7 @@ void ObjectMgr::AddReservedPlayerName(std::string const& name)
}
}
void ObjectMgr::LoadProfanityPlayersNames()
void ObjectMgr::LoadProfanityNamesFromDB()
{
uint32 oldMSTime = getMSTime();
@@ -8226,8 +8198,7 @@ void ObjectMgr::LoadProfanityPlayersNames()
if (!result)
{
LOG_WARN("server.loading", ">> Loaded 0 profanity player names. DB table `profanity_name` is empty!");
LOG_INFO("server.loading", " ");
LOG_WARN("server.loading", ">> Loaded 0 profanity names. DB table `profanity_name` is empty!");
return;
}
@@ -8252,7 +8223,36 @@ void ObjectMgr::LoadProfanityPlayersNames()
++count;
} while (result->NextRow());
LOG_INFO("server.loading", ">> Loaded {} profanity player names in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", ">> Loaded {} profanity names from DB in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadProfanityNamesFromDBC()
{
if (!sWorld->getBoolConfig(CONFIG_STRICT_NAMES_PROFANITY))
{
LOG_WARN("server.loading", ">> Loaded 0 profanity names from DBC. Config option disabled.");
return;
}
uint32 oldMSTime = getMSTime();
uint32 count = 0;
for (NamesProfanityEntry const* profanityStore : sNamesProfanityStore)
{
std::wstring wstr;
Utf8toWStr(profanityStore->Pattern, wstr);
// DBC does not have clean entries, remove the junk.
boost::algorithm::replace_all(wstr, "\\<", "");
boost::algorithm::replace_all(wstr, "\\>", "");
_profanityNamesStore.insert(wstr);
count++;
}
LOG_INFO("server.loading", ">> Loaded {} profanity names from DBC in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
}
@@ -8392,34 +8392,13 @@ uint8 ObjectMgr::CheckPlayerName(std::string_view name, bool create)
if (wname[i] == wname[i - 1] && wname[i] == wname[i - 2])
return CHAR_NAME_THREE_CONSECUTIVE;
// Check Reserved Name from Database
// Check Reserved Name
if (sObjectMgr->IsReservedName(name))
{
return CHAR_NAME_RESERVED;
}
// Check Profanity Name
if (sObjectMgr->IsProfanityName(name))
{
return CHAR_NAME_PROFANE;
}
// Check for Reserved Name from DBC
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_RESERVED))
{
if (ReservedNames(wname))
{
return CHAR_NAME_RESERVED;
}
}
// Check for Profanity
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_PROFANITY))
{
if (ProfanityNames(wname))
{
return CHAR_NAME_PROFANE;
}
}
return CHAR_NAME_SUCCESS;
}
@@ -8437,23 +8416,13 @@ bool ObjectMgr::IsValidCharterName(std::string_view name)
if (wname.size() < minName)
return false;
// Check for Reserved Name from DBC
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_RESERVED))
{
if (ReservedNames(wname))
{
return false;
}
}
// Check Reserved Name
if (sObjectMgr->IsReservedName(name))
return false;
// Check for Profanity
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_PROFANITY))
{
if (ProfanityNames(wname))
{
return false;
}
}
// Check Profanity Name
if (sObjectMgr->IsProfanityName(name))
return false;
uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_CHARTER_NAMES);
@@ -8491,23 +8460,13 @@ PetNameInvalidReason ObjectMgr::CheckPetName(std::string_view name)
if (!isValidString(wname, strictMask, false))
return PET_NAME_MIXED_LANGUAGES;
// Check for Reserved Name from DBC
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_RESERVED))
{
if (ReservedNames(wname))
{
return PET_NAME_RESERVED;
}
}
// Check Reserved Name
if (sObjectMgr->IsReservedName(name))
return PET_NAME_RESERVED;
// Check for Profanity
if (sWorld->getBoolConfig(CONFIG_STRICT_NAMES_PROFANITY))
{
if (ProfanityNames(wname))
{
return PET_NAME_PROFANE;
}
}
// Check Profanity Name
if (sObjectMgr->IsProfanityName(name))
return PET_NAME_PROFANE;
return PET_NAME_SUCCESS;
}
+5 -5
View File
@@ -691,8 +691,6 @@ SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry);
#define MAX_CHARTER_NAME 24 // max allowed by client name length
#define MAX_CHANNEL_NAME 50 // pussywizard
bool ReservedNames(std::wstring& name);
bool ProfanityNames(std::wstring& name);
bool normalizePlayerName(std::string& name);
struct LanguageDesc
@@ -1335,12 +1333,14 @@ public:
uint32 AddCreData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
// reserved names
void LoadReservedPlayersNames();
void LoadReservedPlayerNamesDB();
void LoadReservedPlayerNamesDBC();
[[nodiscard]] bool IsReservedName(std::string_view name) const;
void AddReservedPlayerName(std::string const& name);
// profanity names
void LoadProfanityPlayersNames();
void LoadProfanityNamesFromDB();
void LoadProfanityNamesFromDBC();
[[nodiscard]] bool IsProfanityName(std::string_view name) const;
void AddProfanityPlayerName(std::string const& name);
@@ -1509,7 +1509,7 @@ private:
//character profanity names
typedef std::set<std::wstring> ProfanityNamesContainer;
ReservedNamesContainer _profanityNamesStore;
ProfanityNamesContainer _profanityNamesStore;
GameTeleContainer _gameTeleStore;
+1 -1
View File
@@ -1187,7 +1187,7 @@ void Guild::OnPlayerStatusChange(Player* player, uint32 flag, bool state)
bool Guild::SetName(std::string_view const& name)
{
if (m_name == name || name.empty() || name.length() > 24 || sObjectMgr->IsReservedName(name) || sObjectMgr->IsProfanityName(name) || !ObjectMgr::IsValidCharterName(name))
if (m_name == name || name.empty() || name.length() > 24 || !ObjectMgr::IsValidCharterName(name))
{
return false;
}
@@ -888,7 +888,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
if (at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->m_homebindO);
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
}
pCurrChar->SendInitialPacketsAfterAddToMap();
@@ -2322,7 +2322,6 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
stmt->SetData(3, loc.GetPositionX());
stmt->SetData(4, loc.GetPositionY());
stmt->SetData(5, loc.GetPositionZ());
stmt->SetData(6, loc.GetOrientation());
trans->Append(stmt);
Player::SavePositionInDB(loc, zoneId, factionChangeInfo->Guid, trans);
+1 -1
View File
@@ -1720,7 +1720,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
_player->BuildPlayerRepop();
_player->ResurrectPlayer(1.0f);
_player->SpawnCorpseBones();
_player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->m_homebindO);
_player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());
}
void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
+2 -2
View File
@@ -92,7 +92,7 @@ void WorldSession::HandleMoveWorldportAck()
if (!newMap || newMap->CannotEnter(GetPlayer(), false))
{
LOG_ERROR("network.opcode", "Map {} could not be created for player {}, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString());
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->m_homebindO);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
@@ -111,7 +111,7 @@ void WorldSession::HandleMoveWorldportAck()
GetPlayer()->GetName(), GetPlayer()->GetGUID().ToString(), loc.GetMapId());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(oldMap);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->m_homebindO);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
-12
View File
@@ -856,18 +856,6 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
return;
}
if (sObjectMgr->IsReservedName(name))
{
SendPetNameInvalid(PET_NAME_RESERVED, name, nullptr);
return;
}
if (sObjectMgr->IsProfanityName(name))
{
SendPetNameInvalid(PET_NAME_PROFANE, name, nullptr);
return;
}
pet->SetName(name);
Unit* owner = pet->GetOwner();
@@ -136,7 +136,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
return;
}
if (sObjectMgr->IsReservedName(name) || sObjectMgr->IsProfanityName(name) || !ObjectMgr::IsValidCharterName(name))
if (!ObjectMgr::IsValidCharterName(name))
{
Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_INVALID, name);
return;
@@ -149,7 +149,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return;
}
if (sObjectMgr->IsReservedName(name) || sObjectMgr->IsProfanityName(name) || !ObjectMgr::IsValidCharterName(name))
if (!ObjectMgr::IsValidCharterName(name))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID);
return;
@@ -350,7 +350,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_EXISTS_S, newName);
return;
}
if (sObjectMgr->IsReservedName(newName) || sObjectMgr->IsProfanityName(newName) || !ObjectMgr::IsValidCharterName(newName))
if (!ObjectMgr::IsValidCharterName(newName))
{
Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_INVALID, newName);
return;
@@ -363,7 +363,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newName, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
return;
}
if (sObjectMgr->IsReservedName(newName) || sObjectMgr->IsProfanityName(newName) || !ObjectMgr::IsValidCharterName(newName))
if (!ObjectMgr::IsValidCharterName(newName))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, newName, "", ERR_ARENA_TEAM_NAME_INVALID);
return;
+1 -1
View File
@@ -1266,7 +1266,7 @@ void Map::RemoveAllPlayers()
{
// this is happening for bg
LOG_ERROR("maps", "Map::UnloadAll: player {} is still in map {} during unload, this should not happen!", player->GetName(), GetId());
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->m_homebindO);
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
}
}
}
+4 -3
View File
@@ -655,12 +655,12 @@ enum AcoreStrings
LANG_GMLIST_HEADER = 598,
LANG_GMLIST_EMPTY = 599,
// End Level 3 list, continued at 1100
LANG_EVENT_STARTED = 600,
LANG_EVENT_STOPPED = 601,
// 602-704 - free
LANG_REWARDED = 602,
// 603-704 - free
LANG_WAIT_BEFORE_SPEAKING = 705,
LANG_NOT_EQUIPPED_ITEM = 706,
@@ -844,6 +844,7 @@ enum AcoreStrings
LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_QUESTS = 889,
LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_ACHIEVEMENTS = 890,
LANG_ACCESS_REQUIREMENT_LEADER_OBTAIN_ITEMS = 891,
// End Level 3 list, continued at 1100
// Level 4 (CLI only commands)
LANG_COMMAND_EXIT = 1000,
+1 -1
View File
@@ -17,8 +17,8 @@
#include "ScriptMgr.h"
#include "AllScriptsObjects.h"
#include "LFGScripts.h"
#include "InstanceScript.h"
#include "LFGScripts.h"
#include "ScriptObject.h"
#include "ScriptSystem.h"
#include "SmartAI.h"
+1 -1
View File
@@ -30,8 +30,8 @@
#include "ScriptMgr.h"
#include "World.h"
#include "WorldSession.h"
#include <memory>
#include "zlib.h"
#include <memory>
using boost::asio::ip::tcp;
+3 -1
View File
@@ -1349,7 +1349,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
break;
case TARGET_DEST_HOME:
if (Player* playerCaster = m_caster->ToPlayer())
dest = SpellDestination(playerCaster->m_homebindX, playerCaster->m_homebindY, playerCaster->m_homebindZ, playerCaster->m_homebindO, playerCaster->m_homebindMapId);
dest = SpellDestination(playerCaster->m_homebindX, playerCaster->m_homebindY, playerCaster->m_homebindZ, playerCaster->GetOrientation(), playerCaster->m_homebindMapId);
break;
case TARGET_DEST_DB:
if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id, effIndex))
@@ -3181,6 +3181,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
if (diminishMod == 0.0f)
{
m_spellAura->Remove();
if (m_diminishGroup == DIMINISHING_TAUNT)
return SPELL_MISS_IMMUNE;
bool found = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (effectMask & (1 << i) && m_spellInfo->Effects[i].Effect != SPELL_EFFECT_APPLY_AURA)
@@ -384,12 +384,9 @@ void SpellMgr::LoadSpellInfoCorrections()
27892, // To Anchor 1
27928, // To Anchor 1
27935, // To Anchor 1
27915, // Anchor to Skulls
27931, // Anchor to Skulls
27937 // Anchor to Skulls
}, [](SpellInfo* spellInfo)
}, [](SpellInfo* spellInfo)
{
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS);
});
// Wrath of the Plaguebringer
+4 -2
View File
@@ -1917,10 +1917,12 @@ void World::SetInitialWorldSettings()
sGroupMgr->LoadGroups();
LOG_INFO("server.loading", "Loading Reserved Names...");
sObjectMgr->LoadReservedPlayersNames();
sObjectMgr->LoadReservedPlayerNamesDB();
sObjectMgr->LoadReservedPlayerNamesDBC(); // Needs to be after LoadReservedPlayerNamesDB()
LOG_INFO("server.loading", "Loading Profanity Names...");
sObjectMgr->LoadProfanityPlayersNames();
sObjectMgr->LoadProfanityNamesFromDB();
sObjectMgr->LoadProfanityNamesFromDBC(); // Needs to be after LoadProfanityNamesFromDB()
LOG_INFO("server.loading", "Loading GameObjects for Quests...");
sObjectMgr->LoadGameObjectForQuests();