group if you alt + f4

Issue #497 resolved
Former user created an issue
  1. invite 11 or more players for 10 man raid
  2. set raid difficulty to 10 man normal or heroic
  3. 10 man go to instance and logout one of them or all
  4. other men going into instance
  5. now all login and clear 10man with 11 man or 25 man!

Comments (5)

  1. LordUsagi

    Awaiting feedback on the patch below. Please confirm anonymous!

    # HG changeset patch
    # User LordUsagi
    # Date 1393196884 14400
    #      Sun Feb 23 19:08:04 2014 -0400
    # Node ID 6a24b7d545a46dd58133c10c8f6907099c37540d
    # Parent  3d12d81585799d4f0b8ebc47a09383b33c021d8b
    [Core/Instances] Attempt to fix an exploit with too many players in instances
                     and raids.
    
    diff -r 3d12d8158579 -r 6a24b7d545a4 src/game/Player.cpp
    --- a/src/game/Player.cpp   Sun Feb 23 18:49:31 2014 -0400
    +++ b/src/game/Player.cpp   Sun Feb 23 19:08:04 2014 -0400
    @@ -14946,49 +14946,56 @@
         // load the player's map here if it's not already loaded
         Map *map = MapManager::Instance().CreateMap(mapId, this, instanceId);
    
    +    AreaTrigger const* areaTrigger = NULL;
    +    bool check = false;
    +
         if (!map)
         {
    -        instanceId = 0;
    -        AreaTrigger const* at = objmgr.GetGoBackTrigger(mapId);
    -        if (at)
    -        {
    -            sLog.outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
    -            Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
    -            mapId = at->target_mapId;
    -        }
    -        else
    -        {
    -            sLog.outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
    -            RelocateToHomebind();
    -        }
    -
    +        areaTrigger = objmgr.GetGoBackTrigger(mapId);
    +        check = true;
    +    }
    +    else if (map->IsDungeon()) // if map is dungeon...
    +    {
    +        if (!((InstanceMap*)map)->CanEnter(this)) // ... and can't enter map, then look for entry point.
    +        {
    +            areaTrigger = objmgr.GetGoBackTrigger(mapId);
    +            check = true;
    +        }
    +        else if (instanceId && !sInstanceSaveManager.GetInstanceSave(instanceId)) // ... and instance is reseted then look for entrance.
    +        {
    +            areaTrigger = objmgr.GetMapEntranceTrigger(mapId);
    +            check = true;
    +        }
    +    }
    +
    +    if (check) // in case of special event when creating map...
    +    {
    +        if (areaTrigger) // ... if we have an areatrigger, then relocate to new map/coordinates.
    +        {
    +            Relocate(areaTrigger->target_X, areaTrigger->target_Y, areaTrigger->target_Z, GetOrientation());
    +            if (mapId != areaTrigger->target_mapId)
    +            {
    +                mapId = areaTrigger->target_mapId;
    +                map = MapManager::Instance().CreateMap(mapId, this, 0);
    +            }
    +        }
    +        else
    +        {
    +            sLog.outError("Player %s (guid: %d) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Areatrigger not found.", m_name, guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
    +            map = NULL;
    +        }
    +    }
    +
    +    if (!map)
    +    {
    +        PlayerInfo const* info = objmgr.GetPlayerInfo(getRace(), getClass());
    +        mapId = info->mapId;
    +        Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
             map = MapManager::Instance().CreateMap(mapId, this, 0);
             if (!map)
             {
    -            PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(), getClass());
    -            mapId = info->mapId;
    -            Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
    -            sLog.outError("ERROR: Player (guidlow %d) has invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
    -            map = MapManager::Instance().CreateMap(mapId, this, 0);
    -            if (!map)
    -            {
    -                sLog.outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
    -                return false;
    -            }
    -        }
    -    }
    -
    -    // if the player is in an instance (not a bg) and it has been reset in the meantime teleport him to the entrance
    -    if (instanceId && !m_bgData.bgInstanceID && !sInstanceSaveManager.GetInstanceSave(instanceId))
    -    {
    -        AreaTrigger const* at = objmgr.GetMapEntranceTrigger(mapId);
    -        if (at)
    -            Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
    -        else
    -        {
    -            sLog.outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), mapId);
    -            RelocateToHomebind();
    -            map = MapManager::Instance().CreateMap(mapId, this, instanceId);
    +            sLog.outError("Player %s (guid: %d) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Invalid default map coordinates or instance couldn't be created.", m_name, guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
    +            return false;
             }
         }
    
  2. Log in to comment