diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/gmod/send_datagram.cpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'cheat/gmod/send_datagram.cpp')
| -rw-r--r-- | cheat/gmod/send_datagram.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cheat/gmod/send_datagram.cpp b/cheat/gmod/send_datagram.cpp new file mode 100644 index 0000000..dc55887 --- /dev/null +++ b/cheat/gmod/send_datagram.cpp @@ -0,0 +1,29 @@ +#include "base_cheat.hpp"
+#include "hooks.hpp"
+
+int __fastcall hooks::send_datagram( INetChannel* channel, void* edx_, void* datagram ) {
+ auto send_datagram_o = g_csgo.m_net_channel->get_old_function< decltype( &hooks::send_datagram ) >( 48 );
+ if( g_csgo.m_panic || !g_settings.misc.net_fakelag || datagram ) {
+ return send_datagram_o( channel, 0, datagram );
+ }
+
+ int backup_state = channel->m_nInReliableState;
+ int backup_sequence = channel->m_nInSequenceNr;
+ //int backup_o_state = channel->m_nOutReliableState;
+
+ if( g_settings.misc.net_fakelag != 4 && g_settings.misc.net_fakeping_amount )
+ g_cheat.m_extra.add_latency( channel );
+
+ auto nci = g_csgo.m_engine( )->GetNetChannelInfo( );
+ if( nci && g_settings.misc.net_fakelag == 4 && g_cheat.m_ragebot.can_fakeping( ) ) {
+ channel->m_nInReliableState = backup_state;
+ channel->m_nInSequenceNr = backup_sequence + 10;
+ }
+
+ int ret = send_datagram_o( channel, 0, datagram );
+
+ channel->m_nInReliableState = backup_state;
+ channel->m_nInSequenceNr = backup_sequence;
+
+ return ret;
+}
\ No newline at end of file |
