59 Commits

Author SHA1 Message Date
Kawe Mazidjatari
dd95eee491 Rename 'Con_NPrintf' cvars
A more appropriate name and description for 'Con_NPrintf'.
2023-02-19 10:23:35 +01:00
Kawe Mazidjatari
8965d6f101 Error/Warning/Con_NPrintf log hook refactor
* Warning now only logs if error level < 5.
* Warning buffer size has been increased to '10000' (internal buffer size).
* Error is now hooked as well.
* Error buffer size has been increased to '4096' (internal buffer size).
* Con_NPrintf has been refactored; 'cl_showhoststats' has been removed.
* Con_NPrintf buffer size has been increased to '4096' (MAXPRINTMSG).
* CTextOverlay::Con_NPrintf now checks the first byte in the character buffer before rendering anything, and sets the first byte to a terminating null character after rendering. This fixes the bug causing the host_speeds overlay to be still drawn while the cvar 'host_speeds' was disabled.
2023-02-19 09:51:46 +01:00
Kawe Mazidjatari
0a319971dd Hook ResizeBuffers to obtain rect size during resize
Required as the initialization only sets it to the startup rect size. This will always be up-to-date during resizes.
2023-01-30 22:08:01 +01:00
Kawe Mazidjatari
a618990937 Detour code refactor
This change was planned for a long time. This moves all REGISTER calls to a single translation unit, this is required as we currently added a very dirty workaround for not registering duplicates by checking if VFTable pointer was already present in the vector... Registering from single translation unit prevents duplicate instances that gets created if header is included by more cpp files.
Reworking this reduced 100kb+ of compiled code. This commit also reworked the way functions/variables/constant gets logged with their addresses; the new code formats them on the fly, and allows for resize at any time. Formatting is no longer required by programmer.

TODO: currently there are some compile errors for dedicated and client dll's. These will be resolved very soon as they need to be properly worked out still (server & client only stuff needs to be properly split). Use the 'main' (stable) branch for the time being if you need to compile these dll's.
2023-01-25 02:26:52 +01:00
Kawe Mazidjatari
b477bbbeaa Use correct type size for 'VPANEL'
Thanks p0358
2023-01-17 00:53:19 +01:00
Kawe Mazidjatari
2501c37044 Globally convert all byte patterns to strings
These get reconverted to masked byte patterns at runtime. With the signature map cache system, this will only happen when building the cache.
2022-12-01 22:44:55 +01:00
Kawe Mazidjatari
9e7495e407 Added new logger types (AudioSystem & VideoSystem)
These loggers are to be used for hooking and logging Miles Audio and Bink Video systems.
2022-11-27 10:19:23 +01:00
Kawe Mazidjatari
4f2ed4ae75 Rename 'g_pMatSystemSurfaceReference' to 'g_pVGuiSurface' 2022-11-10 15:34:41 +01:00
Kawe Mazidjatari
bc361c7c85 Fix texture streaming debug overlay bug
Fix bug where we did not log the actual total streaming texture memory.
2022-10-30 10:18:22 +01:00
Kawe Mazidjatari
196bf4c2b3 Logging code cleanup
* Change qualifiers for some types (make const, static const, etc..).
* Renamed 'CNotifyText' to 'CTextNotify'.
* Renamed 's_LogMutex' to 'g_LogMutex' (mutex was not static).
2022-10-30 10:08:14 +01:00
Kawe Mazidjatari
9c440e1e68 Overlay log system cleanup
* Use single static buffer instead of each overlay having its own (its only used in the material system thread).
* Improved readability by using ternary operators and c++ style casts.
2022-10-26 01:55:36 +02:00
Kawe Mazidjatari
5f84803ac6 ImGui and DirectX code improvements
* Fix history duplication by removing trailing white space characters from submitted commands in console.
* Fix out of range exception caused by caching svConVar.size() in CConsole::BuildSummary while we are modifying it.
* Fixed memory leak  caused by extraneous Strdup calls in CConsole.
* Renamed variables and structure members, static vars in id3dx.cpp are not prefixed with s_, IBrowser_Config is now m_BrowserConfig.
* Performed code cleanup in id3dx.cpp.
2022-10-20 12:29:50 +02:00
Kawe Mazidjatari
50fee7414d Missing material error logging
This commit implements missing material error logging.
When a material does not exist, it will get replaced with an error material, we log which material is missing, and with which error material it gets replaced with.
This commit also comes with some updates regarding the CMaterialGlue class, and some new types used by this class from the RePak project.
2022-10-13 02:22:50 +02:00
Kawe Mazidjatari
7b0baf5d1f CLogSystem: make notify fade out animation 500ms slower 2022-09-19 01:46:35 +02:00
Kawe Mazidjatari
23a95f84a8 ConVar names cleanup 2022-09-12 00:44:03 +02:00
Kawe Mazidjatari
1b754fd0b9 'con_notify' improvements
* Fade notify text by a fixed amount regardless of the frame times.
* Implement Valve's 'lerping' animation for text when entries fade away and expire.
* Don't run/push/remove anything if 'con_drawnotify' is disabled.
2022-09-11 23:48:11 +02:00
Kawe Mazidjatari
edbf1af98c Use clock drift managers for displaying the server and client tick count 2022-08-18 11:35:32 +02:00
Kawe Mazidjatari
5548a74d59 Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1.
* Remove some unused patterns and globals (launch performance gains of 100ms).
* Remove most duplicate patterns.
* Relocate globals from engine to a more appropriate location.
* Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known).
* Renamed some vars to fit the naming convention used in the SDK.
* Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
2022-08-18 02:15:23 +02:00
Kawe Mazidjatari
9019e5cb70 Move LogType_t to dbg.h
Renamed to EGlobalContext_t and used globally for all context types combined into one (required for rcon messages for example, as we do native and script messages, while also retaining colors).
2022-08-17 12:28:52 +02:00
Kawe Mazidjatari
851682ab89 Fix most compiler warnings 2022-08-14 18:35:01 +02:00
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
3f8476db88 Logging system light refactor
* Use responceid from server to determine in which context to log.
* Moved all script loggers from combined enums to minus instead (SERVER = -3, CLIENT = -2, UI = -1 SERVER_CODE = 0, etc), this makes it much easier to align stuff in combined systems such as the RUI logger or NetMsg().
* Color log networked RCON messages properly on the client.
* Added dedicated logger for all received RCON messages (net_console.log).
* Log commands submitted through in-game console (allows for easier debugging when going through log files).
2022-08-03 18:34:44 +02:00
rexx
2d25c504fb remove init of streamoverlay buffer 2022-07-21 17:07:20 +01:00
rexx
2e3b4205c0 remove streamoverlay hook 2022-07-21 17:05:19 +01:00
rexx
cb4e422724 reimplement stream overlay drawing 2022-07-20 22:50:55 +01:00
rexx
dad356b0c3 rename materialglue/shaderglue members 2022-07-18 22:00:03 +01:00
rexx
39c49c5b58 Update vgui_debugpanel.cpp 2022-07-13 19:47:16 +01:00
rexx
35515f1ef5 fix clientsdk compilation 2022-07-13 19:46:55 +01:00
Kawe Mazidjatari
4323f0273d Dynamically get Rui debug font face
No longer hardcoded to ArameMono (default cfg's are set to ArameMono still).
2022-07-03 11:33:42 +02:00
Kawe Mazidjatari
e05c9c787d Draw the actual simulation tick on overlay 2022-07-03 11:03:25 +02:00
PixieCore
f614ed5140 New CMemory function and vgui comments.
* CMemory::FindAllCallReferences: Get all function calls to a function from the supplied sectioBase and sectionSize, useful to mass patch calls to a function.
2022-07-02 19:08:35 +02:00
rexx
6f4d69a776
fix crash from pixel's merge 2022-07-01 22:52:55 +01:00
rexx
bd79e805b5
material debug info overlay (#70)
* material debug info overlay

* add x/y offset convars

* change flags to signature

flags is static?

* Update vgui_debugpanel.cpp

Co-authored-by: PixieCore <41352111+IcePixelx@users.noreply.github.com>
2022-07-01 23:33:48 +02:00
Kawe Mazidjatari
27eae42b10 RCON client improvement
Use 3rd argument as password instead of 'rcon_password' ConVar if arg count is > 2.
2022-06-13 01:03:36 +02:00
Kawe Mazidjatari
723976d9cb CLogSystem improvements
Draw the RUI console overlay and logging etc in CEngineVGui::Paint.
cl_showfps is no longer required to render the log system.
2022-06-12 17:50:12 +02:00
Kawe Mazidjatari
162e709190 General cleanup and improvements 2022-06-12 17:41:26 +02:00
Amos
ef68ef96fa Update vgui_debugpanel.cpp
Cleanup and cast loop int to proper type
2022-06-09 13:30:21 +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
efb7c36408 Light project restructure
Moved server/client headers and implementations into dedicated subfolder.
Renamed Some classes to match the game binary (e.g. CBaseClient is now CClient).
Removed redundant files.
2022-05-20 11:52:19 +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
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
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
Kawe Mazidjatari
aa57170e0d Start of pattern search refactor 2022-04-09 01:14:22 +02:00
Kawe Mazidjatari
c3ad5f08fb Forgot this one.. 2022-03-26 01:18:48 +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