290 Commits

Author SHA1 Message Date
Kawe Mazidjatari
dbe1850ec1 Add LZSS implementation to SDK 2023-04-05 21:38:28 +02:00
Kawe Mazidjatari
fe0cce731b Explicitly disable certain warnings in code
This code is good as-is, they cannot be adjusted to suppress the warnings while still guaranteeing its functionality.
2023-04-03 14:55:16 +02:00
Kawe Mazidjatari
a1f7cc9a0d Make code compatible with older C++ versions
Made compatible with earlier C++ versions without having verbose compiler warnings.
2023-04-03 01:41:46 +02:00
Kawe Mazidjatari
b0d2665550 /W4: Fix compiler compatibility
Clang doesn't support function-style casts with types containing a space.
2023-04-02 17:34:42 +02:00
Kawe Mazidjatari
bae2e0a99c /W4: Fix implicit type conversion warnings
Explicitly convert them to avoid any warnings or potential bugs.
2023-04-02 17:23:53 +02:00
Kawe Mazidjatari
a71839f13a /W4: Fix potentially non zero-terminated string
The prior call to 'strcpy' might not zero-terminated string, explicitly perform this operation to prevent this bug.
2023-04-02 16:56:54 +02:00
Kawe Mazidjatari
922709f4d9 /W4: Fix verbose compiler warnings caused by incorrect type conversion
Fixed bug caused by incorrect type conversion. Type should be as wide as the type used for 'CUtlMemory::m_nAllocationCount', which is 64-bits on this particular implementation.
2023-04-02 15:51:08 +02:00
Kawe Mazidjatari
a4a2f34c10 /W4: Fix signed/unsigned mismatch
This commit fixes warnings and bugs caused by signed/unsigned mismatch.
2023-04-02 12:09:43 +02:00
Kawe Mazidjatari
7de717d47c /W4: Use 'constexpr' to evaluate branch at compile time
Fixes many compiler warnings.
2023-04-02 11:19:23 +02:00
Kawe Mazidjatari
c2094a68de Add and implement file path normalization logic
Implementation taken from game executable.
2023-04-02 02:00:47 +02:00
Kawe Mazidjatari
4357c9dbf3 Fix many compiler warnings
Fix many compiler warnings indicating potentially unwanted implicit conversions/truncations.
2023-04-02 00:59:24 +02:00
Kawe Mazidjatari
fd9f9cb00d Comment 'register' keywords in 'generichash.cpp'
Commented due to deprecation in C++17.
2023-04-01 21:14:42 +02:00
Kawe Mazidjatari
69e6c4718e Rename static 'Init' method in ConVar
Renamed to 'StaticInit' to avoid base class override. Also commented '__restrict' qualifiers.
2023-04-01 13:09:02 +02:00
Kawe Mazidjatari
67180e51ff Validate client's origin name on connect
Recently, there has been a sudden influx of players playing with a name that isn't valid. Names such as "    " or "@something $very !crazy". This patch fixes this problem by enforcing checks during connect by default.
2023-03-31 22:37:53 +02:00
Kawe Mazidjatari
47aabf244b Remove redundant tier1 files
These files are no longer necessary.
2023-03-28 01:30:09 +02:00
Kawe Mazidjatari
5a0be4a275 Fix ConVar crash
Fix crash caused by vftable error. Since we are not implementing anything, but only interfacing with the game executable, we need to rename the IConVar variant's due to name ambiguity. Re-defining them in the actual class will lead into vftable misalignment and cause a crash (or other undesired behavior) as a result.
2023-03-28 01:24:55 +02:00
Kawe Mazidjatari
2607f024b9 Move ConVar to separate implementation file
Moved to 'tier1/cvar.h/cpp'.
2023-03-28 01:05:23 +02:00
Kawe Mazidjatari
9e7fbdca54 ConVar/ConCommand class refactor and bug fixes
* Refactored ConCommandBase, ConCommand and ConVar class to make them all virtual, so it could interface with the game's implementation.
* Properly initialize members for ConCommand and ConVar instead of just calling memset.
* Fixed bug in ConVar registration function causing the virtual base table pointer to point to the ConCommand implementation instead of the ConVar implementation.
2023-03-28 00:50:08 +02:00
Kawe Mazidjatari
27ddc30d68 Prune ununsed/useless cvars
Also removed these from the CFG files.
* 'sq_showvmoutput' has been renamed to 'script_show_output'.
* 'sq_showvmwarning' has been renamed to 'script_show_warning'.
2023-03-26 18:18:50 +02:00
Kawe Mazidjatari
9978227915 Lock filesystem 'read' logs behind a cvar
Locked behind cvar as loading a single map already causes 500kb 'read' logs.
2023-03-26 16:21:49 +02:00
Kawe Mazidjatari
793fcd62f2 End of logger refactor
Changed all loggers to use the internal 'CoreMsg/CoreMsgV' functions. Significantly reduced duplicate code and CPU time. Code is also much more robust.

* Code now only acquires mutex lock when the actual logging part takes place.
* Code now only checks and strip ANSI rows if its enabled to begin with.
* Code now supports setting log levels, which ultimately could be tweaked with a cvar.
* Changed logger and file names to be more readable.

TODO:
* The RCON protocol has to be modified to accommodate these changes.
2023-03-26 16:09:05 +02:00
rexx
338d0ad3f9 fix CUtlMemory dtor crash
for some reason this caused an exception when trying to free CUtlString in the console auto-complete routine.
2023-03-21 22:43:09 +00:00
Kawe Mazidjatari
e886208d64 Remove extraneous destructor
This caused the 'CUtlBinaryBlock' destructor to be called twice (freeing memory on the same pointer twice). Destructor should only be called explicitly in 'CUtlBinaryBlock' itself to purge vector memory due to late binding of game's memalloc singleton.
2023-03-18 15:40:04 +01:00
Kawe Mazidjatari
737aad34f6 CUtlString: promote everything to 64 bits
Fix all compiler warnings from CUtlString.
2023-03-18 01:59:32 +01:00
Kawe Mazidjatari
1f735f1f6e Improve comments regarding design issue 2023-03-18 00:55:03 +01:00
Kawe Mazidjatari
98a01e0ae2 Add pattern for 'ConCommand::AutoCompleteSuggest'
Added pattern for 'ConCommand::AutoCompleteSuggest' (will be used for the console autocomplete instead as it supports the old and new callback system).
2023-03-17 00:15:43 +01:00
Kawe Mazidjatari
650b89fa25 CUtlString modifications
* Promote all size types to int64 to accomodate in-memory structure size of the game itself.
* Explicitly call destructors for members. Due to the way we hook the game and utilize the global memory allocation singleton, the destructor of the objects aren't called. CUtlVector does call the destructor of CUtlString. Explicitly defined a destructor that also destructs its underlying memory to avoid any memory leaks.
2023-03-17 00:12:37 +01:00
Kawe Mazidjatari
b030344c10 Add 'CUtlString' to SDK
Add 'CUtlString' from Source SDK.
2023-03-17 00:08:16 +01:00
Kawe Mazidjatari
a0527721b6 Add new strtools
New strtools from Source SDK (will be used in the future).
2023-03-17 00:00:09 +01:00
Kawe Mazidjatari
b3621ba53a Add cvar 'curl_timeout'
New cvar for setting the curl timeout determined in function 'CURLInitRequest'.
2023-03-15 21:33:16 +01:00
Kawe Mazidjatari
cac2c6a917 Make 'sig_getadr' a console command
Changed to hidden ConCommand.
2023-03-15 21:11:20 +01:00
Kawe Mazidjatari
8399881079 Add updaterate cvars 2023-03-13 20:37:39 +01:00
Kawe Mazidjatari
cae5037324 Initial fix for older game builds
SDK compiles and works for the S1 game now, still needs to be debugged further.
2023-03-01 00:09:38 +01:00
Kawe Mazidjatari
b050616c35 Fix compiler warning for tier1
should be a 64bit type as input is 64bit, too.
2023-02-26 19:38:01 +01:00
Kawe Mazidjatari
9573cfa8cb Add usage string parameter for concommand
Add usage string for concommand and move usage to there.
2023-02-23 23:47:27 +01:00
Kawe Mazidjatari
3f2216337e Add completion for pak decompress
* Renamed 'rtech_decompress' to 'pak_decompress'.
* Added completion func for 'pak_decompress'.
2023-02-19 13:38:06 +01:00
Kawe Mazidjatari
3e3c823c55 Change default VPK build directory 2023-02-19 10:24:15 +01:00
Kawe Mazidjatari
dd95eee491 Rename 'Con_NPrintf' cvars
A more appropriate name and description for 'Con_NPrintf'.
2023-02-19 10:23:35 +01:00
Kawe Mazidjatari
8965d6f101 Error/Warning/Con_NPrintf log hook refactor
* Warning now only logs if error level < 5.
* Warning buffer size has been increased to '10000' (internal buffer size).
* Error is now hooked as well.
* Error buffer size has been increased to '4096' (internal buffer size).
* Con_NPrintf has been refactored; 'cl_showhoststats' has been removed.
* Con_NPrintf buffer size has been increased to '4096' (MAXPRINTMSG).
* CTextOverlay::Con_NPrintf now checks the first byte in the character buffer before rendering anything, and sets the first byte to a terminating null character after rendering. This fixes the bug causing the host_speeds overlay to be still drawn while the cvar 'host_speeds' was disabled.
2023-02-19 09:51:46 +01:00
Kawe Mazidjatari
adb2ed60a4 Add 'sv_stats' cvar to SDK
Server CPU statistics.
2023-02-18 00:06:24 +01:00
Kawe Mazidjatari
1e0248a442 Fix command quota warning message
Fix command not getting logged properly when user exceeds quota.
2023-02-17 23:55:27 +01:00
Kawe Mazidjatari
ea4190e534 Slightly more mapped out CUtlBuffer
These are set and used in 'PersistenceParseDefSourceMsg' and 'CAI_NetworkManager::InitializeAINetworks'. Still unknown what they exactly do.
2023-02-12 18:02:37 +01:00
Kawe Mazidjatari
837f53ccb7 Promote CUtlBuffer size types to 64bits
In the engine, all these seem to be 64bits as well as the members are 64bits.
2023-02-12 17:54:15 +01:00
Kawe Mazidjatari
310e4b4af3 Make help text bit more clear 2023-02-12 16:27:17 +01:00
Kawe Mazidjatari
0734d56fe2 Add reversed 'CNetKey' class
Confirmed size, mostly unknown still. But some of this seems to be data related to OpenSSL.
2023-02-12 02:15:58 +01:00
Kawe Mazidjatari
5f7bf4414e Add additional miles debug info
Log the amount of time it took to initialize miles. Also log the language it gets initialized with, as this has been a common problem in the past. This should make it easier to see the problem regarding audio initialization failures.
2023-02-12 00:05:27 +01:00
Kawe Mazidjatari
1051b3a427 Also compile for client.dll
Mask it off for client.dll as well.
2023-02-08 22:57:14 +01:00
Kawe Mazidjatari
f6df34d68d Fix bug caused by recent addition of completion funcs
'map' and 'map_background' were removed from the array, and thus 'FCVAR_DEVELOPMENTONLY' wasn't masked off. As of this commit, its getting masked off along with 'FCVAR_SERVER_CAN_EXECUTE'.
2023-02-08 22:54:35 +01:00
Kawe Mazidjatari
e4df03c4f2 Add RPak completion callbacks
Add completion for 'pak_requestload' and 'pak_requestunload'.
2023-02-06 02:16:02 +01:00
Kawe Mazidjatari
a8c5ed45fd Fix IAppSystem VFTable
Destruvtor is prepended on every class in-engine. Reflected in SDK. Also removed extraneous method from ICvar causing other methods below it to misalign after the IAppSystem change.
2023-02-06 02:15:01 +01:00