8 Commits

Author SHA1 Message Date
Kawe Mazidjatari
b26ed2f746 Engine: implement encryption for RCON protocol
RCON lacked encryption, added AES-CTR encryption on RCON frames. Slightly adjusted protocol to take this into account (sending nonces, encrypted data itself, etc).
2024-06-01 11:24:47 +02:00
Kawe Mazidjatari
3c10bf0e8d Netconsole: refactor & improvements
* Fix multiple issues related to threading, such as not locking the mutex when using thread-unsafe members or methods.
* Netconsole now logs its output to a file on the disk.
* Properly handle close events, to allow netconsole to shutdown properly, so stuff like log buffers could flush properly. Input is now ran in a separate thread so main thread could check if we need to shutdown, and do so if needed. This was needed as previously input was ran in the main thread and the issue is that its blocking until an input is given.
2024-04-05 17:46:55 +02:00
Kawe Mazidjatari
0a25f5e0fe Adjust 'CNetConBase' vftable order
Order has been adjusted to match the order of execution.
2023-08-04 17:45:30 +02:00
Kawe Mazidjatari
d7f92cbefd Adjust names
Adjust since previously they were pointers but now references.
2023-08-04 17:41:55 +02:00
Kawe Mazidjatari
ddfe027677 Pass by reference
CConnectedNetConsoleData was allocated and deallocated manually, but std::vector is able to do it on its own. The vector type has been swapped out with CUtlVector as this removed the need of having to cast size types to a 32bit int to make it more compatible with the other sdk/engine types without throwing compiler warnings.
2023-08-04 10:48:22 +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
39445eecc4 Add missing check
This fixes the bug where RCON address couldn't be set from the '[::]:port' format.
2023-04-19 01:52:05 +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