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.
This commit fixes an engine bug where netmessages are getting copied into the replay buffer, while these messages should never be replayed. The engine performs an internal check on 'CNetMessage::m_nGroup', and if its NOT 2, the message is getting copied into the replay buffer. All messages returning false in 'ShouldReplayMessage' are not getting copied into the replay buffer anymore. This exploit has been used in the past to route clients that were watching a replay to an arbitrary server, which essentially forms an info leak as the client attempts to connect to the arbitrary server on its own. The exploit also allows for some form of remote code execution, depending on if the client was launched in developer mode or not.
Only certain lumps can be cached; see switch case in 'IsLumpIdxCachable'. Attempting to load anything else from cache results in a code crash or invalid data.
This commit allows for loading all lumps from disk, if the m_bExternal var is set, it also attempts to load the lumps listed in the function 'IsLumpTypeExternal' from the cache, but through a different code path, which causes a crash. Setting this to false allows for loading it in the ctor.
bsp_lump loading was missing a check for if the lump is supposed to be able to load from disk
also removes VERTEX lumps from loading from disk due to crashes that occur when they are kept
The 'CMapLoadHelper' constructor has been rebuild to load lump files too (if they exist). Currently, the game only reads the packed BSP file, or lumps if they exist in the filesystem cache. The newly added logic also reads them from a file. This is currently broken, most likely due to alignment problems. Experimental.
This should fix a rare crash that happens when the playlists file is reloaded during disconnect. The client fetches the playlists from the server on connect. On disconnect, we want to reload the one from the client so that if the player want's to create his own game, that he would have his own playlists. The fix is to delay the reload of the playlists file to the beginning of the next frame.
Properly fix the aligned memalloc singleton in the SDK; the implementation now uses a callback based approach for calling the allocator and deallocator.
Set the persistence fields to 'ready' in 'CClient::ActivatePlayer', before executing the rest of the function. Previously, it was set in 'CVEngineServer::PersistenceAvailable', but this is too late. The function 'FairFight_Init' was actually 'CClient::ActivatePlayer', and thus it has been moved to the correct file, and the old file defining it previously has been removed.
Added all public headers to CMake projects, also moved some files around in the public directory. Translation units have been moved to the libraries that were responsible for implementing them, as this game is monolithic.
Treat them as errors globally. Most of the time a warning is a bug, or problem in code that could be solved in a different (better) manner. Thirdparty code have this disabled. The warnings as errors option can be globally disabled through the CMake GUI, but this is not recommended.
Use the 'add_module' macro to add modules without creating duplicate code. This macro also takes a reuse PCH as parameter, so modules that need a precompiled header, could reuse those from different targets that compile them. This commit also restructures the group order of the generated solution files for easier code navigation.
* 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!
Properly decouple squirrel and game code. This makes it easier to reverse engineer more of this squirrel system, and to compile them as individual libraries later on when moving to CMake to significantly decrease compile times.
* Run autoexec(_dev).cfg before anything else.
* Always initialize RCON (only gets ran if an actual password is set).
* Removed 'Cbuf_Execute()' call from 'CHostState::LoadConfig', let it run in the frame loop instead.
* Removed hardcoded set call for 'net_usesocketsforloopback', will be set in autoexec from now on.
* Format the ip as '[ip]:port' in all logging calls for consistency.
* Fixed a bug causing the IP to be send up as full instead of base only to master server (should always be base only).
* Temporarily uncommented the plugin callback logic.