5 ночей на aim_ag_texture2
-
Автор темы
- #1
thanks спасибо gracias:
teapotd &
спустя год после треда sharklaser'a все еще есть люди которые просят сурс этого говна
Охуеть можно!
teapotd &
Пожалуйста, авторизуйтесь для просмотра ссылки.
спустя год после треда sharklaser'a все еще есть люди которые просят сурс этого говна
Охуеть можно!
C++:
bool __fastcall hkdWriteUsercmdDeltaToBuffer( void* ecx, void*, int slot, bf_write* buf, int from, int to, bool isnewcommand )
{
if( _ReturnAddress( ) != ( void* )patterns->sendmovecall ||
info->tickbaseshift <= 0 )
{
info->tickbaseshift = 0;
return originals::WriteUsercmdDeltaToBuffer( ecx, slot, buf, from, to, isnewcommand );
}
if( from != -1 ) return true;
// number of backup and new commands
auto backupptr = cast( int* )( cast( DWORD )( buf ) - 0x30 );
auto newcommandsptr = cast( int* )( cast( DWORD )( buf ) - 0x2C );
auto netchannel = ( INetChannel* )engine->GetNetChannelInfo( );
if( !backupptr || !newcommandsptr || !netchannel ) return originals::WriteUsercmdDeltaToBuffer( ecx, slot, buf, from, to, isnewcommand );
auto newcommands = *newcommandsptr;
if( !info->insendmove )
{
if( !newcommands ) return false;
info->insendmove = true;
info->firstsendmovepack = true;
info->tickbaseshift += newcommands;
while( info->tickbaseshift > 0 )
{
valve->CL_SendMove( );
netchannel->Transmit( );
info->firstsendmovepack = false;
}
info->insendmove = false;
return false;
}
if( !info->firstsendmovepack )
{
const auto loss = std::min( info->tickbaseshift, 10 );
info->tickbaseshift -= loss;
netchannel->m_nOutSequenceNr += loss;
}
auto nextcmdnumber = clientstate->last_outgoing_command + clientstate->choked_commands + 1;
auto totalnewcommands = std::min( info->tickbaseshift, 62 );
info->tickbaseshift -= totalnewcommands;
from = -1;
*newcommandsptr = totalnewcommands;
*backupptr = 0;
for( to = nextcmdnumber - newcommands + 1; to <= nextcmdnumber; to++ )
{
if( !originals::WriteUsercmdDeltaToBuffer( ecx, slot, buf, from, to, true ) )
return false;
from = to;
}
auto lastrealcmd = input->GetUserCmd( slot, from );
CUserCmd fromcmd;
if( lastrealcmd )
fromcmd = *lastrealcmd;
CUserCmd tocmd = fromcmd;
tocmd.command_number = nextcmdnumber++;
tocmd.tick_count += ( TIME_TO_TICKS( 0.5f ) + nextcmdnumber );
auto choked = clientstate->choked_commands;
for( int i = newcommands; i <= totalnewcommands; i++ )
{
valve->WriteUsercmd( buf, &tocmd, &fromcmd );
fromcmd = tocmd;
tocmd.command_number = nextcmdnumber++;
tocmd.tick_count += ( TIME_TO_TICKS( 0.5f ) + i );
if( totalnewcommands > 1 && i != ( totalnewcommands - 1 ) )
choked++;
}
clientstate->choked_commands = choked;
valve->CL_SendMove( );
netchannel->Transmit( true );
clientstate->last_outgoing_command = 1; // value straight outta my ass
clientstate->choked_commands = 0;
return true;
}
C++:
if( chk( cmd->buttons, IN_ATTACK ) && me->CanShootWeapon( ) )
info->needtoshift = true;
if( info->needtoshift )
{
if( ( info->firstuse + 1 ) >= 3 )
info->needtoshift = false;
info->firstuse++;
info->tickbaseshift = TIME_TO_TICKS( 20.f );
}
else
info->firstuse = 0;
C++:
void CValve::CL_SendMove( )
{
static auto function = ( void( __fastcall* )( ) )( patterns->sendmove );
function( );
}
void CValve::WriteUsercmd( bf_write* buf, CUserCmd* in, CUserCmd* out )
{
static auto function = ( void( __fastcall* )( bf_write*, CUserCmd*, CUserCmd* ) )( patterns->writeusercmd );
function( buf, in, out );
}
patterns->sendmovecall = "engine.dll" "84 C0 74 04 B0 01 EB 02 32 C0 8B FE 46 3B F3 7E C9 84 C0 0F 84 ? ? ? ?"
patterns->sendmove = "engine.dll" "55 8B EC A1 ? ? ? ? 81 EC ? ? ? ? B9 ? ? ? ? 53 8B 98"
patterns->writeusercmd = "client_panorama.dll" "55 8B EC 83 E4 F8 51 53 56 8B D9 8B 0D"
Последнее редактирование: