当前位置: 首页>>代码示例>>C++>>正文


C++ Group::GetGroupType方法代码示例

本文整理汇总了C++中Group::GetGroupType方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::GetGroupType方法的具体用法?C++ Group::GetGroupType怎么用?C++ Group::GetGroupType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Group的用法示例。


在下文中一共展示了Group::GetGroupType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleRequestJoinUpdates

void WorldSession::HandleRequestJoinUpdates(WorldPacket& /*recvData*/)
{
    TC_LOG_DEBUG("network", "WORLD: Received CMSG_GROUP_REQUEST_JOIN_UPDATES ");

    Group * grp = GetPlayer()->GetGroup();

    if(grp)
    {
        WorldPacket data(SMSG_REAL_GROUP_UPDATE,13);

        data << uint8(grp->GetGroupType());
        data << uint32(grp->GetMembersCount());

        if(grp->GetMembersCount() > 2) //group is already formed, send the latest member guid
        {
            Group::MemberSlotList::const_iterator lastMember = --grp->GetMemberSlots().end();

            data << uint64(lastMember->guid);
        }
        else // group has just formed, send the other player guid
        {
            Group::MemberSlotList::const_iterator member = grp->GetMemberSlots().begin();

            if(member->guid == GetPlayer()->GetGUID())
                ++member;

            data << uint64(member->guid);
        }

        SendPacket(&data);
    }
}
开发者ID:Exodius,项目名称:ArkCORE-NG,代码行数:32,代码来源:GroupHandler.cpp

示例2: HandlePartyAssignmentOpcode

void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSIGNMENT");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    uint64 senderGuid = GetPlayer()->GetGUID();
    if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        return;

    uint8 assignment;
    bool apply;
    ObjectGuid guid;

    recvData >> assignment;

    recvData.read_skip<uint8>(); // Unknown.

    guid[0] = recvData.ReadBit();
    guid[5] = recvData.ReadBit();
    guid[6] = recvData.ReadBit();
    guid[7] = recvData.ReadBit();
    guid[3] = recvData.ReadBit();
    guid[1] = recvData.ReadBit();
    guid[2] = recvData.ReadBit();

    apply = recvData.ReadBit();

    guid[4] = recvData.ReadBit();

    recvData.FlushBits();

    uint8 byteOrder[8] = { 4, 3, 1, 5, 2, 6, 7, 0 };
    recvData.ReadBytesSeq(guid, byteOrder);

    switch (assignment)
    {
        case GROUP_ASSIGN_MAINASSIST:
            group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST);
            group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINASSIST);
            break;

        case GROUP_ASSIGN_MAINTANK:
            group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK);           // Remove main assist flag from current if any.
            group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINTANK);
            break;

        default: break;
    }

    group->SendUpdate();
}
开发者ID:Expery,项目名称:Core,代码行数:54,代码来源:GroupHandler.cpp

示例3: HandleGroupRequestJoinUpdates

void WorldSession::HandleGroupRequestJoinUpdates(WorldPacket& /*recvData*/)
{
    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    WorldPacket data(SMSG_REAL_GROUP_UPDATE, 1 + 4 + 8);
    data << uint8(group->GetGroupType());
    data << uint32(group->GetMembersCount() - 1);
    data << uint64(group->GetLeaderGUID());
    SendPacket(&data);
}
开发者ID:samaelsacred,项目名称:4.3.4,代码行数:12,代码来源:GroupHandler.cpp

示例4: HandleGroupDisbandOpcode

//////////////////////////////////////////////////////////////////////////////////////////
///This function handles CMSG_GROUP_DISBAND:
//////////////////////////////////////////////////////////////////////////////////////////
void WorldSession::HandleGroupDisbandOpcode(WorldPacket & recv_data)
{
	// this is actually leaving a party, disband is not possible anymore
	CHECK_INWORLD_RETURN;
	Group* pGroup = _player->GetGroup();
	if(pGroup == NULL)
		return;

	// cant leave a battleground group (blizzlike 3.3.3)
	if(pGroup->GetGroupType() & GROUP_TYPE_BG)
		return;

	pGroup->RemovePlayer(_player->m_playerInfo);
}
开发者ID:Desch,项目名称:Edge-of-Chaos,代码行数:17,代码来源:GroupHandler.cpp

示例5: HandleGroupDisbandOpcode

//////////////////////////////////////////////////////////////////////////////////////////
///This function handles CMSG_GROUP_DISBAND:
//////////////////////////////////////////////////////////////////////////////////////////
void WorldSession::HandleGroupDisbandOpcode( WorldPacket & recv_data )
{
	if(!_player->IsInWorld()) 
	{ 
		return;
	}
	Group* pGroup = _player->GetGroup();
	if(!pGroup) 
	{ 
		return;
	}

	// cant leave a battleground group (blizzlike 3.3.3)
	if( pGroup->GetGroupType() & GROUP_TYPE_BG )
		return;

	//pGroup->Disband();
	pGroup->RemovePlayer(_player->m_playerInfo);
}
开发者ID:AtVirus,项目名称:Descent-core,代码行数:22,代码来源:GroupHandler.cpp

示例6: HandleGroupChangeSubGroupOpcode

void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");

    // we will get correct pointer for group here, so we don't have to check if group is BG raid
    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    time_t now = time(NULL);
    if (now - timeLastChangeSubGroupCommand < 2)
        return;
    else
       timeLastChangeSubGroupCommand = now;

    ObjectGuid guid;
    uint8 groupNr, unk;

    recvData >> unk >> groupNr;

    uint8 bitsOrder[8] = { 1, 3, 7, 2, 0, 5, 4, 6 };
    recvData.ReadBitInOrder(guid, bitsOrder);

    recvData.FlushBits();

    uint8 bytesOrder[8] = { 7, 0, 2, 4, 5, 3, 6, 1 };
    recvData.ReadBytesSeq(guid, bytesOrder);

    if (groupNr >= MAX_RAID_SUBGROUPS)
        return;

    uint64 senderGuid = GetPlayer()->GetGUID();
    if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        return;

    if (!group->HasFreeSlotSubGroup(groupNr))
        return;

    if (Player* movedPlayer = sObjectAccessor->FindPlayer(guid))
        group->ChangeMembersGroup(guid, groupNr);
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:41,代码来源:GroupHandler.cpp

示例7: PreTeleport

uint32 InstanceMgr::PreTeleport(uint32 mapid, Player* plr, uint32 instanceid)
{
	// preteleport is where all the magic happens :P instance creation, etc.
	MapInfo* inf = WorldMapInfoStorage.LookupEntry(mapid);
	Group* pGroup;
	InstanceMap* instancemap;
	Instance* in;

	if(inf == NULL || mapid >= NUM_MAPS)
		return INSTANCE_ABORT_NOT_FOUND;

	// main continent check.
	if(inf->type == INSTANCE_NULL)
	{
		// this will be useful when clustering comes into play.
		// we can check if the destination world server is online or not and then cancel them before they load.
		return (m_singleMaps[mapid] != NULL) ? INSTANCE_OK : INSTANCE_ABORT_NOT_FOUND;
	}

	// shouldn't happen
	if(inf->type == INSTANCE_BATTLEGROUND)
		return INSTANCE_ABORT_NOT_FOUND;

	pGroup = plr->GetGroup();

	// players without groups cannot enter raids and heroic instances

	if(pGroup == NULL &&
	        inf->type == INSTANCE_RAID &&
	        !plr->TriggerpassCheat)
		return INSTANCE_ABORT_NOT_IN_RAID_GROUP;

	if(pGroup == NULL &&
	        (inf->type == INSTANCE_NONRAID && plr->iInstanceType == MODE_HEROIC) &&
	        !plr->TriggerpassCheat)
		return INSTANCE_ABORT_NOT_IN_RAID_GROUP;


	// players without raid groups cannot enter raid instances
	if(pGroup != NULL && pGroup->GetGroupType() != GROUP_TYPE_RAID && inf->type == INSTANCE_RAID && !plr->TriggerpassCheat)
		return INSTANCE_ABORT_NOT_IN_RAID_GROUP;

	// We deny transfer if we requested a heroic instance of a map that has no heroic mode
	// We are trying to enter into a non-multi instance with a heroic group, downscaling
	if(inf->type == INSTANCE_NONRAID && plr->GetDungeonDifficulty() == MODE_HEROIC)
	{
		plr->SetDungeonDifficulty(MODE_NORMAL);
		plr->SendDungeonDifficulty();

		Group* grp = plr->GetGroup();
		if(grp != NULL)
			grp->SetDungeonDifficulty(MODE_NORMAL);
	}

	// if it's not a normal / 10men normal then check if we even have this mode
	if(inf->type == INSTANCE_RAID && plr->GetRaidDifficulty() != MODE_NORMAL_10MEN)
	{
		uint32 newtype = 0;

		if(!inf->HasDifficulty(plr->GetRaidDifficulty()))
		{
			// no it doesn't so we will downscale it

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This part is totally speculative, if you know how this is done actually then do change it
//
			switch(plr->GetRaidDifficulty())
			{
				case MODE_NORMAL_25MEN:
				case MODE_HEROIC_10MEN:
					{
						newtype = MODE_NORMAL_10MEN;
						break;
					}

				case MODE_HEROIC_25MEN:
					{
						newtype = MODE_NORMAL_25MEN;
						break;
					}
			}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			// check if we have this mode
			if(!inf->HasDifficulty(newtype))
			{

				//appearantly we don't so we set to 10men normal, which is the default for old raids too
				//regardless of their playerlimit
				newtype = MODE_NORMAL_10MEN;
			}

			// Setting the new mode on us and our group
			if(plr->GetRaidDifficulty() != newtype)
			{

				plr->SetRaidDifficulty(newtype);
				plr->SendRaidDifficulty();

//.........这里部分代码省略.........
开发者ID:Selenah,项目名称:ArcEmu,代码行数:101,代码来源:WorldCreator.cpp

示例8: 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;
	Player * player = NULL;
	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() )
	{
		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);
		return;
	}
	
	if(player->GetTeam()!=_player->GetTeam() && _player->GetSession()->GetPermissionCount() == 0)
	{
		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;
	}

	// 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 << 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());
}
开发者ID:Chero,项目名称:abcwow,代码行数:85,代码来源:GroupHandler.cpp

示例9: HandleMessagechatOpcode


//.........这里部分代码省略.........
					GetPlayer()->SendMessageToSet(data, true);
				}
				delete data;

			}
			break;
		case CHAT_MSG_PARTY:
		case CHAT_MSG_PARTY_LEADER:
		case CHAT_MSG_RAID:
		case CHAT_MSG_RAID_LEADER:
		case CHAT_MSG_RAID_WARNING:
			{
				if(sChatHandler.ParseCommands(msg.c_str(), this) > 0)
					break;

				if(sWorld.interfaction_chat && lang > 0)
					lang = 0;

				if(g_chatFilter->Parse(msg) == true)
				{
					SystemMessage("Your chat message was blocked by a server-side filter.");
					return;
				}

				Group* pGroup = _player->GetGroup();
				if(pGroup == NULL) break;

				if(GetPlayer()->m_modlanguage >= 0)
					data = sChatHandler.FillMessageData(type, GetPlayer()->m_modlanguage,  msg.c_str(), _player->GetGUID(), _player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM) ? 4 : 0);
				else if(lang == 0 && sWorld.interfaction_chat)
					data = sChatHandler.FillMessageData(type, (CanUseCommand('0') && lang != -1) ? LANG_UNIVERSAL : lang, msg.c_str(), _player->GetGUID(), _player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM) ? 4 : 0);
				else
					data = sChatHandler.FillMessageData(type, (CanUseCommand('c') && lang != -1) ? LANG_UNIVERSAL : lang, msg.c_str(), _player->GetGUID(), _player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM) ? 4 : 0);
				if(type == CHAT_MSG_PARTY && pGroup->GetGroupType() == GROUP_TYPE_RAID)
				{
					// only send to that subgroup
					SubGroup* sgr = _player->GetGroup() ?
					                _player->GetGroup()->GetSubGroup(_player->GetSubGroup()) : 0;

					if(sgr)
					{
						_player->GetGroup()->Lock();
						for(GroupMembersSet::iterator itr = sgr->GetGroupMembersBegin(); itr != sgr->GetGroupMembersEnd(); ++itr)
						{
							if((*itr)->m_loggedInPlayer)
								(*itr)->m_loggedInPlayer->GetSession()->SendChatPacket(data, 1, lang, this);
						}
						_player->GetGroup()->Unlock();
					}
				}
				else
				{
					SubGroup* sgr;
					for(uint32 i = 0; i < _player->GetGroup()->GetSubGroupCount(); ++i)
					{
						sgr = _player->GetGroup()->GetSubGroup(i);
						_player->GetGroup()->Lock();
						for(GroupMembersSet::iterator itr = sgr->GetGroupMembersBegin(); itr != sgr->GetGroupMembersEnd(); ++itr)
						{
							if((*itr)->m_loggedInPlayer)
								(*itr)->m_loggedInPlayer->GetSession()->SendChatPacket(data, 1, lang, this);
						}
						_player->GetGroup()->Unlock();

					}
				}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:67,代码来源:ChatHandler.cpp

示例10: HandleRaidTargetUpdateOpcode

void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RAID_TARGET_UPDATE");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    uint8 x, unk;
    recvData >> unk;
    recvData >> x;

    /** error handling **/
    /********************/

    // everything's fine, do it
    if (x == 0xFF)                                           // target icon request
        group->SendTargetIconList(this);
    else                                                    // target icon update
    {
        if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
            return;

        ObjectGuid guid;

        uint8 bitOrder[8] = { 2, 1, 6, 4, 5, 0, 7, 3 };
        recvData.ReadBitInOrder(guid, bitOrder);

        recvData.FlushBits();

        uint8 byteOrder[8] = { 5, 4, 6, 0, 1, 2, 3, 7 };
        recvData.ReadBytesSeq(guid, byteOrder);

        group->SetTargetIcon(x, _player->GetGUID(), guid);
    }
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:36,代码来源:GroupHandler.cpp

示例11: HandleRaidLeaderReadyCheck

void WorldSession::HandleRaidLeaderReadyCheck(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RAID_LEADER_READY_CHECK");

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        return;

	uint32 readyCheckDuration = 35000;
    ObjectGuid groupGUID = group->GetGUID();
    ObjectGuid leaderGUID = GetPlayer()->GetGUID();

    group->SetReadyCheckCount(1);

	WorldPacket data(SMSG_RAID_READY_CHECK, 1 + 8 + 1 + 8 + 1 + 4);
	data.WriteBit(groupGUID[4]);
	data.WriteBit(groupGUID[2]);
	data.WriteBit(leaderGUID[4]);
	data.WriteBit(groupGUID[3]);
	data.WriteBit(groupGUID[7]);
	data.WriteBit(groupGUID[1]);
	data.WriteBit(groupGUID[0]);
	data.WriteBit(leaderGUID[6]);
	data.WriteBit(leaderGUID[5]);
	data.WriteBit(groupGUID[6]);
	data.WriteBit(groupGUID[5]);
	data.WriteBit(leaderGUID[0]);
	data.WriteBit(leaderGUID[1]);
	data.WriteBit(leaderGUID[2]);
	data.WriteBit(leaderGUID[7]);
	data.WriteBit(leaderGUID[3]);

	data << uint32(readyCheckDuration);
	data.WriteByteSeq(groupGUID[2]);
	data.WriteByteSeq(groupGUID[7]);
	data.WriteByteSeq(groupGUID[3]);
	data.WriteByteSeq(leaderGUID[4]);
	data.WriteByteSeq(groupGUID[1]);
	data.WriteByteSeq(groupGUID[0]);
	data.WriteByteSeq(leaderGUID[1]);
	data.WriteByteSeq(leaderGUID[2]);
	data.WriteByteSeq(leaderGUID[6]);
	data.WriteByteSeq(leaderGUID[5]);
	data.WriteByteSeq(groupGUID[6]);
	data.WriteByteSeq(leaderGUID[0]);
	data << uint8(0);                       // unknown
	data.WriteByteSeq(leaderGUID[7]);
	data.WriteByteSeq(groupGUID[4]);
	data.WriteByteSeq(leaderGUID[3]);
	data.WriteByteSeq(groupGUID[5]);
	
    group->BroadcastPacket(&data, false, -1);

    group->OfflineReadyCheck();
}
开发者ID:cooler-SAI,项目名称:PandaFire,代码行数:58,代码来源:GroupHandler.cpp

示例12: HandleGroupSetRolesOpcode

void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_ROLES");

    ObjectGuid targetGuid;                            // Target GUID
    uint32 newRole = 0;
    uint8 unk      = 0;

    recvData >> unk;
    recvData >> newRole;

    uint8 bitOrder[8] = { 5, 3, 1, 0, 2, 6, 7, 4 };
    recvData.ReadBitInOrder(targetGuid, bitOrder);

    recvData.FlushBits();

    uint8 byteOrder[8] = { 4, 6, 1, 3, 0, 7, 5, 2 };
    recvData.ReadBytesSeq(targetGuid, byteOrder);

    Player* tPlayer = ObjectAccessor::FindPlayer(targetGuid);
    Group* group = GetPlayer()->GetGroup();

    if (!tPlayer)
        return;

    if (tPlayer && group)
    {
        // If the target is in another group.
        if (group != tPlayer->GetGroup())
            return;

        // If the target is in the same group but the assigner is not the target itself, neither the leader or assistant (Can only change own roles).
        if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
            if (GetPlayer() != tPlayer)
                return;
    }

    ObjectGuid assignerGuid = GetPlayer()->GetGUID(); // Assigner GUID

    WorldPacket data(SMSG_ROLE_CHANGED_INFORM, 1 + 8 + 1 + 8 + 4 + 1 + 4);

    data.WriteBit(targetGuid[3]);
    data.WriteBit(assignerGuid[3]);
    data.WriteBit(assignerGuid[0]);
    data.WriteBit(targetGuid[5]);
    data.WriteBit(targetGuid[4]);
    data.WriteBit(assignerGuid[1]);
    data.WriteBit(assignerGuid[7]);
    data.WriteBit(assignerGuid[4]);
    data.WriteBit(targetGuid[0]);
    data.WriteBit(assignerGuid[2]);
    data.WriteBit(targetGuid[2]);
    data.WriteBit(assignerGuid[5]);
    data.WriteBit(targetGuid[6]);
    data.WriteBit(targetGuid[1]);
    data.WriteBit(assignerGuid[6]);
    data.WriteBit(targetGuid[7]);

    data.FlushBits();

    data.WriteByteSeq(assignerGuid[5]);
    data.WriteByteSeq(targetGuid[7]);
    data.WriteByteSeq(assignerGuid[4]);
    data.WriteByteSeq(targetGuid[3]);
    data.WriteByteSeq(assignerGuid[1]);
    data.WriteByteSeq(assignerGuid[0]);

    data << uint32(newRole);                                           // New Role

    data.WriteByteSeq(assignerGuid[6]);

    data << uint8(unk);                                                // Unknown - The uint8 in the CMSG above.

    data.WriteByteSeq(targetGuid[2]);
    data.WriteByteSeq(targetGuid[5]);
    data.WriteByteSeq(targetGuid[1]);
    data.WriteByteSeq(assignerGuid[3]);

    data << uint32(group ? group->getGroupMemberRole(targetGuid) : 0); // Old Role

    data.WriteByteSeq(targetGuid[4]);
    data.WriteByteSeq(assignerGuid[2]);
    data.WriteByteSeq(targetGuid[0]);
    data.WriteByteSeq(assignerGuid[7]);
    data.WriteByteSeq(targetGuid[6]);

    if (group)
    {
        group->setGroupMemberRole(targetGuid, newRole);
        group->SendUpdate();
        group->BroadcastPacket(&data, false);
    }
    else
        SendPacket(&data);
}
开发者ID:Expery,项目名称:Core,代码行数:95,代码来源:GroupHandler.cpp

示例13: HandleClearRaidMarkerOpcode

void WorldSession::HandleClearRaidMarkerOpcode(WorldPacket& recvData)
{
    int8 markerId;
    recvData >> markerId;

    Player* plr = GetPlayer();
    if (!plr)
        return;

    Group* group = plr->GetGroup();
    if (!group)
        return;

    if (!group->isRaidGroup() || group->isRaidGroup() && (group->IsAssistant(plr->GetGUID()) || group->IsLeader(plr->GetGUID())) || group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT)
    {
        if (markerId < MAX_RAID_MARKERS)
            group->RemoveRaidMarker(markerId);
        else
            group->RemoveAllRaidMarkers();
    }
}
开发者ID:Expery,项目名称:Core,代码行数:21,代码来源:GroupHandler.cpp

示例14: HandleGroupInviteOpcode


//.........这里部分代码省略.........
    // restrict invite to GMs
    if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_BAD_PLAYER_NAME_S);
        return;
    }

    // can't group with
    if (!GetPlayer()->isGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PLAYER_WRONG_FACTION);
        return;
    }
    if (GetPlayer()->GetInstanceId() != 0 && player->GetInstanceId() != 0 && GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId())
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_TARGET_NOT_IN_INSTANCE_S);
        return;
    }
    // just ignore us
    if (player->GetInstanceId() != 0 && player->GetDungeonDifficulty() != GetPlayer()->GetDungeonDifficulty())
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_IGNORING_YOU_S);
        return;
    }

    if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_IGNORING_YOU_S);
        return;
    }

    Group* group = GetPlayer()->GetGroup();
    if (group && group->isBGGroup())
        group = GetPlayer()->GetOriginalGroup();

    Group* group2 = player->GetGroup();
    if (group2 && group2->isBGGroup())
        group2 = player->GetOriginalGroup();

    // player already in another group or invited
    if (group2 || player->GetGroupInvite())
    {
        SendPartyResult(PARTY_OP_INVITE, memberName, ERR_ALREADY_IN_GROUP_S);

        if (group2)
            player->GetSession()->SendGroupInviteNotification(GetPlayer()->GetName(), true);

        return;
    }

    if (group)
    {
        // not have permissions for invite
        if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        {
            SendPartyResult(PARTY_OP_INVITE, "", ERR_NOT_LEADER);
            return;
        }
        // not have place
        if (group->IsFull())
        {
            SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL);
            return;
        }
    }

    // ok, but group not exist, start a new group
    // but don't create and save the group to the DB until
    // at least one person joins
    if (!group)
    {
        group = new Group;

        // new group: if can't add then delete
        if (!group->AddLeaderInvite(GetPlayer()))
        {
            delete group;
            return;
        }

        if (!group->AddInvite(player))
        {
            delete group;
            return;
        }
    }
    else
    {
        // already existed group: if can't add then just leave
        if (!group->AddInvite(player))
        {
            return;
        }
    }

    // ok, we do it
    player->GetSession()->SendGroupInviteNotification(GetPlayer()->GetName(), false);

    SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK);
}
开发者ID:Expery,项目名称:Core,代码行数:101,代码来源:GroupHandler.cpp

示例15: HandleRaidLeaderReadyCheck

void WorldSession::HandleRaidLeaderReadyCheck(WorldPacket& recvData)
{
    sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RAID_LEADER_READY_CHECK");

    recvData.read_skip<uint8>(); // unk, 0x00

    Group* group = GetPlayer()->GetGroup();
    if (!group)
        return;

    if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()) && !(group->GetGroupType() & GROUPTYPE_EVERYONE_IS_ASSISTANT))
        return;

    ObjectGuid groupGuid = group->GetGUID();
    ObjectGuid playerGuid = GetPlayer()->GetGUID();

    // For the initiator being ready.
    group->SetReadyCheckCount(1);

    // Everything's fine, do it.

    WorldPacket data(SMSG_RAID_READY_CHECK_STARTED, 1 + 8 + 1 + 8 + 1 + 4);

    data.WriteBit(playerGuid[4]);
    data.WriteBit(groupGuid[1]);
    data.WriteBit(groupGuid[4]);
    data.WriteBit(playerGuid[6]);
    data.WriteBit(groupGuid[7]);
    data.WriteBit(groupGuid[6]);
    data.WriteBit(playerGuid[2]);
    data.WriteBit(playerGuid[0]);
    data.WriteBit(playerGuid[7]);
    data.WriteBit(groupGuid[0]);
    data.WriteBit(groupGuid[3]);
    data.WriteBit(groupGuid[5]);
    data.WriteBit(playerGuid[5]);
    data.WriteBit(playerGuid[3]);
    data.WriteBit(playerGuid[1]);
    data.WriteBit(groupGuid[2]);

    data.FlushBits();

    data.WriteByteSeq(groupGuid[6]);
    data.WriteByteSeq(groupGuid[0]);
    data.WriteByteSeq(playerGuid[4]);
    data.WriteByteSeq(playerGuid[7]);
    data.WriteByteSeq(groupGuid[5]);
    data.WriteByteSeq(groupGuid[7]);
    data.WriteByteSeq(playerGuid[6]);
    data.WriteByteSeq(playerGuid[3]);

    data << uint8(0);                       // Unknown

    data.WriteByteSeq(groupGuid[1]);
    data.WriteByteSeq(playerGuid[2]);
    data.WriteByteSeq(groupGuid[3]);
    data.WriteByteSeq(playerGuid[5]);
    data.WriteByteSeq(groupGuid[4]);
    data.WriteByteSeq(groupGuid[2]);

    data << uint32(35000);                  // Ready check duration (35 sec)

    data.WriteByteSeq(playerGuid[1]);
    data.WriteByteSeq(playerGuid[0]);

    group->BroadcastPacket(&data, false, -1);

    group->OfflineReadyCheck();
}
开发者ID:Expery,项目名称:Core,代码行数:69,代码来源:GroupHandler.cpp


注:本文中的Group::GetGroupType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。