diff --git a/src/game/Handlers/GroupHandler.cpp b/src/game/Handlers/GroupHandler.cpp index 4c13cb8015e..f051a39924a 100644 --- a/src/game/Handlers/GroupHandler.cpp +++ b/src/game/Handlers/GroupHandler.cpp @@ -83,8 +83,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recv_data) return; } - if (GetPlayer()->GetMapId() > 1 && GetPlayer()->GetInstanceId() && player->GetInstanceId() && GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId()) + // Prevent inviting player to group who is in a different instance of the same map. + if (GetPlayer()->GetMapId() > 1 && GetPlayer()->GetInstanceId() && player->GetInstanceId() && + GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId()) return; + // Just ignore us if (player->GetSocial()->HasIgnore(GetPlayer()->GetObjectGuid())) { diff --git a/src/game/Handlers/MovementHandler.cpp b/src/game/Handlers/MovementHandler.cpp index 62da53a8573..f68f2f0fd9f 100644 --- a/src/game/Handlers/MovementHandler.cpp +++ b/src/game/Handlers/MovementHandler.cpp @@ -164,6 +164,11 @@ void WorldSession::HandleMoveWorldportAckOpcode() if (mEntry->IsRaid()) { + // Cancel any group invites on teleport to dungeon to prevent raid reset exploits. + // We already prevent inviting player who is in different instance of same map. + // This makes sure you cant bypass that by inviting player first but not accepting until inside. + GetPlayer()->UninviteFromGroup(); + if (time_t timeReset = sMapPersistentStateMgr.GetScheduler().GetResetTimeFor(mEntry->id)) { uint32 timeleft = uint32(timeReset - time(nullptr)); diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 54b719fb5f7..dd1a5befd8a 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -2283,7 +2283,7 @@ bool DungeonMap::Reset(InstanceResetMethod method) } else { - if (method == INSTANCE_RESET_GLOBAL) + if (method == INSTANCE_RESET_GLOBAL || method == INSTANCE_RESET_GROUP_JOIN) { // set the homebind timer for players inside (1 minute) for (const auto& itr : m_mapRefManager) @@ -2313,11 +2313,19 @@ void DungeonMap::PermBindAllPlayers(Player* player) for (const auto& itr : m_mapRefManager) { Player* plr = itr.getSource(); + // players inside an instance cannot be bound to other instances // some players may already be permanently bound, in this case nothing happens InstancePlayerBind *bind = plr->GetBoundInstance(GetId()); if (!bind || !bind->perm) { + if (m_resetAfterUnload) + { + sLog.Player(plr->GetSession(), LOG_BASIC, LOG_LVL_ERROR, "Attempt to permanently save player to raid (map %u, instance %u) scheduled for reset on unload and already deleted from DB!", GetId(), GetInstanceId()); + plr->TeleportToHomebind(); + continue; + } + plr->BindToInstance(GetPersistanceState(), true); WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4); data << uint32(0);