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


C++ WBUFB函数代码示例

本文整理汇总了C++中WBUFB函数的典型用法代码示例。如果您正苦于以下问题:C++ WBUFB函数的具体用法?C++ WBUFB怎么用?C++ WBUFB使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: WBUFB

CWideScanPacket::CWideScanPacket(WIDESCAN_STATUS status) 
{
	this->type = 0xF6;
	this->size = 0x04;

	WBUFB(data,(0x04)-4) = status;
}
开发者ID:ZeDingo,项目名称:darkstar,代码行数:7,代码来源:wide_scan.cpp

示例2: WBUFB

CCharAppearancePacket::CCharAppearancePacket(CCharEntity* PChar)
{
	this->type = 0x51;
	this->size = 0x0C;

	WBUFB(data,(0x04)-4) = PChar->look.face;
	WBUFB(data,(0x05)-4) = PChar->look.race;
	WBUFW(data,(0x06)-4) = PChar->look.head   + 0x1000;
	WBUFW(data,(0x08)-4) = PChar->look.body   + 0x2000;
	WBUFW(data,(0x0A)-4) = PChar->look.hands  + 0x3000;
	WBUFW(data,(0x0C)-4) = PChar->look.legs   + 0x4000;
	WBUFW(data,(0x0E)-4) = PChar->look.feet   + 0x5000;
	WBUFW(data,(0x10)-4) = PChar->look.main   + 0x6000;
	WBUFW(data,(0x12)-4) = PChar->look.sub    + 0x7000;
	WBUFW(data,(0x14)-4) = PChar->look.ranged + 0x8000;
}
开发者ID:Gwynthell,项目名称:FFDB,代码行数:16,代码来源:char_appearance.cpp

示例3: WBUFB

CShopMenuPacket::CShopMenuPacket(CCharEntity * PChar) 
{
	this->type = 0x3E;
	this->size = 0x04;

	WBUFB(data,(0x04)-4) = PChar->Container->getItemsCount();
}
开发者ID:fedaykinofdune,项目名称:ffxinfinity,代码行数:7,代码来源:shop_menu.cpp

示例4: WBUFL

CCharRecastPacket::CCharRecastPacket(CCharEntity* PChar)
{
    this->type = 0x19;
    this->size = 0x7F;

    uint8 count = 0;

    RecastList_t* RecastList = PChar->PRecastContainer->GetRecastList(RECAST_ABILITY);

    for (uint16 i = 0; i < RecastList->size(); ++i)
    {
        Recast_t* recast = RecastList->at(i);

        uint32 recasttime = (recast->RecastTime == 0 ? 0 : ((recast->RecastTime - (time(nullptr) - recast->TimeStamp))));

        if (recast->ID != 0)
        {
            WBUFL(data, (0x0C + count * 8) ) = recasttime;
            WBUFB(data, (0x0F + count * 8) ) = recast->ID;
            count++;
        }
        else
        {
            WBUFL(data, (0x04) ) = recasttime;  // 2h ability (recast id is 0)
        }
    }
}
开发者ID:Anthiam,项目名称:darkstar,代码行数:27,代码来源:char_recast.cpp

示例5: WBUFB

CInventoryFinishPacket::CInventoryFinishPacket() 
{
	this->type = 0x1D;
	this->size = 0x04;

	WBUFB(data,(0x04)-4) = 1;
}
开发者ID:fedaykinofdune,项目名称:ffxinfinity,代码行数:7,代码来源:inventory_finish.cpp

示例6: CBasicPacket

CShopItemsPacket::CShopItemsPacket(CCharEntity * PChar)
{
	this->type = 0x3C;
	this->size = 0x04;

	uint8 ItemsCount = PChar->Container->getItemsCount();

    uint8 i = 0;
	for (uint8 slotID = 0; slotID < ItemsCount; ++slotID)
	{
        if (i == 20)
        {
            PChar->pushPacket(new CBasicPacket(*this));

            i = 0;
            this->size = 0x04;
            memset(data, 0, sizeof(data));
        }
		this->size += 0x06;

		WBUFL(data,((i*12)+0x08)-4) = PChar->Container->getQuantity(slotID);
		WBUFW(data,((i*12)+0x0C)-4) = PChar->Container->getItemID(slotID);
		WBUFB(data,((i*12)+0x0E)-4) = slotID;
        i++;
	}
}
开发者ID:Celyste,项目名称:darkstar,代码行数:26,代码来源:shop_items.cpp

示例7: WBUFB

void CQuestMissionLogPacket::generateCurrentMissionPacket(CCharEntity * PChar)
{
    uint16 add_on_scenarios = 0;
    
    add_on_scenarios += PChar->m_missionLog[MISSION_ACP].current;
    add_on_scenarios += PChar->m_missionLog[MISSION_AMK].current << 0x04;
    add_on_scenarios += PChar->m_missionLog[MISSION_ASA].current << 0x08;
    // Not perfect, but they display and missions DO progress. Can fix properly later. There is a delay before when the menu updates. Zoning will force it.

    uint32 chains = 0;
    chains = PChar->m_missionLog[MISSION_COP].current + 1;
    chains = ((chains * 0x08) + 0x60);

    uint32 soa = (PChar->m_missionLog[MISSION_SOA].current * 2) + 0x6E;
    uint32 rov = PChar->m_missionLog[MISSION_ROV].current + 0x6C;

    // While current National Missions + Zilart Mission are updated in this packet, completed missions are sent in a separate one.
    WBUFB(data, (0x04)) = PChar->profile.nation;                                // Nation
    WBUFW(data, (0x08)) = PChar->m_missionLog[PChar->profile.nation].current;   // National Missions
    WBUFW(data, (0x0C)) = PChar->m_missionLog[MISSION_ZILART].current;          // Rise of the Zilart

    // But for COP, Add-On Scenarios, SOA, and ROV, sending the current mission will also update that log's completed missions.
    WBUFL(data, (0x10)) = chains;												// Chains of Promathia Missions
    //WBUFB(data,(0x16)) = 0x30;                                                // назначение неизвестно
    WBUFW(data, (0x18)) = add_on_scenarios;                                     // A Crystalline Prophecy, A Moogle Kupo d'Etat, A Shantotto Ascension
    WBUFW(data, (0x1C)) = soa;                                                  // Seekers of Adoulin
    WBUFW(data, (0x20)) = rov;                                                  // Rhapsodies of Vana'diel
}
开发者ID:Darkstorm87,项目名称:darkstar,代码行数:28,代码来源:quest_mission_log.cpp

示例8: WBUFL

CCharSkillsPacket::CCharSkillsPacket(CCharEntity* PChar) 
{
	this->type = 0x62;
	this->size = 0x80;

	uint8 count = 0; 

    RecastList_t* RecastList = PChar->PRecastContainer->GetRecastList(RECAST_ABILITY);

    for (uint16 i = 0; i < RecastList->size(); ++i) 
	{
        Recast_t* recast = RecastList->at(i);

		uint32 time = (recast->RecastTime == 0 ? 0 : ((recast->RecastTime - (gettick() - recast->TimeStamp)) / 1000));

		if(recast->ID != 0) 
		{
            WBUFL(data,(0x08 + count*4)-4) = time;
            WBUFB(data,(0x0B + count*4)-4) = recast->ID;
			count++;
		} 
		else
		{
            WBUFL(data,(0x04)-4) = time;  // 2h ability (recast id is 0)
		}
    }
	memcpy(data+(0x80)-4, &PChar->WorkingSkills, 128);
}
开发者ID:ZeDingo,项目名称:darkstar,代码行数:28,代码来源:char_skills.cpp

示例9: logchrif_parse_reqchgsex

/**
 * Receiving a sex change request (sex is reversed).
 * @param fd: fd to parse from (char-serv)
 * @param id: id of char-serv
 * @param ip: char-serv ip (used for info)
 * @return 0 not enough info transmitted, 1 success
 */
int logchrif_parse_reqchgsex(int fd, int id, char* ip){
	if( RFIFOREST(fd) < 6 )
		return 0;
	else{
		struct mmo_account acc;
		AccountDB* accounts = login_get_accounts_db();

		uint32 account_id = RFIFOL(fd,2);
		RFIFOSKIP(fd,6);

		if( !accounts->load_num(accounts, &acc, account_id) )
			ShowNotice("Char-server '%s': Error of sex change (account: %d not found, ip: %s).\n", ch_server[id].name, account_id, ip);
		else if( acc.sex == 'S' )
			ShowNotice("Char-server '%s': Error of sex change - account to change is a Server account (account: %d, ip: %s).\n", ch_server[id].name, account_id, ip);
		else{
			unsigned char buf[7];
			char sex = ( acc.sex == 'M' ) ? 'F' : 'M'; //Change gender

			ShowNotice("Char-server '%s': Sex change (account: %d, new sex %c, ip: %s).\n", ch_server[id].name, account_id, sex, ip);

			acc.sex = sex;
			// Save
			accounts->save(accounts, &acc);

			// announce to other servers
			WBUFW(buf,0) = 0x2723;
			WBUFL(buf,2) = account_id;
			WBUFB(buf,6) = sex_str2num(sex);
			logchrif_sendallwos(-1, buf, 7);
		}
	}
	return 1;
}
开发者ID:RadianFord,项目名称:rAthena,代码行数:40,代码来源:loginchrif.cpp

示例10: WBUFW

CMessageStandardPacket::CMessageStandardPacket(CCharEntity* PChar, uint32 param0, uint32 param1, uint16 MessageID)
{
	this->type = 0x09;
	this->size = 0x12;

	WBUFW(data,(0x0A)-4) = MessageID;

	if (PChar != nullptr)
	{
		WBUFL(data,(0x04)-4) = PChar->id;
		WBUFW(data,(0x08)-4) = PChar->targid;
		
		if (MessageID == 0x59) 
		{
			this->size = 0x30;

			WBUFB(data,(0x0C)-4) = 0x10;

			snprintf((int8*)data+(0x0D)-4, 24, "string2 %s", PChar->GetName());
		}
	}
	else
	{
		snprintf((int8*)data+(0x0D)-4, 20, "Para0 %d Para1 %d", param0, param1);
	}
}
开发者ID:Ex0r,项目名称:darkstar,代码行数:26,代码来源:message_standard.cpp

示例11: WBUFL

CFadeOutPacket::CFadeOutPacket(CBaseEntity * PEntity)
{
	this->type = 0x38;
	this->size = 0x0A;

	WBUFL(data,(0x04)-4) = PEntity->id;
	WBUFL(data,(0x08)-4) = PEntity->id;
	
	WBUFB(data,(0x0C)-4) = 0x6b;
	WBUFB(data,(0x0D)-4) = 0x65;
	WBUFB(data,(0x0E)-4) = 0x73;
	WBUFB(data,(0x0F)-4) = 0x75;

	WBUFW(data,(0x10)-4) = PEntity->targid;
	WBUFW(data,(0x12)-4) = PEntity->targid;
}
开发者ID:Annihilus343,项目名称:darkstar,代码行数:16,代码来源:fade_out.cpp

示例12: WBUFB

CChangeMusicPacket::CChangeMusicPacket(uint8 BlockID, uint8 MusicTrackID)
{
    // Block IDs:
    // 0 Background Music (Day time, 7:00 -> 18:00)
    // 1 Background Music (Night time, 18:00 -> 7:00)
    // 2 SoloBattle Music
    // 3 Party Battle Music
    // 4 Chocobo Music
    // More types likely exist

    this->type = 0x5F;
    this->size = 0x04;

    WBUFB(data,(0x04)-4) = BlockID;        // block
    WBUFB(data,(0x06)-4) = MusicTrackID;   // music
}
开发者ID:Ex0r,项目名称:darkstar,代码行数:16,代码来源:change_music.cpp

示例13: DSP_DEBUG_BREAK_IF

CPartyMemberUpdatePacket::CPartyMemberUpdatePacket(CCharEntity* PChar, uint8 MemberNumber, uint8 ZoneID) 
{
	this->type = 0xDD;
	this->size = 0x18;	

	DSP_DEBUG_BREAK_IF(PChar == NULL);

	WBUFL(data,(0x04)-4) = PChar->id;

	if (PChar->PParty != NULL)
	{
		uint16 PartyFlags = 0;

		if (PChar->PParty->GetLeader() == PChar)
		{
			PartyFlags += PARTY_LEADER;
		}
		if (PChar->PParty->GetQuaterMaster() == PChar)
		{
			PartyFlags += PARTY_QM;
		}
		if (PChar->PParty->GetSyncTarget() == PChar)
		{
			PartyFlags += PARTY_SYNC;
		}
		WBUFW(data,(0x14)-4) = PartyFlags;
	}
	if (PChar->getZone() != ZoneID) 
	{
		WBUFB(data,(0x1F)-4) = PChar->getZone();
	} 
	else
	{
		WBUFW(data,(0x08)-4) = PChar->health.hp;
		WBUFW(data,(0x0C)-4) = PChar->health.mp; 
		WBUFW(data,(0x10)-4) = PChar->health.tp;

		WBUFB(data,(0x1D)-4) = PChar->GetHPP(); 
		WBUFB(data,(0x1E)-4) = PChar->GetMPP();

		WBUFW(data,(0x18)-4) = PChar->targid;

		WBUFB(data,(0x1A)-4) = MemberNumber;
	}

	memcpy(data+(0x20)-4, PChar->GetName(), PChar->name.size()); 
}
开发者ID:Laterus,项目名称:Darkstar-Linux-Fork,代码行数:47,代码来源:party_member_update.cpp

示例14: WBUFB

CShopBuyPacket::CShopBuyPacket(uint8 slotID, uint32 quantity)
{
	this->type = 0x3F;
	this->size = 0x06;

	WBUFB(data,(0x04)-4) = slotID;
	WBUFL(data,(0x08)-4) = quantity;
}
开发者ID:Gwynthell,项目名称:FFDB,代码行数:8,代码来源:shop_buy.cpp

示例15: strlen

CChatMessagePacket::CChatMessagePacket(CCharEntity* PChar, CHAT_MESSAGE_TYPE MessageType, int8* buff)
{
     // Determine the return message length..
     int32 buffSize = (strlen(buff) > 108) ? 108 : strlen(buff);

     // Build the packet..
     this->type = 0x17;
     this->size = dsp_min((32 + (buffSize + 1) + ((4 - ((buffSize + 1) % 4)) % 4)) / 2, 128);

     WBUFB(data, (0x04) - 4) = MessageType;
     if (PChar->nameflags.flags & FLAG_GM)
        WBUFB(data, (0x05) - 4) = 0x01;
     WBUFW(data, (0x06) - 4) = PChar->getZone();

     memcpy(data + (0x08) - 4, PChar->GetName(), PChar->name.size());
     memcpy(data + (0x18) - 4, buff, buffSize);
}
开发者ID:Ex0r,项目名称:darkstar,代码行数:17,代码来源:chat_message.cpp


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