當前位置: 首頁>>代碼示例>>C++>>正文


C++ AssignLength函數代碼示例

本文整理匯總了C++中AssignLength函數的典型用法代碼示例。如果您正苦於以下問題:C++ AssignLength函數的具體用法?C++ AssignLength怎麽用?C++ AssignLength使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AssignLength函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的AssignLength函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。