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
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.
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.
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.
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).
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.
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.
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.
Combine ClearAutoComplete with ResetAutoComplete, full reset needs to be performed when calling this. Combining avoids confusion and potential bugs later on.
* Fixed redundant call (every frame) to 'ResetAutoComplete()' if the list was empty while having text in the buffer.
* 'ResetAutoComplete()' also resets 'm_bCanAutoComplete' now.
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.
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.
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.