本文整理汇总了C++中PlayerPointer::SoftDisconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::SoftDisconnect方法的具体用法?C++ PlayerPointer::SoftDisconnect怎么用?C++ PlayerPointer::SoftDisconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::SoftDisconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssaultControlPoint
void ArathiBasin::AssaultControlPoint(PlayerPointer pPlayer, uint32 Id)
{
#if defined(BG_ANTI_CHEAT) && !defined(_DEBUG)
if(!m_started)
{
SendChatMessage(CHAT_MSG_BG_SYSTEM_NEUTRAL, pPlayer->GetGUID(), "%s has been removed from the game for cheating.", pPlayer->GetName());
pPlayer->SoftDisconnect();
return;
}
#endif
bool isVirgin = false;
uint32 Team = pPlayer->m_bgTeam;
uint32 Owner;
if(m_basesOwnedBy[Id]==-1 && m_basesAssaultedBy[Id]==-1)
{
isVirgin = true;
// omgwtfbbq our flag is a virgin?
m_mapMgr->GetStateManager().UpdateWorldState(NeutralFields[Id], 0);
}
if(m_basesOwnedBy[Id] != -1)
{
Owner = m_basesOwnedBy[Id];
// set it to uncontrolled for now
m_basesOwnedBy[Id] = -1;
// this control point just got taken over by someone! oh noes!
if( m_spiritGuides[Id] != NULL )
{
map<CreaturePointer,set<uint32> >::iterator itr = m_resurrectMap.find(m_spiritGuides[Id]);
if( itr != m_resurrectMap.end() )
{
for( set<uint32>::iterator it2 = itr->second.begin(); it2 != itr->second.end(); ++it2 )
{
PlayerPointer r_plr = m_mapMgr->GetPlayer( *it2 );
if( r_plr != NULL && r_plr->isDead() )
{
HookHandleRepop( r_plr );
QueueAtNearestSpiritGuide(r_plr, itr->first);
}
}
}
m_resurrectMap.erase( itr );
m_spiritGuides[Id]->Despawn( 0, 0 );
m_spiritGuides[Id] = NULLCREATURE;
}
// detract one from the teams controlled points
m_capturedBases[Owner] -= 1;
m_mapMgr->GetStateManager().UpdateWorldState(Owner ? WORLDSTATE_AB_HORDE_CAPTUREBASE : WORLDSTATE_AB_ALLIANCE_CAPTUREBASE, m_capturedBases[Owner]);
// reset the world states
m_mapMgr->GetStateManager().UpdateWorldState(OwnedFields[Id][Owner], 0);
// modify the resource update time period
if(m_capturedBases[Owner]==0)
this->event_RemoveEvents(EVENT_AB_RESOURCES_UPDATE_TEAM_0+Owner);
else
this->event_ModifyTime(EVENT_AB_RESOURCES_UPDATE_TEAM_0 + Owner, ResourceUpdateIntervals[m_capturedBases[Owner]]);
}
// Contested Flag, not ours, and is not virgin
uint32 otherTeam = Team ? 0 : 1;
if( !isVirgin && m_basesLastOwnedBy[Id] == Team && m_basesOwnedBy[Id] == -1 )
{
m_mapMgr->GetStateManager().UpdateWorldState(AssaultFields[Id][Team ? 0 : 1], 0);
this->event_RemoveEvents(EVENT_AB_CAPTURE_CP_1 + Id);
SendChatMessage(Team ? CHAT_MSG_BG_SYSTEM_HORDE : CHAT_MSG_BG_SYSTEM_ALLIANCE, pPlayer->GetGUID(), "$N has defended the %s!", ControlPointNames[Id]);
m_basesAssaultedBy[Id] = Team;
CaptureControlPoint( Id, Team );
return;
}
// nigga stole my flag!
if(m_basesAssaultedBy[Id] != -1)
{
Owner = m_basesAssaultedBy[Id];
// woah! vehicle hijack!
m_basesAssaultedBy[Id] = Team;
m_mapMgr->GetStateManager().UpdateWorldState(AssaultFields[Id][Owner], 0);
// make sure the event does not trigger
sEventMgr.RemoveEvents(shared_from_this(), EVENT_AB_CAPTURE_CP_1 + Id);
// no need to remove the spawn, SpawnControlPoint will do this.
}
m_basesAssaultedBy[Id] = Team;
// spawn the new control point gameobject
SpawnControlPoint(Id, Team ? AB_SPAWN_TYPE_HORDE_ASSAULT : AB_SPAWN_TYPE_ALLIANCE_ASSAULT);
// send out the chat message and sound
SendChatMessage(Team ? CHAT_MSG_BG_SYSTEM_HORDE : CHAT_MSG_BG_SYSTEM_ALLIANCE, pPlayer->GetGUID(), "$N claims the %s! If left unchallenged, the %s will control it in 1 minute!", ControlPointNames[Id],
Team ? "Horde" : "Alliance");
//.........这里部分代码省略.........