305 Commits

Author SHA1 Message Date
Kawe Mazidjatari
7d89a42b56 Mathlib implementation
SourceSDK mathlib port with light modifications.
Renamed Vector to Vector3D (to avoid confusion with std::vector (declared as vector) and Vector2D/Vector4D).
2022-07-06 21:11:32 +02:00
Kawe Mazidjatari
becf8eb6a5 Use size_t for SDK_ARRAYSIZE instead
sizeof() returns a size_t.
2022-07-03 19:18:23 +02:00
Kawe Mazidjatari
e17d72571d Merge branch 'indev' into pylon_new 2022-06-30 20:19:13 +02:00
PixieCore
a2cb0b62c8 Macro for ArraySizes and CFactory Methods are virtual now for later usage. 2022-06-29 18:25:44 +02:00
Kawe Mazidjatari
a20d6a163e Work-in-progress pylon master server implementation
Still in development.
Implemented new fields provided by pylon-ms.
2022-06-28 00:47:01 +02:00
Kawe Mazidjatari
98c43fd6c1 Rename CConLog to ConLog_t 2022-06-26 17:40:02 +02:00
Kawe Mazidjatari
479adc4b85 CCommandLine additions 2022-06-24 12:10:46 +02:00
Kawe Mazidjatari
ef454ac126 Reversed CCommandLine members
Fixed wrong order of 'CCommandLine::ParmValue()' methods. Float overload was first, char const* last.
Added reversed members (confirmed size of 2096 bytes).
2022-06-24 02:42:28 +02:00
Kawe Mazidjatari
426ae0c4cd Bad logic logging improvements
Log bad logic in colors for every game logic error.
Added 'g_flErrorTimeStamp' and a hook to 'SQVM_LogicError'.
2022-06-22 12:12:08 +02:00
Kawe Mazidjatari
98741a9591 Remove redundant 'PrintPercentageEscape' calls 2022-06-21 10:12:15 +02:00
Kawe Mazidjatari
0de09217bc Log process uptime
Log actual process uptime in all (post init) loggers.
The actual process uptime is obtained from the engine (Plat_FloatTime()).
2022-06-20 15:48:33 +02:00
Kawe Mazidjatari
4095424b7c Add clock/time function patterns
Added:
* Sys_GetProcessUpTime
* Plat_FloatTime
* Plat_MSTime
2022-06-20 14:58:53 +02:00
Kawe Mazidjatari
1764f039cf CConsole improvements: Add selectable logger text
CConsole now uses a dedicated class for logging text (modified CTextEditor class (CTextLogger)). The class uses an ImDraw list with a character vector to draw the text.

Text could be selected by double click (word), triple click (line), a selection by dragging the cursor, or everything with 'ctrl + a'.
2022-06-20 10:31:09 +02:00
Kawe Mazidjatari
e711c54bf9 DebugOverlay improvements
Use rebuild 'DestroyOverlay()'
Use 'size_t' type for MemAlloc_Internal alloc size.
2022-06-15 01:35:48 +02:00
Kawe Mazidjatari
162e709190 General cleanup and improvements 2022-06-12 17:41:26 +02:00
Amos
3683a9d108 Optimizations
Remove extraneous 'c_str()' calls
2022-06-09 11:38:31 +02:00
Kawe Mazidjatari
059a394523 Add commonmacros.h and strtools.h/.cpp from SourceSDK
strtools has been redacted to just what we need
2022-05-28 16:12:37 +02:00
Kawe Mazidjatari
e6ef3d71f1 Rename variable 'g_pIConsole' to 'g_pConsole' 2022-05-27 02:46:13 +02:00
Kawe Mazidjatari
4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00
Kawe Mazidjatari
4eaba9f5a2 Gui launcher work
Improved theme
Implemented dedicated server and client logic (gui side only)
2022-05-25 12:07:08 +02:00
Amos
d46db531a0 Use of v->GetContext() 2022-05-21 11:15:36 +02:00
Kawe Mazidjatari
52883808e1 Reversed CServer structure (almost complete). See desc
* Mostly rebuild CServer structure.
* Partially rebuild CNetworkStringTable structure.
* Partially rebuild CNetworkStringTableContainer structure.
* Removed redundant patterns which are now covered in the data structure.
2022-05-20 20:14:39 +02:00
Kawe Mazidjatari
604e25e046 Fix mistake 2022-05-20 02:46:18 +02:00
Kawe Mazidjatari
fc64dfc9be Default back to GAMEDLL_S3 2022-05-20 02:45:13 +02:00
Kawe Mazidjatari
60edcff6c2 Add JT_ParallelCall function to SDK 2022-05-20 02:35:36 +02:00
Kawe Mazidjatari
cb5f7cd1b0 Fix pattern for 'SV_ShutdownGameDLL()'
Now backwards compatible with older builds (function prototype changed).
2022-05-20 01:59:24 +02:00
Kawe Mazidjatari
0fa525c717 Fix CHostState structure alignment for builds below S3
Static level name array size has been increased from 32 bytes to 64 bytes in S3
2022-05-20 01:40:44 +02:00
Kawe Mazidjatari
32487b4230 Fix SDK for S2 bin 2022-05-18 01:00:46 +02:00
Kawe Mazidjatari
ddfdb4ffd8 See description
Add '-nodiscord' and '-nobakedparticles' to launch params for dedicated.
Add hook for 'MemAlloc_Internal()'.
Rename loggers to be more consistent with naming.
Revert omitting frame pointers.
2022-05-17 23:00:30 +02:00
Kawe Mazidjatari
596682c483 More robust RPak loading/unloading system
This is currently the most robust way to perform this.
However it might fail still as the locks don't seem valid for the second loads (we currently load more paks from the same queue..).

We need to push the strings to the queue list and let the engine load these too so a new lock is acquired for that job.
2022-05-15 12:20:21 +02:00
Kawe Mazidjatari
3144227ec8 Update GetAdr implementations to feature spdlog
Fixed all alignments and reduced code verbosity
2022-05-13 14:53:25 +02:00
Kawe Mazidjatari
72289f9f33 CMDLCache::GetStudioHardware improvements
Slightly mapped out the structure more.
The function should now be compatible with earlier game dll's.
CStudioHWDataRef::SetFlags has to be rebuild as these are declared inline for earlier game dll's.
2022-05-06 00:51:49 +02:00
Kawe Mazidjatari
ec7956622b Make CMDLCache::FindMDL and CMDLCache::FindCachedMDL backwards compatible
Mapped out some of the structs
2022-05-05 17:53:05 +02:00
Kawe Mazidjatari
325fee107b Some mdlcache error handling improvements 2022-05-04 12:44:01 +02:00
Kawe Mazidjatari
c3f31d694a Improved mod RPak loading between changelevel
Note: this does not work reliably still.

The only way we could make this work 100% reliable would be to fully rebuild '0x140341D40' in the SDK and load our pak files among with the pre-existing g_pakLoadApi->AsyncLoad() call in this function, as this will ensure everything will be ran synchronously.

The current approach by taking some JT fifolock wrapper will only work reliably between one level change, unsure why the second and up fail.
2022-05-04 02:25:27 +02:00
Kawe Mazidjatari
a496254b93 Add mutex for CMDLCache methods
Als fall back to old GatherProps when at least one model is replaced with mdl/error.rmdl as the new GatherProps function does not support this yet.
2022-04-30 03:30:16 +02:00
PixieCore
8fc2e03772 Remove old interface.h 2022-04-26 15:57:44 +02:00
Kawe Mazidjatari
b421a17d2b Dedicated server optimizations
Removed all ui.rpak/ui.dll assets loading on the dedicated server.
Moved AsyncLoad to CPakFile class.
Moved g_pMallocPool to tslist.h.
2022-04-19 03:55:20 +02:00
Kawe Mazidjatari
3d32346b39 Fix patterns for S1 and removed redundant code 2022-04-19 00:00:45 +02:00
Kawe Mazidjatari
987fc6f78e Update casts 2022-04-18 20:15:23 +02:00
Kawe Mazidjatari
1e7b746356 More detailed system stats
Fixed physical core count always returning logical core count (this engine does not run on the AMD Phenom processor).
2022-04-18 16:45:26 +02:00
Kawe Mazidjatari
e32cc6ae6a Code overhaul
Moved every pattern to IDetour interface. This allows for debugging patterns scans more easily, and create threads during pattern searching (Operation is now fired in APIENTRY).

Also cleaned up some unused code/extraneous comments.
Slightly increased performance by purging duplicate patterns.
Made variable search less dependent from other results (except if pattern-to-scan results is within the same header)
2022-04-18 03:35:08 +02:00
Kawe Mazidjatari
7d869ca189 Extra dedicated server optimizations 2022-04-17 02:00:06 +02:00
Kawe Mazidjatari
f2a5c8ac68 See description
* Renamed 'r5apexsdkd64.dll' to 'gamesdk.dll'.
* Added required dedicated parameters to code instead.
* Bug fixes around CCommandLine class (fixed misaligned VTable indexes).
* SDK now supports being directly launched by the game executable.

The SDK launcher will pass '-launcher' to the game, which indicated its being launched by the launcher. If the game does not receive '-launcher', it assumes its being launched directly from the game executable, which will instead load 'startup_(dedi_)default.cfg'.

The sdk dll's are now added to the game's IAT by their dummy exports allowing for them to be loaded when the exe is loaded (the dll's do everything on init).
2022-04-16 00:30:46 +02:00
Kawe Mazidjatari
196db8660e Dedicated and SDK improvements
* Improve ConVar class (fixed several bugs).
* Hook CEngineAPI::ModInit() and set m_bRestrictServerCommands from there.
* Disable unused ConVar's and purge unused ConCommands in CEngineAPI::ModInit() for dedicated.
* Small relocation of malloc related signatures.
2022-04-15 04:02:33 +02:00
Kawe Mazidjatari
092b7e9d43 Start of migration to IDetour interface
Migrating to this to initialize all patterns and prototypes in Systems_Init() instead.
This should make debugging missing/not found patterns easier and allow for opting out variable/constant search (some of these require other patterns to be found, thus resulting in seg faults..).

Also added check to detect if user has a eligible CPU to run this SDK.
The game requires SSE and SSE2 instruction sets. Our SDK requires this too due to the use of SSE intrinsics, so we cannot let the game handle this. We have to check it ourselves.
2022-04-11 01:44:30 +02:00
Kawe Mazidjatari
8c1dfb50f4 Address class cleanup/improvements
* Move most definitions to implementation file to avoid recompiling whole program for small changes
* Pass strings by reference for where possible.
* Split Module class to dedicated file.
* Add const qualifiers to all eligible methods for address/module class
* Some renaming
2022-04-10 19:59:34 +02:00
Kawe Mazidjatari
2dcbf59041 Move ConVar/ConCommand stuff to tier1 instead and cleanup KeyValues/KeyValuesSystem 2022-04-09 16:16:40 +02:00
Kawe Mazidjatari
b3631facbe Update all function casts 2022-04-09 06:05:47 +02:00
Kawe Mazidjatari
e2f06a8a68 Massive performance improvements
Inline every signature defined in the SDK (previously each translation unit had its own copy of the signature and function prototype). DLL init is near instant now (85% speed improvements).
2022-04-09 02:18:57 +02:00