本文整理汇总了C++中Transporter::RemovePlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ Transporter::RemovePlayer方法的具体用法?C++ Transporter::RemovePlayer怎么用?C++ Transporter::RemovePlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transporter
的用法示例。
在下文中一共展示了Transporter::RemovePlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleSummonCommand
bool ChatHandler::HandleSummonCommand(const char* args, WorldSession *m_session)
{
if(!*args)
return false;
sGMLog.writefromsession(m_session, "summoned %s on map %u, %f %f %f", args, m_session->GetPlayer()->GetMapId(),m_session->GetPlayer()->GetPositionX(),m_session->GetPlayer()->GetPositionY(),m_session->GetPlayer()->GetPositionZ());
Player * plr = m_session->GetPlayer();
Player *chr = objmgr.GetPlayer(args, false);
if( chr && chr->m_isGmInvisible < 2 )
{
// send message to user
char buf[256];
char buf0[256];
if( chr->IsBeingTeleported() == true )
{
snprintf((char*)buf,256, "%s is already being teleported.", chr->GetName());
SystemMessage(m_session, buf);
return true;
}
if(!chr->RemoveTransporterStatus())
{
char buff[256];
snprintf((char*)buf,256, "%s already being teleported.", chr->GetName());
SystemMessage(m_session, buff);
return true;
}
if( plr->RS_getAccess() < chr->RS_getAccess() || chr->m_isGmInvisible > INVIS_NONE )
{
snprintf((char*)buf,256, "%s is attempting to summon you!", plr->GetName());
SystemMessageToPlr(chr, buf);
chr->SummonRequest(plr->GetLowGUID(), plr->GetZoneId(), plr->GetMapId(), plr->GetInstanceID(), plr->GetPosition());
snprintf((char*)buf0,256, "Summon request sent.", chr->GetName());
SystemMessage(m_session, buf0);
return true;
}
snprintf((char*)buf,256, "You are summoning %s.", chr->GetName());
SystemMessage(m_session, buf);
if(!(plr->m_isGmInvisible && chr->RS_getAccess() >= RS_SCRIPTER))
{
// send message to player
snprintf((char*)buf0,256, "You are being summoned by %s.", m_session->GetPlayer()->GetName());
SystemMessageToPlr(chr, buf0);
}
if(chr->GetTaxiState())
{
sEventMgr.RemoveEvents(chr, EVENT_PLAYER_TAXI_DISMOUNT);
sEventMgr.RemoveEvents(chr, EVENT_PLAYER_TAXI_INTERPOLATE);
chr->SetTaxiState(false);
chr->SetTaxiPath(NULL);
chr->UnSetTaxiPos();
chr->m_taxi_ride_time = 0;
chr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID , 0);
chr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNTED_TAXI);
chr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOCK_PLAYER);
chr->SetPlayerSpeed(RUN, chr->m_runSpeed);
}
if(chr->m_TransporterGUID)
{
Transporter * pTrans = objmgr.GetTransporter(GUID_LOPART(chr->m_TransporterGUID));
if(pTrans)
{
if(chr->m_lockTransportVariables == true)
{
char buff[256];
snprintf((char*)buf,256, "%s is already being teleported.", chr->GetName());
SystemMessage(m_session, buff);
return true;
}
pTrans->RemovePlayer(chr);
chr->m_CurrentTransporter = NULL;
chr->m_TransporterGUID = 0;
}
}
if( plr->GetMapMgr() == chr->GetMapMgr() )
{
chr->_Relocate(plr->GetMapId(),plr->GetPosition(),false,false,plr->GetInstanceID());
}
else
{
sEventMgr.AddEvent(chr,&Player::EventPortToGM,plr,0,1,1,0);
}
}
else
{
PlayerInfo * pinfo = objmgr.GetPlayerInfoByName(args);
if(!pinfo)
{
char buf[256];
snprintf((char*)buf,256,"Player (%s) does not exist.", args);
SystemMessage(m_session, buf);
}
else
{
Player * pPlayer = m_session->GetPlayer();
char query[512];
snprintf((char*) &query,512, "UPDATE characters SET mapId = %u, positionX = %f, positionY = %f, positionZ = %f, zoneId = %u WHERE guid = %u;", pPlayer->GetMapId(), pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetZoneId(), pinfo->guid);
//.........这里部分代码省略.........