void RC6Decryption::ProcessBlock(const byte *in, byte *out) const { const RC6_WORD *sptr = sTable+sTable.size; RC6_WORD a, b, c, d, t, u; GETBLOCK(in, a, b, c, d); sptr -= 2; c -= sptr[1]; a -= sptr[0]; for (unsigned i=0; i < r; i++) { sptr -= 2; t = a; a = d; d = c; c = b; b = t; u = ROTL(d*(2*d+1), 5); t = ROTL(b*(2*b+1), 5); c = ROTR(c-sptr[1], t) ^ u; a = ROTR(a-sptr[0], u) ^ t; } sptr -= 2; d -= sTable[1]; b -= sTable[0]; PUTBLOCK(out, a, b, c, d); }
NAMESPACE_END void RC6Encryption::ProcessBlock(const byte *in, byte *out) const { const RC6_WORD *sptr = sTable; RC6_WORD a, b, c, d, t, u; GETBLOCK(in, a, b, c, d); b += sptr[0]; d += sptr[1]; sptr += 2; for(unsigned i=0; i<r; i++) { t = ROTL(b*(2*b+1), 5); u = ROTL(d*(2*d+1), 5); a = ROTL(a^t,u) + sptr[0]; c = ROTL(c^u,t) + sptr[1]; t = a; a = b; b = c; c = d; d = t; sptr += 2; } a += sptr[0]; c += sptr[1]; PUTBLOCK(out, a, b, c, d); }
void CUserMng::AddDoApplySkill( CCtrl *pCtrl, OBJID idTarget, DWORD dwSkill, DWORD dwLevel ) { CAr ar; ar << GETID( pCtrl ) << SNAPSHOTTYPE_DOAPPLYUSESKILL; ar << idTarget << dwSkill << dwLevel; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pCtrl ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pCtrl ) }
// pMover가 스턴 된것을 주위 유저클라에 알림. void CUserMng::AddSetStun( CMover *pMover, int nMaxTime ) { CAr ar; ar << GETID( pMover ) << SNAPSHOTTYPE_SETSTUN; ar << nMaxTime; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pMover ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pMover ) }
void CUserMng::AddCreateSkillEffect( CMover *pAttacker, OBJID idTarget, DWORD dwSkill, DWORD dwLevel ) { CAr ar; ar << GETID( pAttacker ) << SNAPSHOTTYPE_ACTIVESKILL; ar << idTarget << dwSkill << dwLevel; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pAttacker ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pAttacker ) }
void CUserMng::AddRemoveSkillInfluence( CMover *pMover, WORD wType, WORD wID ) { CAr ar; ar << GETID( pMover ) << SNAPSHOTTYPE_REMOVESKILLINFULENCE; ar << wType; ar << wID; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pMover ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pMover ) }
void CUserMng::AddSetPosAngle( CCtrl* pCtrl, const D3DXVECTOR3 &vPos, FLOAT fAngle ) { CAr ar; ar << GETID( pCtrl ) << SNAPSHOTTYPE_SETPOSANGLE; ar << vPos << fAngle; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pCtrl ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pCtrl ) }
// SendActMsg를 주위 유저들에게 보냄 . void CUserMng::AddSendActMsg( CMover *pMover, OBJMSG dwMsg, int nParam1, int nParam2, int nParam3 ) { CAr ar; ar << GETID( pMover ) << SNAPSHOTTYPE_SENDACTMSG; ar << (int)dwMsg; ar << pMover->IsFly(); ar << nParam1 << nParam2 << nParam3; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pMover ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pMover ) }
// Mover를 어느방향으로 밀리게 하다. // pMover : 밀리는 무버 // vPos : 밀리는 시점에서의 vPos - 정확한 동기화때문에 좌표와 각도까지 필요하다. // fAngle : 밀리는 시점에서의 Angle - // fPushAngle : 미는 각도. // fPower : 미는 힘. void CUserMng::AddPushPower( CMover *pMover, D3DXVECTOR3 vPos, FLOAT fAngle, FLOAT fPushAngle, FLOAT fPower ) { if( (pMover->m_pActMover->GetState() & OBJSTA_DMG_FLY_ALL) || pMover->m_pActMover->GetState() & OBJSTA_STUN ) // 데미지 플라이중이면 리턴 return; CAr ar; ar << GETID( pMover ) << SNAPSHOTTYPE_PUSHPOWER; ar << vPos; ar << fAngle; ar << fPushAngle << fPower; GETBLOCK( ar, lpBuf, nBufSize ); FOR_VISIBILITYRANGE( pMover ) USERPTR->AddBlock( lpBuf, nBufSize ); NEXT_VISIBILITYRANGE( pMover ) }
void APU_VRC6::LoadState( LPBYTE p ) { GETBLOCK( p, &ch0, sizeof(ch0) ); GETBLOCK( p, &ch1, sizeof(ch1) ); GETBLOCK( p, &ch2, sizeof(ch2) ); }
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 } }