20 Commits

Author SHA1 Message Date
Kawe Mazidjatari
98d47ce8ed InputSystem: add reversed KeyInfo_t and KeyEvent_t struct
Almost fully mapped out, the unknown fields seem to be unused or padding.
2023-12-24 15:17:08 +01:00
Kawe Mazidjatari
d608c734bd Add/update core headers 2023-12-23 01:22:02 +01:00
Kawe Mazidjatari
5105ea771d NVIDIA: initial implementation of latency markers 2023-12-22 14:42:28 +01:00
Kawe Mazidjatari
9d5c237338 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).
2023-12-22 13:19:06 +01:00
Kawe Mazidjatari
f312c408f0 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.
2023-12-20 22:21:31 +01:00
Kawe Mazidjatari
e541814482 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.
2023-11-26 13:21:20 +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
9c6417ee4e Fix memory leak in token authentication system
Must free claims after creating them!
2023-10-31 19:14:07 +01: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
e99e1c40e0 Drop a warning when someone fails authentication 2023-10-21 11:24:51 +02:00
Kawe Mazidjatari
bbe163f58c Add comments on newly added code 2023-10-20 19:30:07 +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
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
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
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
0eddec2473 Reduce duplicate code
Make a method for setting the host state.
2023-10-12 17:07:35 +02:00
Kawe Mazidjatari
d83270a541 Netchan: comment out unused code 2023-10-08 16:37:35 +02:00
Kawe Mazidjatari
7232c735ac Null console commands past the 512th byte
A mistake has been made, certain area's of the engine actually do allow strings larger than 128 bytes, just one routine that doesn't (console commands). Tokenizer only tokenizes it up to 512 bytes, so null all the other bytes past this. This still fixes the flaw mentioned in the comment at the place where the nulling happens.
2023-09-23 14:04:49 +02:00
Kawe Mazidjatari
794b18c82f Improve NavMesh render performance 2023-09-23 14:01:53 +02:00
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00