73 Commits

Author SHA1 Message Date
Kawe Mazidjatari
a479b4ac78 See description
Fixed rare crash in CMDLCache when buffer itteration returns invalid pointer (not null!) for handle.

Made all variables and functions used by BuildPropStaticFrustumCullMap searched dynamically (these should also work on s0, s1 and s2, they are compared but at the moment untested).

TODO: Fix deref crash properly (see bsplib.cpp l291).
2022-05-01 05:38:51 +02:00
Kawe Mazidjatari
c0511fa8e4 See description
* Add ConVar to allow user to set/unset FCVAR_DEVELOPMENTONLY ConVar's (default behavior would never be hit without this ConVar).
* Add icons to display the flags of a certain CommandBase.
* Fixed Dear ImGui not displaying images correctly (descriptor needs DXGI_FORMAT_R8G8B8A8_UNORM_SRGB due to the nature of this game).
* Dynamically obtain buffer sizes of resources taken from modules.
* Light SDK cleanup.
2022-04-26 20:24:51 +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
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
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
2dcbf59041 Move ConVar/ConCommand stuff to tier1 instead and cleanup KeyValues/KeyValuesSystem 2022-04-09 16:16:40 +02:00
Kawe Mazidjatari
fd01962aa0 Change default console title 2022-03-26 01:23:06 +01:00
Kawe Mazidjatari
96bf41655a Use CBuf_AddText() and Cbuf_Execute() instead
Small improvement
2022-03-25 13:17:57 +01:00
Amos
8f7a3ef336 Small improvements 2022-03-16 02:03:06 +01:00
Amos
1058a6fa10 Use unicode character set instead and light cleanup/bug fixes 2022-03-04 12:22:17 +01:00
Amos
2719a85504 Debug overlay QOL improvements + Con_NPrintf() hook
* Added ability to invert rect to calculate offsets from bottom/right as well so debug text doesn't get out of view, or obstruct view when window is resized.
* Added Con_NPrintf() hook which shows detailed systems running times and VGUI panel debug information.
2022-02-28 01:01:40 +01:00
IcePixelx
03b5f18435 load imgui config from disk only when creating dx instance. 2022-01-31 18:47:21 +01:00
Amos
e28d9060c9 Update console.cpp 2022-01-17 23:21:54 +01:00
Amos
b9af86b9c1 Implement terminal utilities for Windows console + add new colors for various output variations
* Add new SDK launch logo.
* Remove ansi-color coding from in-game console and file loggers.
* Improve console colors for Windows.
* Implement various string utilities.
* Implement various terminal utilities.
2022-01-16 01:33:07 +01:00
Amos
1c5df4e178 Ansi terminal color support + big optimizations on all log systems + 'Warning()' hook
* Ansi colors can now be enabled with the '-ansiclr- flag.
* All loggers have been optimized and are all initialized only once at process startup.
* New hook for 'Warning()' print function with warning level.
2022-01-14 20:48:16 +01:00
Amos
e6254e3a03 Fix issue with ImGui windows where input could loose focus and not work
'ImGui_ImplWin32_WndProcHandler' has to be called at all times from the HwndProc handler as it has to track all events to prevent issues with input.
2022-01-12 13:11:18 +01:00
Amos
de3b3f53bd Optimizations + QoL improvements/cleanup
* IConsole overlay now clears the oldest log entries to stay under the vector limit instead of clearing the whole vector.
* IConsole code cleanup.
* IBrowser code cleanup, reordered class methods.
* Use ConVar utilities to get/set values for strings in IBrowser and IConsole.
* New ConVar's for RUI console overlay to tweak colors.
2022-01-12 02:56:17 +01:00
Amos
64c07af6e0 Cleanup to use new ConVar utilities 2022-01-09 17:17:05 +01:00
Amos
5f664d8e6b Create signatures for all used Dedicated functions 2021-12-31 03:44:21 +01:00
Amos
22c0b5c867 Dedicated server improvements 2021-12-30 17:20:47 +01:00
Amos
69161ae6c0 Implement RTech_AsyncLoad hook and concommand
The ConCommand 'rtech_asyncload' allows the user to load specific pak files on-demand.
2021-12-27 16:53:35 +01:00
IcePixelx
c81aca28de Fixed a few asserts regarding the gui. RPak things. Check description.
* Fixed assert on ImGui on IBrowser because ImGui::Begin wasn't followed up by ImGui::End
* FileExists got modernized. Using std library instead of Windows native functions now.
* RTech::DecompressedSize is actually readable now thanks to steyk.
* Same goes for RTech::Decompress
* rtech_decompress prints the decompressed file CRC32 now and writes the file all at once.
* Fixed ImGui assert on spamming SetupImGui();
2021-12-26 02:30:20 +01:00
Amos
d5b2e58dae Code base refactor + major performance and readability improvement. Read description for details.
* Codebase restructured to SourceSDK codebase style and .cpp/.h assertion paths in the game executable.
* Document most functions with valve style 'Purpose' blocks.
* Rename variables to match the rest of the codebase and Valve's naming convention.
* Dedicated DLL and the SDKLauncher now share the same codebase as the DevSDK.

* Obtain globals or pointers directly instead of waiting for runtime initialized data.
* Dynamically search for all functions and globals (this doesn't count for dedicated yet!).
* Initialize most in-SDK variables.

* Move certain prints and other utilities under ConVars to reduce verbosity and increase performance.
* Print all pattern scan results through a virtual function to make it easier to add and debug new patterns in the future.
* Type global var pointers appropriately if class or type is known and implemented.
* Forward declare 'CClient' class to avoid having 2 'g_pClient' copies.
* Add IDA's pseudo definitions for easier prototyping with decompiled assembly code.

* RPAK decompress Command callback implementation.
* Load decompressed RPaks from 'paks\Win32\' overriding the ones in 'paks\Win64\' (the decompress callback will automatically fix the header and write it to 'paks\Win32\').

* VPK decompress Command callback implementation.
* Move CRC32 ands Adler32 to implementation files.

* Server will print out more details about the connecting client.

* Upgrade ImGui lib to v1.86.
* Don't compile id3dx.h for dedicated.
* Don't compile id3dx.cpp for dedicated
* Implement DevMsg print function allowing to print information to the in-game VGUI/RUI console overlay, ImGui console overlay and the external windows console

* Fixed bug where the Error function would not properly terminate the process when an error is called. This caused access violations for critical/non-recoverable errors.
* Fixed bug where the game would crash if the console or server browser was enabled while the game was still starting up.
* Several bug fixes for the dedicated server (warning: dedicated is still considered work-in-progress!).
2021-12-25 22:36:38 +01:00