From 3d14384c32971096b49f88ff785d92879480af76 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 30 May 2012 08:01:02 +0200 Subject: Merge git://github.com/TrinityCore/TrinityCore into 4.x Conflicts: dep/PackageList.txt sql/base/auth_database.sql src/server/authserver/Server/AuthSocket.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Chat/Commands/Level1.cpp src/server/game/Chat/Commands/Level3.cpp src/server/game/DataStores/DBCEnums.h src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStores.h src/server/game/DataStores/DBCStructure.h src/server/game/DataStores/DBCfmt.h src/server/game/Entities/Corpse/Corpse.cpp src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/DynamicObject/DynamicObject.cpp src/server/game/Entities/GameObject/GameObject.cpp src/server/game/Entities/Item/Item.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Updates/UpdateData.h src/server/game/Entities/Pet/Pet.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Transport/Transport.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Globals/ObjectMgr.h src/server/game/Guilds/Guild.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Loot/LootMgr.cpp src/server/game/Miscellaneous/SharedDefines.h src/server/game/Quests/QuestDef.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/Protocol/Opcodes.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/Spell.h src/server/game/Spells/SpellEffects.cpp src/server/game/Tickets/TicketMgr.cpp src/server/scripts/Commands/cs_gps.cpp src/server/scripts/Commands/cs_modify.cpp src/server/shared/Database/Implementation/CharacterDatabase.cpp src/server/shared/Logging/Log.h src/tools/map_extractor/CMakeLists.txt src/tools/map_extractor/System.cpp src/tools/map_extractor/mpq_libmpq04.h src/tools/vmap4_extractor/CMakeLists.txt --- src/server/game/Scripting/ScriptMgr.cpp | 49 ++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 47751338d66..23d18e12097 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -181,7 +181,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target) if (pData->uiSoundId) { - if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) + if (sSoundEntriesStore.LookupEntry(pData->uiSoundId)) pSource->SendPlaySound(pData->uiSoundId, false); else sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); @@ -260,7 +260,7 @@ void ScriptMgr::Initialize() void ScriptMgr::Unload() { #define SCR_CLEAR(T) \ - FOR_SCRIPTS(T, itr, end) \ + for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \ delete itr->second; \ SCR_REG_LST(T).clear(); @@ -582,7 +582,7 @@ void ScriptMgr::OnCreateMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnCreate(map); SCR_MAP_END; @@ -599,7 +599,7 @@ void ScriptMgr::OnDestroyMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnDestroy(map); SCR_MAP_END; @@ -617,7 +617,7 @@ void ScriptMgr::OnLoadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnLoadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -635,7 +635,7 @@ void ScriptMgr::OnUnloadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUnloadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -653,7 +653,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerEnter(map, player); SCR_MAP_END; @@ -671,7 +671,7 @@ void ScriptMgr::OnPlayerLeaveMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerLeave(map, player); SCR_MAP_END; @@ -688,7 +688,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUpdate(map, diff); SCR_MAP_END; @@ -937,6 +937,22 @@ void ScriptMgr::OnGameObjectDamaged(GameObject* go, Player* player) tmpscript->OnDamaged(go, player); } +void ScriptMgr::OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnLootStateChanged(go, state, unit); +} + +void ScriptMgr::OnGameObjectStateChanged(GameObject* go, uint32 state) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnGameObjectStateChanged(go, state); +} + void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff) { ASSERT(go); @@ -954,6 +970,14 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd return tmpscript->OnDummyEffect(caster, spellId, effIndex, target); } +GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) +{ + ASSERT(go); + + GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); + return tmpscript->GetAI(go); +} + bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) { ASSERT(player); @@ -1295,6 +1319,11 @@ void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, ui FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent); } +void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea) +{ + FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); +} + // Guild void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank) { @@ -1410,7 +1439,7 @@ FormulaScript::FormulaScript(const char* name) WorldMapScript::WorldMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { - if (GetEntry() && !GetEntry()->IsContinent()) + if (GetEntry() && !GetEntry()->IsWorldMap()) sLog->outError("WorldMapScript for map %u is invalid.", mapId); ScriptRegistry::AddScript(this); -- cgit v1.2.3 From 0f04b2fc36593526cf1cc86667d37779691e1135 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 15:27:42 +0100 Subject: Core/Misc: Update money to 64 bits (from 32), increasing the maximum gold possible This got a bit messy and will be further fixed when all related packets are updated. (Also fixed a typo in atoll msvc macro) --- .../2012_07_24_00_characters_various_434.sql | 3 ++ src/server/game/Chat/Commands/Level2.cpp | 10 +++--- src/server/game/Chat/Commands/Level3.cpp | 3 +- src/server/game/Entities/Player/Player.cpp | 38 +++++++++++----------- src/server/game/Entities/Player/Player.h | 22 ++++++------- src/server/game/Guilds/Guild.cpp | 12 +++---- src/server/game/Handlers/AuctionHouseHandler.cpp | 18 +++++----- src/server/game/Handlers/CharacterHandler.cpp | 8 ++--- src/server/game/Handlers/GuildHandler.cpp | 8 ++--- src/server/game/Handlers/ItemHandler.cpp | 6 ++-- src/server/game/Handlers/MailHandler.cpp | 4 +-- src/server/game/Handlers/NPCHandler.cpp | 4 +-- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 6 ++-- src/server/game/Mails/Mail.h | 8 ++--- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.h | 4 +-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/World/World.cpp | 6 ++-- src/server/scripts/Commands/cs_modify.cpp | 7 ++-- src/server/scripts/World/npc_professions.cpp | 6 ++-- src/server/scripts/World/npcs_special.cpp | 8 ++--- src/server/shared/Common.h | 2 +- 23 files changed, 97 insertions(+), 92 deletions(-) create mode 100644 sql/updates/characters/2012_07_24_00_characters_various_434.sql (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/sql/updates/characters/2012_07_24_00_characters_various_434.sql b/sql/updates/characters/2012_07_24_00_characters_various_434.sql new file mode 100644 index 00000000000..8b2bfd4f131 --- /dev/null +++ b/sql/updates/characters/2012_07_24_00_characters_various_434.sql @@ -0,0 +1,3 @@ +ALTER TABLE `characters` CHANGE `money` `money` bigint(20) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail` CHANGE `money` `money` bigint(20) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail` CHANGE `cod` `cod` bigint(20) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 8fe782a75c1..752ba6bc3ca 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -251,7 +251,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) return false; uint32 accId = 0; - uint32 money = 0; + uint64 money = 0; uint32 total_player_time = 0; uint8 level = 0; uint32 latency = 0; @@ -299,7 +299,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) Field* fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); level = fields[1].GetUInt8(); - money = fields[2].GetUInt32(); + money = fields[2].GetUInt64(); accId = fields[3].GetUInt32(); race = fields[4].GetUInt8(); Class = fields[5].GetUInt8(); @@ -422,9 +422,9 @@ bool ChatHandler::HandlePInfoCommand(const char* args) } std::string timeStr = secsToTimeString(total_player_time, true, true); - uint32 gold = money /GOLD; - uint32 silv = (money % GOLD) / SILVER; - uint32 copp = (money % GOLD) % SILVER; + uint64 gold = money / GOLD; + uint64 silv = (money % GOLD) / SILVER; + uint64 copp = (money % GOLD) % SILVER; PSendSysMessage(LANG_PINFO_LEVEL, race_s.c_str(), Class_s.c_str(), timeStr.c_str(), level, gold, silv, copp); // Add map, zone, subzone and phase to output diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 5b93b899898..355789b565e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -63,6 +63,7 @@ #include "SmartAI.h" #include "Group.h" #include "ChannelMgr.h" +#include bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/) { @@ -1388,7 +1389,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char *args) return false; char* money_str = strtok(NULL, ""); - int32 money = money_str ? atoi(money_str) : 0; + int64 money = money_str ? atoll(money_str) : 0; if (money <= 0) return false; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b2808938b57..9847d22f84e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -346,7 +346,7 @@ void TradeData::SetSpell(uint32 spell_id, Item* castItem /*= NULL*/) Update(false); // send spell info to caster self } -void TradeData::SetMoney(uint32 money) +void TradeData::SetMoney(uint64 money) { if (m_money == money) return; @@ -4412,7 +4412,7 @@ bool Player::ResetTalents(bool no_cost) { cost = GetNextResetTalentsCost(); - if (!HasEnoughMoney(cost)) + if (!HasEnoughMoney(uint64(cost))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); return false; @@ -5454,13 +5454,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g TotalCost = costs; } - else if (!HasEnoughMoney(costs)) + else if (!HasEnoughMoney(uint64(costs))) { sLog->outStaticDebug("You do not have enough money"); return TotalCost; } else - ModifyMoney(-int32(costs)); + ModifyMoney(-int64(costs)); } } @@ -14325,7 +14325,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men return; int32 cost = int32(item->BoxMoney); - if (!HasEnoughMoney(cost)) + if (!HasEnoughMoney(int64(cost))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); PlayerTalkClass->SendCloseGossip(); @@ -14773,7 +14773,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) if (qInfo->GetRewOrReqMoney() < 0) { - if (!HasEnoughMoney(-qInfo->GetRewOrReqMoney())) + if (!HasEnoughMoney(-int64(qInfo->GetRewOrReqMoney()))) return false; } @@ -14836,7 +14836,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) } // prevent receive reward with low money and GetRewOrReqMoney() < 0 - if (quest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-quest->GetRewOrReqMoney())) + if (quest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-int64(quest->GetRewOrReqMoney()))) return false; return true; @@ -16755,7 +16755,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // load achievements before anything else to prevent multiple gains for the same achievement/criteria on every loading (as loading does call UpdateAchievementCriteria) m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS)); - uint32 money = fields[8].GetUInt32(); + uint64 money = fields[8].GetUInt64(); if (money > MAX_MONEY_AMOUNT) money = MAX_MONEY_AMOUNT; SetMoney(money); @@ -18647,7 +18647,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, getGender()); stmt->setUInt8(index++, getLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); - stmt->setUInt32(index++, GetMoney()); + stmt->setUInt64(index++, GetMoney()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS)); @@ -18755,7 +18755,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, getGender()); stmt->setUInt8(index++, getLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); - stmt->setUInt32(index++, GetMoney()); + stmt->setUInt64(index++, GetMoney()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS)); @@ -18921,7 +18921,7 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans) void Player::SaveGoldToDB(SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_MONEY); - stmt->setUInt32(0, GetMoney()); + stmt->setUInt64(0, GetMoney()); stmt->setUInt32(1, GetGUIDLow()); trans->Append(stmt); } @@ -20772,7 +20772,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc return false; } - uint32 money = GetMoney(); + uint64 money = GetMoney(); if (npc) totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc)); @@ -20785,7 +20785,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc } //Checks and preparations done, DO FLIGHT - ModifyMoney(-(int32)totalcost); + ModifyMoney(-int64(totalcost)); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); @@ -21161,7 +21161,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 // reputation discount price = uint32(floor(price * GetReputationPriceDiscount(creature))); - if (!HasEnoughMoney(price)) + if (!HasEnoughMoney(uint64(price))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item, 0); return false; @@ -21949,16 +21949,16 @@ void Player::InitPrimaryProfessions() SetFreePrimaryProfessions(sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)); } -void Player::ModifyMoney(int32 d) +void Player::ModifyMoney(int64 d) { sScriptMgr->OnPlayerMoneyChanged(this, d); if (d < 0) - SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0); + SetMoney (GetMoney() > uint64(-d) ? GetMoney() + d : 0); else { - uint32 newAmount = 0; - if (GetMoney() < uint32(MAX_MONEY_AMOUNT - d)) + uint64 newAmount = 0; + if (GetMoney() < uint64(MAX_MONEY_AMOUNT - d)) newAmount = GetMoney() + d; else { @@ -21967,7 +21967,7 @@ void Player::ModifyMoney(int32 d) if (d) SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL); } - SetMoney (newAmount); + SetMoney(newAmount); } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b9261aaff64..ded63b024b8 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -832,7 +832,7 @@ enum PlayerDelayedOperations // Player summoning auto-decline time (in secs) #define MAX_PLAYER_SUMMON_DELAY (2*MINUTE) -#define MAX_MONEY_AMOUNT (0x7FFFFFFF-1) +#define MAX_MONEY_AMOUNT (UI64LIT(9999999999)) // TODO: Move this restriction to worldserver.conf, default to this value, hardcap at uint64.max struct InstancePlayerBind { @@ -1000,8 +1000,8 @@ class TradeData Item* GetSpellCastItem() const; bool HasSpellCastItem() const { return m_spellCastItem != 0; } - uint32 GetMoney() const { return m_money; } - void SetMoney(uint32 money); + uint64 GetMoney() const { return m_money; } + void SetMoney(uint64 money); bool IsAccepted() const { return m_accepted; } void SetAccepted(bool state, bool crosssend = false); @@ -1021,7 +1021,7 @@ class TradeData bool m_accepted; // m_player press accept for trade list bool m_acceptProccess; // one from player/trader press accept and this processed - uint32 m_money; // m_player place money to trade + uint64 m_money; // m_player place money to trade uint32 m_spell; // m_player apply spell to non-traded slot item uint64 m_spellCastItem; // applied spell casted by item use @@ -1590,19 +1590,19 @@ class Player : public Unit, public GridObject void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;} void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;} - uint32 GetMoney() const { return GetUInt32Value(PLAYER_FIELD_COINAGE); } - void ModifyMoney(int32 d); - bool HasEnoughMoney(uint32 amount) const { return (GetMoney() >= amount); } - bool HasEnoughMoney(int32 amount) const + uint64 GetMoney() const { return GetUInt64Value(PLAYER_FIELD_COINAGE); } + void ModifyMoney(int64 d); + bool HasEnoughMoney(uint64 amount) const { return GetMoney() >= amount; } + bool HasEnoughMoney(int64 amount) const { if (amount > 0) - return (GetMoney() >= (uint32) amount); + return (GetMoney() >= (uint64)amount); return true; } - void SetMoney(uint32 value) + void SetMoney(uint64 value) { - SetUInt32Value(PLAYER_FIELD_COINAGE, value); + SetUInt64Value(PLAYER_FIELD_COINAGE, value); MoneyChanged(value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 8cb0a397b8d..ac4802a3091 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1322,12 +1322,12 @@ void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo) if (!_IsLeader(player)) // "Only guild leaders can create emblems." SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTGUILDMASTER); - else if (!player->HasEnoughMoney(EMBLEM_PRICE)) + else if (!player->HasEnoughMoney(uint64(EMBLEM_PRICE))) // "You can't afford to do that." SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTENOUGHMONEY); else { - player->ModifyMoney(-int32(EMBLEM_PRICE)); + player->ModifyMoney(-int64(EMBLEM_PRICE)); m_emblemInfo = emblemInfo; m_emblemInfo.SaveToDB(m_id); @@ -1418,13 +1418,13 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) return; Player* player = session->GetPlayer(); - if (!player->HasEnoughMoney(tabCost)) // Should not happen, this is checked by client + if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client return; if (!_CreateNewBankTab()) return; - player->ModifyMoney(-int32(tabCost)); + player->ModifyMoney(-int64(tabCost)); _SetRankBankMoneyPerDay(player->GetRank(), uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)); _SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, uint32(GUILD_WITHDRAW_SLOT_UNLIMITED))); HandleRoster(); // Broadcast for tab rights update @@ -1652,13 +1652,13 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) // Add money to bank _ModifyBankMoney(trans, amount, true); // Remove money from player - player->ModifyMoney(-int32(amount)); + player->ModifyMoney(-int64(amount)); player->SaveGoldToDB(trans); // Log GM action (TODO: move to scripts) if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(player->GetSession()->GetAccountId(), - "GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)", + "GM %s (Account: %u) deposit money (Amount: " UI64FMTD ") to guild bank (Guild ID %u)", player->GetName(), player->GetSession()->GetAccountId(), amount, m_id); } // Log guild bank event diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index c40d3d7964b..52f0793e73c 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -225,7 +225,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); - if (!_player->HasEnoughMoney(deposit)) + if (!_player->HasEnoughMoney((uint64)deposit)) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY); return; @@ -412,7 +412,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) return; } - if (!player->HasEnoughMoney((uint32)price)) + if (!player->HasEnoughMoney(price)) { //you don't have enought money!, client tests! //SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???); @@ -426,16 +426,16 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) if (auction->bidder > 0) { if (auction->bidder == player->GetGUIDLow()) - player->ModifyMoney(-int32(price - auction->bid)); + player->ModifyMoney(-int64(price - auction->bid)); else { // mail to last bidder and return money sAuctionMgr->SendAuctionOutbiddedMail(auction, price, GetPlayer(), trans); - player->ModifyMoney(-int32(price)); + player->ModifyMoney(-int64(price)); } } else - player->ModifyMoney(-int32(price)); + player->ModifyMoney(-int64(price)); auction->bidder = player->GetGUIDLow(); auction->bid = price; @@ -453,10 +453,10 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) { //buyout: if (player->GetGUIDLow() == auction->bidder) - player->ModifyMoney(-int32(auction->buyout - auction->bid)); + player->ModifyMoney(-int64(auction->buyout - auction->bid)); else { - player->ModifyMoney(-int32(auction->buyout)); + player->ModifyMoney(-int64(auction->buyout)); if (auction->bidder) //buyout for bidded auction .. sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, GetPlayer(), trans); } @@ -516,11 +516,11 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { uint32 auctionCut = auction->GetAuctionCut(); - if (!player->HasEnoughMoney(auctionCut)) //player doesn't have enough money, maybe message needed + if (!player->HasEnoughMoney((uint64)auctionCut)) //player doesn't have enough money, maybe message needed return; //some auctionBidderNotification would be needed, but don't know that parts.. sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans); - player->ModifyMoney(-int32(auctionCut)); + player->ModifyMoney(-int64(auctionCut)); } // item will deleted or added to received mail list diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 9a77c3da55c..01668314c63 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1387,12 +1387,12 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender())) return; - uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); + uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); // 0 - ok // 1, 3 - not enough money // 2 - you have to seat on barber chair - if (!_player->HasEnoughMoney(Cost)) + if (!_player->HasEnoughMoney((uint64)cost)) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); data << uint32(1); // no money @@ -1406,8 +1406,8 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) SendPacket(&data); } - _player->ModifyMoney(-int32(Cost)); // it isn't free - _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, Cost); + _player->ModifyMoney(-int64(cost)); // it isn't free + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost); _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id)); _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color)); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 9d91feabcf6..53862e99db9 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -396,13 +396,13 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); - uint64 GoGuid; - recv_data >> GoGuid; + uint64 goGuid; + recv_data >> goGuid; - uint32 money; + uint64 money; recv_data >> money; - if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) + if (GetPlayer()->GetGameObjectIfCanInteractWith(goGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (money && GetPlayer()->HasEnoughMoney(money)) if (Guild* guild = _GetPlayerGuild(this)) guild->HandleMemberDepositMoney(this, money); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 6a33238e750..bcb3601ee48 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -624,7 +624,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (pItem) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); - if (!_player->HasEnoughMoney(price)) + if (!_player->HasEnoughMoney(uint64(price))) { _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); return; @@ -934,7 +934,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) uint32 price = slotEntry->price; - if (!_player->HasEnoughMoney(price)) + if (!_player->HasEnoughMoney(uint64(price))) { data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS); SendPacket(&data); @@ -942,7 +942,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) } _player->SetBankBagSlotCount(slot); - _player->ModifyMoney(-int32(price)); + _player->ModifyMoney(-int64(price)); data << uint32(ERR_BANKSLOT_OK); SendPacket(&data); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 158fb9b8f55..ba6646a92f9 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -105,7 +105,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) uint32 cost = items_count ? 30 * items_count : 30; // price hardcoded in client - uint32 reqmoney = cost + money; + uint64 reqmoney = cost + uint64(money); if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster()) { @@ -439,7 +439,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) } // prevent cheating with skip client money check - if (!player->HasEnoughMoney(m->COD)) + if (!player->HasEnoughMoney(uint64(m->COD))) { player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_NOT_ENOUGH_MONEY); return; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 4da8805614b..e9b070b2aa2 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -277,10 +277,10 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit))); // check money requirement - if (!_player->HasEnoughMoney(nSpellCost)) + if (!_player->HasEnoughMoney(uint64(nSpellCost))) return; - _player->ModifyMoney(-int32(nSpellCost)); + _player->ModifyMoney(-int64(nSpellCost)); unit->SendPlaySpellVisual(179); // 53 SpellCastDirected unit->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 0c2f8741b15..b8e275f2990 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -187,7 +187,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) return; } - if (!_player->HasEnoughMoney(cost)) + if (!_player->HasEnoughMoney(uint64(cost))) { //player hasn't got enough money _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, charterid, 0); return; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index b2a89ed3021..c42ef3ef94a 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -477,9 +477,9 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) } // update money - _player->ModifyMoney(-int32(my_trade->GetMoney())); + _player->ModifyMoney(-int64(my_trade->GetMoney())); _player->ModifyMoney(his_trade->GetMoney()); - trader->ModifyMoney(-int32(his_trade->GetMoney())); + trader->ModifyMoney(-int64(his_trade->GetMoney())); trader->ModifyMoney(my_trade->GetMoney()); if (my_spell) @@ -676,7 +676,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket) { - uint32 gold; + uint64 gold; recvPacket >> gold; TradeData* my_trade = _player->GetTradeData(); diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index 63676e20be9..b4e5b9ddf48 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -123,8 +123,8 @@ class MailDraft public: // Accessors uint16 GetMailTemplateId() const { return m_mailTemplateId; } std::string const& GetSubject() const { return m_subject; } - uint32 GetMoney() const { return m_money; } - uint32 GetCOD() const { return m_COD; } + uint64 GetMoney() const { return m_money; } + uint64 GetCOD() const { return m_COD; } std::string const& GetBody() const { return m_body; } public: // modifiers @@ -172,8 +172,8 @@ struct Mail std::vector removedItems; time_t expire_time; time_t deliver_time; - uint32 money; - uint32 COD; + uint64 money; + uint64 COD; uint32 checked; MailState state; diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 23d18e12097..f567dd2963b 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1224,7 +1224,7 @@ void ScriptMgr::OnPlayerTalentsReset(Player* player, bool noCost) FOREACH_SCRIPT(PlayerScript)->OnTalentsReset(player, noCost); } -void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount) +void ScriptMgr::OnPlayerMoneyChanged(Player* player, int64& amount) { FOREACH_SCRIPT(PlayerScript)->OnMoneyChanged(player, amount); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index b3d445af0c6..37a26d6e5c2 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -684,7 +684,7 @@ class PlayerScript : public ScriptObject virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { } // Called when a player's money is modified (before the modification is done) - virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { } + virtual void OnMoneyChanged(Player* /*player*/, int64& /*amount*/) { } // Called when a player gains XP (before anything is given) virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { } @@ -990,7 +990,7 @@ class ScriptMgr void OnPlayerLevelChanged(Player* player, uint8 oldLevel); void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints); void OnPlayerTalentsReset(Player* player, bool noCost); - void OnPlayerMoneyChanged(Player* player, int32& amount); + void OnPlayerMoneyChanged(Player* player, int64& amount); void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim); void OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental); void OnPlayerDuelRequest(Player* target, Player* challenger); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c725b6214e0..c2d7a96a397 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1080,7 +1080,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 5b89abe3b24..183602b1124 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -774,11 +774,11 @@ void World::LoadConfigSettings(bool reload) sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; } - else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT) + else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT) { sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", - m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT); - m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT; + m_int_configs[CONFIG_START_PLAYER_MONEY], 0x7FFFFFFF-1, 0x7FFFFFFF-1); + m_int_configs[CONFIG_START_PLAYER_MONEY] = 0x7FFFFFFF-1; } m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 57d13fd2fa1..a227070895c 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ObjectMgr.h" #include "Chat.h" +#include class modify_commandscript : public CommandScript { @@ -1002,13 +1003,13 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - int32 addmoney = atoi((char*)args); + int64 addmoney = atoll((char*)args); - uint32 moneyuser = target->GetMoney(); + uint64 moneyuser = target->GetMoney(); if (addmoney < 0) { - int32 newmoney = int32(moneyuser) + addmoney; + int64 newmoney = int32(moneyuser) + addmoney; sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); if (newmoney <= 0) diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 2afa80dd42c..a55fe2c7ffa 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -209,7 +209,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { - if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) + if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost)) { player->CastSpell(player, triggeredSpellId, true); player->ModifyMoney(-cost); @@ -347,11 +347,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui { if (EquippedOk(player, spellId)) { - if (player->HasEnoughMoney(cost)) + if (player->HasEnoughMoney(int64(cost))) { player->CastSpell(player, spellId, true); ProfessionUnlearnSpells(player, spellId); - player->ModifyMoney(-cost); + player->ModifyMoney(-int64(cost)); if (alternativeSpellId) creature->CastSpell(player, alternativeSpellId, true); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 57a65423b6f..04b74122955 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1287,7 +1287,7 @@ public: case GOSSIP_OPTION_LEARNDUALSPEC: if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { - if (!player->HasEnoughMoney(10000000)) + if (!player->HasEnoughMoney(UI64LIT(10000000))) { player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -1295,7 +1295,7 @@ public: } else { - player->ModifyMoney(-10000000); + player->ModifyMoney(SI64LIT(-10000000)); // Cast spells that teach dual spec // Both are also ImplicitTarget self and must be cast by player @@ -2600,11 +2600,11 @@ public: } if (doSwitch) { - if (!player->HasEnoughMoney(EXP_COST)) + if (!player->HasEnoughMoney(uint64(EXP_COST))) player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); else if (noXPGain) { - player->ModifyMoney(-EXP_COST); + player->ModifyMoney(-int64(EXP_COST)); player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); } else if (!noXPGain) diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 259c60ade20..7a16f2a0eb3 100755 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -116,7 +116,7 @@ #define I32FMT "%08I32X" #define I64FMT "%016I64X" #define snprintf _snprintf -#define atoll __atoi64 +#define atoll _atoi64 #define vsnprintf _vsnprintf #define finite(X) _finite(X) #define llabs _abs64 -- cgit v1.2.3 From 21fb427ffc41858edd8edc21280609ddca0d6b22 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 Aug 2012 20:17:29 +0100 Subject: Merge remote-tracking branch 'origin/master' into 4.3.4 Conflicts: src/server/game/Achievements/AchievementMgr.cpp src/server/game/Events/GameEventMgr.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Spells/SpellMgr.cpp src/server/worldserver/worldserver.conf.dist --- src/server/authserver/authserver.conf.dist | 28 ++--- src/server/game/Achievements/AchievementMgr.cpp | 35 +++---- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 6 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 12 +-- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 54 ++++++---- src/server/game/DungeonFinding/LFGMgr.cpp | 6 +- .../game/Entities/Creature/CreatureGroups.cpp | 6 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 6 +- src/server/game/Entities/Transport/Transport.cpp | 14 +-- src/server/game/Events/GameEventMgr.cpp | 114 +++++++++------------ src/server/game/Globals/ObjectMgr.cpp | 111 ++------------------ src/server/game/Globals/ObjectMgr.h | 8 +- src/server/game/Groups/GroupMgr.cpp | 10 +- src/server/game/Guilds/GuildMgr.cpp | 65 +++++------- src/server/game/Loot/LootMgr.cpp | 69 +++++-------- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 6 +- src/server/game/Pools/PoolMgr.cpp | 32 +++--- src/server/game/Scripting/ScriptMgr.cpp | 5 +- src/server/game/Scripting/ScriptMgr.h | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 28 ++--- src/server/game/Spells/SpellMgr.cpp | 108 +++++++------------ src/server/shared/Logging/Log.cpp | 6 -- src/server/worldserver/worldserver.conf.dist | 9 +- 23 files changed, 257 insertions(+), 483 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 15dd02d9052..9a4beca9bf6 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -198,7 +198,7 @@ LoginDatabase.WorkerThreads = 1 # Example: "13 11 9 5 3 1" # # File: Name of the file (read as optional1 if Type = File) -# Allows to use one "%u" to create dynamic files +# Allows to use one "%s" to create dynamic files # # Mode: Mode to open the file (read as optional2 if Type = File) # a - (Append) @@ -208,19 +208,6 @@ LoginDatabase.WorkerThreads = 1 Appender.Console=1,2,6 Appender.Auth=2,2,7,Auth.log,w -# Logger config values: Given a logger "name" -# Logger.name -# Description: Defines 'What to log' -# Format: Type,LogLevel,AppenderList -# Type -# 0 - Default. Each type that has no config will -# rely on this one. Core will create this logger -# (disabled) if it's not configured -# 7 - Network input/output, -# 30 - Authserver - -Logger.Root=0,3,Console Auth - # LogLevel # 0 - (Disabled) # 1 - (Trace) @@ -240,6 +227,19 @@ Logger.Root=0,3,Console Auth Appenders=Console Auth +# Logger config values: Given a logger "name" +# Logger.name +# Description: Defines 'What to log' +# Format: Type,LogLevel,AppenderList +# Type +# 0 - Default. Each type that has no config will +# rely on this one. Core will create this logger +# (disabled) if it's not configured +# 7 - Network input/output, +# 30 - Authserver + +Logger.Root=0,3,Console Auth + # # Loggers # Description: List of Loggers to read from config diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 723e8b1dbbc..14895ae3165 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2800,8 +2800,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() if (sAchievementCriteriaStore.GetNumRows() == 0) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement criteria."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement criteria."); return; } @@ -2826,7 +2825,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria); } - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadAchievementReferenceList() @@ -2835,8 +2834,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (sAchievementStore.GetNumRows() == 0) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement references."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement references."); return; } @@ -2856,8 +2854,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539)) const_cast(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar) - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadAchievementCriteriaData() @@ -2870,8 +2867,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); return; } @@ -3002,8 +2998,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement); } - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadCompletedAchievements() @@ -3014,8 +3009,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); return; } @@ -3042,8 +3036,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() m_allCompletedAchievements.insert(achievementId); } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadRewards() @@ -3057,8 +3050,7 @@ void AchievementGlobalMgr::LoadRewards() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); return; } @@ -3149,8 +3141,7 @@ void AchievementGlobalMgr::LoadRewards() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadRewardLocales() @@ -3165,8 +3156,7 @@ void AchievementGlobalMgr::LoadRewardLocales() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); return; } @@ -3192,6 +3182,5 @@ void AchievementGlobalMgr::LoadRewardLocales() } } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 416b54a5713..9365172a4ca 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -101,8 +101,7 @@ void ArenaTeamMgr::LoadArenaTeams() if (!result) { - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); return; } @@ -132,8 +131,7 @@ void ArenaTeamMgr::LoadArenaTeams() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ArenaTeamMgr::DistributeArenaPoints() diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index f9fb27f54bc..626ed04566b 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -683,8 +683,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); return; } @@ -793,8 +792,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void BattlegroundMgr::InitAutomaticArenaPointDistribution() @@ -1078,8 +1076,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() if (!result) { - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); return; } @@ -1103,8 +1100,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index c09285fd7ad..051234f1e4f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -700,28 +700,40 @@ void BattlegroundWS::Reset() //call parent's class reset Battleground::Reset(); - m_FlagKeepers[BG_TEAM_ALLIANCE] = 0; - m_FlagKeepers[BG_TEAM_HORDE] = 0; + m_FlagKeepers[BG_TEAM_ALLIANCE] = 0; + m_FlagKeepers[BG_TEAM_HORDE] = 0; + m_DroppedFlagGUID[BG_TEAM_ALLIANCE] = 0; - m_DroppedFlagGUID[BG_TEAM_HORDE] = 0; - _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; - _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; - m_TeamScores[BG_TEAM_ALLIANCE] = 0; - m_TeamScores[BG_TEAM_HORDE] = 0; - bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID()); - m_ReputationCapture = (isBGWeekend) ? 45 : 35; - m_HonorWinKills = (isBGWeekend) ? 3 : 1; - m_HonorEndKills = (isBGWeekend) ? 4 : 2; - // For WorldState - _minutesElapsed = 0; - _lastFlagCaptureTeam = 0; - - /* Spirit nodes is static at this BG and then not required deleting at BG reset. - if (BgCreatures[WS_SPIRIT_MAIN_ALLIANCE]) - DelCreature(WS_SPIRIT_MAIN_ALLIANCE); - if (BgCreatures[WS_SPIRIT_MAIN_HORDE]) - DelCreature(WS_SPIRIT_MAIN_HORDE); - */ + m_DroppedFlagGUID[BG_TEAM_HORDE] = 0; + + _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; + _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; + + m_TeamScores[BG_TEAM_ALLIANCE] = 0; + m_TeamScores[BG_TEAM_HORDE] = 0; + + if (sBattlegroundMgr->IsBGWeekend(GetTypeID())) + { + m_ReputationCapture = 45; + m_HonorWinKills = 3; + m_HonorEndKills = 4; + } + else + { + m_ReputationCapture = 35; + m_HonorWinKills = 1; + m_HonorEndKills = 2; + } + _minutesElapsed = 0; + _lastFlagCaptureTeam = 0; + _bothFlagsKept = false; + _flagDebuffState = 0; + _flagSpellForceTimer = 0; + _lastFlagCaptureTeam = 0; + _flagsDropTimer[BG_TEAM_ALLIANCE] = 0; + _flagsDropTimer[BG_TEAM_HORDE] = 0; + _flagsTimer[BG_TEAM_ALLIANCE] = 0; + _flagsTimer[BG_TEAM_HORDE] = 0; } void BattlegroundWS::EndBattleground(uint32 winner) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 18ba5926b07..52e4e4df9cd 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -135,8 +135,7 @@ void LFGMgr::LoadRewards() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); return; } @@ -183,8 +182,7 @@ void LFGMgr::LoadRewards() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_LFG, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void LFGMgr::Update(uint32 diff) diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 21ed1a23828..8823a788555 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -84,8 +84,7 @@ void FormationMgr::LoadCreatureFormations() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); return; } @@ -136,8 +135,7 @@ void FormationMgr::LoadCreatureFormations() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_UNITS, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void CreatureGroup::AddMember(Creature* member) diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 0478173b96e..f85bf80e145 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -70,14 +70,10 @@ void LoadRandomEnchantmentsTable() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_PLAYER_ITEMS, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } else - { sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); - - } } uint32 GetItemEnchantMod(int32 entry) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 02a6f261e98..528784c018f 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -35,8 +35,7 @@ void MapManager::LoadTransports() if (!result) { - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transports. DB table `transports` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transports. DB table `transports` is empty!"); return; } @@ -66,7 +65,7 @@ void MapManager::LoadTransports() continue; } - // sLog->outInfo(LOG_FILTER_TRANSPORTS, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); + // sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); std::set mapsUsed; @@ -121,8 +120,7 @@ void MapManager::LoadTransports() while (result->NextRow()); } - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void MapManager::LoadTransportNPCs() @@ -134,8 +132,7 @@ void MapManager::LoadTransportNPCs() if (!result) { - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); return; } @@ -166,8 +163,7 @@ void MapManager::LoadTransportNPCs() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0), diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6af90dd85eb..a8eec927854 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Saves Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Saves Data..."); { uint32 oldMSTime = getMSTime(); @@ -273,7 +273,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); } else @@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Prerequisite Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Prerequisite Data..."); { uint32 oldMSTime = getMSTime(); @@ -319,7 +319,7 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); } else @@ -357,12 +357,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Creature Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Creature Data..."); { uint32 oldMSTime = getMSTime(); @@ -372,7 +372,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); } else @@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Data..."); { uint32 oldMSTime = getMSTime(); @@ -415,7 +415,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); } else @@ -443,12 +443,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Model/Equipment Change Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Model/Equipment Change Data..."); { uint32 oldMSTime = getMSTime(); @@ -458,8 +457,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); } else { @@ -500,12 +498,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -514,8 +511,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); } else { @@ -541,12 +537,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -555,8 +550,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); } else { @@ -582,12 +576,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Condition Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -596,8 +589,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); } else { @@ -625,12 +617,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -639,8 +630,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); } else { @@ -667,12 +657,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Save Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Save Data..."); { uint32 oldMSTime = getMSTime(); @@ -681,8 +670,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); } else { @@ -715,12 +703,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event NPCflag Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event NPCflag Data..."); { uint32 oldMSTime = getMSTime(); @@ -729,8 +716,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); } else { @@ -755,12 +741,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Seasonal Quest Relations..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Seasonal Quest Relations..."); { uint32 oldMSTime = getMSTime(); @@ -769,8 +754,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); } else { @@ -799,12 +783,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Vendor Additions Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Vendor Additions Data..."); { uint32 oldMSTime = getMSTime(); @@ -812,7 +795,7 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost, type FROM game_event_npc_vendor ORDER BY guid, slot ASC"); if (!result) - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); else { uint32 count = 0; @@ -863,12 +846,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Battleground Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Battleground Data..."); { uint32 oldMSTime = getMSTime(); @@ -877,8 +859,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); } else { @@ -901,12 +882,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Pool Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Pool Data..."); { uint32 oldMSTime = getMSTime(); @@ -916,8 +896,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); } else { @@ -950,8 +929,7 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2317d89ae24..7a43a6d763a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -297,7 +297,6 @@ void ObjectMgr::LoadCreatureLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenuItemsLocales() @@ -334,7 +333,6 @@ void ObjectMgr::LoadGossipMenuItemsLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPointOfInterestLocales() @@ -361,7 +359,6 @@ void ObjectMgr::LoadPointOfInterestLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadCreatureTemplates() @@ -389,7 +386,6 @@ void ObjectMgr::LoadCreatureTemplates() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); - return; } @@ -495,7 +491,6 @@ void ObjectMgr::LoadCreatureTemplates() CheckCreatureTemplate(&itr->second); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadCreatureTemplateAddons() @@ -508,7 +503,6 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); - return; } @@ -567,7 +561,6 @@ void ObjectMgr::LoadCreatureTemplateAddons() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) @@ -891,7 +884,6 @@ void ObjectMgr::LoadCreatureAddons() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); - return; } @@ -957,7 +949,6 @@ void ObjectMgr::LoadCreatureAddons() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid) @@ -996,7 +987,6 @@ void ObjectMgr::LoadEquipmentTemplates() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); - return; } @@ -1049,7 +1039,6 @@ void ObjectMgr::LoadEquipmentTemplates() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) @@ -1127,7 +1116,6 @@ void ObjectMgr::LoadCreatureModelInfo() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); - return; } @@ -1172,7 +1160,6 @@ void ObjectMgr::LoadCreatureModelInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadLinkedRespawn() @@ -1358,7 +1345,6 @@ void ObjectMgr::LoadLinkedRespawn() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow) @@ -1545,7 +1531,6 @@ void ObjectMgr::LoadCreatures() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) @@ -1850,7 +1835,6 @@ void ObjectMgr::LoadGameobjects() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) @@ -2019,7 +2003,6 @@ void ObjectMgr::LoadItemLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void FillItemDamageFields(float* minDamage, float* maxDamage, float* dps, uint32 itemLevel, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 delay, float statScalingFactor, uint32 inventoryType, uint32 flags2) @@ -2572,7 +2555,6 @@ void ObjectMgr::LoadItemTemplateAddon() sLog->outError(LOG_FILTER_SQL, "Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId); std::swap(minMoneyLoot, maxMoneyLoot); } - ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; itemTemplate.FlagsCu = fields[1].GetUInt32(); itemTemplate.FoodType = fields[2].GetUInt8(); @@ -2617,7 +2599,6 @@ ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) ItemTemplateContainer::const_iterator itr = _itemTemplateStore.find(entry); if (itr != _itemTemplateStore.end()) return &(itr->second); - return NULL; } @@ -2675,7 +2656,6 @@ void ObjectMgr::LoadVehicleTemplateAccessories() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadVehicleAccessories() @@ -2692,7 +2672,6 @@ void ObjectMgr::LoadVehicleAccessories() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime)); - return; } @@ -2720,7 +2699,6 @@ void ObjectMgr::LoadVehicleAccessories() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPetLevelInfo() @@ -2813,7 +2791,6 @@ void ObjectMgr::LoadPetLevelInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const @@ -2955,12 +2932,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate items - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Items Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Items Data..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -2969,7 +2945,6 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); - } else { @@ -3027,12 +3002,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate spells - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Spell Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Spell Data..."); { uint32 oldMSTime = getMSTime(); @@ -3084,12 +3058,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate actions - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Action Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Action Data..."); { uint32 oldMSTime = getMSTime(); @@ -3131,12 +3104,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Loading levels data (class/race dependent) - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Level Stats Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level Stats Data..."); { uint32 oldMSTime = getMSTime(); @@ -3246,11 +3218,10 @@ void ObjectMgr::LoadPlayerInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } // Loading xp per level data - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create XP Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create XP Data..."); { uint32 oldMSTime = getMSTime(); @@ -3305,7 +3276,6 @@ void ObjectMgr::LoadPlayerInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } @@ -4261,7 +4231,6 @@ void ObjectMgr::LoadQuests() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestLocales() @@ -4315,7 +4284,6 @@ void ObjectMgr::LoadQuestLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadScripts(ScriptsType type) @@ -4333,7 +4301,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use. return; - sLog->outInfo(LOG_FILTER_GENERAL, "Loading %s...", tableName.c_str()); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading %s...", tableName.c_str()); scripts->clear(); // need for reload support @@ -4344,7 +4312,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); - return; } @@ -4636,7 +4603,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGameObjectScripts() @@ -4781,7 +4747,6 @@ void ObjectMgr::LoadSpellScriptNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); - return; } @@ -4829,7 +4794,6 @@ void ObjectMgr::LoadSpellScriptNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::ValidateSpellScripts() @@ -4839,7 +4803,6 @@ void ObjectMgr::ValidateSpellScripts() if (_spellScriptsStore.empty()) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated 0 scripts."); - return; } @@ -4887,7 +4850,6 @@ void ObjectMgr::ValidateSpellScripts() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPageTexts() @@ -4900,7 +4862,6 @@ void ObjectMgr::LoadPageTexts() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 page texts. DB table `page_text` is empty!"); - return; } @@ -4930,7 +4891,6 @@ void ObjectMgr::LoadPageTexts() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } PageText const* ObjectMgr::GetPageText(uint32 pageEntry) @@ -4966,7 +4926,6 @@ void ObjectMgr::LoadPageTextLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadInstanceTemplate() @@ -4979,7 +4938,6 @@ void ObjectMgr::LoadInstanceTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 instance templates. DB table `page_text` is empty!"); - return; } @@ -5009,7 +4967,6 @@ void ObjectMgr::LoadInstanceTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID) @@ -5099,7 +5056,6 @@ void ObjectMgr::LoadInstanceEncounters() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const @@ -5120,7 +5076,6 @@ void ObjectMgr::LoadGossipText() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts", count); - return; } _gossipTextStore.rehash(result->GetRowCount()); @@ -5160,7 +5115,6 @@ void ObjectMgr::LoadGossipText() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadNpcTextLocales() @@ -5203,7 +5157,6 @@ void ObjectMgr::LoadNpcTextLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } //not very fast function but it is called only once a day, or on starting-up @@ -5229,7 +5182,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> No expired mails found."); - return; // any mails need to be returned or deleted } @@ -5333,7 +5285,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestAreaTriggers() @@ -5347,7 +5298,6 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); - return; } @@ -5392,7 +5342,6 @@ void ObjectMgr::LoadQuestAreaTriggers() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadTavernAreaTriggers() @@ -5406,7 +5355,6 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); - return; } @@ -5431,7 +5379,6 @@ void ObjectMgr::LoadTavernAreaTriggers() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadAreaTriggerScripts() @@ -5444,7 +5391,6 @@ void ObjectMgr::LoadAreaTriggerScripts() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); - return; } @@ -5469,7 +5415,6 @@ void ObjectMgr::LoadAreaTriggerScripts() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team) @@ -5588,7 +5533,6 @@ void ObjectMgr::LoadGraveyardZones() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); - return; } @@ -5635,7 +5579,6 @@ void ObjectMgr::LoadGraveyardZones() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) @@ -5881,7 +5824,6 @@ void ObjectMgr::LoadAreaTriggerTeleports() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); - return; } @@ -5928,7 +5870,6 @@ void ObjectMgr::LoadAreaTriggerTeleports() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadAccessRequirements() @@ -5942,7 +5883,6 @@ void ObjectMgr::LoadAccessRequirements() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty."); - return; } @@ -6020,7 +5960,6 @@ void ObjectMgr::LoadAccessRequirements() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } /* @@ -6249,7 +6188,6 @@ void ObjectMgr::LoadGameObjectLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) @@ -6328,7 +6266,6 @@ void ObjectMgr::LoadGameObjectTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); - return; } @@ -6499,7 +6436,6 @@ void ObjectMgr::LoadGameObjectTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadExplorationBaseXP() @@ -6528,7 +6464,6 @@ void ObjectMgr::LoadExplorationBaseXP() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetBaseXP(uint8 level) @@ -6552,7 +6487,6 @@ void ObjectMgr::LoadPetNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); - return; } @@ -6573,7 +6507,6 @@ void ObjectMgr::LoadPetNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPetNumber() @@ -6588,7 +6521,6 @@ void ObjectMgr::LoadPetNumber() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); - } std::string ObjectMgr::GeneratePetName(uint32 entry) @@ -6630,7 +6562,6 @@ void ObjectMgr::LoadCorpses() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 corpses. DB table `corpse` is empty."); - return; } @@ -6659,7 +6590,6 @@ void ObjectMgr::LoadCorpses() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationRewardRate() @@ -6722,7 +6652,6 @@ void ObjectMgr::LoadReputationRewardRate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationOnKill() @@ -6796,7 +6725,6 @@ void ObjectMgr::LoadReputationOnKill() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationSpilloverTemplate() @@ -6811,7 +6739,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded `reputation_spillover_template`, table is empty."); - return; } @@ -6917,7 +6844,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPointsOfInterest() @@ -6964,7 +6890,6 @@ void ObjectMgr::LoadPointsOfInterest() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestPOI() @@ -7036,7 +6961,6 @@ void ObjectMgr::LoadQuestPOI() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadNPCSpellClickSpells() @@ -7104,7 +7028,6 @@ void ObjectMgr::LoadNPCSpellClickSpells() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::DeleteCreatureData(uint32 guid) @@ -7183,7 +7106,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGameobjectQuestRelations() @@ -7253,7 +7175,6 @@ void ObjectMgr::LoadReservedPlayersNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); - return; } @@ -7280,7 +7201,6 @@ void ObjectMgr::LoadReservedPlayersNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::IsReservedName(const std::string& name) const @@ -7434,7 +7354,6 @@ void ObjectMgr::LoadGameObjectForQuests() if (sObjectMgr->GetGameObjectTemplates()->empty()) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GameObjects for quests"); - return; } @@ -7483,7 +7402,6 @@ void ObjectMgr::LoadGameObjectForQuests() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) @@ -7575,7 +7493,6 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max else sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); - return true; } @@ -7632,7 +7549,6 @@ void ObjectMgr::LoadFishingBaseSkillLevel() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names) @@ -7758,7 +7674,6 @@ void ObjectMgr::LoadGameTele() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } GameTele const* ObjectMgr::GetGameTele(const std::string& name) const @@ -7903,7 +7818,6 @@ void ObjectMgr::LoadMailLevelRewards() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel) @@ -8024,7 +7938,6 @@ void ObjectMgr::LoadTrainerSpell() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set *skip_vendors) @@ -8118,7 +8031,6 @@ void ObjectMgr::LoadVendors() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenu() @@ -8160,7 +8072,6 @@ void ObjectMgr::LoadGossipMenu() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenuItems() @@ -8224,7 +8135,6 @@ void ObjectMgr::LoadGossipMenuItems() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist /*= true*/) @@ -8409,7 +8319,6 @@ void ObjectMgr::LoadScriptNames() std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetScriptId(const char *name) @@ -8513,7 +8422,6 @@ void ObjectMgr::LoadCreatureClassLevelStats() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); - return; } @@ -8562,7 +8470,6 @@ void ObjectMgr::LoadCreatureClassLevelStats() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeAchievements() @@ -8599,7 +8506,6 @@ void ObjectMgr::LoadFactionChangeAchievements() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeItems() @@ -8611,7 +8517,6 @@ void ObjectMgr::LoadFactionChangeItems() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); - return; } @@ -8636,7 +8541,6 @@ void ObjectMgr::LoadFactionChangeItems() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeSpells() @@ -8673,7 +8577,6 @@ void ObjectMgr::LoadFactionChangeSpells() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeReputations() @@ -8685,7 +8588,6 @@ void ObjectMgr::LoadFactionChangeReputations() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); - return; } @@ -8710,7 +8612,6 @@ void ObjectMgr::LoadFactionChangeReputations() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadHotfixData() diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 0456b800a29..f80881dd7ac 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -781,13 +781,13 @@ class ObjectMgr void LoadQuests(); void LoadQuestRelations() { - sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO Start Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO Start Quest Data..."); LoadGameobjectQuestRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO End Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO End Quest Data..."); LoadGameobjectInvolvedRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Start Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Start Quest Data..."); LoadCreatureQuestRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature End Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature End Quest Data..."); LoadCreatureInvolvedRelations(); } void LoadGameobjectQuestRelations(); diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 7cb8a8ff7b1..77b3a304f6b 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -126,7 +126,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group definitions. DB table `groups` is empty!"); - return; } @@ -152,10 +151,9 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group members..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group members..."); { uint32 oldMSTime = getMSTime(); @@ -170,7 +168,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group members. DB table `group_member` is empty!"); - return; } @@ -191,10 +188,9 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group instance saves..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group instance saves..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 @@ -204,7 +200,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group-instance saves. DB table `group_instance` is empty!"); - return; } @@ -236,6 +231,5 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 72c791e8a9f..584d32b12d5 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -104,7 +104,7 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const void GuildMgr::LoadGuilds() { // 1. Load all guilds - sLog->outInfo(LOG_FILTER_GUILD, "Loading guilds definitions..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guilds definitions..."); { uint32 oldMSTime = getMSTime(); @@ -116,8 +116,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild definitions. DB table `guild` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild definitions. DB table `guild` is empty."); return; } else @@ -139,13 +138,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 2. Load all guild ranks - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild ranks..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild ranks..."); { uint32 oldMSTime = getMSTime(); @@ -157,8 +155,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); } else { @@ -175,13 +172,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 3. Load all guild members - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild members..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild members..."); { uint32 oldMSTime = getMSTime(); @@ -200,8 +196,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild members. DB table `guild_member` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty."); } else { @@ -219,13 +214,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 4. Load all guild bank tab rights - sLog->outInfo(LOG_FILTER_GUILD, "Loading bank tab rights..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading bank tab rights..."); { uint32 oldMSTime = getMSTime(); @@ -237,8 +231,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); } else { @@ -255,13 +248,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 5. Load all event logs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild event logs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild event logs..."); { uint32 oldMSTime = getMSTime(); @@ -272,8 +264,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); } else { @@ -290,13 +281,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 6. Load all bank event logs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank event logs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank event logs..."); { uint32 oldMSTime = getMSTime(); @@ -308,8 +298,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); } else { @@ -326,13 +315,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 7. Load all guild bank tabs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank tabs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank tabs..."); { uint32 oldMSTime = getMSTime(); @@ -344,8 +332,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); } else { @@ -362,8 +349,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } @@ -382,8 +368,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); } else { @@ -400,8 +385,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } @@ -441,7 +425,6 @@ void GuildMgr::LoadGuilds() } } - sLog->outInfo(LOG_FILTER_GUILD, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); } } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 3259cdbadbf..4c25be6146b 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1454,7 +1454,7 @@ bool LootTemplate::isReference(uint32 id) void LoadLootTemplates_Creature() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading creature loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading creature loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1481,16 +1481,14 @@ void LoadLootTemplates_Creature() LootTemplates_Creature.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); - - } void LoadLootTemplates_Disenchant() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading disenchanting loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading disenchanting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1517,15 +1515,14 @@ void LoadLootTemplates_Disenchant() LootTemplates_Disenchant.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); - } void LoadLootTemplates_Fishing() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading fishing loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading fishing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1542,16 +1539,14 @@ void LoadLootTemplates_Fishing() LootTemplates_Fishing.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); - - } void LoadLootTemplates_Gameobject() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading gameobject loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading gameobject loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1578,16 +1573,14 @@ void LoadLootTemplates_Gameobject() LootTemplates_Gameobject.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); - - } void LoadLootTemplates_Item() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading item loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading item loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1604,16 +1597,14 @@ void LoadLootTemplates_Item() LootTemplates_Item.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); - - } void LoadLootTemplates_Milling() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading milling loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading milling loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1635,16 +1626,14 @@ void LoadLootTemplates_Milling() LootTemplates_Milling.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); - - } void LoadLootTemplates_Pickpocketing() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading pickpocketing loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pickpocketing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1671,16 +1660,14 @@ void LoadLootTemplates_Pickpocketing() LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); - - } void LoadLootTemplates_Prospecting() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading prospecting loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading prospecting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1702,16 +1689,14 @@ void LoadLootTemplates_Prospecting() LootTemplates_Prospecting.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); - - } void LoadLootTemplates_Mail() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading mail loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading mail loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1728,16 +1713,14 @@ void LoadLootTemplates_Mail() LootTemplates_Mail.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); - - } void LoadLootTemplates_Skinning() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading skinning loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading skinning loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1764,16 +1747,14 @@ void LoadLootTemplates_Skinning() LootTemplates_Skinning.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); - - } void LoadLootTemplates_Spell() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading spell loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1808,15 +1789,14 @@ void LoadLootTemplates_Spell() LootTemplates_Spell.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); - } void LoadLootTemplates_Reference() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading reference loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading reference loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1839,6 +1819,5 @@ void LoadLootTemplates_Reference() // output error for any still listed ids (not referenced from any loot table) LootTemplates_Reference.ReportUnusedIds(lootIdSet); - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 5ada88cdf7a..ce987e25eed 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -46,8 +46,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); return; } @@ -106,8 +105,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() m_OutdoorPvPSet.push_back(pvp); } - sLog->outInfo(LOG_FILTER_OUTDOORPVP, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 6ee70101af7..79e8d47aa94 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -571,7 +571,7 @@ void PoolMgr::LoadFromDB() if (!result) { mPoolTemplate.clear(); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 object pools. DB table `pool_template` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 object pools. DB table `pool_template` is empty."); return; } @@ -589,12 +589,12 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Creatures - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Creatures Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creatures Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -603,7 +603,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); } else { @@ -644,13 +644,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Gameobjects - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Gameobject Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gameobject Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -659,7 +659,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); } else { @@ -712,13 +712,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Pool of pools - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Mother Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Mother Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -727,7 +727,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 pools in pools"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools in pools"); } else { @@ -796,11 +796,11 @@ void PoolMgr::LoadFromDB() } } - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Quest Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quest Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -809,7 +809,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 quests in pools"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests in pools"); } else { @@ -884,12 +884,12 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks - sLog->outInfo(LOG_FILTER_POOLSYS, "Starting objects pooling system..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting objects pooling system..."); { uint32 oldMSTime = getMSTime(); @@ -899,7 +899,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Pool handling system initialized, 0 pools spawned."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Pool handling system initialized, 0 pools spawned."); } else { diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 480ab8ef4ae..671cba2e2c2 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -251,13 +251,12 @@ void ScriptMgr::Initialize() LoadDatabase(); - sLog->outInfo(LOG_FILTER_TSCR, "Loading C++ scripts"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading C++ scripts"); FillSpellSummary(); AddScripts(); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); } void ScriptMgr::Unload() diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index b16b877eded..0dc357c366d 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -164,7 +164,7 @@ class ScriptObject protected: ScriptObject(const char* name) - : _name(std::string(name)) + : _name(name) { } diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index f24b01306c5..41b41b91808 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -25,10 +25,10 @@ ScriptPointVector const SystemMgr::_empty; void SystemMgr::LoadScriptTexts() { - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts..."); LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2)); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts additional data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -36,8 +36,7 @@ void SystemMgr::LoadScriptTexts() if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); return; } @@ -83,23 +82,21 @@ void SystemMgr::LoadScriptTexts() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); } void SystemMgr::LoadScriptTextsCustom() { - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts..."); LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3)); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts additional data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts additional data..."); QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts"); if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); return; } @@ -145,8 +142,7 @@ void SystemMgr::LoadScriptTextsCustom() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Custom Texts data.", uiCount); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Custom Texts data.", uiCount); } void SystemMgr::LoadScriptWaypoints() @@ -163,15 +159,14 @@ void SystemMgr::LoadScriptWaypoints() if (result) uiCreatureCount = result->GetRowCount(); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); // 0 1 2 3 4 5 result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); return; } @@ -206,6 +201,5 @@ void SystemMgr::LoadScriptWaypoints() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9f8e0943b1e..c9f90bf9e1d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1155,7 +1155,7 @@ void SpellMgr::LoadSpellRanks() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); return; } @@ -1251,7 +1251,7 @@ void SpellMgr::LoadSpellRanks() while (true); } while (!finished); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1267,7 +1267,7 @@ void SpellMgr::LoadSpellRequired() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell required records. DB table `spell_required` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell required records. DB table `spell_required` is empty."); return; } @@ -1312,7 +1312,7 @@ void SpellMgr::LoadSpellRequired() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1350,8 +1350,7 @@ void SpellMgr::LoadSpellLearnSkills() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellLearnSpells() @@ -1364,8 +1363,7 @@ void SpellMgr::LoadSpellLearnSpells() QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); return; } @@ -1453,8 +1451,7 @@ void SpellMgr::LoadSpellLearnSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellTargetPositions() @@ -1467,8 +1464,7 @@ void SpellMgr::LoadSpellTargetPositions() QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); return; } @@ -1573,8 +1569,7 @@ void SpellMgr::LoadSpellTargetPositions() } }*/ - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellGroups() @@ -1588,8 +1583,7 @@ void SpellMgr::LoadSpellGroups() QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); return; } @@ -1655,8 +1649,7 @@ void SpellMgr::LoadSpellGroups() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellGroupStackRules() @@ -1669,8 +1662,7 @@ void SpellMgr::LoadSpellGroupStackRules() QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); return; } @@ -1700,8 +1692,7 @@ void SpellMgr::LoadSpellGroupStackRules() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellProcEvents() @@ -1714,8 +1705,7 @@ void SpellMgr::LoadSpellProcEvents() QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); return; } @@ -1762,9 +1752,9 @@ void SpellMgr::LoadSpellProcEvents() } while (result->NextRow()); if (customProc) - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1778,8 +1768,7 @@ void SpellMgr::LoadSpellProcs() QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); return; } @@ -1905,8 +1894,7 @@ void SpellMgr::LoadSpellProcs() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellBonusess() @@ -1919,8 +1907,7 @@ void SpellMgr::LoadSpellBonusess() QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); return; } @@ -1946,8 +1933,7 @@ void SpellMgr::LoadSpellBonusess() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellThreats() @@ -1960,8 +1946,7 @@ void SpellMgr::LoadSpellThreats() QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); return; } @@ -1987,8 +1972,7 @@ void SpellMgr::LoadSpellThreats() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSkillLineAbilityMap() @@ -2009,8 +1993,7 @@ void SpellMgr::LoadSkillLineAbilityMap() ++count; } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellPetAuras() @@ -2023,8 +2006,7 @@ void SpellMgr::LoadSpellPetAuras() QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); return; } @@ -2071,8 +2053,7 @@ void SpellMgr::LoadSpellPetAuras() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Fill custom data about enchancments @@ -2112,8 +2093,7 @@ void SpellMgr::LoadEnchantCustomAttr() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellEnchantProcData() @@ -2126,8 +2106,7 @@ void SpellMgr::LoadSpellEnchantProcData() QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); return; } @@ -2156,8 +2135,7 @@ void SpellMgr::LoadSpellEnchantProcData() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellLinked() @@ -2170,8 +2148,7 @@ void SpellMgr::LoadSpellLinked() QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); return; } @@ -2209,8 +2186,7 @@ void SpellMgr::LoadSpellLinked() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadPetLevelupSpellMap() @@ -2266,8 +2242,7 @@ void SpellMgr::LoadPetLevelupSpellMap() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime)); } bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells) @@ -2351,10 +2326,9 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); - - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Loading summonable creature templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading summonable creature templates..."); oldMSTime = getMSTime(); // different summon spells @@ -2395,8 +2369,7 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellAreas() @@ -2414,7 +2387,7 @@ void SpellMgr::LoadSpellAreas() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); return; } @@ -2595,8 +2568,7 @@ void SpellMgr::LoadSpellAreas() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellInfoStore() @@ -2612,8 +2584,7 @@ void SpellMgr::LoadSpellInfoStore() mSpellInfoMap[i] = new SpellInfo(spellEntry); } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::UnloadSpellInfoStore() @@ -2925,8 +2896,7 @@ void SpellMgr::LoadSpellCustomAttr() CreatureAI::FillAISpellInfo(); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadDbcDataCorrections() @@ -3571,5 +3541,5 @@ void SpellMgr::LoadDbcDataCorrections() properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; */ - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 8e740ba83b8..3a24190d8fa 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -114,9 +114,6 @@ void Log::CreateAppenderFromConfig(const char* name) { case APPENDER_CONSOLE: { - if (flags == APPENDER_FLAGS_NONE) - flags = AppenderFlags(APPENDER_FLAGS_PREFIX_LOGLEVEL | APPENDER_FLAGS_PREFIX_LOGFILTERTYPE); - AppenderConsole* appender = new AppenderConsole(NextAppenderId(), name, level, flags); appenders[appender->getId()] = appender; if (++iter != tokens.end()) @@ -135,9 +132,6 @@ void Log::CreateAppenderFromConfig(const char* name) return; } - if (flags == APPENDER_FLAGS_NONE) - flags = AppenderFlags(APPENDER_FLAGS_PREFIX_LOGLEVEL | APPENDER_FLAGS_PREFIX_LOGFILTERTYPE | APPENDER_FLAGS_PREFIX_TIMESTAMP); - filename = *iter; if (++iter != tokens.end()) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 61700de050b..cba2bb8b700 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2620,14 +2620,14 @@ PlayerDump.DisallowOverwrite = 1 # Example: "13 11 9 5 3 1" # # File: Name of the file (read as optional1 if Type = File) -# Allows to use one "%u" to create dynamic files +# Allows to use one "%s" to create dynamic files # # Mode: Mode to open the file (read as optional2 if Type = File) # a - (Append) # w - (Overwrite) # -Appender.Console=1,5,0 +Appender.Console=1,3,0 Appender.Server=2,2,0,Server.log,w Appender.GM=2,2,0,GM.log Appender.DBErrors=2,2,0,DBErrors.log @@ -2712,12 +2712,13 @@ Appenders=Console Server GM DBErrors Char RA Warden Chat # (Using spaces as separator). # -Logger.Root=0,3,Console Server +Logger.Root=0,5,Console Server Logger.Chat=22,3,Chat Logger.DBErrors=26,5,Console Server DBErrors Logger.GM=27,3,Console Server GM Logger.RA=28,3,RA Logger.Warden=29,3,Warden +Logger.WorldServer=31,3,Console Server Logger.Character=34,3,Char Logger.Arenas=35,3,Arenas Logger.SQLDriver=36,5,SQLDriver @@ -2731,4 +2732,4 @@ Logger.Load=40,3,Console Server # (Using spaces as separator). # Default: "Root Chat DBErrors GM RA Warden Character Load" -Loggers=Root Chat DBErrors GM RA Warden Character Load +Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer -- cgit v1.2.3 From e3ea3b28bd6d505495908899de154dcf92a219d8 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 21 Aug 2012 23:40:38 +0100 Subject: Merge remote-tracking branch 'origin/master' into 4.3.4 Conflicts: src/server/game/Groups/Group.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/Protocol/Opcodes.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/worldserver/worldserver.conf.dist --- .../2012_08_16_00_world_creature_template.sql | 3 + sql/updates/world/2012_08_21_01_world_command.sql | 3 + .../2012_08_21_02_world_wintergrasp_conditions.sql | 23 +++++ src/server/authserver/Main.cpp | 16 ++- src/server/authserver/authserver.conf.dist | 4 +- src/server/game/AI/CoreAI/GameObjectAI.h | 5 + src/server/game/AI/CreatureAISelector.cpp | 5 + src/server/game/Achievements/AchievementMgr.cpp | 4 +- src/server/game/Battlefield/Battlefield.cpp | 16 +-- .../game/Battlefield/Zones/BattlefieldWG.cpp | 4 +- src/server/game/Battlefield/Zones/BattlefieldWG.h | 88 +++++++++-------- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 9 +- src/server/game/Entities/GameObject/GameObject.h | 1 + src/server/game/Entities/Object/Object.cpp | 7 +- src/server/game/Entities/Player/Player.cpp | 13 ++- src/server/game/Entities/Player/Player.h | 6 +- src/server/game/Entities/Vehicle/Vehicle.h | 4 + src/server/game/Globals/ObjectAccessor.h | 1 + src/server/game/Groups/Group.cpp | 62 ++++++------ src/server/game/Groups/Group.h | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 4 +- src/server/game/Handlers/BattleGroundHandler.cpp | 49 --------- src/server/game/Handlers/ChatHandler.cpp | 4 +- src/server/game/Handlers/MailHandler.cpp | 6 +- src/server/game/Handlers/MiscHandler.cpp | 50 +++++++++- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Scripting/ScriptMgr.cpp | 16 +-- src/server/game/Server/Protocol/Opcodes.h | 9 ++ src/server/game/Server/WorldSession.cpp | 81 +++++++-------- src/server/game/Server/WorldSession.h | 4 +- src/server/game/Server/WorldSocket.cpp | 110 ++++++++++----------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 +- src/server/game/Spells/Spell.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 1 + src/server/game/Spells/SpellMgr.cpp | 16 +++ src/server/game/Warden/Warden.cpp | 5 +- src/server/game/Warden/WardenMac.cpp | 4 +- src/server/game/Warden/WardenWin.cpp | 16 +-- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/CMakeLists.txt | 1 + src/server/scripts/Commands/cs_ban.cpp | 4 +- src/server/scripts/Commands/cs_quest.cpp | 35 ++++++- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 12 +-- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 14 +-- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 16 ++- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 6 +- .../instance_trial_of_the_crusader.cpp | 11 +++ .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.h | 4 +- src/server/scripts/Northrend/wintergrasp.cpp | 35 +++---- src/server/worldserver/Master.cpp | 2 +- src/server/worldserver/worldserver.conf.dist | 64 +++++++++++- 54 files changed, 531 insertions(+), 341 deletions(-) create mode 100644 sql/updates/world/2012_08_16_00_world_creature_template.sql create mode 100644 sql/updates/world/2012_08_21_01_world_command.sql create mode 100644 sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/sql/updates/world/2012_08_16_00_world_creature_template.sql b/sql/updates/world/2012_08_16_00_world_creature_template.sql new file mode 100644 index 00000000000..732f647d7b7 --- /dev/null +++ b/sql/updates/world/2012_08_16_00_world_creature_template.sql @@ -0,0 +1,3 @@ +-- Added trigger flags to triggers +UPDATE `creature_template` SET `flags_extra` = flags_extra | 128 WHERE `entry` = 34862; +UPDATE `creature_template` SET `unit_flags` = unit_flags | 256 WHERE `entry` = 34862; diff --git a/sql/updates/world/2012_08_21_01_world_command.sql b/sql/updates/world/2012_08_21_01_world_command.sql new file mode 100644 index 00000000000..df833d2d246 --- /dev/null +++ b/sql/updates/world/2012_08_21_01_world_command.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE name='quest reward'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('quest reward',3,'Syntax: .quest reward #questId\n\n\Grants quest reward to selected player and removes quest from his log (quest must be in completed state).'); diff --git a/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql b/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql new file mode 100644 index 00000000000..caf8a0cc1e4 --- /dev/null +++ b/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql @@ -0,0 +1,23 @@ +-- Conditions +-- Add gossip_menu condition for 9904 Horde +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (9904,9923); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`NegativeCondition`) VALUES +(14,9904,13759,0,1,33280,0), -- Must have Rank 1: Corporal +(14,9904,13759,1,1,55629,0), -- Or must have Rank 2: First Lieutenant +(14,9904,13761,0,1,33280,1), -- Must not have Rank 1: Corporal +(14,9904,13761,0,1,55629,1), -- Must not have Rank 2: First Lieutenant +-- Add gossip_menu condition for 9923 Alliance +(14,9923,13798,0,1,33280,0), -- Must have Rank 1: Corporal +(14,9923,13798,1,1,55629,0), -- Or must have Rank 2: First Lieutenant +(14,9923,14172,0,1,33280,1), -- Must not have Rank 1: Corporal +(14,9923,14172,0,1,55629,1), -- Must not have Rank 2: First Lieutenant +-- Add conditions to gossip options horde +(15,9904,0,0,1,33280,0), -- Must have reached Rank 1: Corporal +(15,9904,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant +(15,9904,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +(15,9904,2,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +-- Add conditions to gossip options alliance +(15,9923,0,0,1,33280,0), -- Must have reached Rank 1: Corporal +(15,9923,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant +(15,9923,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +(15,9923,2,0,1,55629,0); -- Must have reached Rank 2: First Lieutenant diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index f5a3c7cf7e1..b938706a0be 100755 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -141,10 +141,16 @@ extern int main(int argc, char **argv) // Launch the listening network socket RealmAcceptor acceptor; - uint16 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724); + int32 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724); + if (rmport < 0 || rmport > 0xFFFF) + { + sLog->outError(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)"); + return 1; + } + std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); - ACE_INET_Addr bind_addr(rmport, bind_ip.c_str()); + ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str()); if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1) { @@ -238,14 +244,14 @@ bool StartDB() return false; } - uint8 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); + int32 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); if (worker_threads < 1 || worker_threads > 32) { sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); worker_threads = 1; } - uint8 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); + int32 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); if (synch_threads < 1 || synch_threads > 32) { sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); @@ -253,7 +259,7 @@ bool StartDB() } // NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever. - if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads)) + if (!LoginDatabase.Open(dbstring.c_str(), uint8(worker_threads), uint8(synch_threads))) { sLog->outError(LOG_FILTER_AUTHSERVER, "Cannot connect to database"); return false; diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 9a4beca9bf6..ee7e5970155 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -205,8 +205,8 @@ LoginDatabase.WorkerThreads = 1 # w - (Overwrite) # -Appender.Console=1,2,6 -Appender.Auth=2,2,7,Auth.log,w +Appender.Console=1,2,0 +Appender.Auth=2,2,0,Auth.log,w # LogLevel # 0 - (Disabled) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index fbc8675cc47..6dfea9ac158 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -39,6 +39,11 @@ class GameObjectAI virtual void Reset() {}; + // Pass parameters between AI + virtual void DoAction(const int32 /*param = 0 */) {} + virtual void SetGUID(const uint64& /*guid*/, int32 /*id = 0 */) {} + virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; } + static int Permissible(GameObject const* go); virtual bool GossipHello(Player* /*player*/) { return false; } diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index 2d69f1e0243..4ccaa174e67 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -137,6 +137,11 @@ namespace FactorySelector ai_factory = ai_registry.GetRegistryItem(go->GetAIName()); + // scriptname in db + if (!ai_factory) + if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) + return scriptedAI; + //future goAI types go here std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 30b6de3fc4d..7a73b9f8f69 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -342,14 +342,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un Map* map = source->GetMap(); if (!map->IsDungeon()) { - sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u", + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u", ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } InstanceScript* instance = ((InstanceMap*)map)->GetInstanceScript(); if (!instance) { - sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script", + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script", ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index cdb8e1999fe..d159580d189 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -280,7 +280,7 @@ void Battlefield::InitStalker(uint32 entry, float x, float y, float z, float o) if (Creature* creature = SpawnCreature(entry, x, y, z, o, TEAM_NEUTRAL)) StalkerGuid = creature->GetGUID(); else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry); } void Battlefield::KickAfkPlayers() @@ -563,7 +563,7 @@ bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player) else if (group->IsMember(player->GetGUID())) { uint8 subgroup = group->GetMemberGroup(player->GetGUID()); - player->SetBattlegroundRaid(group, subgroup); + player->SetBattlegroundOrBattlefieldRaid(group, subgroup); } else group->AddMember(player); @@ -587,10 +587,10 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) if (m_GraveyardList[id]) return m_GraveyardList[id]; else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u not existed", id); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u not existed", id); } else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u cant be found", id); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u cant be found", id); return NULL; } @@ -684,7 +684,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team) { if (!spirit) { - sLog->outError(LOG_FILTER_GENERAL, "BfGraveyard::SetSpirit: Invalid Spirit."); + sLog->outError(LOG_FILTER_BATTLEFIELD, "BfGraveyard::SetSpirit: Invalid Spirit."); return; } @@ -798,14 +798,14 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId)); if (!map) { - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); return 0; } Creature* creature = new Creature; if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o)) { - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry); delete creature; return NULL; } @@ -1066,7 +1066,7 @@ bool BfCapturePoint::Update(uint32 diff) if (m_OldState != m_State) { - //sLog->outError(LOG_FILTER_GENERAL, "%u->%u", m_OldState, m_State); + //sLog->outError(LOG_FILTER_BATTLEFIELD, "%u->%u", m_OldState, m_State); if (oldTeam != m_team) ChangeTeam(oldTeam); return true; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 48d6b59d007..8e58dcdc5c0 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -238,7 +238,7 @@ void BattlefieldWG::OnBattleStart() m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } else - sLog->outError(LOG_FILTER_GENERAL, "WG: Failed to spawn titan relic."); + sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic."); // Update tower visibility and update faction @@ -490,7 +490,7 @@ uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) case AREA_THE_CHILLED_QUAGMIRE: return BATTLEFIELD_WG_GY_HORDE; default: - sLog->outError(LOG_FILTER_GENERAL, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId); + sLog->outError(LOG_FILTER_BATTLEFIELD, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId); break; } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 97807eb989c..924ff1ad454 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -26,11 +26,11 @@ #include "GroupMgr.h" #include "Battlefield.h" -const uint32 VehNumWorldState[2] = { 3680, 3490 }; -const uint32 MaxVehNumWorldState[2] = { 3681, 3491 }; -const uint32 ClockWorldState[2] = { 3781, 4354 }; -const uint32 WintergraspFaction[3] = { 1, 2, 35 }; -const float WintergraspStalkerPos[4] = { 0, 0, 0, 0 }; +uint32 const VehNumWorldState[2] = { 3680, 3490 }; +uint32 const MaxVehNumWorldState[2] = { 3681, 3491 }; +uint32 const ClockWorldState[2] = { 3781, 4354 }; +uint32 const WintergraspFaction[3] = { 1, 2, 35 }; +float const WintergraspStalkerPos[4] = { 0, 0, 0, 0 }; class BattlefieldWG; class WintergraspCapturePoint; @@ -81,11 +81,11 @@ enum WintergraspSpells SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA = 58730, // Phasing spells - SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618,// ADDS PHASE 16 - SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT = 56617,// ADDS PHASE 32 + SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618, // ADDS PHASE 16 + SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT = 56617, // ADDS PHASE 32 - SPELL_HORDE_CONTROL_PHASE_SHIFT = 55773,// ADDS PHASE 64 - SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 55774,// ADDS PHASE 128 + SPELL_HORDE_CONTROL_PHASE_SHIFT = 55773, // ADDS PHASE 64 + SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 55774, // ADDS PHASE 128 }; enum WintergraspData @@ -151,7 +151,7 @@ enum WintergraspAreaIds class BfGraveyardWG : public BfGraveyard { public: - BfGraveyardWG(BattlefieldWG *Bf); + BfGraveyardWG(BattlefieldWG* Bf); void SetTextId(uint32 textid) { m_GossipTextId = textid; } uint32 GetTextId() { return m_GossipTextId; } @@ -189,9 +189,9 @@ enum WintergraspNpcs BATTLEFIELD_WG_NPC_STALKER = 15214, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER = 31102, - BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296,// - BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101,// - BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173,// + BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296, // + BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101, // + BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173, // BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH = 31091, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH = 31151, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF = 31106, @@ -199,17 +199,17 @@ enum WintergraspNpcs BATTLEFIELD_WG_NPC_LIEUTENANT_MURP = 31107, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH = 31052, - BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294,// - BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051,// - BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172,// + BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294, // + BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051, // + BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172, // BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH = 31036, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS = 31153, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE = 31108, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA = 31054, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO = 31109, - NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp - NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp + NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp + NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp NPC_TOWER_CANNON = 28366, NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE = 28312, @@ -434,14 +434,14 @@ class BattlefieldWG : public Battlefield GameObject* m_titansRelic; }; -const uint32 NORTHREND_WINTERGRASP = 4197; -const uint8 WG_MAX_OBJ = 32; -const uint8 WG_KEEPGAMEOBJECT_MAX = 44; -const uint8 WG_MAX_TURRET = 15; -const uint8 WG_MAX_KEEP_NPC = 39; -const uint8 WG_MAX_OUTSIDE_NPC = 14; -const uint8 WG_OUTSIDE_ALLIANCE_NPC = 7; -const uint8 WG_MAX_TELEPORTER = 12; +uint32 const NORTHREND_WINTERGRASP = 4197; +uint8 const WG_MAX_OBJ = 32; +uint8 const WG_KEEPGAMEOBJECT_MAX = 44; +uint8 const WG_MAX_TURRET = 15; +uint8 const WG_MAX_KEEP_NPC = 39; +uint8 const WG_MAX_OUTSIDE_NPC = 14; +uint8 const WG_OUTSIDE_ALLIANCE_NPC = 7; +uint8 const WG_MAX_TELEPORTER = 12; enum WintergraspGameObjectBuildingType { @@ -479,15 +479,15 @@ enum WintergraspWorkshopIds enum WintergraspWorldstates { - WORLDSTATE_WORKSHOP_NE = 3701, - WORLDSTATE_WORKSHOP_NW = 3700, - WORLDSTATE_WORKSHOP_SE = 3703, - WORLDSTATE_WORKSHOP_SW = 3702, - WORLDSTATE_WORKSHOP_K_W = 3698, - WORLDSTATE_WORKSHOP_K_E = 3699 + WORLDSTATE_WORKSHOP_NE = 3701, + WORLDSTATE_WORKSHOP_NW = 3700, + WORLDSTATE_WORKSHOP_SE = 3703, + WORLDSTATE_WORKSHOP_SW = 3702, + WORLDSTATE_WORKSHOP_K_W = 3698, + WORLDSTATE_WORKSHOP_K_E = 3699 }; -enum eWGTeamControl +enum WintergraspTeamControl { BATTLEFIELD_WG_TEAM_ALLIANCE, BATTLEFIELD_WG_TEAM_HORDE, @@ -495,7 +495,7 @@ enum eWGTeamControl }; // TODO: Handle this with creature_text ? -enum eWGText +enum WintergraspText { BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NE = 12055, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NW = 12052, @@ -567,7 +567,8 @@ struct WintergraspBuildingSpawnData uint32 nameId; }; -const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { +const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = +{ // Wall (Not spawned in db) // Entry WS X Y Z O type NameID { 190219, 3749, 5371.46f, 3047.47f, 407.571f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 }, @@ -659,7 +660,8 @@ const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { // 192357 : 1 in sql, 1 in header // 192350 : 1 in sql, 1 in header // 192351 : 1 in sql, 1 in header -const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = { +const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = +{ { 5262.540039f, 3047.949951f, 432.054993f, 3.106650f, 192488, 192501 }, // Flag on tower { 5272.939941f, 2976.550049f, 444.492004f, 3.124120f, 192374, 192416 }, // Flag on Wall Intersect { 5235.189941f, 2941.899902f, 444.278015f, 1.588250f, 192375, 192416 }, // Flag on Wall Intersect @@ -706,7 +708,8 @@ const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = { { 5271.279785f, 2820.159912f, 445.200989f, -3.13286f, 192351, 192416 } // Flag on wall intersect }; -const Position WGTurret[WG_MAX_TURRET] = { +const Position WGTurret[WG_MAX_TURRET] = +{ { 5391.19f, 3060.8f, 419.616f, 1.69557f }, { 5266.75f, 2976.5f, 421.067f, 3.20354f }, { 5234.86f, 2948.8f, 420.88f, 1.61311f }, @@ -841,7 +844,8 @@ struct WintergraspTowerData uint8 const WG_MAX_ATTACKTOWERS = 3; // 192414 : 0 in sql, 1 in header // 192278 : 0 in sql, 3 in header -const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] = { +const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] = +{ // West tower { 190356, @@ -1128,7 +1132,7 @@ const WGWorkshopData WorkshopsData[WG_MAX_WORKSHOP] = // Structure for different buildings that can be destroyed during battle struct BfWGGameObjectBuilding { - BfWGGameObjectBuilding(BattlefieldWG *WG) + BfWGGameObjectBuilding(BattlefieldWG* WG) { m_WG = WG; m_Team = 0; @@ -1143,7 +1147,7 @@ struct BfWGGameObjectBuilding uint8 m_Team; // WG object - BattlefieldWG *m_WG; + BattlefieldWG* m_WG; // Linked gameobject GameObject* m_Build; @@ -1254,7 +1258,7 @@ struct BfWGGameObjectBuilding m_WG->BrokenWallOrTower(TeamId(m_Team)); } - void Init(GameObject *go, uint32 type, uint32 worldstate, uint32 nameid) + void Init(GameObject* go, uint32 type, uint32 worldstate, uint32 nameid) { // GameObject associated to object m_Build = go; @@ -1612,7 +1616,7 @@ struct WintergraspWorkshopData GameObjectSet m_GameObjectOnPoint[2]; // Contain all Gameobject associate to this point uint32 m_NameId; // Id of trinity_string witch contain name of this node, using for alert message - WintergraspWorkshopData(BattlefieldWG * WG) + WintergraspWorkshopData(BattlefieldWG* WG) { m_WG = WG; m_Build = NULL; diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index b9ddabcf254..61b15bdd182 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession* session) // Broadcast update if (session) { - BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), ""); + BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), ""); if (Player* player = session->GetPlayer()) sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d10e6a5dd90..98b95b5d32b 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1230,7 +1230,7 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team) if (group->IsMember(playerGuid)) { uint8 subgroup = group->GetMemberGroup(playerGuid); - player->SetBattlegroundRaid(group, subgroup); + player->SetBattlegroundOrBattlefieldRaid(group, subgroup); } else { diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 971716e24a1..e1b312d83d0 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -855,6 +855,13 @@ bool GameObject::IsDynTransport() const return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } +bool GameObject::IsDestructibleBuilding() const +{ + GameObjectTemplate const* gInfo = GetGOInfo(); + if (!gInfo) return false; + return gInfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING; +} + Unit* GameObject::GetOwner() const { return ObjectAccessor::GetUnit(*this, GetOwnerGUID()); @@ -871,7 +878,7 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const if (WorldObject::IsAlwaysVisibleFor(seer)) return true; - if (IsTransport()) + if (IsTransport() || IsDestructibleBuilding()) return true; if (!seer) diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 80aaf1c933f..b3efb47dd6f 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -633,6 +633,7 @@ class GameObject : public WorldObject, public GridObject bool IsTransport() const; bool IsDynTransport() const; + bool IsDestructibleBuilding() const; uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index fb1a5ccb9b6..2ccb5b68bca 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2489,7 +2489,12 @@ void WorldObject::SetZoneScript() if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) m_zoneScript = bf; else - m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); + { + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) + m_zoneScript = bf; + else + m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); + } } } } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 87dd1c51737..3ad14cb9c72 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5523,7 +5523,12 @@ void Player::RepopAtGraveyard() if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this); else - ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); + { + if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) + ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this); + else + ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); + } } // stop countdown until repop @@ -7731,7 +7736,7 @@ void Player::CheckDuelDistance(time_t currTime) bool Player::IsOutdoorPvPActive() { - return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld->IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); + return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); } void Player::DuelComplete(DuelCompleteType type) @@ -23464,7 +23469,7 @@ bool Player::isUsingLfg() return sLFGMgr->GetState(guid) != LFG_STATE_NONE; } -void Player::SetBattlegroundRaid(Group* group, int8 subgroup) +void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup) { //we must move references from m_group to m_originalGroup SetOriginalGroup(GetGroup(), GetSubGroup()); @@ -23474,7 +23479,7 @@ void Player::SetBattlegroundRaid(Group* group, int8 subgroup) m_group.setSubGroup((uint8)subgroup); } -void Player::RemoveFromBattlegroundRaid() +void Player::RemoveFromBattlegroundOrBattlefieldRaid() { //remove existing reference m_group.unlink(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index cd6334714df..09c7e0ff2a1 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2484,9 +2484,9 @@ class Player : public Unit, public GridObject Player* GetNextRandomRaidMember(float radius); PartyResult CanUninviteFromGroup() const; - // Battleground Group System - void SetBattlegroundRaid(Group* group, int8 subgroup = -1); - void RemoveFromBattlegroundRaid(); + // Battleground / Battlefield Group System + void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1); + void RemoveFromBattlegroundOrBattlefieldRaid(); Group* GetOriginalGroup() { return m_originalGroup.getTarget(); } GroupReference& GetOriginalGroupRef() { return m_originalGroup; } uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); } diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 213be5a21fe..95fc2364256 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -25,6 +25,8 @@ struct VehicleEntry; class Unit; +typedef std::set GuidSet; + class Vehicle { public: @@ -53,6 +55,7 @@ class Vehicle void RelocatePassengers(float x, float y, float z, float ang); void RemoveAllPassengers(); void Dismiss(); + void TeleportVehicle(float x, float y, float z, float ang); bool IsVehicleInUse() { return Seats.begin() != Seats.end(); } SeatMap Seats; @@ -65,6 +68,7 @@ class Vehicle Unit* _me; VehicleEntry const* _vehicleInfo; + GuidSet vehiclePlayers; uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players }; diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index 5b31c6bfff4..0a1b41eb292 100755 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -191,6 +191,7 @@ class ObjectAccessor // ACCESS LIKE THAT IS NOT THREAD SAFE static Pet* FindPet(uint64); static Player* FindPlayer(uint64); + static Creature* FindCreature(uint64); static Unit* FindUnit(uint64); static Player* FindPlayerByName(const char* name); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 60dbe64f7f1..2e0843f54c9 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -104,7 +104,7 @@ bool Group::Create(Player* leader) m_leaderGuid = leaderGuid; m_leaderName = leader->GetName(); - m_groupType = isBGGroup() ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL; + m_groupType = (isBGGroup() || isBFGroup()) ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL; if (m_groupType & GROUPTYPE_RAID) _initRaidSubGroupsCounter(); @@ -116,7 +116,7 @@ bool Group::Create(Player* leader) m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { m_dungeonDifficulty = leader->GetDungeonDifficulty(); m_raidDifficulty = leader->GetRaidDifficulty(); @@ -232,7 +232,7 @@ void Group::ConvertToLFG() { m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_UNK1); m_lootMethod = NEED_BEFORE_GREED; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE); @@ -251,7 +251,7 @@ void Group::ConvertToRaid() _initRaidSubGroupsCounter(); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE); @@ -305,7 +305,7 @@ bool Group::AddInvite(Player* player) if (!player || player->GetGroupInvite()) return false; Group* group = player->GetGroup(); - if (group && group->isBGGroup()) + if (group && (group->isBGGroup() || group->isBFGroup())) group = player->GetOriginalGroup(); if (group) return false; @@ -402,8 +402,8 @@ bool Group::AddMember(Player* player) if (player) { player->SetGroupInvite(NULL); - if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() - player->SetBattlegroundRaid(this, subGroup); + if (player->GetGroup() && (isBGGroup() || isBFGroup())) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() + player->SetBattlegroundOrBattlefieldRaid(this, subGroup); else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() player->SetOriginalGroup(this, subGroup); else //if player is not in group, then call set group @@ -422,7 +422,7 @@ bool Group::AddMember(Player* player) } // insert into the table if we're not a battleground group - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER); @@ -441,7 +441,7 @@ bool Group::AddMember(Player* player) if (player) { - if (!IsLeader(player->GetGUID()) && !isBGGroup()) + if (!IsLeader(player->GetGUID()) && !isBGGroup() && !isBFGroup()) { // reset the new member's instances, unless he is currently in one of them // including raid/heroic instances that they are not permanently bound to! @@ -527,15 +527,15 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK) return m_memberSlots.size(); - // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group) - if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u)) + // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group) + if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u)) { Player* player = ObjectAccessor::FindPlayer(guid); if (player) { // Battleground group handling - if (isBGGroup()) - player->RemoveFromBattlegroundRaid(); + if (isBGGroup() || isBFGroup()) + player->RemoveFromBattlegroundOrBattlefieldRaid(); else // Regular group { @@ -566,13 +566,13 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV } // Remove player from group in DB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); - - stmt->setUInt32(0, GUID_LOPART(guid)); - - CharacterDatabase.Execute(stmt); - - DelinkMember(guid); + if (!isBGGroup() && !isBFGroup()) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); + CharacterDatabase.Execute(stmt); + DelinkMember(guid); + } // Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player) @@ -663,7 +663,7 @@ void Group::ChangeLeader(uint64 guid) sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { // Remove the groups permanent instance bindings for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) @@ -723,8 +723,8 @@ void Group::Disband(bool hideDestroy /* = false */) //we cannot call _removeMember because it would invalidate member iterator //if we are removing player from battleground raid - if (isBGGroup()) - player->RemoveFromBattlegroundRaid(); + if (isBGGroup() || isBFGroup()) + player->RemoveFromBattlegroundOrBattlefieldRaid(); else { //we can remove player who is in battleground from his original group @@ -768,7 +768,7 @@ void Group::Disband(bool hideDestroy /* = false */) RemoveAllInvites(); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -1540,7 +1540,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) Player* member = ObjectAccessor::FindPlayer(citr->guid); uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; - onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); + onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0); data << citr->name; data << uint64(citr->guid); // guid @@ -1645,7 +1645,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group) SubGroupCounterIncrease(group); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); @@ -1696,7 +1696,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group) SubGroupCounterDecrease(prevSubGroup); // Preserve new sub group in database for non-raid groups - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); @@ -1891,7 +1891,7 @@ void Roll::targetObjectBuildLink() void Group::SetDungeonDifficulty(Difficulty difficulty) { m_dungeonDifficulty = difficulty; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY); @@ -1915,7 +1915,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty) void Group::SetRaidDifficulty(Difficulty difficulty) { m_raidDifficulty = difficulty; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY); @@ -1951,7 +1951,7 @@ bool Group::InCombatToInstance(uint32 instanceId) void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) { - if (isBGGroup()) + if (isBGGroup() || isBFGroup()) return; // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND @@ -2066,7 +2066,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load) { - if (!save || isBGGroup()) + if (!save || isBGGroup() || isBFGroup()) return NULL; InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index f11cdcdbcf4..e6da9caea32 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -247,7 +247,7 @@ class Group void ConvertToGroup(); void SetBattlegroundGroup(Battleground* bg); - void SetBattlefieldGroup(Battlefield *bf); + void SetBattlefieldGroup(Battlefield* bf); GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); void ChangeMembersGroup(uint64 guid, uint8 group); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 385bb8abb45..122102b76f3 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -247,7 +247,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); } AH->item_guidlow = item->GetGUIDLow(); @@ -293,7 +293,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); + GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); } AH->item_guidlow = newItem->GetGUIDLow(); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index e46aa4c39b7..d1da504008e 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -34,8 +34,6 @@ #include "Opcodes.h" #include "DisableMgr.h" #include "Group.h" -#include "Battlefield.h" -#include "BattlefieldMgr.h" void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData) { @@ -561,53 +559,6 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) } } -void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); - - Battleground* bg = _player->GetBattleground(); - - uint64 guid; - recvData >> guid; - - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) - return; - - if (!unit->isSpiritService()) // it's not spirit service - return; - - if (bg) - sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); - - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->SendAreaSpiritHealerQueryOpcode(_player,guid); -} - -void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); - - Battleground* bg = _player->GetBattleground(); - - uint64 guid; - recvData >> guid; - - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) - return; - - if (!unit->isSpiritService()) // it's not spirit service - return; - - if (bg) - bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); - - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->AddPlayerToResurrectQueue(guid, _player->GetGUID()); -} - - void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 28f15a7377d..2ab2831c0d0 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -110,7 +110,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) type = CHAT_MSG_RAID_WARNING; break; default: - sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); + sLog->outError(LOG_FILTER_NETWORKIO, "HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); return; } @@ -535,7 +535,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) type = CHAT_MSG_WHISPER; break; default: - sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); + sLog->outError(LOG_FILTER_NETWORKIO, "HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); return; } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 4d16fb27bec..f89fa2ab25e 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -305,7 +305,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account); + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account); } item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable @@ -325,7 +325,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: " UI64FMTD " to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); + GetPlayerName().c_str(), GetAccountId(), money, receiver.c_str(), rc_account); } } @@ -520,7 +520,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: " UI64FMTD " to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); + GetPlayerName().c_str(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); } else if (!receive) sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c177d8b2888..677b3cccf82 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -52,6 +52,7 @@ #include "Group.h" #include "AccountMgr.h" #include "Spell.h" +#include "BattlegroundMgr.h" #include "Battlefield.h" #include "BattlefieldMgr.h" @@ -1727,6 +1728,53 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) SendPacket(&data); } +// Battlefield and Battleground +void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); + + Battleground* bg = _player->GetBattleground(); + + uint64 guid; + recv_data >> guid; + + Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); + if (!unit) + return; + + if (!unit->isSpiritService()) // it's not spirit service + return; + + if (bg) + sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); + + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) + bf->SendAreaSpiritHealerQueryOpcode(_player,guid); +} + +void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); + + Battleground* bg = _player->GetBattleground(); + + uint64 guid; + recv_data >> guid; + + Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); + if (!unit) + return; + + if (!unit->isSpiritService()) // it's not spirit service + return; + + if (bg) + bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); + + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) + bf->AddPlayerToResurrectQueue(guid, _player->GetGUID()); +} + void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/) { if (_player->isInFlight()) @@ -1890,5 +1938,5 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) recvPacket.ReadByteSeq(guid[5]); WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid); - sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName(), GetGuidLow()); + sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName().c_str(), GetGuidLow()); } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 0337a60a459..5e6caec1f29 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -47,6 +47,7 @@ void AddSC_SmartSCripts(); void AddSC_account_commandscript(); void AddSC_achievement_commandscript(); void AddSC_ban_commandscript(); +void AddSC_bf_commandscript(); void AddSC_cast_commandscript(); void AddSC_character_commandscript(); void AddSC_debug_commandscript(); @@ -655,6 +656,7 @@ void AddCommandScripts() AddSC_account_commandscript(); AddSC_achievement_commandscript(); AddSC_ban_commandscript(); + AddSC_bf_commandscript(); AddSC_cast_commandscript(); AddSC_character_commandscript(); AddSC_debug_commandscript(); diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 589eb6fc179..e3f550c5f48 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -723,14 +723,6 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd return tmpscript->OnDummyEffect(caster, spellId, effIndex, target); } -GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) -{ - ASSERT(go); - - GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); - return tmpscript->GetAI(go); -} - bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest) { ASSERT(player); @@ -861,6 +853,14 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature) return tmpscript->GetAI(creature); } +GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject) +{ + ASSERT(gameobject); + + GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, NULL); + return tmpscript->GetAI(gameobject); +} + void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff) { ASSERT(creature); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6c27c49bf79..43e4ddfb9e4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1466,5 +1466,14 @@ inline const char* LookupOpcodeName(Opcodes id) return "INVALID OPCODE"; } + +inline std::string GetOpcodeNameForLogging(Opcodes id) +{ + uint32 opcode = uint32(id); + std::ostringstream ss; + ss << '[' << LookupOpcodeName(id) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]"; + return ss.str().c_str(); +} + #endif /// @} diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 92db86c2a35..e2755d3d1f7 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -163,16 +163,29 @@ WorldSession::~WorldSession() delete _compressionStream; } -void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const -{ - sLog->outError(LOG_FILTER_GENERAL, "Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped", - GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size); -} - /// Get the player name -char const* WorldSession::GetPlayerName() const -{ - return GetPlayer() ? GetPlayer()->GetName() : ""; +std::string WorldSession::GetPlayerName(bool simple /* = true */) const + { + std::string name = "[Player: "; + uint32 guidLow = 0; + + if (Player* player = GetPlayer()) + { + name.append(player->GetName()); + guidLow = player->GetGUIDLow(); + } + else + name.append(""); + + if (!simple) + { + std::ostringstream ss; + ss << " (Guid: " << guidLow << ", Account: " << GetAccountId() << ")"; + name.append(ss.str()); + } + + name.append("]"); + return name; } /// Get player guid if available. Use for logging purposes only @@ -249,16 +262,15 @@ void WorldSession::QueuePacket(WorldPacket* new_packet) /// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason); + sLog->outError(LOG_FILTER_OPCODES, "Received unexpected opcode %s Status: %s Reason: %s from %s", + GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), status, reason, GetPlayerName(false).c_str()); } /// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket* packet) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos())); + sLog->outError(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s", + uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str()); packet->print_storage(); } @@ -290,6 +302,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) _recvQueue.next(packet, updater)) { const OpcodeHandler* opHandle = opcodeTable[packet->GetOpcode()]; + try { switch (opHandle->status) @@ -309,8 +322,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) deletePacket = false; QueuePacket(packet); //! Log - sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s (0x%.4X) with with status STATUS_LOGGEDIN. " - "Player is currently not in world yet.", opHandle->name, packet->GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. " + "Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()); } } else if (_player->IsInWorld()) @@ -367,14 +380,12 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnprocessedTail(packet); break; case STATUS_NEVER: - sLog->outError(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() + , GetPlayerName(false).c_str()); break; case STATUS_UNHANDLED: - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outDebug(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() + , GetPlayerName(false).c_str()); break; } } @@ -382,11 +393,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) - { - sLog->outTrace(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); - packet->hexlike(); - } + packet->hexlike(); } if (deletePacket) @@ -648,30 +655,26 @@ const char *WorldSession::GetTrinityString(int32 entry) const void WorldSession::Handle_NULL(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received unhandled opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received unhandled opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_EarlyProccess(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received opcode %s that must be processed in WorldSocket::OnRead from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_ServerSide(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received server-side opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received server-side opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_Deprecated(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received deprecated opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received deprecated opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::SendAuthWaitQue(uint32 position) diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 78af675a348..53398de8c65 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -240,8 +240,6 @@ class WorldSession bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; } bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; } - void SizeError(WorldPacket const& packet, uint32 size) const; - void ReadAddonsInfo(WorldPacket& data); void SendAddonsInfo(); bool IsAddonRegistered(const std::string& prefix) const; @@ -264,7 +262,7 @@ class WorldSession AccountTypes GetSecurity() const { return _security; } uint32 GetAccountId() const { return _accountId; } Player* GetPlayer() const { return _player; } - char const* GetPlayerName() const; + std::string GetPlayerName(bool simple = true) const; uint32 GetGuidLow() const; void SetSecurity(AccountTypes security) { _security = security; } std::string const& GetRemoteAddress() { return m_Address; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 783d53562a2..8211f846f7d 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -173,7 +173,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct) pkt = &buff; } - sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s 0x%.4X (%u)", LookupOpcodeName(pkt->GetOpcode()), uint32(pkt->GetOpcode()), uint32(pkt->GetOpcode())); + sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s", GetOpcodeNameForLogging(pkt->GetOpcode()).c_str()); sScriptMgr->OnPacketSend(this, *pkt); @@ -204,7 +204,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct) if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::SendPacket enqueue_tail failed"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::SendPacket enqueue_tail failed"); mb->release(); return -1; } @@ -247,7 +247,7 @@ int WorldSocket::open (void *a) if (peer().get_remote_addr(remote_addr) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -264,7 +264,7 @@ int WorldSocket::open (void *a) // Register with ACE Reactor if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -300,14 +300,14 @@ int WorldSocket::handle_input (ACE_HANDLE) return Update(); // interesting line, isn't it ? } - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); errno = ECONNRESET; return -1; } case 0: { - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer has closed connection"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer has closed connection"); errno = ECONNRESET; return -1; @@ -376,7 +376,7 @@ int WorldSocket::handle_output_queue (GuardType& g) if (msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue dequeue_head"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue dequeue_head"); return -1; } @@ -411,7 +411,7 @@ int WorldSocket::handle_output_queue (GuardType& g) if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue enqueue_head"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue enqueue_head"); mblk->release(); return -1; } @@ -483,7 +483,7 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 0xFFFF && (header.cmd >> 16) != 0x4C52)) // LR (from MSG_VERIFY_CONNECTIVITY) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", m_Session ? m_Session->GetAccountId() : 0, _player ? _player->GetGUIDLow() : 0, _player ? _player->GetName() : "", @@ -589,7 +589,7 @@ int WorldSocket::handle_input_missing_data (void) // hope this is not hack, as proper m_RecvWPct is asserted around if (!m_RecvWPct) { - sLog->outError(LOG_FILTER_GENERAL, "Forcing close on input m_RecvWPct = NULL"); + sLog->outError(LOG_FILTER_NETWORKIO, "Forcing close on input m_RecvWPct = NULL"); errno = EINVAL; return -1; } @@ -635,7 +635,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g) (this, ACE_Event_Handler::WRITE_MASK) == -1) { // would be good to store errno from reactor with errno guard - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::cancel_wakeup_output"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::cancel_wakeup_output"); return -1; } @@ -654,7 +654,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g) if (reactor()->schedule_wakeup (this, ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::schedule_wakeup_output"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::schedule_wakeup_output"); return -1; } @@ -668,7 +668,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) // manage memory ;) ACE_Auto_Ptr aptr(new_pct); - const ACE_UINT16 opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); + Opcodes opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); if (closing_) return -1; @@ -677,7 +677,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) if (sPacketLog->CanLogPacket()) sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER); - sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s 0x%.4X (%u)", LookupOpcodeName(Opcodes(opcode)), uint32(Opcodes(opcode)), uint32(Opcodes(opcode))); + char const* opcodeName = GetOpcodeNameForLogging(opcode).c_str(); + sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s", opcodeName); try { @@ -688,26 +689,26 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) case CMSG_AUTH_SESSION: if (m_Session) { - sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", m_Session->GetPlayerName(false).c_str()); return -1; } sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return HandleAuthSession(*new_pct); case CMSG_KEEP_ALIVE: - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", GetOpcodeNameForLogging(opcode).c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; case CMSG_LOG_DISCONNECT: new_pct->rfinish(); // contains uint32 disconnectReason; - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; // not an opcode, client sends string "WORLD OF WARCRAFT CONNECTION - CLIENT TO SERVER" without opcode // first 4 bytes become the opcode (2 dropped) case MSG_VERIFY_CONNECTIVITY: { - sLog->outInfo(LOG_FILTER_NETWORKIO, "MSG_VERIFY_CONNECTIVITY , size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); std::string str; *new_pct >> str; @@ -717,48 +718,43 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) } case CMSG_ENABLE_NAGLE: { + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return m_Session ? m_Session->HandleEnableNagleAlgorithm() : -1; } default: { ACE_GUARD_RETURN(LockType, Guard, m_SessionLock, -1); - if (!opcodeTable[Opcodes(opcode)]) + if (!m_Session) { - sLog->outError(LOG_FILTER_NETWORKIO, "Opcode with no defined handler received from client: %u", new_pct->GetOpcode()); - return 0; - } - if (m_Session != NULL) - { - // Our Idle timer will reset on any non PING opcodes. - // Catches people idling on the login screen and any lingering ingame connections. - m_Session->ResetTimeOutTime(); - - // OK, give the packet to WorldSession - aptr.release(); - // WARNINIG here we call it with locks held. - // Its possible to cause deadlock if QueuePacket calls back - m_Session->QueuePacket(new_pct); - return 0; + sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + return -1; } - else + + if (!opcodeTable[opcode]) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } + + // Our Idle timer will reset on any non PING opcodes. + // Catches people idling on the login screen and any lingering ingame connections. + m_Session->ResetTimeOutTime(); + + // OK, give the packet to WorldSession + aptr.release(); + // WARNINIG here we call it with locks held. + // Its possible to cause deadlock if QueuePacket calls back + m_Session->QueuePacket(new_pct); + return 0; } } } catch (ByteBufferException &) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", - opcode, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_DEBUG)) - { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); - new_pct->hexlike(); - } - + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", + opcodeName, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); + new_pct->hexlike(); return -1; } @@ -840,7 +836,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_REJECT); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } @@ -861,7 +857,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); return -1; } @@ -872,7 +868,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (expansion > world_expansion) expansion = world_expansion; - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", fields[5].GetCString(), fields[4].GetCString()); @@ -887,7 +883,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_FAILED); SendPacket(packet); - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); return -1; } } @@ -953,7 +949,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_BANNED); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); return -1; } @@ -969,7 +965,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); - sLog->outInfo(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); + sLog->outInfo(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); return -1; } @@ -994,11 +990,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_FAILED); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); return -1; } - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); @@ -1073,12 +1069,8 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity())) { - Player* _player = m_Session->GetPlayer(); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)", - m_Session->GetAccountId(), - _player ? _player->GetGUIDLow() : 0, - _player ? _player->GetName() : "", - GetRemoteAddress().c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)", + m_Session->GetPlayerName(false).c_str(), GetRemoteAddress().c_str()); return -1; } @@ -1096,7 +1088,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) m_Session->SetLatency (latency); else { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: peer sent CMSG_PING, " + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: peer sent CMSG_PING, " "but is not authenticated or got recently kicked, " " address = %s", GetRemoteAddress().c_str()); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e9c498392ee..be18785e76e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4923,7 +4923,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool { if (Battleground* bg = target->ToPlayer()->GetBattleground()) bg->RemovePlayerFromResurrectQueue(target->GetGUID()); - if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId())) + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId())) bf->RemovePlayerFromResurrectQueue(target->GetGUID()); } break; @@ -4962,6 +4962,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this); break; case 58600: // Restricted Flight Area + case 58730: // Restricted Flight Area if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) target->CastSpell(target, 58601, true); break; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 46f735d26f1..ed8a4252128 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5439,8 +5439,8 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive()) { Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId()); - if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId())) - if (pArea->flags & AREA_FLAG_NO_FLY_ZONE) + if (AreaTableEntry const* area = GetAreaEntryByAreaID(m_originalCaster->GetAreaId())) + if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn())) return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index d1af1832ce4..be5d4e3fa74 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5928,6 +5928,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex) case 58730: // Restricted Flight Area case 58600: // Restricted Flight Area unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); + unitTarget->PlayDirectSound(9417); // Fel Reaver sound break; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4cc72cc3660..03824cf7dc9 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3249,6 +3249,22 @@ void SpellMgr::LoadDbcDataCorrections() // this needs research on modifier applying rules, does not seem to be in Attributes fields spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000); break; + case 64949: // Idol of the Flourishing Life + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; + case 34231: // Libram of the Lightbringer + case 60792: // Libram of Tolerance + case 64956: // Libram of the Resolute + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; + case 28851: // Libram of Light + case 28853: // Libram of Divinity + case 32403: // Blessed Book of Nagrand + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; case 45602: // Ride Carpet spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 06f11cfaa2c..d651fbd4ce1 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -105,9 +105,8 @@ void Warden::Update() // Kick player if client response delays more than set in config if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS) { - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), - secsToTimeString(maxClientResponseDelay, true).c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s (latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client", + _session->GetPlayerName(false).c_str(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), secsToTimeString(maxClientResponseDelay, true).c_str()); _session->KickPlayer(); } else diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 96b71912421..9c90662105a 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -152,9 +152,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0) { - sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 7aea6794e01..20f09ec5bda 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -156,9 +156,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { - sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -343,9 +341,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) { buff.rpos(buff.wpos()); - sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed checksum. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -356,9 +352,7 @@ void WardenWin::HandleData(ByteBuffer &buff) // TODO: test it. if (result == 0x00) { - sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed timing check. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -500,9 +494,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (checkFailed > 0) { WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed); - - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed Warden check %u. Action: %s", _session->GetPlayerName(false).c_str(), checkFailed, Penalty(check).c_str()); } // Set hold off timer, minimum timer should at least be 1 second diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 273820d02ff..e7c140c01b8 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1720,7 +1720,7 @@ void World::SetInitialWorldSettings() sOutdoorPvPMgr->InitOutdoorPvP(); ///- Initialize Battlefield - sLog->outInfo(LOG_FILTER_GENERAL, "Starting Battlefield System"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battlefield System"); sBattlefieldMgr->InitBattlefield(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transports..."); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index bd439c2c473..d5ebeab3b8a 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -13,6 +13,7 @@ set(scripts_STAT_SRCS Commands/cs_account.cpp Commands/cs_achievement.cpp Commands/cs_ban.cpp + Commands/cs_bf.cpp Commands/cs_cast.cpp Commands/cs_character.cpp Commands/cs_debug.cpp diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index b84a7e5544a..bfb52d342e1 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -107,7 +107,7 @@ public: return false; } - switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "")) + switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "")) { case BAN_SUCCESS: { @@ -183,7 +183,7 @@ public: break; } - switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "")) + switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "")) { case BAN_SUCCESS: if (atoi(durationStr) > 0) diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 2472a29e595..7e489a5781e 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -38,6 +38,7 @@ public: { "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "", NULL }, { "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL }, + { "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -77,7 +78,7 @@ public: // check item starting quest (it can work incorrectly if added without item in inventory) ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore(); - ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); + ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); if (result != itc->end()) { @@ -244,6 +245,38 @@ public: player->CompleteQuest(entry); return true; } + + static bool HandleQuestReward(ChatHandler* handler, char const* args) + { + Player* player = handler->getSelectedPlayer(); + if (!player) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + // .quest reward #entry + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); + if (!cId) + return false; + + uint32 entry = atol(cId); + + Quest const* quest = sObjectMgr->GetQuestTemplate(entry); + + // If player doesn't have the quest + if (!quest || player->GetQuestStatus(entry) != QUEST_STATUS_COMPLETE) + { + handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry); + handler->SetSentErrorMessage(true); + return false; + } + + player->RewardQuest(quest, 0, player); + return true; + } }; void AddSC_quest_commandscript() diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 1019deac106..89fdcc7f725 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -207,7 +207,7 @@ public: { if (!m_bIntro) { - DoScriptText(SAY_INTRO, me); + Talk(SAY_INTRO); m_bIntro = false; } } @@ -225,7 +225,7 @@ public: void JustDied(Unit* /*killer*/) { Summons.DespawnAll(); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(TYPE_ANUBARAK, DONE); } @@ -242,7 +242,7 @@ public: break; case NPC_SPIKE: summoned->CombatStart(target); - DoScriptText(EMOTE_SPIKE, me, target); + Talk(EMOTE_SPIKE, target->GetGUID()); break; } Summons.Summon(summoned); @@ -260,7 +260,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetInCombatWithZone(); if (instance) @@ -405,8 +405,8 @@ public: { m_bReachedPhase3 = true; DoCastAOE(SPELL_LEECHING_SWARM); - DoScriptText(EMOTE_LEECHING_SWARM, me); - DoScriptText(SAY_LEECHING_SWARM, me); + Talk(EMOTE_LEECHING_SWARM); + Talk(SAY_LEECHING_SWARM); } if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK)) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index f9e2080895a..10f7150351e 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -161,7 +161,7 @@ public: void JustDied(Unit* /*killer*/) { Summons.DespawnAll(); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(TYPE_JARAXXUS, DONE); } @@ -176,7 +176,7 @@ public: me->SetInCombatWithZone(); if (instance) instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 uiDiff) @@ -186,8 +186,8 @@ public: if (m_uiSummonInfernalEruptionTimer <= uiDiff) { - DoScriptText(EMOTE_INFERNAL_ERUPTION, me); - DoScriptText(SAY_INFERNAL_ERUPTION, me); + Talk(EMOTE_INFERNAL_ERUPTION); + Talk(SAY_INFERNAL_ERUPTION); DoCast(SPELL_INFERNAL_ERUPTION); m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS; } else m_uiSummonInfernalEruptionTimer -= uiDiff; @@ -217,8 +217,8 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { - DoScriptText(EMOTE_INCINERATE, me, target); - DoScriptText(SAY_INCINERATE, me); + Talk(EMOTE_INCINERATE, target->GetGUID()); + Talk(SAY_INCINERATE); DoCast(target, SPELL_INCINERATE_FLESH); } m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS); @@ -234,7 +234,7 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { - DoScriptText(EMOTE_LEGION_FLAME, me, target); + Talk(EMOTE_LEGION_FLAME, target->GetGUID()); DoCast(target, SPELL_LEGION_FLAME); } m_uiLegionFlameTimer = 30*IN_MILLISECONDS; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index db9bc3581ea..88e0fe5ba66 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -905,6 +905,8 @@ public: if (m_uiMassiveCrashTimer <= diff) { me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room + SetCombatMovement(false); + me->AttackStop(); m_uiStage = 7; //Invalid (Do nothing more than move) m_uiMassiveCrashTimer = 30*IN_MILLISECONDS; } else m_uiMassiveCrashTimer -= diff; @@ -913,22 +915,28 @@ public: break; case 1: DoCastAOE(SPELL_MASSIVE_CRASH); + me->StopMoving(); + me->AttackStop(); m_uiStage = 2; break; case 2: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) { + me->StopMoving(); + me->AttackStop(); m_uiTrampleTargetGUID = target->GetGUID(); me->SetTarget(m_uiTrampleTargetGUID); m_bTrampleCasted = false; - SetCombatMovement(false); - me->GetMotionMaster()->MoveIdle(); + //SetCombatMovement(false); + //me->GetMotionMaster()->MoveIdle(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_uiTrampleTimer = 4*IN_MILLISECONDS; m_uiStage = 3; } else m_uiStage = 6; break; case 3: + me->StopMoving(); + me->AttackStop(); if (m_uiTrampleTimer <= diff) { if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID)) @@ -941,12 +949,14 @@ public: me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX, 2*me->GetPositionY()-m_fTrampleTargetY, me->GetPositionZ(), - 10.0f, 20.0f); // 2: Hop Backwards + 20.0f, 30.0f); // 2: Hop Backwards m_uiStage = 7; //Invalid (Do nothing more than move) } else m_uiStage = 6; } else m_uiTrampleTimer -= diff; break; case 4: + me->StopMoving(); + me->AttackStop(); Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID); me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1); me->SetTarget(0); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 203e49420be..a65eaebbc0c 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -254,7 +254,7 @@ struct boss_twin_baseAI : public ScriptedAI void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) { if (Creature* pSister = GetSister()) @@ -296,7 +296,7 @@ struct boss_twin_baseAI : public ScriptedAI instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); } - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(me, m_uiSurgeSpellId); } @@ -384,7 +384,7 @@ struct boss_twin_baseAI : public ScriptedAI if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff) { DoCast(me, SPELL_BERSERK); - DoScriptText(SAY_BERSERK, me); + Talk(SAY_BERSERK); m_bIsBerserk = true; } else diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 3fb76ea52dc..9767126371b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -244,10 +244,18 @@ class instance_trial_of_the_crusader : public InstanceMapScript switch (type) { case TYPE_JARAXXUS: + // Cleanup Icehowl + if (Creature* icehowl = instance->GetCreature(IcehowlGUID)) + icehowl->DespawnOrUnsummon(); if (data == DONE) EventStage = 2000; break; case TYPE_CRUSADERS: + // Cleanup Jaraxxus + if (Creature* jaraxxus = instance->GetCreature(JaraxxusGUID)) + jaraxxus->DespawnOrUnsummon(); + if (Creature* fizzlebang = instance->GetCreature(FizzlebangGUID)) + fizzlebang->DespawnOrUnsummon(); switch (data) { case IN_PROGRESS: @@ -267,6 +275,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript } break; case TYPE_VALKIRIES: + // Cleanup chest + if (GameObject* cache = instance->GetGameObject(CrusadersCacheGUID)) + cache->Delete(); switch (data) { case FAIL: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 7064368f090..37d08484f0b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -789,7 +789,7 @@ class npc_tirion_toc : public CreatureScript case 5005: m_uiUpdateTimer = 8000; instance->SetData(TYPE_EVENT, 5010); - me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5); + me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5); break; case 5020: Talk(SAY_STAGE_4_03); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index f361c3521d1..ba230551b24 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -53,8 +53,8 @@ const Position ToCCommonLoc[]= {563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center {573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right {553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left - {585.5f, 170.0f, 395.14f, 0}, // 8 Move 1 Right - {545.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left + {573.0f, 170.0f, 395.14f, 0}, // 8 Move 1 Right + {555.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left {563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door {575.042358f, 195.260727f, 395.137146f, 0}, // 5 diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp index 37994e40b63..fc967acf9e2 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -139,7 +139,7 @@ class npc_wg_demolisher_engineer : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender */, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->CLOSE_GOSSIP_MENU(); @@ -207,7 +207,7 @@ class npc_wg_spirit_guide : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 action) + bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender */ , uint32 action) { player->CLOSE_GOSSIP_MENU(); @@ -225,17 +225,16 @@ class npc_wg_spirit_guide : public CreatureScript struct npc_wg_spirit_guideAI : public ScriptedAI { - npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) - { } + npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(const uint32 /* diff */) + void UpdateAI(uint32 const /*diff*/) { if (!me->HasUnitState(UNIT_STATE_CASTING)) DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL); } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_wg_spirit_guideAI(creature); } @@ -258,7 +257,7 @@ class npc_wg_queue : public CreatureScript if (wintergrasp->IsWarTime()) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID()); + player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID()); } else { @@ -275,7 +274,7 @@ class npc_wg_queue : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 /*action*/) + bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); @@ -302,9 +301,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript struct go_wg_vehicle_teleporterAI : public GameObjectAI { - go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), - _checkTimer(1000) - { } + go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), _checkTimer(1000) { } void UpdateAI(uint32 diff) { @@ -324,6 +321,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript } else _checkTimer -= diff; } + private: uint32 _checkTimer; }; @@ -358,12 +356,12 @@ class npc_wg_quest_giver : public CreatureScript for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) { - uint32 quest_id = i->second; - QuestStatus status = player->GetQuestStatus(quest_id); + uint32 questId = i->second; + QuestStatus status = player->GetQuestStatus(questId); if (status == QUEST_STATUS_COMPLETE) - qm.AddMenuItem(quest_id, 4); + qm.AddMenuItem(questId, 4); else if (status == QUEST_STATUS_INCOMPLETE) - qm.AddMenuItem(quest_id, 4); + qm.AddMenuItem(questId, 4); //else if (status == QUEST_STATUS_AVAILABLE) // qm.AddMenuItem(quest_id, 2); } @@ -549,17 +547,14 @@ public: } }; - - void AddSC_wintergrasp() { new npc_wg_queue(); new npc_wg_spirit_guide(); new npc_wg_demolisher_engineer(); + new go_wg_vehicle_teleporter(); new npc_wg_quest_giver(); - new achievement_wg_didnt_stand_a_chance(); new spell_wintergrasp_force_building(); new spell_wintergrasp_grab_passenger(); - - new go_wg_vehicle_teleporter(); + new achievement_wg_didnt_stand_a_chance(); } diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 48e07c727b4..7587a9d1904 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -240,7 +240,7 @@ int Master::Run() if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false)) { TCSoapRunnable* runnable = new TCSoapRunnable(); - runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), ConfigMgr::GetIntDefault("SOAP.Port", 7878)); + runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878))); soap_thread = new ACE_Based::Thread(runnable); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 28bd8aecaf3..fbd45bec8e1 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -20,6 +20,7 @@ # SERVER RATES # AUTO BROADCAST # BATTLEGROUND CONFIG +# BATTLEFIELD CONFIG # ARENA CONFIG # NETWORK CONFIG # CONSOLE AND REMOTE ACCESS @@ -2183,6 +2184,62 @@ Battleground.Random.ResetHour = 6 # ################################################################################################### +################################################################################################### +# BATTLEFIELD CONFIG +# +# Wintergrasp.Enable +# Description: Enable the Wintergrasp battlefield. +# Default: 0 - (Disabled) +# 1 - (Enabled, Experimental as of still being in development) + +Wintergrasp.Enable = 0 + +# +# Wintergrasp.PlayerMax +# Description: Maximum number of players allowed in Wintergrasp. +# Default: 100 + +Wintergrasp.PlayerMax = 100 + +# +# Wintergrasp.PlayerMin +# Description: Minimum number of players required for Wintergrasp. +# Default: 0 + +Wintergrasp.PlayerMin = 0 + +# +# Wintergrasp.PlayerMinLvl +# Description: Required character level for the Wintergrasp battle. +# Default: 77 + +Wintergrasp.PlayerMinLvl = 77 + +# +# Wintergrasp.BattleTimer +# Description: Time (in minutes) for the Wintergrasp battle to last. +# Default: 30 + +Wintergrasp.BattleTimer = 30 + +# +# Wintergrasp.NoBattleTimer +# Description: Time (in minutes) between Wintergrasp battles. +# Default: 150 + +Wintergrasp.NoBattleTimer = 150 + +# +# Wintergrasp.CrashRestartTimer +# Description: Time (in minutes) to delay the restart of Wintergrasp if the world server +# crashed during a running battle. +# Default: 10 + +Wintergrasp.CrashRestartTimer = 10 + +# +################################################################################################### + ################################################################################################### # ARENA CONFIG # @@ -2651,7 +2708,7 @@ Appender.GM=2,2,0,GM.log Appender.DBErrors=2,2,0,DBErrors.log Appender.Char=2,2,0,Char.log,w Appender.RA=2,2,0,RA.log -Appender.Warden=2,2,0,Warden.log +Appender.Warden=2,4,0,Warden.log Appender.Chat=2,2,0,Chat.log Appender.CharDump=2,2,0,%s.log Appender.Arenas=2,2,0,Arena.log @@ -2735,7 +2792,7 @@ Logger.Chat=22,3,Chat Logger.DBErrors=26,5,Console Server DBErrors Logger.GM=27,3,Console Server GM Logger.RA=28,3,RA -Logger.Warden=29,3,Warden +Logger.Warden=29,4,Warden Logger.WorldServer=31,3,Console Server Logger.Character=34,3,Char Logger.Arenas=35,3,Arenas @@ -2743,6 +2800,7 @@ Logger.SQLDriver=36,5,SQLDriver Logger.SQLDev=37,3,SQLDev Logger.CharDump=38,3,CharDump Logger.Load=40,3,Console Server +Logger.Opcodes=41,6,Console Server # # Loggers @@ -2750,4 +2808,4 @@ Logger.Load=40,3,Console Server # (Using spaces as separator). # Default: "Root Chat DBErrors GM RA Warden Character Load" -Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer +Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer Opcodes -- cgit v1.2.3 From a3a667460aafbd96688359fc358cb1272908720c Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 10:37:27 +0100 Subject: Core/Achievement: Do not expose AchivementCriteriaData to ScriptMgr --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.cpp | 4 ++-- src/server/game/Scripting/ScriptMgr.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 436d3851d43..d6b6c928ebb 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -316,7 +316,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; return target->getGender() == gender.gender; case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: - return sScriptMgr->OnCriteriaCheck(this, const_cast(source), const_cast(target)); + return sScriptMgr->OnCriteriaCheck(ScriptId, source, target); case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM: diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 6c8d651a5a0..93dae4c63f2 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1186,12 +1186,12 @@ void ScriptMgr::OnShutdown() FOREACH_SCRIPT(WorldScript)->OnShutdown(); } -bool ScriptMgr::OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target) +bool ScriptMgr::OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target) { ASSERT(source); // target can be NULL. - GET_SCRIPT_RET(AchievementCriteriaScript, data->ScriptId, tmpscript, false); + GET_SCRIPT_RET(AchievementCriteriaScript, scriptId, tmpscript, false); return tmpscript->OnCheck(source, target); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 80439b4e556..b245039dc92 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -61,7 +61,6 @@ class WorldPacket; class WorldSocket; class WorldObject; -struct AchievementCriteriaData; struct AuctionEntry; struct ConditionSourceInfo; struct Condition; @@ -980,7 +979,7 @@ class ScriptMgr public: /* AchievementCriteriaScript */ - bool OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target); + bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target); public: /* PlayerScript */ -- cgit v1.2.3