diff options
Diffstat (limited to 'src/server/game/Events/GameEventMgr.cpp')
-rwxr-xr-x | src/server/game/Events/GameEventMgr.cpp | 217 |
1 files changed, 97 insertions, 120 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index a8492726e75..bead65bbfdd 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -210,8 +210,8 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); - sLog->outString(); + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 game events. DB table `game_event` is empty."); + return; } @@ -223,7 +223,7 @@ void GameEventMgr::LoadFromDB() uint8 event_id = fields[0].GetUInt8(); if (event_id == 0) { - sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event entry 0 is reserved and can't be used."); continue; } @@ -241,7 +241,7 @@ void GameEventMgr::LoadFromDB() if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check { - sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id); continue; } @@ -249,7 +249,7 @@ void GameEventMgr::LoadFromDB() { if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) { - sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id); + sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id); pGameEvent.holiday_id = HOLIDAY_NONE; } } @@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } - sLog->outString("Loading Game Event Saves Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Saves Data..."); { uint32 oldMSTime = getMSTime(); @@ -273,8 +273,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + } else { @@ -287,7 +287,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id); continue; } @@ -298,7 +298,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u", event_id); + sLog->outError(LOG_FILTER_SQL, "game_event_save includes event save for non-worldevent id %u", event_id); continue; } @@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Prerequisite Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Prerequisite Data..."); { uint32 oldMSTime = getMSTime(); @@ -319,8 +319,8 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { - sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + } else { @@ -333,7 +333,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -342,14 +342,14 @@ void GameEventMgr::LoadFromDB() uint16 prerequisite_event = fields[1].GetUInt32(); if (prerequisite_event >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); + sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); continue; } mGameEvent[event_id].prerequisite_events.insert(prerequisite_event); } else { - sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u", event_id); + sLog->outError(LOG_FILTER_SQL, "game_event_prerequisiste includes event entry for non-worldevent id %u", event_id); continue; } @@ -357,12 +357,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event Creature Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Creature Data..."); { uint32 oldMSTime = getMSTime(); @@ -372,8 +372,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + } else { @@ -389,7 +389,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } } - sLog->outString("Loading Game Event GO Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Data..."); { uint32 oldMSTime = getMSTime(); @@ -415,8 +415,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + } else { @@ -432,7 +432,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -443,12 +443,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); } else { @@ -473,7 +471,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventModelEquip.size()) { - sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -488,7 +486,7 @@ void GameEventMgr::LoadFromDB() { if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id)) { - sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", + sLog->outError(LOG_FILTER_SQL, "Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id); continue; } @@ -500,12 +498,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); } else { @@ -530,7 +526,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventCreatureQuests.size()) { - sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -541,12 +537,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); } else { @@ -571,7 +565,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventGameObjectQuests.size()) { - sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -582,12 +576,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); } else { @@ -613,7 +605,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -625,12 +617,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); } else { @@ -654,7 +644,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -667,12 +657,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); } else { @@ -696,7 +684,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -707,7 +695,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition); + sLog->outError(LOG_FILTER_SQL, "game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition); continue; } @@ -715,12 +703,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); } else { @@ -745,7 +731,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -755,12 +741,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("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->outString(">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); } else { @@ -784,13 +768,13 @@ void GameEventMgr::LoadFromDB() if (!sObjectMgr->GetQuestTemplate(questId)) { - sLog->outErrorDb("`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId); + sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId); continue; } if (eventEntry >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry); + sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry); continue; } @@ -799,12 +783,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("Loading Game Event Vendor Additions Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Vendor Additions Data..."); { uint32 oldMSTime = getMSTime(); @@ -813,8 +796,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); } else { @@ -827,7 +809,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventVendors.size()) { - sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -865,12 +847,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("Loading Game Event Battleground Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Battleground Data..."); { uint32 oldMSTime = getMSTime(); @@ -879,8 +860,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); } else { @@ -893,7 +873,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -903,12 +883,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outString("Loading Game Event Pool Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Pool Data..."); { uint32 oldMSTime = getMSTime(); @@ -918,8 +897,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); } else { @@ -935,13 +913,13 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id); + sLog->outError(LOG_FILTER_SQL, "`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } if (!sPoolMgr->CheckPool(entry)) { - sLog->outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry); + sLog->outError(LOG_FILTER_SQL, "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry); continue; } @@ -952,8 +930,7 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } } @@ -1015,7 +992,7 @@ void GameEventMgr::StartArenaSeason() if (!result) { - sLog->outError("ArenaSeason (%u) must be an existant Arena Season", season); + sLog->outError(LOG_FILTER_GAMEEVENTS, "ArenaSeason (%u) must be an existant Arena Season", season); return; } @@ -1024,13 +1001,13 @@ void GameEventMgr::StartArenaSeason() if (eventId >= mGameEvent.size()) { - sLog->outError("EventEntry %u for ArenaSeason (%u) does not exists", eventId, season); + sLog->outError(LOG_FILTER_GAMEEVENTS, "EventEntry %u for ArenaSeason (%u) does not exists", eventId, season); return; } StartEvent(eventId, true); - sLog->outString("Arena Season %u started...", season); - sLog->outString(); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Arena Season %u started...", season); + } uint32 GameEventMgr::Update() // return the next event delay in ms @@ -1043,7 +1020,7 @@ uint32 GameEventMgr::Update() // return the next e { // must do the activating first, and after that the deactivating // so first queue it - //sLog->outErrorDb("Checking event %u", itr); + //sLog->outError(LOG_FILTER_SQL, "Checking event %u", itr); if (CheckOneGameEvent(itr)) { // if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so @@ -1099,13 +1076,13 @@ uint32 GameEventMgr::Update() // return the next e nextEventDelay = 0; for (std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); - sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Next game event check in %u seconds.", nextEventDelay + 1); return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call } void GameEventMgr::UnApplyEvent(uint16 event_id) { - sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, false); // un-spawn positive event tagged objects @@ -1124,8 +1101,6 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) UpdateEventNPCVendor(event_id, false); // update bg holiday UpdateBattlegroundSettings(); - // check for seasonal quest reset. - sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::ApplyNewEvent(uint16 event_id) @@ -1139,7 +1114,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) break; } - sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, true); @@ -1160,6 +1135,8 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) UpdateEventNPCVendor(event_id, true); // update bg holiday UpdateBattlegroundSettings(); + // check for seasonal quest reset. + sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) @@ -1211,7 +1188,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1238,7 +1215,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1271,7 +1248,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1286,7 +1263,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1308,7 +1285,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1329,7 +1306,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) } if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); + sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } |