aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/DungeonFinding/LFGScripts.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-10-17 14:19:59 +0200
committerSpp <spp@jorge.gr>2012-10-18 09:15:10 +0200
commitd0334bf94839301cda93f95913db8ea3f27c19cb (patch)
tree97116c966cffcb9cd95e9aeeb555edf496c9628d /src/server/game/DungeonFinding/LFGScripts.cpp
parentca276292dcce939d65649d434a08796269789901 (diff)
Core/Dungeon Finder: Some optimizations.
- Store teleport coordinates to avoid recalculations each time someone has to be teleported - Correct teleport error msg when player is charming or using vehicle - Internal changes in storage types - Proper code for missing achievement lock type - Better debug msgs - Trying to get rid of "Player*" and "Group*" inside LFGMgr as much as possible (Step 1)
Diffstat (limited to 'src/server/game/DungeonFinding/LFGScripts.cpp')
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 36f04b3020b..26686dbaa33 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -39,12 +39,12 @@ void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/)
void LFGPlayerScript::OnLogout(Player* player)
{
- sLFGMgr->Leave(player);
+ uint64 guid = player->GetGUID();
+ sLFGMgr->LeaveLfg(player);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE);
player->GetSession()->SendLfgUpdateParty(updateData);
player->GetSession()->SendLfgUpdatePlayer(updateData);
- player->GetSession()->SendLfgUpdateSearch(false);
- uint64 guid = player->GetGUID();
+ player->GetSession()->SendLfgLfrList(false);
// TODO - Do not remove, add timer before deleting
sLFGMgr->RemovePlayerData(guid);
}
@@ -85,11 +85,11 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
// TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued
if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED)
- sLFGMgr->Leave(NULL, group);
+ sLFGMgr->LeaveLfg(NULL, group);
if (sLFGMgr->GetState(guid) == LFG_STATE_QUEUED)
if (Player* player = ObjectAccessor::FindPlayer(guid))
- sLFGMgr->Leave(player);
+ sLFGMgr->LeaveLfg(player);
}
void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason)
@@ -102,7 +102,7 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED)
{
// TODO - Do not remove, just remove the one leaving and rejoin queue with all other data
- sLFGMgr->Leave(NULL, group);
+ sLFGMgr->LeaveLfg(NULL, group);
}
if (!group->isLFGGroup())
@@ -119,16 +119,14 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
}
uint32 state = sLFGMgr->GetState(gguid);
- sLFGMgr->ClearState(guid);
+ sLFGMgr->ClearState(guid, "OnRemoveMember");
sLFGMgr->SetState(guid, LFG_STATE_NONE);
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
if (method == GROUP_REMOVEMETHOD_LEAVE && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON && sLFGMgr->GetDungeon(gguid, false))
player->CastSpell(player, LFG_SPELL_DUNGEON_DESERTER, true);
- /*
- else if (group->isLfgKickActive())
+ //else if (state == LFG_STATE_BOOT)
// Update internal kick cooldown of kicked
- */
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER);
player->GetSession()->SendLfgUpdateParty(updateData);
@@ -176,5 +174,5 @@ void LFGGroupScript::OnInviteMember(Group* group, uint64 guid)
return;
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID());
- sLFGMgr->Leave(NULL, group);
+ sLFGMgr->LeaveLfg(NULL, group);
}