本文整理汇总了C++中UpdateData类的典型用法代码示例。如果您正苦于以下问题:C++ UpdateData类的具体用法?C++ UpdateData怎么用?C++ UpdateData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BuildCreateUpdateBlockForPlayer
void Transport::UpdateForMap(Map const* targetMap)
{
Map::PlayerList const& pl = targetMap->GetPlayers();
if(pl.isEmpty())
return;
if(GetMapId()==targetMap->GetId())
{
for(Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
{
if(this != itr->getSource()->GetTransport())
{
UpdateData transData;
BuildCreateUpdateBlockForPlayer(&transData, itr->getSource());
WorldPacket packet;
transData.BuildPacket(&packet);
itr->getSource()->SendDirectMessage(&packet);
}
}
}
else
{
UpdateData transData;
BuildOutOfRangeUpdateBlock(&transData);
WorldPacket out_packet;
transData.BuildPacket(&out_packet);
for(Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
if(this != itr->getSource()->GetTransport())
itr->getSource()->SendDirectMessage(&out_packet);
}
}
开发者ID:bobx,项目名称:Projeto,代码行数:32,代码来源:Transports.cpp
示例2: CalculatePassengerPosition
void Transport::UpdateNPCPositions()
{
for (CreatureSet::iterator itr = m_NPCPassengerSet.begin(); itr != m_NPCPassengerSet.end(); ++itr)
{
Creature* npc = *itr;
float x, y, z, o;
npc->m_movementInfo.t_pos.GetPosition(x, y, z, o);
CalculatePassengerPosition(x, y, z, o);
GetMap()->CreatureRelocation(npc, x, y, z, o, false);
npc->GetTransportHomePosition(x, y, z, o);
CalculatePassengerPosition(x, y, z, o);
npc->SetHomePosition(x, y, z, o);
}
for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end(); ++itr)
{
Player* plr = *itr;
float x, y, z, o;
o = GetOrientation() + plr->m_movementInfo.t_pos.m_orientation;
MapManager::NormalizeOrientation(o);
x = GetPositionX() + (plr->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI));
y = GetPositionY() + (plr->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionX * sin(GetOrientation()));
z = GetPositionZ() + plr->m_movementInfo.t_pos.m_positionZ;
plr->Relocate(x, y, z, o);
UpdateData transData;
WorldPacket packet;
transData.BuildPacket(&packet);
plr->SendDirectMessage(&packet);
}
}
开发者ID:Nightprince,项目名称:Avalon,代码行数:33,代码来源:Transport.cpp
示例3: DoorOpen
void BattlegroundSA::StartShips()
{
if (ShipsStarted)
return;
DoorOpen(BG_SA_BOAT_ONE);
DoorOpen(BG_SA_BOAT_TWO);
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
{
if (Player* p = sObjectMgr->GetPlayer(itr->first))
{
if (p->GetTeamId() != Attackers)
continue;
UpdateData data;
WorldPacket pkt;
GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p);
data.BuildPacket(&pkt);
p->GetSession()->SendPacket(&pkt);
}
}
}
ShipsStarted = true;
}
开发者ID:Enturion,项目名称:EnturionEMU,代码行数:27,代码来源:BattlegroundSA.cpp
示例4: UnLoadTransportFromMap
void MapManager::UnLoadTransportFromMap(Transport* t)
{
Map* map = t->GetMap();
for (Transport::CreatureSet::iterator itr = t->m_NPCPassengerSet.begin(); itr != t->m_NPCPassengerSet.end();)
{
if (Creature* npc = *itr)
{
npc->SetTransport(NULL);
npc->setActive(false);
npc->RemoveFromWorld();
}
++itr;
}
UpdateData transData;
t->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket out_packet;
transData.BuildPacket(&out_packet);
for (Map::PlayerList::const_iterator itr = map->GetPlayers().begin(); itr != map->GetPlayers().end(); ++itr)
if (t != itr->getSource()->GetTransport())
itr->getSource()->SendDirectMessage(&out_packet);
t->m_NPCPassengerSet.clear();
m_TransportsByInstanceIdMap[t->GetInstanceId()].erase(t);
m_Transports.erase(t);
t->m_WayPoints.clear();
t->RemoveFromWorld();
}
开发者ID:Nightprince,项目名称:Avalon,代码行数:30,代码来源:Transport.cpp
示例5: SetData
void SetData(uint32 id, uint32 value)
{
switch(id)
{
case DATA_LEVIATHAN_DOOR:
if (pLeviathanDoor)
pLeviathanDoor->SetGoState(GOState(value));
break;
case DATA_RUNIC_DOOR:
if (pRunicDoor)
pRunicDoor->SetGoState(GOState(value));
break;
case DATA_STONE_DOOR:
if (pStoneDoor)
pStoneDoor->SetGoState(GOState(value));
break;
case DATA_CALL_TRAM:
if (MimironTram && instance)
{
// Load Mimiron Tram (unfortunally only server side)
instance->LoadGrid(2307, 284.632);
if (value == 0)
MimironTram->SetGoState(GO_STATE_READY);
if (value == 1)
MimironTram->SetGoState(GO_STATE_ACTIVE);
// Send movement update to players
if (Map* pMap = MimironTram->GetMap())
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->getSource())
{
UpdateData data;
WorldPacket pkt;
MimironTram->BuildValuesUpdateBlockForPlayer(&data, i->getSource());
data.BuildPacket(&pkt);
i->getSource()->GetSession()->SendPacket(&pkt);
}
}
}
break;
case DATA_MIMIRON_ELEVATOR:
if (MimironElevator)
MimironElevator->SetGoState(GOState(value));
break;
case DATA_HODIR_RARE_CHEST:
if (HodirRareChest && value == GO_STATE_READY)
HodirRareChest->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
break;
}
}
开发者ID:Archives,项目名称:ro_core,代码行数:56,代码来源:instance_ulduar.cpp
示例6: SendTransportInit
void BattlegroundSA::SendTransportInit(Player* player)
{
if (BgObjects[BG_SA_BOAT_ONE] || BgObjects[BG_SA_BOAT_TWO])
{
UpdateData transData;
if (BgObjects[BG_SA_BOAT_ONE])
GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player);
if (BgObjects[BG_SA_BOAT_TWO])
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(&packet);
player->SendDirectMessage(&packet);
}
}
开发者ID:redlaine,项目名称:TrinityCore,代码行数:14,代码来源:BattlegroundSA.cpp
示例7: SendTransportsRemove
void BattleGroundSA::SendTransportsRemove(Player * player)
{
if (GetBGObject(BG_SA_BOAT_ONE) || GetBGObject(BG_SA_BOAT_TWO))
{
UpdateData transData;
if (GetBGObject(BG_SA_BOAT_ONE))
GetBGObject(BG_SA_BOAT_ONE)->BuildOutOfRangeUpdateBlock(&transData);
if (GetBGObject(BG_SA_BOAT_TWO))
GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
}
开发者ID:Sar777,项目名称:mangos,代码行数:14,代码来源:BattleGroundSA.cpp
示例8: SendTransportInit
void BattleGroundSA::SendTransportInit(Player *player)
{
if (GetBGObject(BG_SA_BOAT_ONE) || GetBGObject(BG_SA_BOAT_TWO))
{
UpdateData transData;
if (GetBGObject(BG_SA_BOAT_ONE))
GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player);
if (GetBGObject(BG_SA_BOAT_TWO))
GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
}
开发者ID:xXNembiXx,项目名称:mangos_335,代码行数:14,代码来源:BattleGroundSA.cpp
示例9: SendTransportsRemove
void BattlegroundSA::SendTransportsRemove(Player* player)
{
if (BgObjects[BG_SA_BOAT_ONE] || BgObjects[BG_SA_BOAT_TWO])
{
UpdateData transData;
if (BgObjects[BG_SA_BOAT_ONE])
GetBGObject(BG_SA_BOAT_ONE)->BuildOutOfRangeUpdateBlock(&transData);
if (BgObjects[BG_SA_BOAT_TWO])
GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket packet;
transData.BuildPacket(&packet);
player->SendDirectMessage(&packet);
}
}
开发者ID:redlaine,项目名称:TrinityCore,代码行数:14,代码来源:BattlegroundSA.cpp
示例10: SendTransportInit
void BattlegroundIC::SendTransportInit(Player *player)
{
if(!m_GunshipA)
return;
if(!m_GunshipH)
return;
UpdateData transData;
m_GunshipA->BuildCreateUpdateBlockForPlayer(&transData, player);
m_GunshipH->BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
开发者ID:sensibob,项目名称:tempestcore,代码行数:15,代码来源:BattlegroundIC.cpp
示例11: SendTransportInit
void BattlegroundIC::SendTransportInit(Player* player)
{
if (!gunshipAlliance || !gunshipHorde)
return;
UpdateData transData;
gunshipAlliance->BuildCreateUpdateBlockForPlayer(&transData, player);
gunshipHorde->BuildCreateUpdateBlockForPlayer(&transData, player);
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
开发者ID:kmishima,项目名称:DarkCore,代码行数:15,代码来源:BattlegroundIC.cpp
示例12: SendUpdateObjectToAllExcept
void Object::SendUpdateToPlayer(Player* player)
{
// send update to another players
SendUpdateObjectToAllExcept(player);
// send create update to player
UpdateData upd;
WorldPacket packet;
upd.Clear();
BuildCreateUpdateBlockForPlayer(&upd, player);
upd.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
// now object updated/(create updated)
}
开发者ID:Aion,项目名称:caldari,代码行数:16,代码来源:Object.cpp
示例13: SendTransportsRemove
void BattlegroundSA::SendTransportsRemove(Player * player)
{
if (m_BgObjects[BG_SA_BOAT_ONE] || m_BgObjects[BG_SA_BOAT_TWO])
{
UpdateData transData;
transData.m_map = GetMapId();
if (m_BgObjects[BG_SA_BOAT_ONE])
GetBGObject(BG_SA_BOAT_ONE)->BuildOutOfRangeUpdateBlock(&transData);
if (m_BgObjects[BG_SA_BOAT_TWO])
GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
}
开发者ID:,项目名称:,代码行数:16,代码来源:
示例14: LoadTransportForPlayers
void MapManager::LoadTransportForPlayers(Player* player)
{
MapManager::TransportMap& tmap = sMapMgr->m_TransportsByInstanceIdMap;
UpdateData transData;
MapManager::TransportSet& tset = tmap[player->GetInstanceId()];
for(MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i)
{
(*i)->BuildCreateUpdateBlockForPlayer(&transData, player);
}
WorldPacket packet;
transData.BuildPacket(&packet);
player->SendDirectMessage(&packet);
}
开发者ID:ahuraa,项目名称:ServerMythCore,代码行数:17,代码来源:Transport.cpp
示例15: GetOrientation
void Transport::UpdatePlayerPositions()
{
for (PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end(); ++itr)
{
Player* plr = *itr;
float x, y, z, o;
o = GetOrientation() + plr->m_movementInfo.t_pos.m_orientation;
x = GetPositionX() + (plr->m_movementInfo.t_pos.m_positionX * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionY * sin(GetOrientation() + M_PI));
y = GetPositionY() + (plr->m_movementInfo.t_pos.m_positionY * cos(GetOrientation()) + plr->m_movementInfo.t_pos.m_positionX * sin(GetOrientation()));
z = GetPositionZ() + plr->m_movementInfo.t_pos.m_positionZ;
plr->Relocate(x, y, z, o);
UpdateData transData;
WorldPacket packet;
transData.BuildPacket(&packet);
plr->SendDirectMessage(&packet);
}
}
开发者ID:ahuraa,项目名称:ServerMythCore,代码行数:18,代码来源:Transport.cpp
示例16: LoadTransportForPlayers
void MapManager::LoadTransportForPlayers(Player* player)
{
MapManager::TransportMap& tmap = sMapMgr->m_TransportsByInstanceIdMap;
UpdateData transData;
MapManager::TransportSet& tset = tmap[player->GetInstanceId()];
for (MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i)
{
(*i)->BuildCreateUpdateBlockForPlayer(&transData, player);
sLog->outInfo(LOG_FILTER_UNITS,"Cargando el transporte <---> Aqui hasta el de TransportSet");
}
WorldPacket packet;
transData.BuildPacket(&packet);
player->SendDirectMessage(&packet);
}
开发者ID:,项目名称:,代码行数:18,代码来源:
示例17: HandleActivateObject
void HandleActivateObject(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (GameObject* go = GetHitGObj())
{
go->SetGoState(GO_STATE_ACTIVE);
if (Map* map = go->GetMap())
{
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource())
{
UpdateData data;
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, i->GetSource());
data.BuildPacket(&pkt);
i->GetSource()->GetSession()->SendPacket(&pkt);
}
}
}
}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:21,代码来源:boss_brutallus.cpp
示例18: SendTransportsRemove
void BattleGroundSA::SendTransportsRemove(Player * player)
{
if (GetBGObject(BG_SA_BOAT_ONE) || GetBGObject(BG_SA_BOAT_TWO))
{
UpdateData transData;
if (GameObject * boat1 = GetBGObject(BG_SA_BOAT_ONE))
{
boat1->BuildOutOfRangeUpdateBlock(&transData);
boat1->SetRespawnTime(0);
boat1->Delete();
}
if (GameObject * boat2 = GetBGObject(BG_SA_BOAT_TWO))
{
boat2->BuildOutOfRangeUpdateBlock(&transData);
boat2->SetRespawnTime(0);
boat2->Delete();
}
WorldPacket packet;
transData.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
}
开发者ID:xXNembiXx,项目名称:mangos_335,代码行数:22,代码来源:BattleGroundSA.cpp
示例19: DoorOpen
void BattleGroundSA::StartShips()
{
if (shipsStarted)
return;
DoorOpen(m_BgObjects[BG_SA_BOAT_ONE]);
DoorOpen(m_BgObjects[BG_SA_BOAT_TWO]);
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
{
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* p = sObjectMgr.GetPlayer(itr->first))
{
UpdateData data;
WorldPacket pkt;
GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p);
data.BuildPacket(&pkt);
p->GetSession()->SendPacket(&pkt);
}
}
}
shipsStarted = true;
}
开发者ID:BACKUPLIB,项目名称:Darkportalwow,代码行数:24,代码来源:BattleGroundSA.cpp
示例20: DoorOpen
void BattlegroundSA::StartShips()
{
if (ShipsStarted)
return;
DoorOpen(BG_SA_BOAT_ONE);
DoorOpen(BG_SA_BOAT_TWO);
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
{
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* p = ObjectAccessor::FindPlayer(itr->first))
{
UpdateData data;
WorldPacket pkt;
GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p);
data.BuildPacket(&pkt);
p->SendDirectMessage(&pkt);
}
}
}
ShipsStarted = true;
}
开发者ID:redlaine,项目名称:TrinityCore,代码行数:24,代码来源:BattlegroundSA.cpp
注:本文中的UpdateData类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论