Official site anti-cheat Ultra Core Protector

Home Download F.A.Q. Addons Monitor Forum Support Advertise English version site UCP Anti-Cheat  Russian version site UCP Anti-Cheat
Ultra Core Protector - is the client-server anti-cheat freeware, for server protection from unscrupulous players.

Abilities Supported games  
Half-Life
Condition Zero
Counter-Strike 1.6
Day of Defeat
Adrenaline Gamer
Team Fortress Classic
Counter-Strike Source
MU Online
Ragnarok Online
Half-Life 2 Deathmatch
Adrenaline Gamer 2
Team Fortress 2
CSGO: lbyt update prediction

Because of my efforts in this this topic, trying to explain how this all worked, i still saw some threads about this subject, so i decided to release some code.

the point of this code is rebuilding how the server will calculate when your lbyt will update. since the client-sided animstate should be updated every client frame, the server animstate runs on server fames, also known as ‘ticks’ and is ‘not processed’ when one is choking.

you normally would run this code somewhere after createmove, since that is where the server processing happens too. the code also assumes that your curtime at that point is tickbase*ipt.

void Animations::UpdateServerAnimations( ) {
bool allocate = ( m_serverAnimState == nullptr );
bool change = ( !allocate ) && ( local->GetRefEHandle( ) != m_ulEntHandle );
bool reset = ( !allocate && !change ) && ( local->m_flSpawnTime( ) != m_flSpawnTime );

// player changed, free old animation state.
if( change )
g_pMemAlloc->Free( m_serverAnimState );

// need to reset? (on respawn)
if( reset ) {
// reset animation state.
ResetAnimationState( m_serverAnimState );

// note new spawn time.
m_flSpawnTime = local->m_flSpawnTime( );
}

// need to allocate or create new due to player change.
if( allocate || change ) {
// only works with games heap alloc.
CCSGOPlayerAnimState* state = ( CCSGOPlayerAnimState* )g_pMemAlloc->Alloc( sizeof( CCSGOPlayerAnimState ) );

if( state != nullptr )
CreateAnimationState( state, local );

// used to detect if we need to recreate / reset.
m_ulEntHandle = local->GetRefEHandle( );
m_flSpawnTime = local->m_flSpawnTime( );

// note anim state for future use.
m_serverAnimState = state;
}

// run the animstate code how the server would too.
else if( !gClientState->m_nChokedCommands ) {

// back up some data to not mess with game..

UpdateAnimationState( m_serverAnimState, m_angRealAngle );

// restore that data..

// walking, delay next update by .22s.
if( m_serverAnimState->m_flSpeed > 0.1f )
m_flNextBodyUpdate = gpGlobals->curtime + 0.22f;

// calculate delta.
float delta = std::abs( Math::NormalizeAngle( m_angRealAngle - local->m_flLowerBodyYawTarget( ) ) );

// standing, update every 1.1s.
else if( delta > 35.f && gpGlobals->curtime > m_flNextBodyUpdate )
m_flNextBodyUpdate = gpGlobals->curtime + 1.1f;
}
}

void Animations::CreateAnimationState( CCSGOPlayerAnimState* state, Player* player ) {
using CreateAnimState_t = void( __thiscall* )( CCSGOPlayerAnimState*, Player* );

static auto CreateAnimState = ( CreateAnimState_t )0xca11ab1e;
if( !CreateAnimState )
return;

CreateAnimState( state, player );
}

void Animations::UpdateAnimationState( CCSGOPlayerAnimState* state, QAngle ang ) {
static auto UpdateAnimState = 0xca11ab1e;
if( !UpdateAnimState )
return;

__asm {
mov ecx, state

movss xmm1, dword ptr[ ang + 4 ]
movss xmm2, dword ptr[ ang ]

call UpdateAnimState
}
}

void Animations::ResetAnimationState( CCSGOPlayerAnimState* state ) {
using ResetAnimState_t = void( __thiscall* )( CCSGOPlayerAnimState* );

static auto ResetAnimState = ( ResetAnimState_t )0xca11ab1e;
if( !ResetAnimState )
return;

ResetAnimState( state );
}