174 Commits

Author SHA1 Message Date
Kawe Mazidjatari
5d38b3762b Engine: enforce rcon convar name consistency
Removed extra '_' from sv_rcon_whitelist_address, its now sv_rcon_whitelistaddress.
2024-06-01 11:43:08 +02:00
Kawe Mazidjatari
51e4a11bdb Resource: add new LiveAPI configuration file
Executed on server launch.
2024-06-01 11:41:28 +02:00
Kawe Mazidjatari
39191f445f Resource: add new parallel VPK build script
Build script to build VPK files in parallel with use of the new tool 'ReVPK'.
2024-06-01 11:40:46 +02:00
Kawe Mazidjatari
caafe60cf2 Resource: update cleaner script
Added new LiveAPI log directory, and several files that were renamed.
2024-06-01 11:36:23 +02:00
Kawe Mazidjatari
aee8447320 Resource: update configuration files
Slightly adjusted RCON configuration files, recent changes implemented RCON encryption (users can specify their own AES keys).
2024-06-01 11:36:23 +02:00
Kawe Mazidjatari
b52a5cce48 NavMesh: rename editor program to 'recast'
Renamed to original tool name
2024-06-01 11:36:23 +02:00
Kawe Mazidjatari
73aff08819 Resource: update RCON cfg files
Reflect recent changes made to the RCON system.
2024-06-01 11:25:57 +02:00
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
e91b8cfcec RTech: implement custom events and slight adjustments/improvements
Implemented CustomEvent in code, which supports:
- bool|int|float|string|vector|array|table
- nested arrays and tables, up to a depth of 64

Also improved foundation code for LiveAPI:
- added ability to log liveapi events to a file on the disk (rotates between each match or round, depending on how the abstracted functions are called in scripts)
- when the system is enabled through cvars, code will be invoked on the fly
- when the system is disabled through cvars, the system will be shutdown properly on the fly (properly handling socket closing, log file finishing, etc)
- if the socket system is enabled/disabled on the fly using cvars, related code will be called to initiate or shutdown the connections.

The generated proto.cpp/h file has been moved to the protoc project as it was causing some compiler warnings that we suppress on the thirdparty (vendored) code.
2024-04-05 18:39:36 +02:00
Kawe Mazidjatari
de06d51ef0 Server: upgrade live_api events.proto
Upgraded to "R5pc_r5-201_J29_CL6350311_EX6402312_6403685_2024_03_22".
2024-04-05 18:35:05 +02:00
Kawe Mazidjatari
44d7a252de Server: implement LiveAPI into the game
Full implementation of all LiveAPI events into the game server.

NOTE: The only event left to be implemented in code is CustomEvent.

NOTE: ObserverSwitched and WeaponSwitched events are implemented in code, but they need a proper CodeCallback to hook them up properly in scripts.

The events.proto file is from build "R5pc_r5-200_J33_CL6243000_2024_02_27_14_53" with some slight modifications:

- PlayerStatChanged.newValue is now a oneof field, which can be either int, float or bool as Season 3 Apex still handles stats in one of those 3 types while retail was only int (which is most likely why they kept it just int only int he proto file).

- PlayerRespawnTeam.respawned is now a repeated Player field instead of a string. Initially the respawned field contained a comma separated list of player names that were respawned in the team, it now contains the actual Player data that is respawned as this was much easier to get from scripts, and also makes a bunch more sense than just string names.

- New CustomEvent event: since R5Reloaded is a modding platform, and we can't make new events for literally all gamemodes that modders create, we added another event "CustomEvent" which allows modders to sent their own data to their own tracker or anything while still remaining compatibility with the protocol.
2024-04-05 18:33:33 +02:00
Kawe Mazidjatari
fed4ce80bf RTech: properly disable asset streaming on dedicated server
Just set the mode to 0, required as we rebuilt the functions and can't really check for dedicated there, we have to initialize it with this mode.
2024-04-05 17:56:51 +02:00
Kawe Mazidjatari
3d207d30a2 DataCache: rework datacache invalid data handling
This is a more reliable solution as pretty much all code patch in CMDLCache checks the ptr for NULL, but none of them do for 0xDEADFEEDDEADFEED (probably a debug only thing that somehow made it into this build). Patched out so the engine could deal with it properly. Anything interesting already gets logged from the SDK so we won't miss out on anything patching this out.
2024-04-05 17:26:16 +02:00
Kawe Mazidjatari
97c534ed60 DataCache: fix inline crash 2024-04-05 17:24:29 +02:00
Kawe Mazidjatari
be8ee3d0b1 SDK cleaner script is now in the bin dir 2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
1687b633f3 Update SDK cleaner script 2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
98a5cdc246 Spawn AI hints so the entire AI Network can be cached 2024-04-05 16:34:27 +02:00
Kawe Mazidjatari
1b5238eab0 Rename VPK build scripts 2024-04-05 16:31:08 +02:00
Kawe Mazidjatari
5d2a331170 CFG cleanup
Remove dev parameters from retail configs, disable net_usesocketsforloopback by default now. This was a leftover from before we got dedicated servers working, and was thus required to get other people to connect to the listen server. This is no longer needed, it was causing a problem with authentication on the local server as the input address from the client would differ from what the master server would bake into the JWT token (localhost translates into an actual ip address on the master server side).
2024-04-05 16:24:47 +02:00
Kawe Mazidjatari
f6d2628937 Cleanup proto structure
Removed unused/extraneous enumerants.
2023-08-04 11:20:24 +02:00
Kawe Mazidjatari
4bef9fc6cf Light script cleanup
- Rename 'checksum' to 'digest'.
- Sort the data in the correct order to reduce load on the client (client sorts it to the same order).
2023-08-03 17:25:11 +02:00
Kawe Mazidjatari
010c0d0c20 Improve manifest script
- Add configuration support for each depot
- Add configurable vendor for each depot
- Add size field for each depot (used for installer's progress callback)
- Compute depot package checksum on the spot
- Take manifest version input as string instead (used as tags)
2023-08-03 16:43:22 +02:00
Kawe Mazidjatari
9a23ab68ec Rename output file 2023-07-31 11:43:42 +02:00
Kawe Mazidjatari
de26e5735f Add depot names to manifest json 2023-07-30 13:35:55 +02:00
Kawe Mazidjatari
631535a4c9 Add json fields for manifest version and asset list
Make it so it could actually be checked and parsed properly.
2023-07-30 01:25:13 +02:00
Kawe Mazidjatari
da3142812b Create script for creating manifest files 2023-07-29 23:34:19 +02:00
Kawe Mazidjatari
e4a05b4a93 Increase oriented bone to world memory
Increase to 2MiB, so all 120 players could be rendered on the client without overflowing the bone memory (which causes an error in 'CModelRenderSystem::DrawModels').
2023-07-17 02:51:01 +02:00
Kawe Mazidjatari
f0bef4a537 Fix formatting 2023-07-17 02:48:14 +02:00
Kawe Mazidjatari
e515c2d93f Don't force game into windowed mode on each launch
Let the video config decide whether or not to launch windowed.
2023-07-15 21:33:47 +02:00
Kawe Mazidjatari
1496e86273 Remove 'rui_defaultDebugFontFace' asignment
Redundant, as its defaulted to 'ArameMono' in the executable now.
2023-07-15 21:31:34 +02:00
Kawe Mazidjatari
89092a9bb8 Update navmesh build automation script
Copy levels navmeshes that have identical geometry.
2023-07-15 21:30:42 +02:00
Kawe Mazidjatari
48a8b5c36c Remove unused parameter
No longer used, removed.
2023-07-15 17:10:04 +02:00
Kawe Mazidjatari
fbe136df64 Rename command 'fs_vpk_build' --> 'fs_vpk_pack' 2023-07-15 17:03:42 +02:00
Kawe Mazidjatari
40bcef2682 Fixup exec paths in 'build_all_vpk.cfg'
Point to new location that changed in commit afb09e1d.
2023-07-14 00:39:08 +02:00
Kawe Mazidjatari
afb09e1d05 Cleanup CFG directory
Move to dedicated subdirectories.
2023-07-13 23:15:10 +02:00
Kawe Mazidjatari
cfa2172322 Undo CUtlBuffer::ParseToken patch
The bug was only reproduced on the compiled implementation in the game executable. The CUtlBuffer::ParseToken implementation in the SDK did not bug on the same input string. More research is required, and a possible good fix would be to just hook and replace the game's implementation with that of the SDK.
2023-06-23 00:27:24 +02:00
Kawe Mazidjatari
a93824b2db Discard invalid string commands
Must be UTF-8 encoded, currently there are no checks.
2023-06-22 23:45:19 +02:00
Kawe Mazidjatari
4290b08fd0 Fix desync in CUtlbuffer::ParseToken in assembled code
See commit 4969a840300bbafbc5a47f06fef41751a5620fc9, the same fix has been applied to the game executable.
2023-06-07 22:15:28 +02:00
Kawe Mazidjatari
70f89c1bd8 Fix incorrect ConVar string assignment in executable
This ConVar's name was set to its helpstring. This patch solves it by assigning the name field to an existing string that makes sense, and moving the helpstring into the actual helpstring field. An additional instruction has been inserted to load the NULL string address into RAX, which required light instruction shifting. After performing this patch, the ConVar now could be ser in the console.
2023-06-05 10:27:23 +02:00
Kawe Mazidjatari
1afa75fec3 Fix >190FPS input system/simulation problems
Function 'CL_Move' has been fully rebuild in the SDK. Originally, the game checked if the delta time exceeded an amount defined by an immediate value, and dropped usercmd's if that was the case. This logic has been replaced with a more dynamic solution, and the console variable regulating this ('fps_input_max') is set to 200.0 by default (the same as the fix applied in the Season 9.1 Genesis update). This function also has been slightly optimized by removing duplicate operations that were performed in the original function. A second fix has been applied to 'CInput::JoyStickApplyMovement' that was also found changed in the Season 9.1 Genesis executable. In that function, an extraneous clamp was performed on the frame time causing viewstick problems when usercmd's get dropped in CL_Move.
2023-06-03 21:20:23 +02:00
Kawe Mazidjatari
a061f7dd00 Optimize C2S_CONNECT vuln fix
Save 2 bytes from segment padding by performing zero test at original address followed by the long jump to patch, there were 5 bytes, zero test only requires 2, thus only 3 bytes were nopped with these changes.
2023-05-31 21:25:16 +02:00
Kawe Mazidjatari
c2799ff68c Fix bug in vulnerability patch
Value should be treated as unsigned, else negative values could still be used to read outside the static buffer.
2023-05-30 20:24:52 +02:00
Amos
46fafef60c Fix vulnerability in C2S_CONNECT message parser
Thanks Robotic for reporting the crash!
2023-05-30 10:03:53 +02:00
Kawe Mazidjatari
71b7770968 Add BSP converter batch file
Automate BSP version conversions.
2023-05-29 01:04:39 +02:00
Kawe Mazidjatari
245d13cea8 Create map rename script
Rename all files associated to a BSP with a single command.
2023-05-28 10:31:17 +02:00
Kawe Mazidjatari
1fbc3291c7 Fix EOF read errors and PAKFILE_LUMP not loading correctly when discrete
This commit adds support for loading cubemap lumps from the disk, several patches and hooks had to be implemented to make this work. Since the game was trying to read the pakfile lump from the BSP file (even when absent), it would read EOF (heavily reduces down map loading performance).
2023-05-22 12:32:49 +02:00
Kawe Mazidjatari
0c26cc9b10 Add MOTD to playlists
Temporary MOTD.
2023-05-01 23:45:16 +02:00
Kawe Mazidjatari
848098c71d Update state machine initialization order
* Run autoexec(_dev).cfg before anything else.
* Always initialize RCON (only gets ran if an actual password is set).
* Removed 'Cbuf_Execute()' call from 'CHostState::LoadConfig', let it run in the frame loop instead.
* Removed hardcoded set call for 'net_usesocketsforloopback', will be set in autoexec from now on.
2023-04-30 11:39:20 +02:00
Kawe Mazidjatari
94ae3e58ce Fix exploitable code defect in 'CNetChan::ProcessSubChannelData'
Patch applied to server & client.
2023-04-13 22:38:03 +02:00
Kawe Mazidjatari
4c8952ac96 Improve formatting in patch file document 2023-04-13 20:29:46 +02:00