121 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
rexx
1055ba8994 add serverbrowser convars to fix script error 2023-05-01 20:41:27 +01:00
Kawe Mazidjatari
366ff3fb4f Remove devonly flag from 'net_usesocketsforloopback' 2023-05-01 00:01:18 +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
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
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
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
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
0ffcca14ab Add 'sv_cheats' cvar to SDK 2023-04-15 00:18:13 +02:00
Kawe Mazidjatari
e77b301f2b Remove unused ConVar
No longer required.
2023-04-10 15:05:05 +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
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
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
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
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
8399881079 Add updaterate cvars 2023-03-13 20:37:39 +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
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
87ff71675b Implement ICvar interface class
Reversed ICvar interface class. Has been tested and verified on assembly level.
2023-02-05 11:01:27 +01:00
Kawe Mazidjatari
ca9143dde9 Add curl cvars for debugging 2023-01-30 00:04:11 +01:00
Kawe Mazidjatari
5f56c23af2 Compile CRConServer for gamesdk
RCON can now be used on the host game as well (previously dedicated exclusive).
2023-01-29 16:07:02 +01:00
Kawe Mazidjatari
61684ddf87 Create cvar for global banned list queries
This was planned to be changed a long time ago. This change allows dedicated server users to disable the logic as well.
2023-01-26 21:20:11 +01:00
Kawe Mazidjatari
19447f1122 Improve debug draw depth test toggle logic
* Add box depth test cvar from engine for 'CBaseAnimating::DrawServerHitboxes'.
* Use noDepthTest field from OverlayBox_t instead of the cvar.
2023-01-24 12:05:09 +01:00
Kawe Mazidjatari
888989d2b3 Fully working implementation of 'sv_showhitboxes'
Setting 'sv_showhitboxes' to 0 will enable it on everything deriving from CBaseAnimating, and having a valid studiohdr/hitbox. -1 means off, value > 0 will select entity by index (value of 'sv_showhitbox').
2023-01-24 00:53:45 +01:00
Kawe Mazidjatari
a281768ac9 BHit performance improvements
Use ray trace directly instead of build-in drawline command.
2023-01-22 12:09:12 +01:00
Kawe Mazidjatari
4710b51fa3 Experimental bot simulation implementation
Simulate bot user commands on the server. The simulation system is experimental and only runs if cvar 'sv_simulateBots' is set, and bots are created on the server.
2023-01-20 01:23:08 +01:00
rexx
6695a9bdaf add MilesQueueEventRun debug print 2022-11-27 20:44:17 +00:00
rexx
b15b876eed Revert "add more miles debug hooks"
This reverts commit feeaf5c54536a6ff7dae385314f9036ff45c4cd2.
2022-11-27 20:26:58 +00:00
rexx
feeaf5c545 add more miles debug hooks 2022-11-27 20:14:41 +00:00
Kawe Mazidjatari
9e7495e407 Added new logger types (AudioSystem & VideoSystem)
These loggers are to be used for hooking and logging Miles Audio and Bink Video systems.
2022-11-27 10:19:23 +01:00
Kawe Mazidjatari
4ba88963ff Fix bugs and many compiler warnings
* Promoted size types in CUtlBuffer to int64.
* Fixed bug where CUtlBuffer::GetPtr returns a 64bit pointer that was promoted from a 32bit integral type.
* Use int64/size_t for anything strlen, pointer subtraction, etc..
* Removed invalid structure alignment declarations.
2022-11-24 15:41:52 +01:00
Kawe Mazidjatari
bfa875394f Definitions for 'fs_packedstore_max_helper_threads' 2022-11-17 20:37:55 +01:00