229 Commits

Author SHA1 Message Date
Kawe Mazidjatari
16156ffd3a Add missing help strings 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
d57d3f0838 Add promo version cvars
Used for showing promo's like events such as tournaments.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
6bc15b50b5 Put lag compensation clamping in a separate method, under a cvar that is disabled for now
There have been reports of hit registration issues, this is most likely caused by the clamping system to mitigate an exploit. Put behind a convar and disabled for now until debugged.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
c6f2c99619 Improve client-side online authentication error handling and UX
Display the error to the user without having to open the developer console or terminal window. This patch also adds printing to COM_ExplainDisconnection (which has been stripped out of the retail binary).
2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
1dea3575ef Must be compiled for client dll too 2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
209045e10c Patch is no longer needed
This file has been moved over to the VPK, therefore, formatting will always be identical.
2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
dbb85e97f0 The dedicated server needs this as well 2024-04-05 16:28:59 +02:00
Kawe Mazidjatari
22c82d6f1d EULA dialog implementation
Display the EULA (fetched from masterserver), which the end user MUST accept before they can make use of the multiplayer features of R5Reloaded. NOTE: user doesn't need to agree to this to use the listenserver.
2024-04-05 16:26:18 +02:00
Kawe Mazidjatari
cd2d47b959 Add configurable server cvars for auth system
The command execute is now guarded off on the client with the cvar 'sv_allowClientSideCfgExec' instead of 'sv_cheats'.
2024-04-05 16:24:46 +02:00
Kawe Mazidjatari
02acb45037 Reset to default master server endpoint 2024-04-05 16:24:46 +02:00
Kawe Mazidjatari
909977452e Client token authentication implementation
The game internally obtains a auth token from Origin. On connect to a gameserver, it will send it to the masterserver. The master server will create a JWT token and send this back to the client. The client stores this token in 3 userinfo cvars (token, sig1, sig2). the sig1 and sig2 cvars are there to compensate for the truncation caused by sending the cvar, as each cvar string length could be up to 255 (byte max). The server verifies this token (the signature, timestamp, expiry); if they are valid, the has successfully authenticated and will connect.
2024-04-05 16:24:45 +02:00
Kawe Mazidjatari
3b81e9e589 Pak load code refactor and improvements
Make pak code more consistent.
* Added 'Pak_CloseFile' to SDK.
* Added partial rebuild of 'Pak_ProcessPakFile' to SDK.
* Added compile time assert for 'PakFileHeader_t' structure.
2024-04-05 15:57:33 +02:00
Kawe Mazidjatari
d6fd782601 Add new RPak types and rename existing
Rename to enforce consistency.
2024-04-05 15:57:33 +02:00
Kawe Mazidjatari
00e79268d7 Fix infinite memalloc exploit in NET_SetConVar
Reported by Wanderer. Don't allow the creation of new ConVar entries in CClient::m_ConVars after the initial creation.
2023-09-16 16:18:18 +02:00
Kawe Mazidjatari
140270f426 Fix infinite recursion
Bug introduced in recent commit 1d41b23a.
2023-09-16 13:08:56 +02:00
Kawe Mazidjatari
1d41b23abb Make sure language is never NULL
* Initialize CPylon::m_Language to "english".
* Make sure cvar change callback is always setting values instead of returning out early.
2023-09-16 00:45:11 +02:00
Amos
0634261c18 Move global language constants to single file
Deduplicate.
2023-09-15 18:25:31 +02:00
Amos
95cd34eb23 Replace hardcoded sleep threshold constant
Replaced with a cvar.
2023-09-14 09:17:03 +02:00
Kawe Mazidjatari
1874443425 Disable NVIDIA Reflex Boost by default
Default the implementation to On, as per the documentation.
2023-09-14 00:02:37 +02:00
Kawe Mazidjatari
cdf03d8df7 Add UI settings cvar for NVIDIA Reflex
Required for settings scripts to work.
2023-09-14 00:01:33 +02:00
Kawe Mazidjatari
907e582f55 Remove latency markers
Some parts of the engine have to be rebuild in order to implement this correctly, therefore, it has been removed for now to avoid potential performance problems.

fps_max_rt and fps_max_gfx have been limited to 295 to avoid a contest with the engine's hard limit causing huge performance hits.
2023-09-13 17:37:09 +02:00
Kawe Mazidjatari
51a3f4a1c4 Only call 'NvAPI_D3D_SetSleepMode(...)' on pending changes
No need to keep calling this if there are no pending changes.
2023-09-12 17:44:24 +02:00
Kawe Mazidjatari
ea6c15df4c Initial implementation of NVIDIA Reflex Low Latency timing
Propagated latency markers in an attempt to further reduce input latency. Code is pending rigorous testing on several systems, including systems powered by an AMD GPU to make sure we are not impacting performance on systems that does NOT support NVIDIA Reflex.
2023-09-12 11:06:16 +02:00
Kawe Mazidjatari
9df90d4a25 Add cvar for low latency timing (work in progress)
Work in progress NVIDIA Low Latency timing implementation.
2023-09-12 00:19:47 +02:00
Kawe Mazidjatari
1baaf25929 Fix typo in help strings for newly added cvars
Small typo.
2023-09-11 22:23:07 +02:00
Kawe Mazidjatari
07dade5d5d Implement high precision frame limiter
Limits frames at a much higher level of precision than 'fps_max' and 'fps_max_gfx', probably ideal to reduce input latency even more. Also changed the logic of the NVIDIA Reflex frame limiter, to which it would use the desktop's refresh rate if set to '-1'. The new render thread frame limiter has a similar behavior. Using desktop refresh rates on the render thread or NVIDIA Reflex frame limiter requires 'fps_max' to be set to 0 (unlimited), as it would otherwise result in a major performance drop due to a contest if fps_max_(gfx/rt) is set to a similar number as fps_max.
2023-09-11 22:20:24 +02:00
Kawe Mazidjatari
bf01287129 Add cvar for NVAPI frame limiter
Might be useful for someone.
2023-09-10 01:44:04 +02:00
Kawe Mazidjatari
21093ca1a1 Implement NVIDIA Reflex Low Latency technology 2023-09-09 15:12:58 +02:00
Kawe Mazidjatari
9cfc2b4b6a Use actual pakLoadApi pointer
Actual pakLoadApi pointer used internally.
2023-09-08 23:52:00 +02:00
Kawe Mazidjatari
bc59f1349d Use CUtlVector for map list 2023-09-05 17:34:22 +02:00
Kawe Mazidjatari
7e247d9943 Create separate cvar to enable Base_CmdKeyValues netmsg's
The server can exploit the client with these netmessages, therefore, sv_cheats shouldn't be used to toggle it. Create a cvar that the server and client have to enable individually to enable the system.
2023-09-04 09:48:47 +02:00
Kawe Mazidjatari
cb1a69e82a Ban system refactor
Use CUtlVector, and remove every copy caused by passing vectors by value. CUtlVector does not support copying. Also removed all extraneous std::string copies caused by calling itoa instead of std::to_string, or std::stoll, etc. All features have been tested and work as designed.
2023-08-31 00:16:25 +02:00
Kawe Mazidjatari
71b0781715 Utilize 'DevMsg()' for uncertain builds only
Only uncertain builds will contain DevMsg()/DevWarning() prints. For retail, Msg() and Warning() should be used instead.
2023-08-21 19:12:29 +02:00
Kawe Mazidjatari
905ae5a202 Add netmsg type defines
These 2 are used in CNetChan::ProcessMessages.
2023-08-21 16:28:37 +02:00
rexx
abf6c33c45 Update global.cpp 2023-08-17 20:26:10 +01:00
rexx
1c179434d3 fix dedi compile
sets pylon language in a cvar change callback instead of accessing directly, as networksystem does not have a DEDICATED define
2023-08-17 20:22:28 +01:00
rexx
356f0ce7c0 send language to MS 2023-08-17 20:02:42 +01:00
Amos
e66680881b Add 'sv_clockcorrection_msecs' cvar to SDK 2023-08-17 01:56:42 +02:00
Amos
ebe7a997ac Fixup comments 2023-08-15 20:20:29 +02:00
Amos
3ff85c174a Finish unlag exploit fix
- Make sure cmdTime is never lower than last.
- Make sure delta doesn't exceed maxUnlag.
- Make sure latency gets clamped to maxUnlag (clamp appears to be missing in the engine).
- Only check for cmdTime if we are not discarding the cmd; previously, already processed queued cmd's got checked before being discarded.
2023-08-15 00:45:58 +02:00
Amos
631e6d9e17 Work in progress unlag exploit fix
Temporary lag compensation exploit fix by clamping the difference. Exploiter could carefully control the detonation time of a grenade, or alter the ability cool downs by altering the 'CUserCmd::command_time' field before sending it up.
2023-08-14 20:47:02 +02:00
Kawe Mazidjatari
5f64cd83d8 Fix FileSystem size integer truncation
The implementation in the engine always took/returned signed 64bit size types, but I made a mistake when reversing the virtual function table. All types have been changed to what they should be (mostly signed 64bit, very few unsigned), and usage in-SDK has been adjusted accordingly.
2023-08-09 14:43:54 +02:00
Kawe Mazidjatari
d0544a3bc7 Remove development only flags for some cvars
Removed for:
* base_tickinterval_sp
* base_tickinterval_mp
* sv_updaterate_sp
* sv_updaterate_mp
* cl_updaterate_mp

Cvar 'cl_cmdrate' is deprecated in the engine and SDK since the CL_Move rebuild, and therefore has been removed entirely.
2023-08-08 13:05:33 +02:00
Kawe Mazidjatari
a840fd1493 Remove devonly flag from 'discord_updatePresence'
Allow user to enable it, seems to work perfectly fine.
2023-08-07 17:54:57 +02:00
Kawe Mazidjatari
2d6a1c79ac Comment 'sv_rcon_banpenalty' out for now
Nice to implement at some point, but its not a priority. The current system just disables itself if its under attack (requires action from server owner to re-enable).
2023-08-05 01:14:03 +02:00
Kawe Mazidjatari
759d8d6d2e Flip 'sv_rcon_sendlogs' if netcon is not input only 2023-08-05 01:11:32 +02:00
Kawe Mazidjatari
5e4ea7d25a Minor convar string stuff 2023-08-05 01:09:53 +02:00
Kawe Mazidjatari
f2783ae93f Make use of 'CConnectedNetConsoleData::m_bInputOnly' properly
This member was in the class when RCON was added to the r5sdk, but it was never utilized. Now, each netconsole can toggle whether they are input only or not, the server only sends logs to netconsoles that are not input only. This patch also contains a fix in which the listen server sends logs to the client of its own process, causing an infinite recursive call to DevMsg.
2023-08-04 17:28:01 +02:00
Kawe Mazidjatari
ce4b7b84a8 Promote RCON command execution authority
Allow RCON to execute any commands and set any cvar, regardless of their flags.
2023-08-04 11:53:46 +02:00
rexx
b8744a9ab8 create sv_language cvar
currently unused, will be implemented in #103
2023-08-01 22:45:58 +01:00