mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix several exploitable bugs in the CUserCmd class. Some of these have been used to exploit/cheat in-game. Fixes contain: - Camera position clamping (the only patch that hasn't been tested yet!) - Weapon activity exploit, allowing player to infinitely throw ordnances, and perform other 'cheats'. - Akimbo exploit + server crasher, allowing client to set multiple inventory weapons as active. The active weapon index bounds were also not checked, a properly crafter CUserCmd message would therefore be able to crash the server. Note that this does not fix all issues related to the UserCmd class; further reversing and testing revealed there is more to be fixed, these fixes will get implemented with a future commit.
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
||
//
|
||
// Purpose:
|
||
//
|
||
// $NoKeywords: $
|
||
//
|
||
//===========================================================================//
|
||
#ifndef IN_BUTTONS_H
|
||
#define IN_BUTTONS_H
|
||
#ifdef _WIN32
|
||
#pragma once
|
||
#endif
|
||
|
||
/* !TODO: not confirmed, some are correct, some are not.
|
||
Only use the ones you confirmed ar ecorrect! */
|
||
|
||
#define IN_ATTACK (1 << 0)
|
||
#define IN_JUMP (1 << 1)
|
||
#define IN_DUCK (1 << 2)
|
||
#define IN_FORWARD (1 << 3)
|
||
#define IN_BACK (1 << 4)
|
||
#define IN_USE (1 << 5)
|
||
#define IN_CANCEL (1 << 6)
|
||
#define IN_LEFT (1 << 7)
|
||
#define IN_RIGHT (1 << 8)
|
||
#define IN_MOVELEFT (1 << 9)
|
||
#define IN_MOVERIGHT (1 << 10)
|
||
#define IN_ATTACK2 (1 << 11)
|
||
#define IN_RUN (1 << 12)
|
||
#define IN_RELOAD (1 << 13)
|
||
#define IN_ALT1 (1 << 14)
|
||
#define IN_ALT2 (1 << 15)
|
||
#define IN_SCORE (1 << 16) // Used by client.dll for when scoreboard is held down
|
||
#define IN_SPEED (1 << 17) // Player is holding the speed key
|
||
#define IN_WALK (1 << 18) // Player holding walk key
|
||
#define IN_ZOOM (1 << 19) // Zoom key for HUD zoom
|
||
#define IN_WEAPON1 (1 << 20) // weapon defines these bits
|
||
#define IN_WEAPON2 (1 << 21) // weapon defines these bits
|
||
#define IN_BULLRUSH (1 << 22)
|
||
#define IN_GRENADE1 (1 << 23) // grenade 1
|
||
#define IN_GRENADE2 (1 << 24) // grenade 2
|
||
#define IN_ATTACK3 (1 << 25)
|
||
|
||
#endif // IN_BUTTONS_H
|