3262 Commits

Author SHA1 Message Date
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
Kawe Mazidjatari
869aff3ce2 Fixup hardcoded thirdparty directories in CMake files
Should be obtained from the 'THIRDPARTY_SOURCE_DIR' variable.
2023-10-07 16:26:56 +02:00
Kawe Mazidjatari
858cbaa9a2 Make JWT code C++ compatible
Must be C++ as we will be replacing jasmin json with rapidjson.
2023-10-07 16:25:58 +02:00
Kawe Mazidjatari
591b202808 Rename to .cpp (unfinished)
JWT code will feature c++ code (jasmin json library will be replaced with rapidjson).
2023-10-07 16:23:31 +02:00
Kawe Mazidjatari
946422a91b Add MbedTLS library to SDK
Will be used for the JWS library, should eventually be replaced with SChannel.
2023-10-07 16:21:54 +02:00
Kawe Mazidjatari
3c868190d9 WIP: add JWT library
Currently does not compile, pending integration into SDK.
2023-10-07 11:19:05 +02:00
Kawe Mazidjatari
7348b859d2 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.
2023-10-06 21:43:41 +02:00
Kawe Mazidjatari
d2495be72a Make ICpuTopology methods virtual
Virtual in the engine we are working on; this should be virtual too.
2023-10-06 21:29:46 +02:00
Kawe Mazidjatari
7157a95350 Add table for affinity mask
Small usage table.
2023-10-06 21:28:57 +02:00
Kawe Mazidjatari
7806cceb33 Swap SSE4.1 instruction with an SSE2 instruction
The min spec is SSSE3, using SSE4.1 instructions (_mm_extract_epi64) will break compatibility. The code containing the defect is debug only, and %90+ of the user base uses an SSE4.1 capable processor.
2023-09-23 16:34:37 +02:00
Kawe Mazidjatari
4bc4b6f092 Fix typo
Second statement should be checking on vecMaxBound.
2023-09-23 14:55:23 +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
095d22c8ec Should be a word pointer 2023-09-19 22:15:55 +02:00
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00
Kawe Mazidjatari
37ab1cfad5 Add new RPak types and rename existing
Rename to enforce consistency.
2023-09-19 20:43:01 +02:00
Kawe Mazidjatari
156e31404e Light protobuf cmakelist cleanup
Add missing files and remove unused version file (version file was also incorrect, it mentions version 3.19 but we have 3.21.12).
v2.3_rc4 v2.3_rc0 v2.4_rc4 v2.4_rc3 v2.4_rc2 v2.4_rc1 v2.4_rc0 v2.3_rc9 v2.3_rc8 v2.3_rc7 v2.2_rc11 v2.3_rc6 v2.3_rc2 v2.3_rc3 v2.2_rc12 v2.3_rc1 v2.4_rc5 v2.3_rc5
2023-09-17 22:06:15 +02:00
Kawe Mazidjatari
7b5f40fb9d Upgrade spdlog library to 1.12.0 2023-09-17 20:37:44 +02:00
Kawe Mazidjatari
feffcdfa94 Light pluginsystem cleanup
Light cleanup and improvements. Always load plugin dll's from "GAME" first before searching through mods to prevent mods from overriding them.
2023-09-17 20:33:57 +02:00
Kawe Mazidjatari
5af364f325 Remove extraneous check
Should not fire this code if that cvar is set.
2023-09-17 17:19:32 +02:00
Kawe Mazidjatari
71d0332dca Add CCommonHostState to SDK
The previous 'interval_per_tick' global belongs to the 'g_pCommonHostState' singleton.
2023-09-17 16:44:18 +02:00
Kawe Mazidjatari
b723cb35cc Combine methods
Combine ClearAutoComplete with ResetAutoComplete, full reset needs to be performed when calling this. Combining avoids confusion and potential bugs later on.
2023-09-17 16:15:42 +02:00
Kawe Mazidjatari
970c04fa56 Improve suggest reset logic
* Fixed redundant call (every frame) to 'ResetAutoComplete()' if the list was empty while having text in the buffer.
* 'ResetAutoComplete()' also resets 'm_bCanAutoComplete' now.
2023-09-17 12:47:36 +02:00
Kawe Mazidjatari
0cc148e65c Improve position reset logic
Force scroll to 0 on xy when it should reset, setting rects to 0 isn't sufficient as it goes into minus. Made the code mode simple as well.
2023-09-17 12:06:38 +02:00
Kawe Mazidjatari
375ff7fb16 Clarify code
Use enums for default positions.
2023-09-17 11:38:00 +02:00
Kawe Mazidjatari
fc845d355f CConsole: Fix reset hack and optimize
Don't update the view once we already found the 'active' object, or if we are at the park position (-1). This fixes the hack of having to have CConsole::m_bSuggestMoved to be true all the time.
2023-09-17 01:37:01 +02:00
Kawe Mazidjatari
9aefd6a046 CConsole: reset the view to the top if the list was updated
If you had a list of suggestions, and had an active element halfway through the list, and then update the suggestion list again by changing what's in the input buffer, the view would remain at the old position (displaying whatever is there). This makes sure the view gets reset all the way to the top if the list was updated.
2023-09-17 01:25:44 +02:00
Kawe Mazidjatari
53d981a06d Fix incorrect address print
Printed the wrong pointer.
2023-09-16 22:34:21 +02:00
Kawe Mazidjatari
1323703251 Move process time rate limit back to caller hook
Move it back to caller hook instead of in the ProcessMessages function as there were crash reports when running the listen server. Moving this back solved the intermittent crash problem entirely while still rate limiting process time.
2023-09-16 22:03:39 +02:00
Kawe Mazidjatari
228b9222b3 Fix compiler error
Define this out for client dll.
2023-09-16 22:02:04 +02:00
Kawe Mazidjatari
57feab706c Add NVIDIA NvAPI legal notice
Should be in the thirdpartylegalnotices.txt we ship with builds.
2023-09-16 17:45:38 +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
ee3560e722 Reimplement 'KeyValues::FindKey(...)'
Reimplement.
2023-09-16 16:13:14 +02:00
Kawe Mazidjatari
66daec04db Fix compile errors in non cert builds 2023-09-16 13:10:12 +02:00