本文整理汇总了C++中DungeonMap::SendToPlayers方法的典型用法代码示例。如果您正苦于以下问题:C++ DungeonMap::SendToPlayers方法的具体用法?C++ DungeonMap::SendToPlayers怎么用?C++ DungeonMap::SendToPlayers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DungeonMap
的用法示例。
在下文中一共展示了DungeonMap::SendToPlayers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendSpecialEncounterState
void DungeonPersistentState::SendSpecialEncounterState(ObjectGuid guid)
{
// Possible need move this method to DungeonMap class
DungeonMap* dungeon = (DungeonMap*)GetMap();
if (!dungeon || guid.IsEmpty())
return;
SpecialEncountersMap::iterator itr = m_specialEncountersMap.find(guid);
if (itr == m_specialEncountersMap.end())
return;
SpecialEncounterState* state = &itr->second;
if (!state || state->lastCommand >= ENCOUNTER_FRAME_MAX)
return;
// size of this packet is at most 15 (usually less)
WorldPacket data(SMSG_INSTANCE_ENCOUNTER, 15);
data << uint32(state->lastCommand);
switch (state->lastCommand)
{
case ENCOUNTER_FRAME_ENGAGE:
case ENCOUNTER_FRAME_DISENGAGE:
case ENCOUNTER_FRAME_UPDATE_PRIORITY:
data << state->guid.WriteAsPacked();
data << uint8(state->data1);
break;
case ENCOUNTER_FRAME_ADD_TIMER:
case ENCOUNTER_FRAME_ENABLE_OBJECTIVE:
case ENCOUNTER_FRAME_DISABLE_OBJECTIVE:
data << uint8(state->data1);
break;
case ENCOUNTER_FRAME_UPDATE_OBJECTIVE:
data << uint8(state->data1);
data << uint8(state->data2);
break;
case ENCOUNTER_FRAME_UNK7:
default:
break;
}
dungeon->SendToPlayers(&data);
}