-
Автор темы
- #1
C++:
void CL_SendMove( void )
{
byte data[ MAX_CMD_BUFFER ];
int nextcommandnr = cl.lastoutgoingcommand + cl.chokedcommands + 1;
// send the client update packet
CLC_Move moveMsg;
moveMsg.m_DataOut.StartWriting( data, sizeof( data ) );
// Determine number of backup commands to send along
int cl_cmdbackup = 2;
moveMsg.m_nBackupCommands = clamp( cl_cmdbackup, 0, MAX_BACKUP_COMMANDS );
// How many real new commands have queued up
moveMsg.m_nNewCommands = 1 + cl.chokedcommands;
moveMsg.m_nNewCommands = clamp( moveMsg.m_nNewCommands, 0, MAX_NEW_COMMANDS );
int numcmds = moveMsg.m_nNewCommands + moveMsg.m_nBackupCommands;
int from = -1; // first command is deltaed against zeros
bool bOK = true;
for ( int to = nextcommandnr - numcmds + 1; to <= nextcommandnr; to++ )
{
bool isnewcmd = to >= (nextcommandnr - moveMsg.m_nNewCommands + 1);
// first valid command number is 1
bOK = bOK && g_ClientDLL->WriteUsercmdDeltaToBuffer( &moveMsg.m_DataOut, from, to, isnewcmd );
from = to;
}
if ( bOK )
{
// only write message if all usercmds were written correctly, otherwise parsing would fail
cl.m_NetChannel->SendNetMsg( moveMsg );
}
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
)Secondly, according to
Пожалуйста, авторизуйтесь для просмотра ссылки.
, you need to hook virtual function SendNetMsg from NetChannel -
Пожалуйста, авторизуйтесь для просмотра ссылки.
( probably its index is 42, bcoz it's 7 lines above Transmit, which is 49, but i'm not 100% sure tbh )And also take a look at global vars like cl in source sdk, which is probably g_pClientState in your pasta
Have a good day