diff options
Diffstat (limited to 'src/server/game/Events/GameEventMgr.cpp')
-rwxr-xr-x | src/server/game/Events/GameEventMgr.cpp | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 407e816f7e2..d7e5007cae3 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -153,7 +153,7 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite) // this update is needed to possibly start events dependent on the started one // or to scedule another update where the next event will be started if (overwrite && conditions_met) - sWorld.ForceGameEventUpdate(); + sWorld->ForceGameEventUpdate(); return conditions_met; } @@ -198,8 +198,8 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event"); if (!result) { - sLog.outString(">> Loaded 0 weather definitions. DB table `game_event` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 weather definitions. DB table `game_event` is empty."); + sLog->outString(); return; } @@ -213,8 +213,8 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - sLog.outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); + sLog->outString(); return; } @@ -228,7 +228,7 @@ void GameEventMgr::LoadFromDB() uint16 event_id = fields[0].GetUInt16(); if (event_id == 0) { - sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); + sLog->outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); continue; } @@ -246,7 +246,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->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id); continue; } @@ -254,7 +254,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->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); pGameEvent.holiday_id = HOLIDAY_NONE; } } @@ -263,12 +263,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); // load game event saves - sLog.outString("Loading Game Event Saves Data..."); + sLog->outString("Loading Game Event Saves Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -276,8 +276,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->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + sLog->outString(); } else { @@ -291,7 +291,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog.outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -302,7 +302,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog.outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id); + sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id); continue; } @@ -310,20 +310,20 @@ 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->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // load game event links (prerequisites) - sLog.outString("Loading Game Event Prerequisite Data..."); + sLog->outString("Loading Game Event Prerequisite Data..."); oldMSTime = getMSTime(); result = WorldDatabase.Query("SELECT event_id, 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->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + sLog->outString(); } else { @@ -337,7 +337,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->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -346,14 +346,14 @@ void GameEventMgr::LoadFromDB() uint16 prerequisite_event = fields[1].GetUInt16(); 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->outErrorDb("`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->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u",event_id); continue; } @@ -361,13 +361,13 @@ 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->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Creatures - sLog.outString("Loading Game Event Creature Data..."); + sLog->outString("Loading Game Event Creature Data..."); oldMSTime = getMSTime(); mGameEventCreatureGuids.resize(mGameEvent.size()*2-1); @@ -377,8 +377,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); - sLog.outString(); + sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + sLog->outString(); } else { @@ -395,7 +395,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->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -405,13 +405,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Gameobjects - sLog.outString("Loading Game Event GO Data..."); + sLog->outString("Loading Game Event GO Data..."); oldMSTime = getMSTime(); mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1); @@ -421,8 +421,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + sLog->outString(); } else { @@ -439,7 +439,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->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -449,13 +449,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Model/Equipment Changes - sLog.outString("Loading Game Event Model/Equipment Change Data..."); + sLog->outString("Loading Game Event Model/Equipment Change Data..."); oldMSTime = getMSTime(); mGameEventModelEquip.resize(mGameEvent.size()); @@ -467,8 +467,8 @@ 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->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); + sLog->outString(); } else { @@ -482,7 +482,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->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -498,7 +498,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.", guid, 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.", guid, newModelEquipSet.equipment_id); continue; } } @@ -507,13 +507,13 @@ 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->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Quests - sLog.outString("Loading Game Event Quest Data..."); + sLog->outString("Loading Game Event Quest Data..."); oldMSTime = getMSTime(); mGameEventCreatureQuests.resize(mGameEvent.size()); @@ -522,8 +522,8 @@ 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->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); + sLog->outString(); } else { @@ -538,7 +538,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->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -548,13 +548,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // GO Quests - sLog.outString("Loading Game Event GO Quest Data..."); + sLog->outString("Loading Game Event GO Quest Data..."); oldMSTime = getMSTime(); mGameEventGameObjectQuests.resize(mGameEvent.size()); @@ -563,8 +563,8 @@ 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->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); + sLog->outString(); } else { @@ -579,7 +579,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->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -589,22 +589,22 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load quest to (event,condition) mapping // 0 1 2 3 - sLog.outString("Loading Game Event Quest Condition Data..."); + sLog->outString("Loading Game Event Quest Condition Data..."); oldMSTime = getMSTime(); result = WorldDatabase.Query("SELECT quest, event_id, condition_id, num FROM game_event_quest_condition"); if (!result) { - sLog.outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); + sLog->outString(); } else { @@ -620,7 +620,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->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -631,13 +631,13 @@ 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->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load conditions for events - sLog.outString("Loading Game Event Condition Data..."); + sLog->outString("Loading Game Event Condition Data..."); oldMSTime = getMSTime(); // 0 1 2 3 4 @@ -645,8 +645,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); + sLog->outString(); } else { @@ -660,7 +660,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->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -673,13 +673,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load condition saves - sLog.outString("Loading Game Event Condition Save Data..."); + sLog->outString("Loading Game Event Condition Save Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -687,8 +687,8 @@ 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->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); + sLog->outString(); } else { @@ -702,7 +702,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->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -713,7 +713,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->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition); continue; } @@ -721,13 +721,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event npcflag - sLog.outString("Loading Game Event NPCflag Data..."); + sLog->outString("Loading Game Event NPCflag Data..."); oldMSTime = getMSTime(); mGameEventNPCFlags.resize(mGameEvent.size()); @@ -737,8 +737,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); + sLog->outString(); } else { @@ -753,7 +753,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->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -763,13 +763,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event vendors - sLog.outString("Loading Game Event Vendor Additions Data..."); + sLog->outString("Loading Game Event Vendor Additions Data..."); oldMSTime = getMSTime(); mGameEventVendors.resize(mGameEvent.size()); @@ -779,8 +779,8 @@ 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->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + sLog->outString(); } else { @@ -793,7 +793,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->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -829,13 +829,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event npc gossip ids - sLog.outString("Loading Game Event NPC Gossip Data..."); + sLog->outString("Loading Game Event NPC Gossip Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -843,8 +843,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 npc gossip textids in game events. DB table `game_event_npc_gossip` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 npc gossip textids in game events. DB table `game_event_npc_gossip` is empty."); + sLog->outString(); } else { @@ -859,7 +859,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog.outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -869,13 +869,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u npc gossip textids in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u npc gossip textids in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event battleground flags - sLog.outString("Loading Game Event Battleground Data..."); + sLog->outString("Loading Game Event Battleground Data..."); oldMSTime = getMSTime(); // set all flags to 0 @@ -886,8 +886,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); + sLog->outString(); } else { @@ -901,7 +901,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->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -911,15 +911,15 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } //////////////////////// // GameEventPool //////////////////////// - sLog.outString("Loading Game Event Pool Data..."); + sLog->outString("Loading Game Event Pool Data..."); oldMSTime = getMSTime(); mGameEventPoolIds.resize(mGameEvent.size()*2-1); @@ -930,8 +930,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); + sLog->outString(); } else { @@ -948,13 +948,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->outErrorDb("`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->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); continue; } @@ -964,8 +964,8 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -1005,11 +1005,11 @@ uint32 GameEventMgr::Initialize() // return the next e void GameEventMgr::StartArenaSeason() { - QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); + QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); if (!result) { - sLog.outError("ArenaSeason (%i) must be an existant Arena Season",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); + sLog->outError("ArenaSeason (%i) must be an existant Arena Season",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); return; } @@ -1018,8 +1018,8 @@ void GameEventMgr::StartArenaSeason() uint16 eventId = fields[0].GetUInt16(); StartEvent(eventId,true); - sLog.outString("Arena Season %i started...",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); - sLog.outString(); + sLog->outString("Arena Season %i started...",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + sLog->outString(); } uint32 GameEventMgr::Update() // return the next event delay in ms @@ -1032,7 +1032,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->outErrorDb("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 @@ -1053,14 +1053,14 @@ uint32 GameEventMgr::Update() // return the next e // changed, save to DB the gameevent state, will be updated in next update cycle SaveWorldEventStateToDB(itr); - //sLog.outDebug("GameEvent %u is active",itr->first); + //sLog->outDebug("GameEvent %u is active",itr->first); // queue for activation if (!IsActiveEvent(itr)) activate.insert(itr); } else { - //sLog.outDebug("GameEvent %u is not active",itr->first); + //sLog->outDebug("GameEvent %u is not active",itr->first); if (IsActiveEvent(itr)) deactivate.insert(itr); else @@ -1088,13 +1088,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->outDetail("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->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); // un-spawn positive event tagged objects GameEventUnspawn(event_id); // spawn negative event tagget objects @@ -1115,16 +1115,16 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) void GameEventMgr::ApplyNewEvent(uint16 event_id) { - switch(sWorld.getIntConfig(CONFIG_EVENT_ANNOUNCE)) + switch(sWorld->getIntConfig(CONFIG_EVENT_ANNOUNCE)) { case 0: // disable break; case 1: // announce events - sWorld.SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); + sWorld->SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); break; } - sLog.outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); // spawn positive event tagget objects GameEventSpawn(event_id); @@ -1193,7 +1193,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1211,7 +1211,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog.outDebug("Spawning creature %u",*itr); + //sLog->outDebug("Spawning creature %u",*itr); if (!pCreature->LoadFromDB(*itr, map)) delete pCreature; else @@ -1222,7 +1222,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1240,7 +1240,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { GameObject* pGameobject = new GameObject; - //sLog.outDebug("Spawning gameobject %u", *itr); + //sLog->outDebug("Spawning gameobject %u", *itr); if (!pGameobject->LoadFromDB(*itr, map)) delete pGameobject; else @@ -1254,7 +1254,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1269,7 +1269,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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1284,14 +1284,14 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { sObjectMgr->RemoveCreatureFromGrid(*itr, data); - if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); } } 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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1306,13 +1306,13 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { sObjectMgr->RemoveGameobjectFromGrid(*itr, data); - if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); } } 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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",internal_event_id,mGameEventPoolIds.size()); return; } @@ -1332,7 +1332,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) continue; // Update if spawned - Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); + Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); if (pCreature) { if (activate) @@ -1530,7 +1530,7 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) { WorldPacket data; sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0); - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } } } @@ -1580,7 +1580,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id) // changed, save to DB the gameevent state SaveWorldEventStateToDB(event_id); // force update events to set timer - sWorld.ForceGameEventUpdate(); + sWorld->ForceGameEventUpdate(); } } } |