Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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
		{
Ejemplo n.º 3
0
void CCampusMember::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
		ar << m_idPlayer << m_nMemberLv;
	else
		ar >> m_idPlayer >> m_nMemberLv;
}
Ejemplo n.º 4
0
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 ) );
		}
	}
}
Ejemplo n.º 5
0
void CCampusMng::Serialize( CAr & ar )
{
	int	i = 0;
	
	if( ar.IsStoring() )
	{
		ar << m_idCampus << m_mapCampus.size();
		for( MAP_CAMPUS::iterator it = m_mapCampus.begin(); it != m_mapCampus.end(); ++it )
			( it->second )->Serialize( ar );

		ar << m_mapPid2Cid.size();
		for( MAP_PID2CID::iterator it2 = m_mapPid2Cid.begin(); it2 != m_mapPid2Cid.end(); ++it2 )
			ar << it2->first << it2->second;

	}
	else
	{
		Clear();
		size_t nSize;
		ar >> m_idCampus >> nSize;
		for( i = 0; i < (int)( nSize ); ++i )
		{
			CCampus* pCampus = new CCampus;
			pCampus->Serialize( ar );
			m_mapCampus.insert( MAP_CAMPUS::value_type( pCampus->GetCampusId(), pCampus ) );
		}
		ar >> nSize;
		for( i = 0; i < (int)( nSize ); ++i )
		{
			u_long idPlayer, idCampus;
			ar >> idPlayer >> idCampus;
			AddPlayerId2CampusId( idPlayer, idCampus );
		}
	}
}
Ejemplo n.º 6
0
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 );
        }
    }
}
Ejemplo n.º 7
0
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
        }
    }
}
Ejemplo n.º 8
0
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 );
	}
}
Ejemplo n.º 9
0
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
		}
	}
}
Ejemplo n.º 10
0
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
	}
}
Ejemplo n.º 11
0
void CCtrl::Serialize( CAr & ar )	// 33
{
	CObj::Serialize( ar );

	if( ar.IsStoring() )
	{
		ar << m_objid;
	}
	else
	{
		ar >> m_objid;
	}
}
Ejemplo n.º 12
0
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 );
	}
}
Ejemplo n.º 13
0
/*------------------------------------------------------------------------------------------------------------------------------------------------------------*/
void CItem::Serialize( CAr & ar )	// 45
{
	CCtrl::Serialize( ar );		// 33
	
	if( ar.IsStoring() )
	{
	}
	else
	{
		SAFE_DELETE( m_pItemBase );
		m_pItemBase	= new CItemElem;
	}

	m_pItemBase->Serialize( ar );	// 11
}
Ejemplo n.º 14
0
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
	}
}
Ejemplo n.º 15
0
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 );
	}
}
Ejemplo n.º 16
0
void CCampus::Serialize( CAr & ar )
{
	if( ar.IsStoring() )
	{
		ar << m_idCampus << m_idMaster << m_mapCM.size();
		for( MAP_CM::iterator it = m_mapCM.begin(); it != m_mapCM.end(); ++it )
			( it->second )->Serialize( ar );
	}
	else
	{
		Clear();
		size_t nSize;
		ar >> m_idCampus >> m_idMaster >> nSize;
		for( int i = 0; i < (int)( nSize ); ++i )
		{
			CCampusMember* pMember = new CCampusMember;
			pMember->Serialize( ar );
			m_mapCM.insert( MAP_CM::value_type( pMember->GetPlayerId(), pMember ) );
		}
	}
}
Ejemplo n.º 17
0
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
	}
}
Ejemplo n.º 18
0
void CPartyMng::Serialize( CAr & ar )
{
#ifndef __WORLDSERVER
	m_AddRemoveLock.Enter( theLineFile );	// lock1
#endif	// __WORLDSERVER

	if( ar.IsStoring() )
	{
		ar << m_id;
		int nCount	= 0;
		u_long uOffset	= ar.GetOffset();
		ar << nCount;
		for( C2PartyPtr::iterator i	= m_2PartyPtr.begin(); i != m_2PartyPtr.end(); ++i )
		{
			CParty* pParty = (CParty*)i->second;
			pParty->Serialize( ar );
			nCount++;
		}
		int nBufSize1;
		LPBYTE lpBuf1	= ar.GetBuffer( &nBufSize1 );
		*(UNALIGNED int*)( lpBuf1 + uOffset )	= nCount;
	}
	else
	{
		int nCount;
		ar >> m_id;
		ar >> nCount;		
		for( int i = 0 ; i < nCount ; i++ )
		{
			CParty* pParty	= new CParty;
//			pParty->Lock();
			pParty->Serialize( ar );
			m_2PartyPtr.insert( C2PartyPtr::value_type( pParty->m_uPartyId, pParty ) );
//			pParty->Unlock();
		}
	}
#ifndef __WORLDSERVER
	m_AddRemoveLock.Leave( theLineFile );	// unlock1
#endif	// __WORLDSERVER
}
Ejemplo n.º 19
0
/*------------------------------------------------------------------------------------------------------------------------------------------------------------*/
void CItemElem::Serialize( CAr & ar )	// 18
{
	CItemBase::Serialize( ar );
	if( ar.IsStoring() )
	{
		ar << m_nItemNum;
		ar << m_nRepairNumber << m_nHitPoint;
		ar << m_nRepair;
		ar << m_byFlag;
		ar << m_nAbilityOption;
		ar << m_idGuild;				// 길드번호도 저장.
		ar << m_bItemResist;			// 어느 속성 인가?
		ar << m_nResistAbilityOption ;	// 속성 추가 능력치 가변 옵션
		ar << m_nResistSMItemId;
		m_piercing.Serialize( ar );
		ar << m_bCharged;
#if __VER >= 11 // __SYS_IDENTIFY
		ar << m_iRandomOptItemId;
#else	// __SYS_IDENTIFY
		ar << m_nRandomOptItemId;
#endif	// __SYS_IDENTIFY
		ar << m_dwKeepTime;
		if( m_dwKeepTime )
		{
			time_t t	= m_dwKeepTime - time_null();
			ar << t;
		}
#if __VER >= 9	// __PET_0410
		if( m_pPet )
		{
			ar << (BYTE)0x01;
			m_pPet->Serialize( ar );
		}
		else
		{
			ar << (BYTE)0x00;
		}
#endif	// __PET_0410
#if __VER >= 15 // __PETVIS
		ar << m_bTranformVisPet;
#endif // __PETVIS
	}
	else
	{
		ar >> m_nItemNum;
		ar >> m_nRepairNumber ;
		ar >> m_nHitPoint;
		ar >> m_nRepair;
		ar >> m_byFlag;
		ar >> m_nAbilityOption;
		ar >> m_idGuild;		
		ar >> m_bItemResist;	
		ar >> m_nResistAbilityOption ;	
		ar >> m_nResistSMItemId;
//		memset( &m_piercingInfo, 0, sizeof(m_piercingInfo) );
		m_piercing.Serialize( ar );
		ar >> m_bCharged;
#if __VER >= 11 // __SYS_IDENTIFY
		ar >> m_iRandomOptItemId;
#else	// __SYS_IDENTIFY
		ar >> m_nRandomOptItemId;
#endif	// __SYS_IDENTIFY
		ar >> m_dwKeepTime;

		if( m_dwKeepTime ) 
		{
			time_t t;
			ar >> t;
		#ifdef __CLIENT
			m_dwKeepTime	= time_null() + t;
		#endif	// __CLIENT
		}
#if __VER >= 9	// __PET_0410
		SAFE_DELETE( m_pPet );
		BYTE bPet;
		ar >> bPet;
		if( bPet )
		{
			m_pPet	= new CPet;
			m_pPet->Serialize( ar );
		}
#endif	// __PET_0410
#if __VER >= 15 // __PETVIS
		ar >> m_bTranformVisPet;
#endif // __PETVIS

#ifdef __CLIENT
		SetTexture();
#endif
	}
}
Ejemplo n.º 20
0
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];

			if( CObj::GetMethod() == METHOD_NONE )
			{
				ar << (u_short)m_nManaPoint;
				ar << (u_short)m_nFatiguePoint;
#if __VER >= 12 // __MOD_TUTORIAL
				ar << m_nTutorialState;
#else	// __MOD_TUTORIAL
				ar << (u_short)m_nFlightLv;
#endif	// __MOD_TUTORIAL
				ar << m_nFxp;
				
				dwGold = GetGold();
				ar << dwGold;
				ar << m_nExp1;
				ar << m_nSkillLevel;
				ar << m_nSkillPoint;
				ar << m_nDeathExp;
				ar << m_nDeathLevel;
				DWORD dwJobLv[MAX_JOB] = {0, };
				ar.Write( (void*)dwJobLv, sizeof(DWORD) * MAX_JOB );
				ar << m_idMarkingWorld;
				ar << m_vMarkingPos;
				ar << m_nQuestSize;
				ar.Write( m_aQuest, sizeof(QUEST) * m_nQuestSize );
				ar << m_nCompleteQuestSize;
				ar.Write( m_aCompleteQuest, sizeof(WORD) * m_nCompleteQuestSize ); 

#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
				ar << m_nCheckedQuestSize;
				ar.Write( m_aCheckedQuest, sizeof(WORD) * m_nCheckedQuestSize ); 
#endif // __IMPROVE_QUEST_INTERFACE

				ar << m_idMurderer;
				ar << (short)m_nRemainGP;
				ar << (short)0;
				{
					for( int i = 0; i < MAX_HUMAN_PARTS; i++ )
						ar << m_aEquipInfo[i].dwId;
				}
				ar.Write( (void*)m_aJobSkill, sizeof(SKILL) *  ( MAX_SKILL_JOB ) );
				
				ar << (BYTE)m_nCheerPoint << m_dwTickCheer - GetTickCount();

				ar << m_nSlot;
				for( int k = 0 ; k < 3 ; ++k )
					ar << m_dwGoldBank[k];
				for( k = 0 ; k < 3 ; ++k )
					ar << m_idPlayerBank[k];
				ar << m_nPlusMaxHitPoint;
				ar << m_nAttackResistLeft;
				ar << m_nAttackResistRight;
				ar << m_nDefenseResist;
#if __VER >= 8 // __CSC_VER8_5
				ar << m_nAngelExp;
				ar << m_nAngelLevel;
#endif // __CSC_VER8_5
				m_Inventory.Serialize( ar );
				for( k = 0 ; k < 3 ; ++k )
					m_Bank[k].Serialize( ar );
#if __VER >= 9	// __PET_0410
				ar << GetPetId();	// 소환 중인 펫 인벤토리 위치
#endif	// __PET_0410
#if __VER >= 11 // __SYS_POCKET
				m_Pocket.Serialize( ar );
#endif	// __SYS_POCKET
#ifdef __JEFF_9_20
				ar << m_dwMute;
#endif	// __JEFF_9_20
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
				for( int i = 0 ; i < MAX_HONOR_TITLE ; ++i )
				{
					ar << m_aHonorTitle[i];

				}
#endif	// __HONORABLE_TITLE			// 달인
#if __VER >= 15 // __CAMPUS
				ar << m_idCampus;
				ar << m_nCampusPoint;
#endif // __CAMPUS
			}
			else if( CObj::GetMethod() == METHOD_EXCLUDE_ITEM )
			{
#	if defined (__WORLDSERVER) || defined(__CLIENT)
				ar.WriteString( m_vtInfo.GetTitle() );
#	endif
				u_char uSize	= 0;
				u_long uOffset	= ar.GetOffset();
				ar << uSize;
				for( u_char uParts = 0; uParts < MAX_HUMAN_PARTS; uParts++ )
				{
					CItemElem* pItemElem	= m_Inventory.GetEquip( uParts );
					if( pItemElem )
					{
						uSize++;
						ar << uParts;
						ar << (u_short)pItemElem->m_dwItemId;
						ar << pItemElem->m_byFlag;
					}
				}
				GETBLOCK( ar, pBlock, nBlockSize );
				*(UNALIGNED u_char*)( pBlock + uOffset )	= uSize;
#if __VER >= 9	// __PET_0410
				DWORD dwPetId	= NULL_ID;
#ifdef __PET_1024
				char* pszPetName	= "";
#endif	// __PET_1024
				CItemElem* pItemElem	= GetPetItem();
				if( pItemElem )
				{
					dwPetId		= MAKELONG( (WORD)pItemElem->m_pPet->GetIndex(), (WORD)pItemElem->m_pPet->GetLevel() );
#ifdef __PET_1024
					pszPetName	= const_cast<char*>( pItemElem->m_pPet->GetName() );
#endif	// __PET_1024
				}
				ar << dwPetId;
#ifdef __PET_1024
				ar.WriteString( pszPetName );
#endif	// __PET_1024
#endif	// __PET_0410
			}
		}
Ejemplo n.º 21
0
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++ )
		{
			ar >> nIndex;
			ar >> m_aSlotQueue[nIndex].m_dwShortcut >> m_aSlotQueue[nIndex].m_dwId >> m_aSlotQueue[nIndex].m_dwType;
			ar >> m_aSlotQueue[nIndex].m_dwIndex >> m_aSlotQueue[nIndex].m_dwUserId >> m_aSlotQueue[nIndex].m_dwData;
//			ar >> m_aSlotQueue[nIndex]에 정보를 넣는다.
		}
		ar >> m_nActionPoint;
	}
}
Ejemplo n.º 22
0
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) )
			{
				Error( "SkillInflu::>Load : %s %d", m_pMover->GetName(), dwOdd );
				dwOdd = MIN(60);
			}
#endif //__WORLDSERVER
			m_aSkillInfluence[j].tmCount = dwOdd;			// 로딩했을때 남은시간을 로딩해서 세기 시작.
		} // for