blob: 7a86842e813f1831ff2ba287894ba5f5a9fa8b87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "mem.hpp"
#include "base_cheat.hpp"
#include "context.hpp"
#include "hooks.hpp"
uintptr_t cl_sendmove = 0;
int __fastcall hooks::send_datagram( INetChannel* channel, void* edx_, void* datagram ) {
if( g_csgo.m_panic || !g_settings.misc.net_fakelag || datagram ) {
return send_datagram_o( channel, 0, datagram );
}
auto cl = g_csgo.m_global_state->get_client_state( );
if( !cl || cl->m_delta_tick <= 0 ) {
return send_datagram_o( channel, 0, datagram );
}
// There is no need to restore the reliable state sequence since
// we are not fucking with reliable state with 'proper' fake latency.
int backup_sequence = channel->m_nInSequenceNr;
g_cheat.m_extra.add_latency( channel );
auto nci = g_csgo.m_engine( )->GetNetChannelInfo( );
int ret = send_datagram_o( channel, 0, datagram );
channel->m_nInSequenceNr = backup_sequence;
return ret;
}
|