本文整理汇总了C++中ArenaTeam::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ ArenaTeam::Destroy方法的具体用法?C++ ArenaTeam::Destroy怎么用?C++ ArenaTeam::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArenaTeam
的用法示例。
在下文中一共展示了ArenaTeam::Destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleArenaTeamDisbandOpcode
void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
{
ArenaTeam * team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if(!team)
{
GetPlayer()->SoftDisconnect();
return;
}
if( (team = _player->m_playerInfo->arenaTeam[team->m_type]) == NULL )
{
SystemMessage("You are not in an arena team of this type.");
return;
}
if(team->m_leader != _player->GetLowGUID())
{
SystemMessage("You aren't the captain of this team.");
return;
}
team->Destroy();
}
示例2: HandleArenaTeamDisbandOpcode
void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
{
ArenaTeam * team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if(!team)
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_INTERNAL);
return;
}
if( (team = _player->m_playerInfo->arenaTeam[team->m_type]) == NULL )
{
SendNotInArenaTeamPacket(uint8(team->GetPlayersPerTeam()));
return;
}
if(team->m_leader != _player->GetLowGUID())
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PERMISSIONS);
return;
}
team->SendArenaTeamEventPacket(ERR_ARENA_TEAM_DISBANDED, 2, _player->GetName(), team->m_name, "");
team->Destroy();
}
示例3: HandleArenaTeamLeaveOpcode
void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
{
ArenaTeam * team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if( !team || team->m_type >= NUM_ARENA_TEAM_TYPES )
{
GetPlayer()->SoftDisconnect();
return;
}
team = _player->m_arenaTeams[team->m_type];
if( team == NULL )
{
SystemMessage("You are not in an arena team of this type.");
return;
}
//if there is anyone inside an arena match then do not destroy it
if( _player->m_bg && IS_ARENA( _player->m_bg->GetType() ) )
{
SystemMessage("You cannot leave team while inside arena.");
return;
}
if (team->m_leader == _player->GetLowGUID() && team->m_memberCount == 1)
{
team->Destroy();
return;
}
if(team->m_leader == _player->GetLowGUID())
{
SystemMessage("You cannot leave the team yet, promote someone else to captain first.");
return;
}
if(team->RemoveMember(_player->m_playerInfo))
{
char buffer[1024];
WorldPacket * data;
snprintf(buffer,1024,"%s left the arena team, '%s'.", _player->GetName(), team->m_name.c_str());
data = sChatHandler.FillSystemMessageData(buffer);
team->SendPacket(data);
delete data;
data = NULL;
SystemMessage("You have left the arena team, '%s'.", team->m_name.c_str());
}
}
示例4: HandleArenaTeamLeaveOpcode
void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
{
CHECK_INWORLD_RETURN
ArenaTeam* team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if(!team)
{
GetPlayer()->SoftDisconnect();
return;
}
if((team = _player->m_arenaTeams[team->m_type]) == NULL)
{
SystemMessage("You are not in an arena team of this type.");
return;
}
if(team->m_leader == _player->GetLowGUID() && team->m_memberCount == 1)
{
team->Destroy();
return;
}
if(team->m_leader == _player->GetLowGUID())
{
SystemMessage("You cannot leave the team yet, promote someone else to captain first.");
return;
}
if(team->RemoveMember(_player->m_playerInfo))
{
char buffer[1024];
WorldPacket* data;
snprintf(buffer, 1024, "%s left the arena team, '%s'.", _player->GetName(), team->m_name.c_str());
data = sChatHandler.FillSystemMessageData(buffer);
team->SendPacket(data);
delete data;
SystemMessage("You have left the arena team, '%s'.", team->m_name.c_str());
}
}
示例5: HandleArenaTeamLeaveOpcode
void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data)
{
ArenaTeam * team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if(!team)
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_INTERNAL);
return;
}
if( (team = _player->m_playerInfo->arenaTeam[team->m_type]) == NULL )
{
SendNotInArenaTeamPacket(uint8(team->GetPlayersPerTeam()));
return;
}
if(team->m_leader == _player->GetLowGUID())
{
if( team->m_memberCount > 1 )
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, "", "", ERR_ARENA_TEAM_LEADER_LEAVE);
return;
}
else if( team->m_memberCount == 1 )
{
team->Destroy();
return;
}
}
if(team->RemoveMember(_player->m_playerInfo))
{
team->SendArenaTeamEventPacket(ERR_ARENA_TEAM_LEAVE, 2, _player->GetName(), team->m_name, "");
}
SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, team->m_name, "", 0);
}
示例6: HandleArenaTeamDisbandOpcode
void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data)
{
ArenaTeam * team;
uint32 teamId;
recv_data >> teamId;
team = objmgr.GetArenaTeamById(teamId);
if( !team || team->m_type >= NUM_ARENA_TEAM_TYPES )
{
GetPlayer()->SoftDisconnect();
return;
}
if( (team = _player->m_arenaTeams[team->m_type]) == NULL )
{
SystemMessage("You are not in an arena team of this type.");
return;
}
if(team->m_leader != _player->GetLowGUID())
{
SystemMessage("You aren't the captain of this team.");
return;
}
//if there is anyone inside an arena match then do not destroy it
for( uint32 i=0;i<team->m_memberCount;i++)
{
ArenaTeamMember *member = team->GetMemberBySlot( i );
if( member && member->Info && member->Info->m_loggedInPlayer && member->Info->m_loggedInPlayer->m_bg && IS_ARENA( member->Info->m_loggedInPlayer->m_bg->GetType() ) )
{
SystemMessage("Someone is playing an active Arena match.");
return;
}
}
team->Destroy();
}