Exemplo n.º 1
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId,
		Battleground* bg) {
	// load/create a map
	ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);

	sLog->outDebug(LOG_FILTER_MAPS,
			"MapInstanced::CreateBattleground: map bg %d for %d created.",
			InstanceId, GetId());

	PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(
			bg->GetMapId(), bg->GetMinLevel());

	uint8 spawnMode;

	if (bracketEntry)
		spawnMode = bracketEntry->difficulty;
	else
		spawnMode = REGULAR_DIFFICULTY;

	BattlegroundMap *map = new BattlegroundMap(GetId(), GetGridExpiry(),
			InstanceId, this, spawnMode);
	ASSERT(map->IsBattlegroundOrArena());
	map->SetBG(bg);
	bg->SetBgMap(map);

	m_InstancedMaps[InstanceId] = map;
	return map;
}
Exemplo n.º 2
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* pBg)
{
    if(!pBg)
        return NULL;

    // load/create map
    ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);

    PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(pBg->GetMapId(), pBg->GetMinLevel());

    uint8 spawnMode;

    if(bracketEntry)
        spawnMode = bracketEntry->difficulty;
    else
        spawnMode = REGULAR_DIFFICULTY;

    BattlegroundMap* pMap = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
    ASSERT(pMap->IsBattlegroundOrArena());
    pMap->SetBG(pBg);
    pBg->SetBgMap(pMap);

    m_InstancedMaps[InstanceId] = pMap;
    return pMap;
}
Exemplo n.º 3
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
    // load/create a map
    std::lock_guard<std::mutex> lock(_mapLock);

    TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());

    BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, DIFFICULTY_NONE);
    ASSERT(map->IsBattlegroundOrArena());
    map->SetBG(bg);
    bg->SetBgMap(map);

    m_InstancedMaps[InstanceId] = map;
    return map;
}
Exemplo n.º 4
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
    // load/create a map
    ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);

    sLog->outDebug (LOG_FILTER_NETWORKIO, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());

    BattlegroundMap *map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this);
    ASSERT(map->IsBattlegroundOrArena());
    map->SetBG(bg);
    bg->SetBgMap(map);

    m_InstancedMaps[InstanceId] = map;
    return map;
}
Exemplo n.º 5
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
    // load/create a map
    Guard guard(*this);

    sLog.outDebug("MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());

    BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this);
    ASSERT(map->IsBattlegroundOrArena());
    map->SetBG(bg);
    bg->SetBgMap(map);

    m_InstancedMaps[InstanceId] = map;
    return map;
}
Exemplo n.º 6
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
    // load/create a map
    INFINITY_GUARD(ACE_Thread_Mutex, Lock);

    IC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());

    uint8 spawnMode;

    spawnMode = REGULAR_DIFFICULTY;

    BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
    ASSERT(map->IsBattlegroundOrArena());
    map->SetBG(bg);
    bg->SetBgMap(map);

    m_InstancedMaps[InstanceId] = map;
    return map;
}
Exemplo n.º 7
0
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
{
    // load/create a map
    std::lock_guard<std::mutex> lock(_mapLock);

    TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());

    PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel());

    uint8 spawnMode;

    if (bracketEntry)
        spawnMode = bracketEntry->difficulty;
    else
        spawnMode = REGULAR_DIFFICULTY;

    BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
    ASSERT(map->IsBattlegroundOrArena());
    map->SetBG(bg);
    bg->SetBgMap(map);

    m_InstancedMaps[InstanceId] = map;
    return map;
}