565 Commits

Author SHA1 Message Date
Kawe Mazidjatari
39ccf8636d Force ConVar getters as inline 2023-05-03 23:59:33 +02:00
rexx
bcc51460bc
new new modsystem pr (#96)
* modsystem v2 initial commit

* call CModSystem::Init

* clean up custom cvar value handling

* add mod script compiling support

* add error check to script rson loading

yes this error is a duplicate but this one exits the game

* fix typo

* fix compile error
2023-05-02 19:26:49 +01:00
Kawe Mazidjatari
e8f6bf0eda Bump signature cache version
Force a full rebuild as some signatures have changed.
2023-05-01 23:45:42 +02:00
Kawe Mazidjatari
c02e738866 Fix utlvector and utlstring destructor bug
Fix duplicate call to CUtlMemory<T>::Purge. This was caused due to an extra call performed in the destructor of CUtlVector and CUtlString. Disassembling the DLL after performing these changes revealed the destructor of the allocator is only getting called once now; the issue has been fixed.
2023-05-01 22:49:53 +02:00
Kawe Mazidjatari
8ffe04c736 Bump cache version
Force full rebuild of cache map due to changed/added/removed signatures.
2023-04-30 21:49:04 +02:00
Kawe Mazidjatari
f97cf6c249 RCON socket bind improvement
Check 'net_usesocketsforloopback' before binding sockets; allows binding to loopback as well.
2023-04-30 11:32:51 +02:00
Kawe Mazidjatari
55aa254e6b Merge branch 'bulk_check' into indev 2023-04-29 21:01:59 +02:00
rexx
dca27475ec (re)implement sv_alltalk
Rebuilds SV_BroadcastVoiceData with an additional check of "sv_alltalk" cvar to disable team checking, allowing for servers to enable global voice chat
2023-04-29 11:11:10 +01:00
Kawe Mazidjatari
73fe590f99 Fix small bug
Fixed bug caused by const char* to const string& conversion, resulting in the request message not always getting sent properly.
2023-04-25 22:51:06 +02:00
Kawe Mazidjatari
be61c93c85 RCON system improvements
* Added more error handling throughout code.
* Marked function parameters 'const' where possible.
* Updated comments.
2023-04-22 16:02:54 +02:00
Kawe Mazidjatari
e51336dd5a Add 'bf_write::WriteBytes' 2023-04-19 01:36:35 +02:00
Kawe Mazidjatari
83d5deb109 Remove unused type
No longer used; replaced with cvar 'sv_rcon_maxpacketsize'.
2023-04-19 01:36:10 +02:00
Kawe Mazidjatari
179bd31ee6 Initial large refactor of the RCON implementation
* Decoding and encoding is done into a single buffer, from raw buffers to avoid extraneous copies.
* Added base class holding all core logic for encoding, decoding, receiving and processing of the RCON protocol. This code was initially identical between all implementations of RCON, deduplicating this avoids bugs.
* Added more sophisticated error handling, stop right away when decoding for example fails.
* Added ability to have more than one active authenticated net console on the server. Controlled by cvar 'sv_rcon_maxconnections' (default 1).
* Max packet size for accepted, but not authenticated sockets is now controled by cvar 'sv_rcon_maxpacketsize' (default 1024).
2023-04-19 01:35:31 +02:00
Kawe Mazidjatari
c354d7ae02 Add ability to compare IPv6 addresses 2023-04-16 11:55:57 +02:00
Kawe Mazidjatari
e0e7adbed4 Rename 'ip' cvar global to avoid conflicts
Avoid shadowing conflicts due to short name.
2023-04-16 01:17:46 +02:00
Kawe Mazidjatari
72a0399427 Add 'ip' cvar to SDK 2023-04-16 00:32:50 +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
0b9e5f6e68 Light cleanup of the 'CNetAdr' class 2023-04-16 00:21:17 +02:00
Kawe Mazidjatari
0ffcca14ab Add 'sv_cheats' cvar to SDK 2023-04-15 00:18:13 +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
d2e0621163 Fix bug in CGlobalVarsBase
Field 'm_flTickInterval' should be float, not int.
2023-04-10 22:30:57 +02:00
Kawe Mazidjatari
e77b301f2b Remove unused ConVar
No longer required.
2023-04-10 15:05:05 +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
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
3dd4054838 'IsValidUTF8' const correctness
Does not modify the string; make it const.
2023-04-09 23:34:06 +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
2c28391ca4 Make 'FL_EDICT_INVALID' unsigned
Should be unsigned as the type we test this on (edict_t) is of type unsigned short.
2023-04-08 19:02:14 +02:00
Kawe Mazidjatari
1d04f837f8 Fix many high level compiler warnings
* Put initializer values inside brackets.
* Put logical AND conditions within parentheses.
* Put assignments within conditional statements within parentheses.
* Mark unused variables as such to suppress compiler warnings.
* Fix vftable shadow warnings caused by ConVar::CreateInternal (does not implement, only interface. Renamed to yield desired behavior).
* Fix 'never' initialized class members for 'CCVarIteratorInternal'.
* Return values in interface vftables that cannot be pure virtual.
2023-04-08 19:00:28 +02:00
Kawe Mazidjatari
4079956356 Fix non-portable include paths
Portable include paths are case sensitive.
2023-04-08 18:52:33 +02:00
Kawe Mazidjatari
60b38e8904 Implement 'StringUnescape' properly 2023-04-08 18:05:05 +02:00
Kawe Mazidjatari
23b2d0174a Fix incorrect ctor order 2023-04-08 17:45:21 +02:00
Kawe Mazidjatari
4890593203 Add absolute array comparators
Check for highest/lowest value in array (absolute).
2023-04-08 13:32:34 +02:00
Kawe Mazidjatari
9f428f1567 Move tier0 lib headers to public
This commit does not change any logic or behavior of the code.
2023-04-06 23:50:48 +02:00
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
c729b6faa8 Fix symbol shadowing warnings in VDF parser 2023-04-03 14:52:22 +02:00
Kawe Mazidjatari
e79ed464e9 Improve HexDump utility
* Improved formatting.
* Get default logger directly instead of using a string identifier.
* Promoted size type to 'size_t'.
* Removed extraneous static variables.
2023-04-02 21:51:15 +02:00
Kawe Mazidjatari
ae431c6ac2 /W4: Fix unreferenced symbol warnings
Fix verbose unreferenced symbol warnings.
2023-04-02 17:02:04 +02:00
Kawe Mazidjatari
09553e3e2c /W4: Fix incorrect instantiation of string transformer
The case transformation didn't work properly as the char value was not casted to an unsigned char, causing undefined behavior. Added new utility function 'IsEqualNoCase' which allows for comparing 2 strings case insensitively. Code has been tested with module strings containing irregular cases, and was still able to obtain the imported function address correctly.
2023-04-02 15:16:32 +02:00
Kawe Mazidjatari
978f108526 /W4: Fix incorrect type cast
Values passed to functions from '<cctype>' must be representable as unsigned chars to avoid undefined behavior.
2023-04-02 14:58:02 +02:00
Kawe Mazidjatari
0f461b7695 /W4: Fix unreferenced functions and light cleanup
* Fully commented 'UTF8Decode' to suppress warnings (currently unsupported).
* Cleaned up 'GetModuleInfo' and 'DbgPrint' to use the non-wide string versions instead.
* Added error handling in 'PrintLastError'.
2023-04-02 14:52:12 +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
20b6b021d9 /W4: Fix verbose compiler warning caused by type demotion
Explicitly demote to unsigned char.
2023-04-02 09:43:08 +02:00
Kawe Mazidjatari
b648378574 Turn 'TxtrAssetToDxgiFormat' into constant table
Turned into an actual constant.
2023-04-02 01:40:28 +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
4c79b5af5d Change immediate from decimal to hexadecimal
Force consistency.
2023-04-01 21:43:16 +02:00
Kawe Mazidjatari
7a521d1d27 Turn static map into jump table
Slightly increase performance and reduce overhead during texture creation.
2023-04-01 11:27:53 +02:00
Kawe Mazidjatari
e3429705eb Fix crash caused by CAppSystemGroup changes
* Moved 'm_pFileSystem' to 'CSourceAppSystemGroup' (actually belongs there, CAppSystemGroup has to be 0xA8 in size in order for 'm_bDedicated' to line up in 'CModAppSystemGroup').
* Prefixed all static functions with 'Static' to avoid name collisions.
2023-04-01 01:27:04 +02:00