3452 Commits

Author SHA1 Message Date
Kawe Mazidjatari
b15b4dd524 Thirdparty: add LZ4 to project
Will be used for data block sender/receiver rebuild
2024-02-19 21:22:23 +01:00
Kawe Mazidjatari
535ffe5562 Tier1: use signed size types for buffer size field 2024-02-10 01:35:24 +01:00
Kawe Mazidjatari
a5a87f0847 Tier1: use correct format specifier CCountedStringPoolBase 2024-02-10 01:34:55 +01:00
Kawe Mazidjatari
a1fd351ccc Tier1: make utlbuffer flags clear
Use 'FLAGS_NONE' as default.
2024-02-10 01:34:37 +01:00
Kawe Mazidjatari
190da115a5 Tier1: use correct index types for template classes
This ensures that we can never allocate more memory than the maximum value that type could hold, without triggering a compile warning. There was a mention about shorts being slow on PowerPC platforms for utllinkedlist, but the index local type could be overridden (defaults to index storage type). In case it gets used for PowerPC, use 32bit ints as index local types; as the local type gets used for arithmetic operations while storage type is what's getting cached off in memory. This patch had no effect on generated output code, it was mostly implemented to avoid future problems.
2024-02-10 01:34:03 +01:00
Kawe Mazidjatari
35f684f9ac Tier1: use the Max defined in platform headers
This one is the preferred Max as per Valve Source.
2024-02-10 01:21:29 +01:00
Kawe Mazidjatari
24f41ef6c7 Tier1: use SSIZE_MAX for default str slice buf end
Will be INT_MAX on 32bit platform and INT64_MAX on 64bit.
2024-02-10 01:20:35 +01:00
Kawe Mazidjatari
8b338ce682 Add signed size type defines 2024-02-10 01:18:55 +01:00
Kawe Mazidjatari
9b800a19f7 Tier1: optimize V_UnqualifiedFileName()
If we are going to do a strlen, then check the chars from the start
2024-02-07 14:30:37 +01:00
Kawe Mazidjatari
92dd860079 Engine: fix bug causing level assets to not load properly
The level has changed when strcmp returns a non-null value.
2024-02-06 15:37:50 +01:00
Kawe Mazidjatari
340dcfd4bd Engine: remove unused variable
No longer used as of commit b29be00d.
2024-02-06 14:51:47 +01:00
Kawe Mazidjatari
1a9e393d1b Tier1: properly implement UtlString methods
Determine proper stack buf size for ssize_t += operator. If its 64bits then the buf should be doubled to accommodate for the maximum number of digits in a 64bit decimal number. Also properly determine stack buf size of double += operator. For FormatV, instead of a fixed stack buffer, perform a dry run to determine required buflen, reserve num char bytes of memory and write into it again on the next call.
2024-02-06 14:48:11 +01:00
Kawe Mazidjatari
b29be00d82 Engine: revert server tick msg rebuild to old behavior
Only update statistics, this code was mainly added for testing, but testing revealed no additional performance or smoothness improvements, even during >6 hour sessions. The clock drift already gets corrected each frame from Host_RunFrame(). Only update statistics to update CPU and frame times on the client's debug panels if enabled.
2024-02-06 14:42:36 +01:00
Kawe Mazidjatari
7599aa4002 Recast: remove use of auto
Useless use of auto
2024-02-06 14:37:14 +01:00
Kawe Mazidjatari
cc8c5ee6b0 utility: fix STL string formatter bug
Must reserve a buf size of len+1 before resizing it, else we are 1 byte too short when copying the entire string. Also just clear when 0.
2024-02-06 14:36:01 +01:00
Kawe Mazidjatari
c42b128672 Engine: hoststate loop cleanup
Logic hasn't been changed, conditions have been brought into the loop itself
2024-02-06 14:33:40 +01:00
Kawe Mazidjatari
7eff7f4ce2 Engine: add missing include
Needed for NucleusID_t.
2024-02-04 18:26:04 +01:00
Kawe Mazidjatari
c12c8fb7fe NVIDIA: disable gfx_nvnUseMarkersToOptimize by default
Causes rubber banding on some systems.
2024-02-04 14:42:39 +01:00
Kawe Mazidjatari
63d7a20531 Thirdparty: upgrade SpdLog to 1.13.0 2024-02-04 13:43:17 +01:00
Kawe Mazidjatari
ed5721eaa0 BanSystem: refactor & fix bugs
* Make sure we read the banlist from platform as well, just like how we write to it.
* Use strtoull() instead of atoll() for nucleus id values, nucleus id is unsigned so we must convert to unsigned.
* Remove extraneous try catches, these were previously used for integral type conversions that threw exceptions, but the current ones do not throw so the try catch is unnecessary.
2024-02-04 12:55:56 +01:00
Kawe Mazidjatari
0dd19ab2dd Tier1: add V_IsAllDigit()
This function checks if a string consists of only numeric characters.
2024-02-04 12:52:46 +01:00
Kawe Mazidjatari
8da31dd15c Engine: use NucleusID_t type for CClient 2024-02-04 12:50:36 +01:00
Kawe Mazidjatari
c72cf89465 RapidJSON: use iterative parsing instead
Use iterative parsing to protect against stack overflows in rare cases
2024-02-04 12:50:02 +01:00
Kawe Mazidjatari
5e10fde155 Thirdparty: upgrade to latest RapidJSON 2024-02-04 11:18:55 +01:00
Kawe Mazidjatari
bed3bc87a0 RTech: mark const 2024-02-04 00:55:48 +01:00
Kawe Mazidjatari
cd39a68b48 Core: use forward slash when formatting logger files
Minor cleanup
2024-02-04 00:55:33 +01:00
Kawe Mazidjatari
e728877035 Tier0: crash handler refactor & bug fix
Fix syntax error on page protection flags check when determining whether we encountered a return address. Also limit the amount of dynamic memory allocation calls, offer a large enough static buffer where we can just write into when we crash without needing to alloc or realloc anything. Also removed some hacky code like the whitelist set, and made the module handle array static into the class as well. The CrashHandler singleton is now a static class instance.
2024-02-04 00:55:07 +01:00
Kawe Mazidjatari
063d8d7cad Tier1: fix type demotion warning
Promote type to signed size type.
2024-02-03 23:53:22 +01:00
Kawe Mazidjatari
b89f72ac36 Tier0: iostream light cleanup
- Take const char* directly instead of making extraneous copies
- Add overload for reading strings into fixed size buffers
2024-02-03 23:34:14 +01:00
Kawe Mazidjatari
2ed42296db RTech: properly disable asset streaming on dedicated server
Just set the mode to 0, required as we rebuilt the functions and can't really check for dedicated there, we have to initialize it with this mode.
2024-01-30 14:30:20 +01:00
Kawe Mazidjatari
21addb83ea Tier0: bump sigcache minor version
Force rebuild of local cache since many signatures have changed.
2024-01-30 13:50:07 +01:00
Kawe Mazidjatari
dd4c9c2637 ReVPK:
Fix usage text, there were some errors in it.
2024-01-30 13:49:30 +01:00
Kawe Mazidjatari
d767824932 VpkLib: actually search for corresponding data block file
Instead of just using English as default, actually scan for all supported directory tree files, error if not found. This completes the sanitization logic which allows the user to only pass in the data block file to load the directory tree file
2024-01-30 13:49:09 +01:00
Kawe Mazidjatari
f3dc26d2cb RTech: make PakPatchDataHeader_t fields unsigned and add static assert for struct size 2024-01-30 13:47:25 +01:00
Kawe Mazidjatari
e154762746 RTech: rename AsyncHandleTracker_t fields
Better names
2024-01-30 13:46:52 +01:00
Kawe Mazidjatari
07af98abd9 RTech: use Max() from our own headers 2024-01-30 13:46:31 +01:00
Kawe Mazidjatari
207bd5588c ZStd: explicitly set debug level
Explicitly set to 0 for release
2024-01-30 13:46:05 +01:00
Kawe Mazidjatari
0938eb2415 Fix unresolved external symbols
These projects used 'V_FixSlashes' but weren't licked to Tier1.
2024-01-30 13:45:37 +01:00
Kawe Mazidjatari
2a9ad5b382 RTech: cleanup & const correctness 2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
82860e164b RTech: fix bug when string is NULL
Fixes a crash because string can be NULL when this is called
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
89ff792dd3 IOStream: improve seeking logic
Instead of seeking to the very start again when GetSize() is called, seek back to the original position. Also added dedicated methods for seeking put or get instead of using the mode since this is a fstream
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
0452720cf8 RTech: fix numeric overflow caused by massive pak files
Pak files above 4GB caused the async file system to throw an error about failing to load audio banks, removed casts and promoted everything correctly. Also removed irrelevant comments in the public pakfile header.
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
52edcc6d84 RTech: fix bug when trying to print fourcc as string
The printf specifier does not allow limiting buffer reads. Made the FourCCToString more performant by using a fixed size stack array and creating the fourcc into that which we now use to properly print out the asset magic.
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
5ddf69c764 RTech: minor cleanup and renaming 2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
ea1befbb61 Tier1: remove parameter description that doesn't exist 2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
e901a32c18 RTech: update comment on pak header flag
Patches can actually use different compression algorithms, but the patch headers must accommodate for pak file sizes properly. One pak could also be compressed while the others aren't if patch headers present correct sizes (both RTech and ZStream)
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
a2d869d572 RTech: add buffered decompress function, cleanup and bug fixes
The pak_decompress callback has been fully moved to a dedicated buffered pak decoder function, also added descriptive error to the buffered pak encode function. Fixed a bug in the streamed pak decoder where the next required streamed buffer size would always be below actually required on any subsequent patch rpaks that are getting loaded. Also fixed assert in Pak_ZStreamDecode, as the inbuf position can equal total streamed size, but shall never exceed it!
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
511c700fde RTech: add several new pak tools
Added tools to reduce noise in pak code in a planned refactor
2024-01-29 23:00:18 +01:00
Kawe Mazidjatari
5c0e7a944f Utility: fix bug in CreateDirHierarchy
Fix bug where even the last path would be processed in the loop, making the return call always return an error as the path would've been created by that time. This ensures that we always return the value returned by mkdir when creating the last path
2024-01-29 23:00:17 +01:00
Kawe Mazidjatari
7a09219002 FileSystem: make CreateDirHierarchy and IsDirectory general function
Moved to general utility
2024-01-29 23:00:17 +01:00