本文整理汇总了C++中PlayerPointer::SetInviter方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::SetInviter方法的具体用法?C++ PlayerPointer::SetInviter怎么用?C++ PlayerPointer::SetInviter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::SetInviter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGroupAcceptOpcode
////////////////////////////////////////////////////////////////
///This function handles CMSG_GROUP_ACCEPT:
////////////////////////////////////////////////////////////////
void WorldSession::HandleGroupAcceptOpcode( WorldPacket & recv_data )
{
if(!_player->IsInWorld()) return;
PlayerPointer player = objmgr.GetPlayer(_player->GetInviter());
if ( !player )
return;
player->SetInviter(0);
_player->SetInviter(0);
Group *grp = player->GetGroup();
if(grp)
{
grp->AddMember(_player->m_playerInfo);
if(grp->GetLeader()->m_loggedInPlayer)
_player->iInstanceType = grp->GetLeader()->m_loggedInPlayer->iInstanceType;
_player->GetSession()->OutPacket(MSG_SET_DUNGEON_DIFFICULTY, 4, &_player->iInstanceType);
return;
}
// If we're this far, it means we have no existing group, and have to make one.
grp = new Group(true);
grp->AddMember(player->m_playerInfo); // add the inviter first, therefore he is the leader
grp->AddMember(_player->m_playerInfo); // add us.
_player->iInstanceType = player->iInstanceType;
_player->GetSession()->OutPacket(MSG_SET_DUNGEON_DIFFICULTY, 4, &player->iInstanceType);
}
示例2: HandleGroupDeclineOpcode
///////////////////////////////////////////////////////////////////////////////////////
///This function handles CMSG_GROUP_DECLINE:
//////////////////////////////////////////////////////////////////////////////////////
void WorldSession::HandleGroupDeclineOpcode( WorldPacket & recv_data )
{
if(!_player->IsInWorld()) return;
WorldPacket data(SMSG_GROUP_DECLINE, 100);
PlayerPointer player = objmgr.GetPlayer(_player->GetInviter());
if(!player) return;
data << GetPlayer()->GetName();
player->GetSession()->SendPacket( &data );
player->SetInviter(0);
_player->SetInviter(0);
}
示例3: HandleGroupInviteOpcode
//////////////////////////////////////////////////////////////
/// This function handles CMSG_GROUP_INVITE
//////////////////////////////////////////////////////////////
void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
{
if(!_player->IsInWorld())
return;
CHECK_PACKET_SIZE(recv_data, 1);
WorldPacket data(100);
std::string membername;
PlayerPointer player = NULLPLR;
Group *group = NULL;
recv_data >> membername;
if(_player->HasBeenInvited())return;
player = objmgr.GetPlayer(membername.c_str(), false);
if ( player == NULL)
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_CANNOT_FIND);
return;
}
if (player == _player)
{
return;
}
if ( _player->InGroup() && (!_player->IsGroupLeader() || _player->GetGroup()->HasFlag(GROUP_FLAG_BATTLEGROUND_GROUP) ) )
{
SendPartyCommandResult(_player, 0, "", ERR_PARTY_YOU_ARE_NOT_LEADER);
return;
}
group = _player->GetGroup();
if ( group != NULL )
{
if (group->IsFull())
{
SendPartyCommandResult(_player, 0, "", ERR_PARTY_IS_FULL);
return;
}
}
if ( player->InGroup() )
{
SendPartyCommandResult(_player, player->GetGroup()->GetGroupType(), membername, ERR_PARTY_ALREADY_IN_GROUP);
data.SetOpcode(SMSG_GROUP_INVITE);
data << uint8(0);
data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data);
return;
}
if(player->GetTeam()!=_player->GetTeam() && _player->GetSession()->GetPermissionCount() == 0 && !sWorld.cross_faction_world)
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_WRONG_FACTION);
return;
}
if ( player->HasBeenInvited() )
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_ALREADY_IN_GROUP);
return;
}
if( player->Social_IsIgnoring( _player->GetLowGUID() ) )
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_IS_IGNORING_YOU);
return;
}
if( player->bGMTagOn && !_player->GetSession()->HasPermissions())
{
SendPartyCommandResult(_player, 0, membername, ERR_PARTY_CANNOT_FIND);
return;
}
// 16/08/06 - change to guid to prevent very unlikely event of a crash in deny, etc
_player->SetInviter(_player->GetLowGUID());//bugfix if player invtied 2 people-> he can be in 2 parties
data.SetOpcode(SMSG_GROUP_INVITE);
data << uint8(1);
data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data);
uint32 gtype = 0;
if(group)
gtype = group->GetGroupType();
SendPartyCommandResult(_player, gtype, membername, ERR_PARTY_NO_ERROR);
// 16/08/06 - change to guid to prevent very unlikely event of a crash in deny, etc
player->SetInviter(_player->GetLowGUID());
}