6 Commits

Author SHA1 Message Date
Kawe Mazidjatari
51ea9c7c4f CUserCmd hardening
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.
2023-06-13 17:43:32 +02:00
Kawe Mazidjatari
9f2b1b1bb5 Improve CL_Move rebuild
Ported the logic from the more recent builds into the SDK rebuild. Note that this isn't all that has changed in the live builds, but were the only things worth porting back. Frame times are now properly clamped on the client. Some testing revealed that the movement now feels identical to the live version of the game, which was the target. This commit also fixes a bug in CL_Move were the datagram was not send, and the next cmd time wasn't set if the client was NOT active, while it should have.
2023-06-05 00:27:36 +02:00
Kawe Mazidjatari
1afa75fec3 Fix >190FPS input system/simulation problems
Function 'CL_Move' has been fully rebuild in the SDK. Originally, the game checked if the delta time exceeded an amount defined by an immediate value, and dropped usercmd's if that was the case. This logic has been replaced with a more dynamic solution, and the console variable regulating this ('fps_input_max') is set to 200.0 by default (the same as the fix applied in the Season 9.1 Genesis update). This function also has been slightly optimized by removing duplicate operations that were performed in the original function. A second fix has been applied to 'CInput::JoyStickApplyMovement' that was also found changed in the Season 9.1 Genesis executable. In that function, an extraneous clamp was performed on the frame time causing viewstick problems when usercmd's get dropped in CL_Move.
2023-06-03 21:20:23 +02:00
Kawe Mazidjatari
abef34d3ef CPackedStore refactor
* Improve naming convention, and make it more consistent.
* Use engine types as much as possible.
* Reduced the amount of string copy constructions.
2023-05-29 21:41:17 +02:00
Kawe Mazidjatari
7ddd33c8de Force name consistency
Renamed to just 'netconsole' as it was phrased like that throughout other files.
2023-05-15 18:00:51 +02:00
Kawe Mazidjatari
f120354e96 Initial port to CMake
* All libraries have been isolated from each other, and build into separate artifacts.
* Project has been restructured to support isolating libraries.
* CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example).
* Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp).

TODO:
* Add a batch file to autogenerate all projects.
* Add support for dedicated server.
* Add support for client dll.

Bugs:
* Game crashes on the title screen after the UI script compiler has finished (root cause unknown).
* Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
2023-05-10 00:05:38 +02:00