341 Commits

Author SHA1 Message Date
Kawe Mazidjatari
bef7f352d6 Implement '-novid' param check
the parameter check for '-novid' has been removed from S2 onwards, but later added back in. Our S3 build doesn't have it as well. This commit adds it back in and allows user to launch the game without the startup video's by adding '-novid' to the launch arguments. ('-dev' also works, but this enables developer and sv_cheats..).
2022-09-25 13:36:55 +02:00
Kawe Mazidjatari
734d3307ed Update R5R emblem 2022-09-25 01:20:48 +02:00
Kawe Mazidjatari
7912b79fa2 CL_CopyExistingEntity: implement missing bounds check
Implement bounds check for non-sanitized value of u.m_nNewEntity.
Debug builds of the engine have an assertion, however in release these are stripped.
This fixes a full chain client RCE exploit, for more information, see: https://ctf.re/source-engine/exploitation/2021/05/01/source-engine-2/
2022-09-21 02:38:58 +02:00
Kawe Mazidjatari
fdd74aa622 Implement net message processing budget
Implement net message process budget (channel gets removed if value is exceeded).
Use 'net_processLimit' to enable the implementation on the server. It will get enabled by default after testing and some cleanup. This helps against people trying to slow the server down by spamming net messages with a higher rate, e.g. using 'bind "mousewheel_up" "status"'.
2022-09-18 23:19:50 +02:00
rexx
7d8d515190 add global text chat
use sv_forceChatToTeamOnly 0 to enable global chat
2022-09-18 20:42:16 +01:00
Kawe Mazidjatari
4ec7239b57 Add 'CNetChan::ProcessMessages(..)' hook body
Compat from S0 to S7.
2022-09-17 23:34:36 +02:00
Kawe Mazidjatari
242320e735 Also check CPU for SSE 3, SSSE 3 and POPCNT.
Check for SSE 3, SSSE 3 and POPCNT in CheckCPU(), and SSE, SSE2 in MathLib_Init().
This should fix all crash cases caused by launching the game on unsupported CPU's.
2022-09-14 02:23:06 +02:00
Kawe Mazidjatari
e0504d2828 Perform CPU check as early as possible
Check CPU as early as possible (first routine during init). This is required because SpdLog compiles down to SSE instructions.
2022-09-14 01:35:05 +02:00
Kawe Mazidjatari
729475c74c Light cleanup
Use NO_ERROR instead of NULL for error code parameter passed to Error(..).
2022-09-14 01:14:51 +02:00
Kawe Mazidjatari
3d6d6644bd Logging bug fix and error handling improvements
* Replaced the boolean 'fatal' parameter with a error code parameter, anything non-null will prompt a message (fatal) and terminate the process with given error code.
* Fixed bug where the global ostreamsink for spdlog did NOT get cleared in 'SQVM_PrintFunc' when cvar 'sq_showvmoutput' was < 3. Moved to global scope.
* Added error message for when detouring the process has failed, with the error code.
* Only call 'Plat_GetProcessUpTime()' once per log, (improves performance and fixes bug where the error message box would show a different time stamp than what is logged into the console or file).
* All TIER0 loggers only log to notify and console when the SDK engine has fully initialized and detoured all functions.
2022-09-14 00:39:38 +02:00
Kawe Mazidjatari
577a8760cd CConsole: add more color coded flags
* Added more color coded flags to the console autocomplete window.
* Removed 'hidden' as FCVAR_HIDDEN is now enforced on the autocomplete window.
* force real-time CommandBase flags (previously compile-time).
2022-09-12 01:49:51 +02:00
Kawe Mazidjatari
9fe2c2d798 Update emblem
Next release is v2.1.
2022-09-01 01:24:51 +02:00
Kawe Mazidjatari
42dcfdbbec Rename R5Dev_ to SDK_ 2022-08-29 14:31:05 +02:00
Kawe Mazidjatari
0f488c685c Move simple task to global fixed frame
Avoids having to create threads for tiny little things.
2022-08-29 02:21:32 +02:00
Kawe Mazidjatari
2010e11310 Add 'fatal' functionality to Error()
When fatal is set, the function will show a error dialogue, which will halt the process and close when the message is dismissed. Else we will end up in a crash.
2022-08-22 12:42:41 +02:00
Marvin D
10b87b3bbc PluginSDK init and PluginSystem improvements
* Plugins can be loaded now (commented)
2022-08-21 00:59:55 +02:00
Kawe Mazidjatari
6764b5e56e Implement frame tasks
Run all Cbuf_Execute calls in the main thread. This should fix every problem related to (but not only):
* Connecting to server while RUI dialogue is still open.
* Connecting to server while in an active game.
* Running 'weapon_reparse'.
2022-08-19 21:33:31 +02:00
Kawe Mazidjatari
48cc2979ec Remove 'vengineclient_impl.h/.cpp' entirely from dedi 2022-08-17 02:04:01 +02:00
Kawe Mazidjatari
3c3da82154 Additional code improvements
* Removed some unused signatures.
* Named 2 CBaseFileSystem methods, and applied them to 'MOD_ProcessPakQueue()'.
* Renamed 'qword_1671061C8' to 'g_pMTVFTaskItem'.
* Renamed 'g_pMapVPKCache' to 'g_szMTVFItemName'.
* Only set first byte to 0 in 'g_szMTVFItemName' (actual size is 0x100, not 0x40).
2022-08-16 21:42:57 +02:00
Kawe Mazidjatari
88b3336758 Many small code improvements and optimizations
* Use c++ methods as much as possible.
* Use enum types for accessing NavMesh objects from array.
* Use size_t for for loops when testing against size types.
* Don't compute strlen twice of more on the same string.
* Don't use unnecessary c string casts if there is a method with a std::string overload.
* Don't create string objects from string pointers if we could use them directly.
* Don't initialize RCON password twice on each change, and don't set if the new password equals the old.
2022-08-11 11:07:45 +02:00
Kawe Mazidjatari
329621c6ad Move all public headers into root of 'public' 2022-08-09 17:18:07 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
3f8476db88 Logging system light refactor
* Use responceid from server to determine in which context to log.
* Moved all script loggers from combined enums to minus instead (SERVER = -3, CLIENT = -2, UI = -1 SERVER_CODE = 0, etc), this makes it much easier to align stuff in combined systems such as the RUI logger or NetMsg().
* Color log networked RCON messages properly on the client.
* Added dedicated logger for all received RCON messages (net_console.log).
* Log commands submitted through in-game console (allows for easier debugging when going through log files).
2022-08-03 18:34:44 +02:00
Kawe Mazidjatari
feef90c44f Light cleanup of the detours init system 2022-07-26 03:00:51 +02:00
Kawe Mazidjatari
de6aab7252 Change default spdlog pattern
Log 0.000 as process time, as this begins to start when the engine is initialized (Plat_FloatTime()).
2022-07-26 02:34:22 +02:00
Kawe Mazidjatari
799dac882a Add 'MainViewOrigin()' and 'MainViewAngles()'
Implemented g_vecRenderOrigin and g_vecRenderAngles to SDK.
2022-07-25 12:46:57 +02:00
Kawe Mazidjatari
c405c23934 Implement memory allocation singleton wrappers
* Pointer to g_pMemAllocSingleton
* New wrapper for returning the singleton, and creating one if not yet initialized (game shares the same pointer, and is aware of its creation).
2022-07-22 16:34:10 +02:00
Kawe Mazidjatari
bd3fe5b445 Public IVDebugOverlay VFTable interface.
New public interface to add debug overlays on the go (memory is managed by the game module).
3 new commands:
* line.
* sphere.
* capsule.
2022-07-12 17:46:47 +02:00
Kawe Mazidjatari
e14934d244 Fix persistence state for s0/s1 builds
CVEngineServer::IsPersistenceAvailable() is inline with Persistence_SetXP in S0 and S1. the virtual function never gets fired.
The approach for S0/S1 will call CVEngineServer::IsPersistenceAvailable() when Persistence_SetXP() is ran (the first function to ever use pClient->m_nPersistenceState after the SendServerInfo query).
2022-07-08 23:42:28 +02:00
Kawe Mazidjatari
86c9ac5292 Upgrade mathlib to latest
Latest SourceSDK MathLib with minor modifications.
2022-07-08 00:55:01 +02:00
Kawe Mazidjatari
7d89a42b56 Mathlib implementation
SourceSDK mathlib port with light modifications.
Renamed Vector to Vector3D (to avoid confusion with std::vector (declared as vector) and Vector2D/Vector4D).
2022-07-06 21:11:32 +02:00
Kawe Mazidjatari
becf8eb6a5 Use size_t for SDK_ARRAYSIZE instead
sizeof() returns a size_t.
2022-07-03 19:18:23 +02:00
Kawe Mazidjatari
158ec96d55 Move SSE/SSE2 tests to end of query
If the test fails we could still see the hardware.
2022-07-01 19:51:43 +02:00
Kawe Mazidjatari
0de09217bc Log process uptime
Log actual process uptime in all (post init) loggers.
The actual process uptime is obtained from the engine (Plat_FloatTime()).
2022-06-20 15:48:33 +02:00
Kawe Mazidjatari
4095424b7c Add clock/time function patterns
Added:
* Sys_GetProcessUpTime
* Plat_FloatTime
* Plat_MSTime
2022-06-20 14:58:53 +02:00
Kawe Mazidjatari
1764f039cf CConsole improvements: Add selectable logger text
CConsole now uses a dedicated class for logging text (modified CTextEditor class (CTextLogger)). The class uses an ImDraw list with a character vector to draw the text.

Text could be selected by double click (word), triple click (line), a selection by dragging the cursor, or everything with 'ctrl + a'.
2022-06-20 10:31:09 +02:00
PixieCore
8bf08af7b9 Start of RTech::CreateDXTexture rebuild.
* Currently crashes due to stack corruption.
2022-06-19 18:07:43 +02:00
Kawe Mazidjatari
0c11011567 Add ImGuiColorTextEdit to project 2022-06-18 23:23:29 +02:00
Kawe Mazidjatari
e70e4d1a8c Add DebugOverlay implementation 2022-06-15 01:24:29 +02:00
Kawe Mazidjatari
723976d9cb CLogSystem improvements
Draw the RUI console overlay and logging etc in CEngineVGui::Paint.
cl_showfps is no longer required to render the log system.
2022-06-12 17:50:12 +02:00
Kawe Mazidjatari
bbe885689a Add define for compiling launcher for dedicated servers
This sets the selected mode to server by default upon launch
2022-06-06 01:31:20 +02:00
Kawe Mazidjatari
e735683940 SquirrelVM refactor
The game uses 2 types, CSquirrelVM (mostly exposed to the VScript API of the engine) and HSQUIRRELVM (mostly used for internal squirrel functions like sq_pushbool etc..).

This refactor properly splits the CSquirrelVM* functions from the HSQUIRRELVM (SQVM*) ones. The functions have also been renamed accordingly and the prototypes have been adjusted to use the correct pointer type.
2022-05-28 22:02:00 +02:00
Kawe Mazidjatari
c8432acc9a Add 'tier0/commonmacros.h' to precompiled header 2022-05-28 16:15:39 +02:00
Kawe Mazidjatari
11652d015d SDK launcher progress
* Fixed compiler error when trying to compile SDK Launcher in debug (static lib was not compiled with static link runtime).
* Documented most stuff in basepanel.cpp
* Split some logic into dedicated functions in basepanel.cpp
* Implemented VDF parser from Matthias Moeller.
* Parse playlist file and load all playlists into the combo box.
2022-05-26 01:44:46 +02:00
Kawe Mazidjatari
4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00
Kawe Mazidjatari
dacd307663 See description
* Finished designer code for launcher gui.
* Basic implementation of setting flags for host launch option.
* Check in 'CHostState::LoadConfig' if -launcher is below 1.. if condition is met the cfg's will be executed from 'CHostState::LoadConfig'.
* Added 'StringIsDigit' utility.
2022-05-24 02:23:37 +02:00
Kawe Mazidjatari
52883808e1 Reversed CServer structure (almost complete). See desc
* Mostly rebuild CServer structure.
* Partially rebuild CNetworkStringTable structure.
* Partially rebuild CNetworkStringTableContainer structure.
* Removed redundant patterns which are now covered in the data structure.
2022-05-20 20:14:39 +02:00
Kawe Mazidjatari
efb7c36408 Light project restructure
Moved server/client headers and implementations into dedicated subfolder.
Renamed Some classes to match the game binary (e.g. CBaseClient is now CClient).
Removed redundant files.
2022-05-20 11:52:19 +02:00
Kawe Mazidjatari
3e403224d0 Pad seconds by 10 instead (3+1+6) 2022-05-19 02:20:52 +02:00
Kawe Mazidjatari
ddfdb4ffd8 See description
Add '-nodiscord' and '-nobakedparticles' to launch params for dedicated.
Add hook for 'MemAlloc_Internal()'.
Rename loggers to be more consistent with naming.
Revert omitting frame pointers.
2022-05-17 23:00:30 +02:00