3245 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e0a60a14e5 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).
2023-11-26 11:42:26 +01:00
Kawe Mazidjatari
fa2a005d34 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.
2023-11-25 17:41:08 +01:00
Kawe Mazidjatari
7648d19fa9 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'.

Code is tested and compiles on all supported compilers.
2023-11-25 12:00:47 +01:00
Kawe Mazidjatari
236dc31292 Fix bug in utllinkedlist
Should return template type (default 'unsigned short') instead of int as Count.
2023-11-25 11:29:58 +01:00
Kawe Mazidjatari
e5d8f46c61 CCommand adjustments
Moved inlines to header; made ArgC return 32bit integer instead.
2023-11-25 11:27:47 +01:00
Kawe Mazidjatari
167ef46dcb Add additional warning codes to thirdparty warning suppressor 2023-11-25 11:24:06 +01:00
Kawe Mazidjatari
26a7e90354 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.
2023-11-25 11:23:19 +01:00
Kawe Mazidjatari
35fe8dad04 Fix declaration/implementation mismatch 2023-11-25 11:21:51 +01:00
Kawe Mazidjatari
e269d9d548 Add missing help strings 2023-11-10 01:29:50 +01:00
Kawe Mazidjatari
4301c3c8d6 Add promo version cvars
Used for showing promo's like events such as tournaments.
2023-11-10 01:27:19 +01:00
Kawe Mazidjatari
8932a9bfec Fix emblem misalignment 2023-11-01 02:08:08 +01:00
Kawe Mazidjatari
46b9561ae9 Update emblem for 2.4 release 2023-11-01 01:49:24 +01:00
Kawe Mazidjatari
9c6417ee4e Fix memory leak in token authentication system
Must free claims after creating them!
2023-10-31 19:14:07 +01:00
Kawe Mazidjatari
278d24930b 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.
2023-10-25 23:31:02 +02:00
Kawe Mazidjatari
193cc9b19b Show a more detailed error if the EULA request failed 2023-10-25 23:29:37 +02:00
Kawe Mazidjatari
284f06a145 Bump sig cache version
Signatures changed
2023-10-22 17:01:12 +02:00
Kawe Mazidjatari
4ef4a0b803 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).
2023-10-22 17:00:56 +02:00
Kawe Mazidjatari
45adfb50f0 Must be compiled for client dll too 2023-10-22 16:57:21 +02:00
Kawe Mazidjatari
dbedacebbf Don't check for accepted EULA versions if this is a dedicated server 2023-10-21 19:16:52 +02:00
Kawe Mazidjatari
fa079bf5e4 These files are now located in the bin dir 2023-10-21 18:58:42 +02:00
Kawe Mazidjatari
5cd7a64c8d SDK cleaner script is now in the bin dir 2023-10-21 11:43:31 +02:00
Kawe Mazidjatari
b4f5c1961d Update SDK cleaner script 2023-10-21 11:37:54 +02:00
Kawe Mazidjatari
dedd83c84d Patch is no longer needed
This file has been moved over to the VPK, therefore, formatting will always be identical.
2023-10-21 11:30:01 +02:00
Kawe Mazidjatari
e99e1c40e0 Drop a warning when someone fails authentication 2023-10-21 11:24:51 +02:00
Kawe Mazidjatari
ab5c5a39e1 Spawn AI hints so the entire AI Network can be cached 2023-10-21 11:23:39 +02:00
Kawe Mazidjatari
a54c8eacd9 Rename VPK build scripts 2023-10-20 20:15:36 +02:00
Kawe Mazidjatari
1a1f00ce2f The dedicated server needs this as well 2023-10-20 19:39:18 +02:00
Kawe Mazidjatari
bbe163f58c Add comments on newly added code 2023-10-20 19:30:07 +02:00
Kawe Mazidjatari
234dc312fe 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.
2023-10-20 19:16:33 +02:00
Kawe Mazidjatari
0d442285ca 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).
2023-10-20 19:14:40 +02:00
Kawe Mazidjatari
9b3024a874 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.
2023-10-20 19:12:42 +02:00
Kawe Mazidjatari
d80e60428d 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.
2023-10-20 19:11:12 +02:00
Kawe Mazidjatari
e7111bee18 Bump version to 009 2023-10-15 22:00:35 +02:00
Kawe Mazidjatari
d6c175a5e5 Update third party legal notices
Added MbedTLS & l8w8jwt.
2023-10-15 16:51:47 +02:00
Kawe Mazidjatari
f3f042ae63 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'.
2023-10-15 16:30:29 +02:00
Kawe Mazidjatari
9145faafd5 Bump sigcache version to 2.8 and rename methods
Bump version and rename CSigCache::LoadCache to CSigCache::ReacCache.
2023-10-15 16:29:26 +02:00
Kawe Mazidjatari
6709fcb058 R5Reloaded 2.3 emblem 2023-10-15 16:28:30 +02:00
Kawe Mazidjatari
b9a24b30af 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
2023-10-15 10:47:19 +02:00
Kawe Mazidjatari
879e187118 Reset to default master server endpoint 2023-10-15 10:45:36 +02:00
Kawe Mazidjatari
f5eb2a2e08 Bugfix: don't print summaries of hidden cvars 2023-10-15 10:41:17 +02:00
Kawe Mazidjatari
59fab7ac93 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.
2023-10-15 10:40:46 +02:00
Kawe Mazidjatari
6b344ad52f Only compile signature results in dev mode 2023-10-15 10:32:35 +02:00
Kawe Mazidjatari
0eddec2473 Reduce duplicate code
Make a method for setting the host state.
2023-10-12 17:07:35 +02:00
Kawe Mazidjatari
fe5099eb04 Make const
Const correctness.
2023-10-12 17:06:51 +02:00
Kawe Mazidjatari
c1bf0cb4f9 Fix CVE-2023-38546
Merge: curl/curl@61275672b4
2023-10-12 17:05:12 +02:00
Kawe Mazidjatari
1783df407b Make JWT C again
Return to C since we don't need to replace the JasmineJSON library to the RapidJSON one, as the signature gets verified first before any JSON is getting parsed. JasmineJSON also appears to only have problems when compiled in the STRICT and/or LINK mode, which we aren't doing.
2023-10-12 17:03:12 +02:00
Kawe Mazidjatari
d83270a541 Netchan: comment out unused code 2023-10-08 16:37:35 +02:00
Kawe Mazidjatari
c3e11b4283 Pylon: fix use after free
The member must contain a copy of the string, pointing it to the buffer used by the language cvar results in undefined behavior. Several cases were the string pointed to random data were reported.
2023-10-08 16:37:10 +02:00
Kawe Mazidjatari
ab1d28c778 Improve CPU detection code
Structure now fully aligns with that of the engine, with exception of newly added fields for the SDK (new fields are marked in the structure definition).
2023-10-08 16:27:10 +02:00
Kawe Mazidjatari
ffedb41705 Constness 2023-10-08 15:52:16 +02:00