2642 Commits

Author SHA1 Message Date
Kawe Mazidjatari
fe15a1c745 Add 'NET_Config' to SDK
Signature matches among all builds between S0 and S3.
2023-04-16 00:30:29 +02:00
Kawe Mazidjatari
3882b64b91 Fixed several bugs in socket creator class
* Fixed 'connect' socket bug preventing connection to IPv4 addresses, by making the method used by the listen socket and connect socket configurator shared (dual stack was disabled on connect, but not on listen).
* Removed extraneous member from the 'CSocketCreator' class, this member was a copy of the 'netadr_t' input, but nothing ever was done with it.
2023-04-16 00:28:33 +02:00
Kawe Mazidjatari
2d3f2ba507 Fixed bug causing RCON server socket to only listen on IPv6
Ip address must be unspecified (::) to bind sockets properly.
2023-04-16 00:24:06 +02:00
Kawe Mazidjatari
cf610b7d6b Light improvements to client side RCON system 2023-04-16 00:22:21 +02:00
Kawe Mazidjatari
0b9e5f6e68 Light cleanup of the 'CNetAdr' class 2023-04-16 00:21:17 +02:00
Kawe Mazidjatari
fd5b840ba9 Light cleanup of the 'CNetAdr' class 2023-04-16 00:08:06 +02:00
Kawe Mazidjatari
7870f1557a Fix 'CLC_CmdKeyValues' exploit
Fix exploitation vector that could be performed on the game client to submit commands to other game clients connected to the same server, specifically the 'OnPlayerAward' command. Base_CmdKeyValues now only works when sv_cheats is enabled. SVC/CLC_CmdKeyValues subclass 'Base_CmdKeyValues', so these messages are 'fixed' as well.
2023-04-15 02:13:29 +02:00
Kawe Mazidjatari
0ffcca14ab Add 'sv_cheats' cvar to SDK 2023-04-15 00:18:13 +02:00
Kawe Mazidjatari
8611a0c607 Small logger system optimization
Only perform colorization operation for script errors when log level is at least that of the console.
2023-04-14 00:37:57 +02:00
Kawe Mazidjatari
dee5b36088 Fix bug in script print logger
Fixed bug causing script warnings/errors to not override the log level. Warnings/errors should always be printed to the console. This commit also fixes a bug that causes warnings/errors to not show in red/yellow colors in the imgui console when '-ansicolor' command line parameter isn't used. The imgui console always logs colors and does not rely on '-ansicolor', this is only for the external terminal window.
2023-04-14 00:30:50 +02:00
Kawe Mazidjatari
94ae3e58ce Fix exploitable code defect in 'CNetChan::ProcessSubChannelData'
Patch applied to server & client.
2023-04-13 22:38:03 +02:00
Kawe Mazidjatari
4c8952ac96 Improve formatting in patch file document 2023-04-13 20:29:46 +02:00
Kawe Mazidjatari
53e2ddb122 Fix compiler warning caused by signed/unsigned mismatch v2.2_rc4 2023-04-10 23:45:51 +02:00
Kawe Mazidjatari
350dd4fcca Bump cache version
Force full rebuild; a new signature was added.
2023-04-10 23:45:33 +02:00
Kawe Mazidjatari
2aa20fbf18 Fix compiler warnings
* Explicitly cast to types.
* Mark parameter unused in release.
2023-04-10 23:45:09 +02:00
Kawe Mazidjatari
c6915fcf42 Cleanup 'CHostState::Think'
Reordered code and cleanup preprocessor directives.
2023-04-10 23:11:52 +02:00
Kawe Mazidjatari
a26ad748c8 Add patch for dedicated server executable
This patch prevents 'fps_max' from being reset in 'CEngine::Frame' if 'sv_cheats' isn't set; this cvar is now bound to the server's tickrate in sdk code to save CPU time.
2023-04-10 22:36:32 +02:00
Kawe Mazidjatari
f37743e068 Significantly reduce CPU time in CEngine::Frame for dedicated
Significant reduction of CPU time in CEngine::Frame for the dedicated server, by assigning the ConVar 'fps_max' to the tickrate of the server.
2023-04-10 22:35:41 +02:00
Kawe Mazidjatari
b45055dafd Fix debug compile errors 2023-04-10 22:31:42 +02:00
Kawe Mazidjatari
d2e0621163 Fix bug in CGlobalVarsBase
Field 'm_flTickInterval' should be float, not int.
2023-04-10 22:30:57 +02:00
Kawe Mazidjatari
b75fb7913f Rename symbols 2023-04-10 19:14:59 +02:00
Kawe Mazidjatari
e77b301f2b Remove unused ConVar
No longer required.
2023-04-10 15:05:05 +02:00
Kawe Mazidjatari
e48623102f Write 'SVC_ServerTick' into snapshot buffer
This should be cheaper and more reliable than sending it as a separate net message.
2023-04-10 15:04:46 +02:00
Kawe Mazidjatari
6a69965b33 Improve 'bf_read' and 'bf_write'
* Implemented a proper initializer for the mask tables (s_nMaskTable has been removed).
* Implemented write methods in 'bf_write'. There are still some missing methods; there have to be added in later.
* Documented most functions.
2023-04-10 15:02:56 +02:00
Kawe Mazidjatari
4ecf58f61c Add additional bit utilities from SourceSDK 2023-04-10 14:59:36 +02:00
Kawe Mazidjatari
129637e8e6 Fix incorrect netmsg constant
Should be '7' based on the calls to 'bf_write::WriteUBitLong' in the game executable.
2023-04-10 14:58:21 +02:00
Kawe Mazidjatari
e4bea5a88f
Update README.md 2023-04-10 02:11:25 +02:00
Kawe Mazidjatari
8171d4530f
Update thirdpartylegalnotices.txt 2023-04-10 02:10:51 +02:00
Kawe Mazidjatari
fd2c7864b9 Update VPK build scripts
* Added 'mp_rr_party_crasher'.
* Renamed 'mp_lobby' to 'mp_common' for server.
2023-04-10 02:09:16 +02:00
Kawe Mazidjatari
7c6094fc19 Bump sigcache version
Bumped to force a full rebuild of the signature cache map.
2023-04-10 00:13:05 +02:00
Kawe Mazidjatari
7ae19d245a Bump version gate string
Bumped to '008' for version gating as this release fixes security issues.
2023-04-10 00:12:27 +02:00
Kawe Mazidjatari
294ac7d02e Enable COMDAT folding and reference linker optimizations for netconsole project 2023-04-10 00:11:29 +02:00
Kawe Mazidjatari
c116479c37 Fix naveditor compiler error
Use the global variant instead, as the std variant requires a locale.
2023-04-09 23:52:25 +02:00
Kawe Mazidjatari
99ff9492a8 Fix SDK initialization order bug
Fix initialization order bug; 'CheckCPU()' and 'MathLib_Init()' have to be initialized before any other function is called. 'strstr(...)' also uses intrinsics not supported on some processors.
2023-04-09 23:38:55 +02:00
Kawe Mazidjatari
7aa07083ca CBitRead::ReadString: Improve readability
The intention of null-terminating the string is clearer when using '\0' instead of '0' or 'NULL'.
2023-04-09 23:35:58 +02:00
Kawe Mazidjatari
3dd4054838 'IsValidUTF8' const correctness
Does not modify the string; make it const.
2023-04-09 23:34:06 +02:00
Kawe Mazidjatari
381f09b1d7 CTextLogger: Skip newline characters when advancing cursor
Skip newline characters to avoid having to issue a move left/right command twice before seeing the cursor move.
2023-04-09 23:33:10 +02:00
Kawe Mazidjatari
dbf3b5b91d Improve ImGui logger API
* Better structure packing (reduced padding).
* 'CTextLogger::GetFilter' now returns a reference to 'm_itFilter'.
* Added additional setters and getters.
2023-04-09 22:35:55 +02:00
Kawe Mazidjatari
b0f94fd641 Fix compiler warnings
* Comment unused code.
* Explicitly cast input and results to/from 'toupper'.
2023-04-09 22:24:25 +02:00
Kawe Mazidjatari
bd8b9e8c77 Improve server print messages
Always format with a newline if one is missing.
Calculate string size directly from 'ReadString' in 'SVC_UserMessage::ProcessImpl'.
Added additional asserts to detect code errors.
2023-04-09 22:22:06 +02:00
Kawe Mazidjatari
a39afd4efe CTextLogger: Manage keyboard and mouse inputs
Manage them under 1 member variable.
2023-04-09 19:53:33 +02:00
Kawe Mazidjatari
d46cc0d6b1 Remove unused member variables 2023-04-09 19:37:00 +02:00
Kawe Mazidjatari
fe2bd4c4d8 Make sure only UTF-8 encoded strings are getting logged
This should fix all bugs and vulnerabilities to the ImGui console. This code has been fuzzed for hours without triggering any exceptions or assertions.
2023-04-09 19:36:30 +02:00
Kawe Mazidjatari
810870b611 Fix buffer overflow in ImGui text logger
Fix a potential buffer overflow that could be triggered by logging invalid characters to the Dear ImGui console. The incrementation of the loop control variable performed by 'UTF8CharLength' was never validated.
2023-04-09 16:15:08 +02:00
Kawe Mazidjatari
678c6dc833 Add proper timing logic for server statistics
Update rate is now controller by a cvar.
2023-04-09 11:06:55 +02:00
Kawe Mazidjatari
8a052f819d Improve error string 2023-04-08 20:15:16 +02:00
Kawe Mazidjatari
94d30b759d Fix potential security flaws caused by uncontrolled format strings
Make sure format strings are string literals to avoid an uncontrolled format string situation.
2023-04-08 20:13:06 +02:00
rexx
cebca2ca04 Fix security flaws in use of format strings
In all cases, the string is already formatted by the time that DrawColoredText is called, so we must make sure that an invalid format specifier cannot be placed inside the string as this can cause arbitrary memory reading and potentially crashes
2023-04-08 18:42:20 +01:00
Kawe Mazidjatari
f09bdc472b Suppress compiler warning and avoid potential bug
The string literal will never change during runtime; this commit is to make sure no mistakes are made in future refactors.
2023-04-08 19:14:00 +02:00
Kawe Mazidjatari
a7cab1d891 Fix potential security flaws caused by uncontrolled format strings
Make sure format strings are string literals to avoid an uncontrolled format string situation.
2023-04-08 19:10:59 +02:00