• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AssignLength函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SEND_GPSC_RECONNECT

BYTEARRAY CGPSProtocol :: SEND_GPSC_RECONNECT( unsigned char PID, uint32_t reconnectKey, uint32_t lastPacket )
{
	BYTEARRAY packet;
	packet.push_back( GPS_HEADER_CONSTANT );
	packet.push_back( GPS_RECONNECT );
	packet.push_back( 0 );
	packet.push_back( 0 );
	packet.push_back( PID );
	UTIL_AppendByteArray( packet, reconnectKey, false );
	UTIL_AppendByteArray( packet, lastPacket, false );
	AssignLength( packet );
	return packet;
}
开发者ID:Mofsy,项目名称:ghost-one,代码行数:13,代码来源:gpsprotocol.cpp


示例2: SEND_SID_WARDEN

BYTEARRAY CBNETProtocol :: SEND_SID_WARDEN( BYTEARRAY wardenResponse )
{
	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );			// BNET header constant
	packet.push_back( SID_WARDEN );						// SID_WARDEN
	packet.push_back( 0 );								// packet length will be assigned later
	packet.push_back( 0 );								// packet length will be assigned later
	UTIL_AppendByteArrayFast( packet, wardenResponse );	// warden response
	AssignLength( packet );
	// DEBUG_Print( "SENT SID_WARDEN" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:ProDotaTrY,项目名称:ghostcb,代码行数:13,代码来源:bnetprotocol.cpp


示例3: SEND_SID_NETGAMEPORT

BYTEARRAY CBNETProtocol :: SEND_SID_NETGAMEPORT( uint16_t serverPort )
{
	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );			// BNET header constant
	packet.push_back( SID_NETGAMEPORT );				// SID_NETGAMEPORT
	packet.push_back( 0 );								// packet length will be assigned later
	packet.push_back( 0 );								// packet length will be assigned later
	UTIL_AppendByteArray( packet, serverPort, false );	// local game server port
	AssignLength( packet );
	// DEBUG_Print( "SENT SID_NETGAMEPORT" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:ProDotaTrY,项目名称:ghostcb,代码行数:13,代码来源:bnetprotocol.cpp


示例4: SEND_SID_CHATCOMMAND

BYTEARRAY CBNETProtocol :: SEND_SID_CHATCOMMAND( string command )
{
	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );		// BNET header constant
	packet.push_back( SID_CHATCOMMAND );			// SID_CHATCOMMAND
	packet.push_back( 0 );							// packet length will be assigned later
	packet.push_back( 0 );							// packet length will be assigned later
	UTIL_AppendByteArrayFast( packet, command );	// Message
	AssignLength( packet );
	// DEBUG_Print( "SENT SID_CHATCOMMAND" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:ProDotaTrY,项目名称:ghostcb,代码行数:13,代码来源:bnetprotocol.cpp


示例5: SEND_BNLS_WARDEN_RAW

BYTEARRAY CBNLSProtocol :: SEND_BNLS_WARDEN_RAW( uint32_t cookie, BYTEARRAY raw )
{
    BYTEARRAY packet;
    packet.push_back( 0 );											// packet length will be assigned later
    packet.push_back( 0 );											// packet length will be assigned later
    packet.push_back( BNLS_WARDEN );								// BNLS_WARDEN
    packet.push_back( 1 );											// BNLS_WARDEN_RAW
    UTIL_AppendByteArray( packet, cookie, false );					// cookie
    UTIL_AppendByteArray( packet, (uint16_t)raw.size( ), false );	// raw length
    UTIL_AppendByteArray( packet, raw );							// raw
    AssignLength( packet );
    return packet;
}
开发者ID:ProDotaTrY,项目名称:ghostcb,代码行数:13,代码来源:bnlsprotocol.cpp


示例6: SEND_GPSS_INIT

BYTEARRAY CGPSProtocol :: SEND_GPSS_INIT( uint16_t reconnectPort, unsigned char PID, uint32_t reconnectKey, unsigned char numEmptyActions )
{
	BYTEARRAY packet;
	packet.push_back( GPS_HEADER_CONSTANT );
	packet.push_back( GPS_INIT );
	packet.push_back( 0 );
	packet.push_back( 0 );
	UTIL_AppendByteArray( packet, reconnectPort, false );
	packet.push_back( PID );
	UTIL_AppendByteArray( packet, reconnectKey, false );
	packet.push_back( numEmptyActions );
	AssignLength( packet );
	return packet;
}
开发者ID:PrOGm2,项目名称:ent-ghost,代码行数:14,代码来源:gpsprotocol.cpp


示例7: SEND_SID_CLANSETMOTD

BYTEARRAY CBNETProtocol :: SEND_SID_CLANSETMOTD( string motd )
{
	unsigned char Cookie[] = { 0, 0, 0, 0 };

	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );	// BNET header constant
	packet.push_back( SID_CLANSETMOTD );		// SID_CLANSETMOTD
	packet.push_back( 0 );						// packet length will be assigned later
	packet.push_back( 0 );						// packet length will be assigned later
	UTIL_AppendByteArray( packet, Cookie, 4);
	UTIL_AppendByteArray( packet, motd);
	AssignLength( packet );
	return packet;
}
开发者ID:4RtY,项目名称:ghostpp,代码行数:14,代码来源:bnetprotocol.cpp


示例8: SendUnableToCreate

BYTEARRAY CPUBProtocol :: SendUnableToCreate( )
{
    BYTEARRAY packet;

    packet.push_back( PUB_HEADER_CONSTANT );		// Auth header  1 byte
    packet.push_back( PUB_UNABLETOCREATE );           // 1 byte

    packet.push_back( 0 );           // 1 byte
    packet.push_back( 0 );           // 1 byte

    AssignLength(packet);

    return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:14,代码来源:pubprotocol.cpp


示例9: SEND_SID_CLANINVITATION

BYTEARRAY CBNETProtocol :: SEND_SID_CLANINVITATION( string accountName )
{
	unsigned char Cookie[] = { 0, 0, 0, 0 };

	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );	// BNET header constant
	packet.push_back( SID_CLANINVITATION );		// SID_CLANINVITATION
	packet.push_back( 0 );						// packet length will be assigned later
	packet.push_back( 0 );						// packet length will be assigned later
	UTIL_AppendByteArray( packet, Cookie, 4);
	UTIL_AppendByteArray( packet, accountName);
	AssignLength( packet );
	return packet;	
}
开发者ID:4RtY,项目名称:ghostpp,代码行数:14,代码来源:bnetprotocol.cpp


示例10: SEND_GAME_KEY

BYTEARRAY CPUBProtocol :: SEND_GAME_KEY( string key, string login )
{
	BYTEARRAY packet;
	packet.push_back( PUB_HEADER_CONSTANT );
	packet.push_back( this->PUB_BOT_GAME_KEY );
	packet.push_back( 0 );
	packet.push_back( 0 );
	packet.push_back( key.size() );
	UTIL_AppendByteArray( packet, key, false );
	packet.push_back( login.size() );
	UTIL_AppendByteArray( packet, login, false );
	AssignLength( packet );
	return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:14,代码来源:pubprotocol.cpp


示例11: SendVersionOk

BYTEARRAY CPUBProtocol :: SendVersionOk()
{
    BYTEARRAY packet;

    packet.push_back( PUB_HEADER_CONSTANT );
    packet.push_back( PUB_VERSION_OK );

    packet.push_back( 0 ); // assign later
    packet.push_back( 0 ); // assign later

    AssignLength(packet);

    return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:14,代码来源:pubprotocol.cpp


示例12: SendAuthFailed

BYTEARRAY CPUBProtocol :: SendAuthFailed( )
{
    BYTEARRAY packet;

    packet.push_back( PUB_HEADER_CONSTANT );		// Auth header  1 byte
    packet.push_back( PUB_AUTH_FAILED );           // 1 byte

    packet.push_back(0);
    packet.push_back(0);

    AssignLength(packet);

    return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:14,代码来源:pubprotocol.cpp


示例13: SEND_SID_ENTERCHAT

BYTEARRAY CBNETProtocol :: SEND_SID_ENTERCHAT( )
{
	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );	// BNET header constant
	packet.push_back( SID_ENTERCHAT );			// SID_ENTERCHAT
	packet.push_back( 0 );						// packet length will be assigned later
	packet.push_back( 0 );						// packet length will be assigned later
	packet.push_back( 0 );						// Account Name is NULL on Warcraft III/The Frozen Throne
	packet.push_back( 0 );						// Stat String is NULL on CDKEY'd products
	AssignLength( packet );
	// DEBUG_Print( "SENT SID_ENTERCHAT" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:RiseCakoPlusplus,项目名称:brtGHost,代码行数:14,代码来源:bnetprotocol.cpp


示例14: SEND_SID_CLANMEMBERLIST

BYTEARRAY CBNETProtocol :: SEND_SID_CLANMEMBERLIST( )
{
	unsigned char Cookie[] = { 0, 0, 0, 0 };

	BYTEARRAY packet;
	packet.push_back( BNET_HEADER_CONSTANT );	// BNET header constant
	packet.push_back( SID_CLANMEMBERLIST );		// SID_CLANMEMBERLIST
	packet.push_back( 0 );						// packet length will be assigned later
	packet.push_back( 0 );						// packet length will be assigned later
	UTIL_AppendByteArray( packet, Cookie, 4 );	// cookie
	AssignLength( packet );
	// DEBUG_Print( "SENT SID_CLANMEMBERLIST" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:RiseCakoPlusplus,项目名称:brtGHost,代码行数:15,代码来源:bnetprotocol.cpp


示例15: SEND_W3GS_SLOTINFO

BYTEARRAY CGameProtocol :: SEND_W3GS_SLOTINFO( vector<CGameSlot> &slots, uint32_t randomSeed, unsigned char layoutStyle, unsigned char playerSlots )
{
	BYTEARRAY SlotInfo = EncodeSlotInfo( slots, randomSeed, layoutStyle, playerSlots );
	BYTEARRAY packet;
	packet.push_back( W3GS_HEADER_CONSTANT );									// W3GS header constant
	packet.push_back( W3GS_SLOTINFO );											// W3GS_SLOTINFO
	packet.push_back( 0 );														// packet length will be assigned later
	packet.push_back( 0 );														// packet length will be assigned later
	UTIL_AppendByteArray( packet, (uint16_t)SlotInfo.size( ), false );			// SlotInfo length
	UTIL_AppendByteArrayFast( packet, SlotInfo );								// SlotInfo
	AssignLength( packet );
	// DEBUG_Print( "SENT W3GS_SLOTINFO" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:brunobnb,项目名称:ghostcb,代码行数:15,代码来源:gameprotocol.cpp


示例16: SEND_W3GS_DECREATEGAME

BYTEARRAY CGameProtocol :: SEND_W3GS_DECREATEGAME( )
{
	unsigned char HostCounter[]	= { 1, 0, 0, 0 };

	BYTEARRAY packet;
	packet.push_back( W3GS_HEADER_CONSTANT );			// W3GS header constant
	packet.push_back( W3GS_DECREATEGAME );				// W3GS_DECREATEGAME
	packet.push_back( 0 );								// packet length will be assigned later
	packet.push_back( 0 );								// packet length will be assigned later
	UTIL_AppendByteArray( packet, HostCounter, 4 );		// Host Counter
	AssignLength( packet );
	// DEBUG_Print( "SENT W3GS_DECREATEGAME" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:brunobnb,项目名称:ghostcb,代码行数:15,代码来源:gameprotocol.cpp


示例17: SEND_W3GS_REFRESHGAME

BYTEARRAY CGameProtocol :: SEND_W3GS_REFRESHGAME( uint32_t players, uint32_t playerSlots, uint32_t HostCounter )
{
	BYTEARRAY packet;
	packet.push_back( W3GS_HEADER_CONSTANT );			// W3GS header constant
	packet.push_back( W3GS_REFRESHGAME );				// W3GS_REFRESHGAME
	packet.push_back( 0 );								// packet length will be assigned later
	packet.push_back( 0 );								// packet length will be assigned later
	UTIL_AppendByteArray( packet, HostCounter, false );		// Host Counter
	UTIL_AppendByteArray( packet, players, false );		// Players
	UTIL_AppendByteArray( packet, playerSlots, false );	// Player Slots
	AssignLength( packet );
	// DEBUG_Print( "SENT W3GS_REFRESHGAME" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:interkill,项目名称:brtghost,代码行数:15,代码来源:gameprotocol.cpp


示例18: SendPlayerLowScore

BYTEARRAY CPUBProtocol :: SendPlayerLowScore( uint16_t nScore )
{
     BYTEARRAY packet;

    packet.push_back( PUB_HEADER_CONSTANT );		// Auth header  1 byte
    packet.push_back( PUB_LOWSCORE );           // 1 byte

    packet.push_back( 0 );           // 1 byte
    packet.push_back( 0 );           // 1 byte

    UTIL_AppendByteArray( packet, nScore, false);

    AssignLength(packet);

    return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:16,代码来源:pubprotocol.cpp


示例19: SendCurrentOnline

BYTEARRAY CPUBProtocol :: SendCurrentOnline( const uint32_t nCurrentOnline )
{
    BYTEARRAY packet;

    packet.push_back( PUB_HEADER_CONSTANT );		// Auth header  1 byte
    packet.push_back( PUB_CURRENT_ONLINE );           // 1 byte

    packet.push_back( 0 );           // 1 byte
    packet.push_back( 0 );           // 1 byte

    UTIL_AppendByteArray( packet, nCurrentOnline, false );

    AssignLength(packet);

    return packet;
}
开发者ID:brunobnb,项目名称:brtGHost,代码行数:16,代码来源:pubprotocol.cpp


示例20: SEND_W3GS_STARTDOWNLOAD

BYTEARRAY CGameProtocol :: SEND_W3GS_STARTDOWNLOAD( unsigned char fromPID )
{
	unsigned char Unknown[] = { 1, 0, 0, 0 };

	BYTEARRAY packet;
	packet.push_back( W3GS_HEADER_CONSTANT );				// W3GS header constant
	packet.push_back( W3GS_STARTDOWNLOAD );					// W3GS_STARTDOWNLOAD
	packet.push_back( 0 );									// packet length will be assigned later
	packet.push_back( 0 );									// packet length will be assigned later
	UTIL_AppendByteArray( packet, Unknown, 4 );				// ???
	packet.push_back( fromPID );							// from PID
	AssignLength( packet );
	// DEBUG_Print( "SENT W3GS_STARTDOWNLOAD" );
	// DEBUG_Print( packet );
	return packet;
}
开发者ID:brunobnb,项目名称:ghostcb,代码行数:16,代码来源:gameprotocol.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AssignOutputVariable函数代码示例发布时间:2022-05-30
下一篇:
C++ Assign函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap