3250 Commits

Author SHA1 Message Date
Kawe Mazidjatari
59e0bfa10b NVIDIA: initial implementation of latency markers 2024-04-05 16:45:05 +02:00
Kawe Mazidjatari
d3d80398e3 Add new reversed packet header flags
These flags only exist in the respawn version of the engine. Renamed 'CNetChan::unknown_challenge_var' to 'CNetChan::m_nRealTimePackets'. This field counts the number of packets sent while the frame time wasn't prescaled with the 'host_timescale' cvar, see r5apex.exe+0x3093C0 (140309FC0).
2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
c8b5f47c80 Add packet header flags 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
51b866f6a1 NVIDIA: check if adapter is from NVIDIA in GFX_SetLatencyMarker()
Moved adapter vendor check to its own func, added a global which could be used to fully disable the low latency system. Also added groundwork for the (future) PCL stats implementation.
2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
82c522a424 Use size types for keyvaluesystem interface 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
f609f16427 Don't compile debug code in cert builds 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
fe650711c2 ConCommand: marked 'script(_...)' FCVAR_DEVELOPMENTONLY 2024-04-05 16:41:11 +02:00
Kawe Mazidjatari
144d5f62e1 IDetour: code refactor
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
3831058f81 New method for IDetour
This will deprecate IDetour::Attach and IDetour::Detatch. This should reduce the chances of potential errors caused by using the wrong function in the wrong method (e.g. using DetourAttach in IDetour::Detatch).
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
c86f0c5c6a Check if we have enough room for new execution markers
Make sure we always have enough room for new execution markers. Engine normally truncates the head of the vector if out of room; we want to avoid it as this will cause the cookies to shift, and thus cause them to misalign with their respective commands.
2024-04-05 16:41:08 +02:00
Kawe Mazidjatari
699a4ce464 Implement CCommandBuffer
Code is based on Valve's implementation, with the following changes:
- Usage of 64bit signed size types.
- Usage of const where possible.
- Removal of field 'CCommandBuffer::m_nLastUsedArgSSize'.
2024-04-05 16:39:22 +02:00
Kawe Mazidjatari
ea8074dff9 Fix bug in utllinkedlist
Should return template type (default 'unsigned short') instead of int as Count.
2024-04-05 16:34:30 +02:00
Kawe Mazidjatari
a8312517f4 CCommand adjustments
Moved inlines to header; made ArgC return 32bit integer instead.
2024-04-05 16:34:30 +02:00
Kawe Mazidjatari
5967a0d011 Add additional warning codes to thirdparty warning suppressor 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
8c22d9ed80 Fix compiler warnings on Visual Studio 2017
Should not be a constexpr, this caused cryptic errors in template code when compiling the code with older compilers.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
e2b231f4e0 Fix declaration/implementation mismatch 2024-04-05 16:34:29 +02:00
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
8400ee769f Fix emblem misalignment 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
37139130be Update emblem for 2.4 release 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
b24e5815bc Fix memory leak in token authentication system
Must free claims after creating them!
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
fa76747baa Show a more detailed error if the EULA request failed 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
901b4e13ba Bump sig cache version
Signatures changed
2024-04-05 16:34:28 +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
2fe902061e Don't check for accepted EULA versions if this is a dedicated server 2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
ec825962b6 These files are now located in the bin dir 2024-04-05 16:34:28 +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
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
5e53a75571 Drop a warning when someone fails authentication 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
dbb85e97f0 The dedicated server needs this as well 2024-04-05 16:28:59 +02:00
Kawe Mazidjatari
b37a3bdeba Add comments on newly added code 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
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
cbf370019d Don't query JWT token if we connect to localhost
Localhost in many cases implies usage of listen server; these don't require auth on loopback connections.
2024-04-05 16:24:47 +02:00
Kawe Mazidjatari
506134fffb Only run ImGui code if we aren't quitting
Should fix a very rare crash where this still gets called while imgui has already been destroyed.
2024-04-05 16:24:47 +02:00
Kawe Mazidjatari
8774baecd7 Bump version to 009 2024-04-05 16:24:46 +02:00
Kawe Mazidjatari
7c06711a0a Update third party legal notices
Added MbedTLS & l8w8jwt.
2024-04-05 16:24:46 +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
967aa0dfd4 Bump sigcache version to 2.8 and rename methods
Bump version and rename CSigCache::LoadCache to CSigCache::ReacCache.
2024-04-05 16:24:46 +02:00
Kawe Mazidjatari
9c4fb57fa7 R5Reloaded 2.3 emblem 2024-04-05 16:24:46 +02:00
Kawe Mazidjatari
0eaa226dce Change JSON field types send to master server
They were all strings; changed them to what made most sense for each field type. Changes:
"hidden": string -> bool
"port": string -> int
"checksum": string -> uint
"playerCount": string -> int
"maxPlayers": string -> int
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
dd85e2b6a1 Bugfix: don't print summaries of hidden cvars 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
f8fe90874a Only compile signature results in dev mode 2024-04-05 16:24:45 +02:00