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


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

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


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

示例1: Serialize

void CParty::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_uPartyId << m_nKindTroup << m_nSizeofMember;
		ar << m_nLevel << m_nExp << m_nPoint;
		ar << m_nTroupsShareExp << m_nTroupeShareItem;
		ar << m_idDuelParty;
		for( int i = 0 ; i < MAX_PARTYMODE  ; i++ )
		{
			ar << m_nModeTime[i];
		}
		if( m_nKindTroup )
			ar.WriteString( m_sParty );
		for( i = 0 ; i < m_nSizeofMember ; i++ )
		{
			ar << m_aMember[i].m_uPlayerId;
#if __VER < 11 // __SYS_PLAYER_DATA
			ar << m_aMember[i].m_nLevel;
			ar << m_aMember[i].m_nJob;
#endif	// __SYS_PLAYER_DATA
			ar << m_aMember[i].m_bRemove;
#if __VER < 11 // __SYS_PLAYER_DATA
			ar << m_aMember[i].m_nSex;
			ar.WriteString( m_aMember[i].m_szName );
#endif	// __SYS_PLAYER_DATA
		}
	}
	else
	{
		ar >> m_uPartyId >> m_nKindTroup >> m_nSizeofMember;
		ar >> m_nLevel >> m_nExp >> m_nPoint;
		ar >> m_nTroupsShareExp >> m_nTroupeShareItem;
		ar >> m_idDuelParty;
		for( int i = 0 ; i < MAX_PARTYMODE  ; i++ )
		{
			ar >> m_nModeTime[i];
		}
		if( m_nKindTroup )
			ar.ReadString( m_sParty, 33 );
		for( i = 0 ; i < m_nSizeofMember ; i++ )
		{
			ar >> m_aMember[i].m_uPlayerId;
#if __VER < 11 // __SYS_PLAYER_DATA
			ar >> m_aMember[i].m_nLevel;
			ar >> m_aMember[i].m_nJob;
#endif	// __SYS_PLAYER_DATA
			ar >> m_aMember[i].m_bRemove;
#if __VER < 11 // __SYS_PLAYER_DATA
			ar >> m_aMember[i].m_nSex;
			ar.ReadString( m_aMember[i].m_szName, 20 );
#endif	// __SYS_PLAYER_DATA
		}
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:55,代码来源:party.cpp

示例2: Write

void CWantedListSnapshot::Write( CAr& ar )
{
	ar << m_lRecvTime;
	ar << (int)m_wantedList.size();

	WANTED_ENTRY_VECTOR::iterator it;
	for( it = m_wantedList.begin(); it != m_wantedList.end(); ++it )
	{
		ar.WriteString( (*it).szPlayer );
		ar << (*it).nGold;
		ar << (*it).nEnd; 
		ar.WriteString( (*it).szMsg );
	}
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:14,代码来源:WantedListSnapshot.cpp

示例3: Serialize

void CServerDesc::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_uKey;
		ar << (short)m_lspJurisdiction.size();
		for( list<CJurisdiction*>::iterator i = m_lspJurisdiction.begin(); i != m_lspJurisdiction.end(); ++i )
		{
			ar << (*i)->m_dwWorldID;
			ar << (*i)->m_rect;
			ar << (*i)->m_wLeft;
			ar << (*i)->m_wRight;
		}
		ar.WriteString( m_szAddr );
	}
	else
	{
		u_long uKey;
		ar >> uKey;
		SetKey( uKey );
		short nSize;
		ar >> nSize;
		for( int i =0; i < nSize; i++ )
		{
			CJurisdiction* pJurisdiction	= new CJurisdiction;
			ar >> pJurisdiction->m_dwWorldID;
			ar >> pJurisdiction->m_rect;
			ar >> pJurisdiction->m_wLeft;
			ar >> pJurisdiction->m_wRight;
			m_lspJurisdiction.push_back( pJurisdiction );
		}
		ar.ReadString( m_szAddr );
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:34,代码来源:serverdesc.cpp

示例4: Serialize

void CItemBase::Serialize( CAr & ar )	// 11	// 20
{
	if( ar.IsStoring() )
	{
		ar << m_dwObjId << m_dwItemId;
		ar << m_liSerialNumber;
		ar.WriteString( m_szItemText );
	}
	else
	{
		ar >> m_dwObjId >> m_dwItemId;
		ar >> m_liSerialNumber;
		ar.ReadString( m_szItemText, 32 );
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:15,代码来源:ObjSerialize.cpp

示例5: Serialize

void CArena::Serialize( CAr & ar )
{
	ar << m_Online.size();

	for( map<u_long, nomember>::iterator itor = m_Online.begin(); itor != m_Online.end(); ++itor )
	{
		map<u_long, ARENAPLAYER>::iterator it = m_mArenaMap.find( itor->first );
		if( it != m_mArenaMap.end() )
		{
			ar << it->second.nKill;
			ar << it->second.nDeath;
			ar << it->second.nRow;
			ar << it->second.nJob;
			ar << it->second.nDeathMatchWin;
			ar << it->second.nDeathMatchLose;
			ar << it->second.nDuelWin;
			ar << it->second.nDuelLose;
			ar << (unsigned long)it->second.n64ArenaPoint;
			ar.WriteString( LPCTSTR( it->second.szName ) );
		}
		else //map.size() == ar >> size ( --> nomatch = crash ).
		{
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar << 0;
			ar.WriteString( "Deleted" );
		}

	}
}
开发者ID:careysky,项目名称:FlyFF,代码行数:36,代码来源:Arena.cpp

示例6: Serialize

void CDDomTeam::Serialize( CAr & ar )
{
	ar << m_TeamPlayer.size();
	for( vector<DOMPLAYER>::iterator it = m_TeamPlayer.begin(); it != m_TeamPlayer.end(); ++it )
	{
		ar << it->nKill;
		ar << it->nDeath;
		ar << it->nTouch;
		ar << it->nCaptureS;
		ar << it->nTeam;
		ar << it->nJob;
		ar << it->nPoint;
		ar.WriteString( LPCTSTR( it->strName ) );
	}
	
	ar << this->nKill;
	ar << this->nDeath;
	ar << this->nTouch;
	ar << this->nCaptureS;
}
开发者ID:careysky,项目名称:FlyFF,代码行数:20,代码来源:DDom.cpp

示例7: Serialize

void CUserTaskBar::Serialize( CAr &ar )
{
	if( ar.IsStoring() )
	{
		int nCount	= 0;
		u_long uOffset	= ar.GetOffset();
		ar << nCount;
		for( int i = 0; i < MAX_SLOT_APPLET; i++ )
		{
			if( m_aSlotApplet[i].m_dwShortcut != SHORTCUT_NONE )		// 값이 들어있는지 검사
			{
				ar << i;
				ar << m_aSlotApplet[i].m_dwShortcut <<	m_aSlotApplet[i].m_dwId << m_aSlotApplet[i].m_dwType;
				ar << m_aSlotApplet[i].m_dwIndex <<	m_aSlotApplet[i].m_dwUserId << m_aSlotApplet[i].m_dwData;
				if( m_aSlotApplet[i].m_dwShortcut == SHORTCUT_CHAT)
					ar.WriteString( m_aSlotApplet[i].m_szString );
				nCount++;
			}
		}
		int nBufSize;
		LPBYTE lpBuf	= ar.GetBuffer( &nBufSize );
		*(UNALIGNED int*)( lpBuf + uOffset )	= nCount;

		nCount	= 0;
		uOffset	= ar.GetOffset();
		ar << nCount;
		for( i = 0; i < MAX_SLOT_ITEM_COUNT; i++ )
		{
			for( int j = 0; j < MAX_SLOT_ITEM; j++ )
			{
				if( m_aSlotItem[i][j].m_dwShortcut != SHORTCUT_NONE )		// 값이 들어있는지 검사
				{
					ar << i << j;
					ar << m_aSlotItem[i][j].m_dwShortcut <<	m_aSlotItem[i][j].m_dwId << m_aSlotItem[i][j].m_dwType;
					ar << m_aSlotItem[i][j].m_dwIndex << m_aSlotItem[i][j].m_dwUserId << m_aSlotItem[i][j].m_dwData;
					if( m_aSlotItem[i][j].m_dwShortcut == SHORTCUT_CHAT)
						ar.WriteString( m_aSlotItem[i][j].m_szString );
					nCount++;
					
				}

				// m_aSlotItem[i][j]이 유효한 숏컷이라면
//				ar << i << j << m_aSlotItem[i][j]의 필요한 정보 저장
//				if( m_aSlotItem[i][j].m_dwType == SHORTCUT_CHAT )
//					ar.WriteString(
			}
		}
		lpBuf	= ar.GetBuffer( &nBufSize );
		*(UNALIGNED int*)( lpBuf + uOffset )	= nCount;

		nCount	= 0;
		uOffset	= ar.GetOffset();
		ar << nCount;
		for( i = 0; i < MAX_SLOT_QUEUE; i++ )
		{
			if( m_aSlotQueue[i].m_dwShortcut != SHORTCUT_NONE )		// 값이 들어있는지 검사
			{
				ar << i;
				ar << m_aSlotQueue[i].m_dwShortcut << m_aSlotQueue[i].m_dwId << m_aSlotQueue[i].m_dwType;
				ar << m_aSlotQueue[i].m_dwIndex << m_aSlotQueue[i].m_dwUserId << m_aSlotQueue[i].m_dwData;
				nCount++;
			}
			
							// m_aSlotQueue[i]이 유효한 숏컷이라면
//				ar << i << m_aSlotQueue[i]의 필요한 정보 저장
		}
		ar << m_nActionPoint;
		lpBuf	= ar.GetBuffer( &nBufSize );
		*(UNALIGNED int*)( lpBuf + uOffset )	= nCount;
	}
	else
	{
		memset( m_aSlotApplet, 0, sizeof(m_aSlotApplet) );
		memset( m_aSlotItem, 0, sizeof(m_aSlotItem) );
		memset( m_aSlotQueue, 0, sizeof(m_aSlotQueue) );

		int nCount, nIndex;
		ar >> nCount;	// applet count
		for( int i = 0; i < nCount; i++ )
		{
			ar >> nIndex;
			ar >> m_aSlotApplet[nIndex].m_dwShortcut >>	m_aSlotApplet[nIndex].m_dwId >> m_aSlotApplet[nIndex].m_dwType;
			ar >> m_aSlotApplet[nIndex].m_dwIndex >> m_aSlotApplet[nIndex].m_dwUserId >> m_aSlotApplet[nIndex].m_dwData;
			if( m_aSlotApplet[nIndex].m_dwShortcut == SHORTCUT_CHAT)
				ar.ReadString( m_aSlotApplet[nIndex].m_szString, MAX_SHORTCUT_STRING );
//			ar >>  m_aSlotApplet[nIndex]에 아까 넣은 필요한 정보를 넣는다.
		}
		ar >> nCount;	// slot item count
		int nIndex2;
		for( i = 0; i < nCount; i++ )
		{
			ar >> nIndex >> nIndex2;	// index
			ar >> m_aSlotItem[nIndex][nIndex2].m_dwShortcut >>	m_aSlotItem[nIndex][nIndex2].m_dwId >> m_aSlotItem[nIndex][nIndex2].m_dwType;
			ar >> m_aSlotItem[nIndex][nIndex2].m_dwIndex >> m_aSlotItem[nIndex][nIndex2].m_dwUserId >> m_aSlotItem[nIndex][nIndex2].m_dwData;
			if( m_aSlotItem[nIndex][nIndex2].m_dwShortcut == SHORTCUT_CHAT)
				ar.ReadString( m_aSlotItem[nIndex][nIndex2].m_szString, MAX_SHORTCUT_STRING );
		}

		ar >> nCount;
		for( i = 0; i < nCount; i++ )
//.........这里部分代码省略.........
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:101,代码来源:UserTaskBar.cpp

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