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


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

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


在下文中一共展示了CAr::IsStoring方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: SerializeLevel

void IBuff::SerializeLevel( CAr & ar )
{
	if( ar.IsStoring() )
	{
#ifdef __DBSERVER
		if( GetType() == BUFF_ITEM2 )
		{
			time_t t	= static_cast<time_t>( GetLevel() ) - time_null();
			ar << t;
		}
		else
		{
			ar << m_dwLevel;
		}
#else	// __DBSERVER
		ar << m_dwLevel;
#endif	// __DBSERVER
	}
	else
	{
#ifdef __DBSERVER
		if( GetType() == BUFF_ITEM2 )
		{
			time_t t;
			ar >> t;
			SetLevel( time_null() + t );
		}
		else
		{
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:29,代码来源:buff.cpp

示例3: Serialize

void CCampusMember::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
		ar << m_idPlayer << m_nMemberLv;
	else
		ar >> m_idPlayer >> m_nMemberLv;
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:7,代码来源:Campus.cpp

示例4: Serialize

void CGuildWarMng::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_id;
		ar << GetSize();
		for( map<u_long, CGuildWar*>::iterator i = m_mapPWar.begin(); i != m_mapPWar.end(); ++i )
			( i->second )->Serialize( ar );
	}
	else
	{
#ifdef __CLIENT
		Clear();
#endif	// __CLIENT
		ar >> m_id;
		int nSize;
		ar >> nSize;
		for( int i = 0; i < nSize; i++ )
		{
			CGuildWar* pWar	= new CGuildWar;
			pWar->Serialize( ar );
			m_mapPWar.insert( map<u_long, CGuildWar*>::value_type( pWar->m_idWar, pWar ) );
		}
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:25,代码来源:guildwar.cpp

示例5: Clear

void	CPocketController::Serialize( CAr & ar )
{
    if( ar.IsStoring() )
    {
        for( int i = 0; i < MAX_POCKET; i++ )
        {
            if( IsAvailable( i, FALSE ) )
            {
                ar << (BYTE)1;
                m_apPocket[i]->Serialize( ar );
            }
            else
                ar << (BYTE)0;
        }
    }
    else
    {
        Clear();
        for( int i = 0; i < MAX_POCKET; i++ )
        {
            BYTE bExists;
            ar >> bExists;
            if( !bExists )
                continue;
            Avail( i );
            m_apPocket[i]->Serialize( ar );
        }
    }
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:29,代码来源:pocket.cpp

示例6: Serialize

void CPocket::Serialize( CAr & ar )
{
    CItemContainer<CItemElem>::Serialize( ar );
    if( ar.IsStoring() )
    {
        ar << m_bExpired << m_tExpirationDate;
        if( m_tExpirationDate )
        {
            time_t	t	= m_tExpirationDate - time_null();
            ar << t;
        }
    }
    else
    {
        ar >> m_bExpired >> m_tExpirationDate;
        if( m_tExpirationDate )
        {
            time_t	t;
            ar >> t;
#ifdef __CLIENT
            m_tExpirationDate	= time_null() + t;
#endif	// __CLIENT
        }
    }
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:25,代码来源:pocket.cpp

示例7: 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

示例8: 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

示例9: Serialize

void CPiercing::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << GetPiercingSize();
		int i; for( i = 0; i < GetPiercingSize(); i++ )
			ar << GetPiercingItem( i );
#if __VER >= 12 // __EXT_PIERCING
		ar << GetUltimatePiercingSize();
		for( i = 0; i < GetUltimatePiercingSize(); i++ )
			ar << GetUltimatePiercingItem( i );
#endif // __EXT_PIERCING
#if __VER >= 15 // __PETVIS
		ar << m_vtmPetVis.size();
		for( int i=0; i<(int)( m_vtmPetVis.size() ); i++ )
			ar << GetVisKeepTime( i ) - time_null();
#endif // __PETVIS
	}
	else
	{
		m_vPiercing.clear();
		size_t nSize;
		ar >> nSize;
		SetPiercingSize( nSize );
		size_t i;
		for(  i = 0; i < nSize; i++ )
		{
			DWORD dwItem;
			ar >> dwItem;
			SetPiercingItem( i, dwItem );
		}
#if __VER >= 12 // __EXT_PIERCING
		m_vUltimatePiercing.clear();
		ar >> nSize;
		SetUltimatePiercingSize( nSize );
		for( i = 0; i < nSize; i++ )
		{
			DWORD dwItem;
			ar >> dwItem;
			SetUltimatePiercingItem( i, dwItem );
		}
#endif // __EXT_PIERCING
#if __VER >= 15 // __PETVIS
		ar >> nSize;
		SetVisKeepTimeSize( nSize );
		for( i=0; i<nSize; i++ )
		{
			time_t tmTemp;
			ar >> tmTemp;
			SetVisKeepTime( i, tmTemp + time_null() );
		}
#endif // __PETVIS
	}
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:54,代码来源:piercing.cpp

示例10: Serialize

void CCtrl::Serialize( CAr & ar )	// 33
{
	CObj::Serialize( ar );

	if( ar.IsStoring() )
	{
		ar << m_objid;
	}
	else
	{
		ar >> m_objid;
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:13,代码来源:ObjSerialize.cpp

示例11: Serialize

void CObj::Serialize( CAr & ar )	// 21
{
	if( ar.IsStoring() )
	{
		ar << (u_char)m_dwType;

		// mirchang_100513 type cast fix
		//ar << (u_short)m_dwIndex;
		ar << m_dwIndex;
		// mirchang_100513 type cast fix

		ar << (u_short)( m_vScale.x * 100.0f );
		ar << m_vPos;
		ar << (short)( m_fAngle * 10.0f );
	}
	else
	{
		u_short u2;
		short i2;
		m_dwType = m_dwIndex = 0; 
		
		ar >> (u_char&)m_dwType;				// m_dwType

		// mirchang_100513 type cast fix
		//ar >> u2;								// m_dwIndex
		//m_dwIndex	= (DWORD)u2;
		ar >> m_dwIndex;
		// mirchang_100513 type cast fix

		ar >> u2;								// m_vScale.x * 100.0f
		m_vScale.x	=	m_vScale.y	=	m_vScale.z	= (float)u2 / 100.0f;
		ar >> m_vPos;							// m_vPos
		ar >> i2;								// m_fAngle * 10.0f
		m_fAngle	= (float)i2 / 10.0f;
	#if defined(__WORLDSERVER) || defined(__CLIENT)
		SetAngle( m_fAngle );
	#endif

	#ifdef __WORLDSERVER
		m_vLink		= m_vPos;
	#endif	// __WORLDSERVER
	}
}
开发者ID:KerwinMa,项目名称:SourceFlyFF,代码行数:43,代码来源:ObjSerializeOpt.cpp

示例12: Serialize

void CEnvironment::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
#ifdef __ENVIRONMENT_EFFECT
		ar << m_bEffect;
#else // __ENVIRONMENT_EFFECT
		ar << m_bRain;
		ar << m_bSnow;
#endif // __ENVIRONMENT_EFFECT
	}
	else
	{
#ifdef __ENVIRONMENT_EFFECT
		ar >> m_bEffect;
#else // __ENVIRONMENT_EFFECT
		ar >> m_bRain;
		ar >> m_bSnow;
#endif // __ENVIRONMENT_EFFECT
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:21,代码来源:Environment.cpp

示例13: 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

示例14: Serialize

void CSkillInfluence::Serialize( CAr & ar )
{
	int j, nMax = 0;
	DWORD	dwOdd;

	if( ar.IsStoring() )	// Saving
	{
		for( j = 0; j < MAX_SKILLINFLUENCE; j++ )		// 데이타 있는것만 개수 셈.
			if( m_aSkillInfluence[j].wID > 0 )
				nMax ++;

		ar << nMax;
		for( j = 0; j < MAX_SKILLINFLUENCE ; ++j )
		{
			if( m_aSkillInfluence[j].wID > 0 )
			{
				ar << m_aSkillInfluence[j].wType;
				ar << m_aSkillInfluence[j].wID;

#if __VER >= 11 // __SYS_COLLECTING
				if( m_aSkillInfluence[j].wType == BUFF_ITEM2 )
				{
					time_t t	= (time_t)m_aSkillInfluence[j].dwLevel - time_null();
					ar << t;
				}
				else
					ar << m_aSkillInfluence[j].dwLevel;
#else	// __SYS_COLLECTING
				ar << m_aSkillInfluence[j].dwLevel;
#endif	// __SYS_COLLECTING

#ifdef __WORLDSERVER			
				if( m_aSkillInfluence[j].tmCount )
				{
					if( m_aSkillInfluence[j].tmTime )
						dwOdd = m_aSkillInfluence[j].tmCount - (timeGetTime() - m_aSkillInfluence[j].tmTime);	// 남은시간 계산.
					else
						dwOdd = m_aSkillInfluence[j].tmCount;
				}
				else
					dwOdd = 0;
				if( (int)dwOdd < 0 )		dwOdd = 0;
				ar << dwOdd;		// 남은 시간을 저장.
#else // World
				ar << m_aSkillInfluence[j].tmCount;
#endif // not World
			}
		}
	} else
	// Loading
	{

		memset( m_aSkillInfluence, 0, sizeof(m_aSkillInfluence) );
#if __VER < 8 //__CSC_VER8_3
		m_pEmptyNode = NULL;
#endif //__CSC_VER8_3
		ar >> nMax;
		for( j = 0 ; j < nMax; ++j )		// 있는만큼만 부른다.
		{
			ar >> m_aSkillInfluence[j].wType;
			ar >> m_aSkillInfluence[j].wID;
#if __VER >= 11 // __SYS_COLLECTING
			if( m_aSkillInfluence[j].wType == BUFF_ITEM2 )
			{
				time_t t;
				ar >> t;
				m_aSkillInfluence[j].dwLevel	= time_null() + t;
			}
			else
				ar >> m_aSkillInfluence[j].dwLevel;
#else	// __SYS_COLLECTING
			ar >> m_aSkillInfluence[j].dwLevel;
#endif	// __SYS_COLLECTING
			ar >> dwOdd;
#ifdef __WORLDSERVER				
			BOOL bCharged = FALSE;
			if( m_aSkillInfluence[j].wType == BUFF_ITEM
#if __VER >= 11 // __SYS_COLLECTING
				|| m_aSkillInfluence[j].wType == BUFF_ITEM2
#endif	// __SYS_COLLECTING
				)
			{
				ItemProp *pItemProp = prj.GetItemProp( m_aSkillInfluence[j].wID );
				if( pItemProp )
				{
					if( pItemProp->bCharged ) // 상용화 아이템은 종료가 안되게 수정
						bCharged = TRUE;
				}
			}
#if __VER >= 9	// __PET_0410
			else if( m_aSkillInfluence[j].wType == BUFF_PET )
				bCharged	= TRUE;
#endif	// __PET_0410
#ifdef __DST_GIFTBOX
			else if( m_aSkillInfluence[j].wType == BUFF_EQUIP )
				bCharged	= TRUE;
#endif // __DST_GIFTBOX

			if( bCharged == FALSE && m_pMover && dwOdd >= MIN(61) )
			{
//.........这里部分代码省略.........
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:101,代码来源:SkillInfluence.cpp


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