328 Commits

Author SHA1 Message Date
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
rexx
1055ba8994 add serverbrowser convars to fix script error 2023-05-01 20:41:27 +01:00
rexx
f90bba9d85 Fix compile
This assert was accidentally left in to catch any invalid calling of CNetAdr::ToString
2023-05-01 15:15:06 +01:00
Kawe Mazidjatari
366ff3fb4f Remove devonly flag from 'net_usesocketsforloopback' 2023-05-01 00:01:18 +02:00
Kawe Mazidjatari
ef20846314 Remove extraneous include 2023-04-30 21:43:08 +02:00
Kawe Mazidjatari
cc38fabaa7 Change default value of 'rcon_password'
Changed to '[loopback]:37015' (always works, regardless of address type).
2023-04-30 11:57:49 +02:00
Kawe Mazidjatari
c6748edcc9 Reboot RCON server if 'net_usesocketsforloopback' changed
Reboot so it could update accordingly, just like the game's UDP sockets.
2023-04-30 11:34:47 +02:00
Kawe Mazidjatari
55aa254e6b Merge branch 'bulk_check' into indev 2023-04-29 21:01:59 +02:00
Kawe Mazidjatari
d52074238f Mark pylon refresh cvars as devonly
Marked 'sv_pylonRefreshRate' and 'sv_banlistRefreshRate' as development only.
2023-04-29 20:44:51 +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
7739e56b0d Adjust default value of cvar 'sv_banlistRefreshRate'
Set to 30 sec.
2023-04-28 23:48:30 +02:00
Kawe Mazidjatari
d69451466c Add assert in 'CNetAdr::ToString'
Main thread only from now on. Any other thread should manually pass in a buffer.
2023-04-22 21:46:37 +02:00
Kawe Mazidjatari
9829684183 Set max value for rcon cvars
Clamp 'sv_rcon_maxsockets' and 'sv_rcon_maxconnections' to MAX_PLAYERS as it could otherwise crash the game if set too high.
2023-04-22 18:13:27 +02:00
Kawe Mazidjatari
50b3273101 Add change callback for 'sv_rcon_maxconnections'
If 'sv_rcon_maxconnections' is set higher than current auth socket count, reopen listen socket. If its set lower, close all sockets until auth socket count matches 'sv_rcon_maxconnections'. Sockets are getting closed in reverse order, so the netcon that connected last will be disconnected first.
2023-04-22 16:51:18 +02:00
Kawe Mazidjatari
e51336dd5a Add 'bf_write::WriteBytes' 2023-04-19 01:36:35 +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
437a54486d Fix typo in 'bf_write' 2023-04-18 20:14:20 +02:00
Kawe Mazidjatari
85f586bd2e RCON server improvements
* Prevent attacker from being able to abuse and overflow the banned list vector.
* Improved IPv6 comparison performance.
* Change size fields of payload frame from unsigned to signed.
* Close all accepted sockets on RCON server shutdown.
2023-04-16 17:51:48 +02:00
Kawe Mazidjatari
c354d7ae02 Add ability to compare IPv6 addresses 2023-04-16 11:55:57 +02:00
Kawe Mazidjatari
8bf105b072 Smoother fade animation for ImGui panels
Fade out when disabled too, in steps of 0.5f. SDK fixed frame has been increased to 100tps.
2023-04-16 02:45:22 +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
fd5b840ba9 Light cleanup of the 'CNetAdr' class 2023-04-16 00:08:06 +02:00
Kawe Mazidjatari
0ffcca14ab Add 'sv_cheats' cvar to SDK 2023-04-15 00:18:13 +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
b45055dafd Fix debug compile errors 2023-04-10 22:31:42 +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
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
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
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
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
f62092d6f2 Fix sign of array subscript
Must be unsigned to avoid indexing on negative numbers.
2023-04-08 18:28:39 +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
5e95b280c0 Fix level 3/4 compiler warnings
Fix level 3 and 4 compiler warnings in 'lzss.cpp'.
2023-04-06 21:01:42 +02:00
Kawe Mazidjatari
a5489f16b6 Fix small oversight
Should be '+1' as 'position' could be 0.
2023-04-05 22:58:26 +02:00
Kawe Mazidjatari
e76f5b98c8 CLZSS: Fix bug causing iterator to go out of bounds
Check if 'position' exceeds buffer size.
2023-04-05 22:31:37 +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
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