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


C++ CAr::Write方法代码示例

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


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

示例1: Serialize

int CRTMessenger::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_dwState;
		ar << static_cast<int>( size() );
		for( map<u_long, Friend>::iterator i = begin(); i != end(); ++i )
		{
			ar << i->first;
			ar.Write( &i->second, sizeof(Friend) );
		}
	}
	else
	{
		clear();
		ar >> m_dwState;
		int nSize;
		ar >> nSize;

		if( nSize > MAX_FRIEND )
			return nSize;

		u_long idFriend;

		int i; for( i = 0; i < nSize; i++ )
		{
			ar >> idFriend;
			Friend f;
			ar.Read( &f, sizeof(Friend) );
			SetFriend( idFriend, &f );
		}
	}
	return 0;
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:34,代码来源:rtmessenger.cpp

示例2: SendGSCSStart

// 빌링서버에 connect될 때, 이를 빌링서버에 알린다.
void CDPBilling::SendGSCSStart()
{
	OutputDebugString("send 0x00000005 - GSCS_START\n");

	char cbServerName[MAX_SERVERNAME];
	AppendEndMark( cbServerName, g_szServerName, MAX_SERVERNAME );
	
	CAr	ar;
	int nBufSize;
	
	ar << htonl( static_cast<DWORD>(GSCS_START_SEND) );
	ar.Write( cbServerName, MAX_SERVERNAME );
	
	SEND( ar, this, DPID_SERVERPLAYER );
}
开发者ID:ElectraX,项目名称:FlyFF,代码行数:16,代码来源:dpBilling.cpp

示例3: SendGameStart

// 과금정보 REQ
void CDPBilling::SendGameStart( LPCTSTR lpszUserID, LPCTSTR lpszUserIP )
{
	OutputDebugString("send 0x00000001 - GAME_START\n");

	char cbUserID[MAX_ID_LENGTH];
	char cbUserIP[MAX_IP_LENGTH];

	AppendEndMark( cbUserID, lpszUserID, MAX_ID_LENGTH );
	char* p = StrCpyExcludeNull( cbUserIP, lpszUserIP );
	AppendSpace( p, cbUserIP + MAX_IP_LENGTH );

	CAr	ar;
	int nBufSize;
	ar << htonl( static_cast<DWORD>(GAME_START_SEND) );
	ar.Write( cbUserID, MAX_ID_LENGTH );
	ar.Write( cbUserIP, MAX_IP_LENGTH );
	SEND( ar, this, DPID_SERVERPLAYER );
}
开发者ID:ElectraX,项目名称:FlyFF,代码行数:19,代码来源:dpBilling.cpp

示例4: Serialize

void CGuildWar::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_idWar;
		ar.Write( &m_Decl, sizeof(m_Decl) );
		ar.Write( &m_Acpt, sizeof(m_Acpt) );
		ar << m_nFlag;
		ar << (time_t)m_time.GetTime();
	}
	else
	{
		ar >> m_idWar;
		ar.Read( &m_Decl, sizeof(m_Decl) );
		ar.Read( &m_Acpt, sizeof(m_Acpt) );
		ar >> m_nFlag;
		time_t time;
		ar >> time;
		m_time	= CTime( time );
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:21,代码来源:guildwar.cpp

示例5: Serialize

void CMover::Serialize( CAr & ar )
{
	CCtrl::Serialize( ar );	//	25
	DWORD dwGold;

	if( ar.IsStoring() )	// STORING
	{
		ar << (u_short)m_dwMotion;
		ar << (u_char)m_bPlayer;
		ar << m_nHitPoint;
		ar << m_pActMover->GetState();
		ar << m_pActMover->GetStateFlag();
		ar << (u_char)m_dwBelligerence;
#if __VER >= 15 // __PETVIS
		ar << m_dwMoverSfxId;
#endif // __PETVIS
		if( m_bPlayer )	// PLAYER
		{
			ar.WriteString( m_szName );
			ar << GetSex();
			ar << (u_char)m_dwSkinSet;
			ar << (u_char)m_dwHairMesh;
			ar << m_dwHairColor;
			ar << (u_char)m_dwHeadMesh;
			ar << m_idPlayer;
			ar << (u_char)m_nJob;
			ar << (u_short)m_nStr;
			ar << (u_short)m_nSta;
			ar << (u_short)m_nDex;
			ar << (u_short)m_nInt;
			ar << (u_short)m_nLevel;
			ar << m_nFuel;
			ar << m_tmAccFuel;
			if( m_idGuild > 0 )
			{
				ar << (u_char)1;
				ar << m_idGuild;
				ar << m_idWar;
			}
			else
			{
				ar << (u_char)0;
			}
			ar << m_idGuildCloak;

			if( m_idparty > 0 )
			{
				ar << (u_char)1;
				ar << m_idparty;
				ar << m_idDuelParty;
			}
			else
			{
				ar << (u_char)0;
			}

			ar << (char)m_dwAuthorization;
			ar << m_dwMode;
			ar << m_dwStateMode;
 #ifdef __WORLDSERVER
			CItemElem* pItemElem = m_Inventory.GetAtId( m_dwUseItemId );
			if( pItemElem )
				ar << pItemElem->GetProp()->dwID;
			else
				ar << (OBJID)0;
 #else // __WORLDSERVER
			ar << m_dwUseItemId;
 #endif // __WORLDSERVER
#if __VER >= 8 // __S8_PK
			if( m_dwPKTime > 0 )
	#ifdef __WORLDSERVER
				ar << ( m_dwPKTime - GetTickCount() );
	#else // __WORLDSERVER
				ar << m_dwPKTime;
	#endif // __WORLDSERVER
			else
				ar << m_dwPKTime;
			ar << m_nPKValue;
			ar << m_dwPKPropensity;
			ar << m_dwPKExp;
#else // __VER >= 8 // __S8_PK
			ar << (u_short)m_nNumKill;
			ar << m_nSlaughter;
#endif // __VER >= 8 // __S8_PK
			ar << m_nFame;
			ar << (u_char)m_nDuel;
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
			ar << m_nHonor;					// 달인선택 
#endif	// __HONORABLE_TITLE			// 달인
			{
				int i;
				for( i = 0; i < MAX_HUMAN_PARTS; i ++ )
				{
					ar << m_aEquipInfo[i].nOption;
				}
			}
			ar << m_nGuildCombatState;
			
			for( int j = 0 ; j < SM_MAX ; ++j )
				ar << m_dwSMTime[j];
//.........这里部分代码省略.........
开发者ID:KerwinMa,项目名称:SourceFlyFF,代码行数:101,代码来源:ObjSerializeOpt.cpp


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