309 Commits

Author SHA1 Message Date
Kawe Mazidjatari
c29c2a9063 Adjust SMap path formatting
'/' is always a path separator, '\\' is implementation defined. The standard filesystem class takes care for OS regardless. Changed to standard separator.
2023-03-21 00:20:22 +01:00
Kawe Mazidjatari
68b5fc24fb Remove CSigCache singleton from PCH
Removed from precompiled header, and only used where needed.
2023-03-20 00:24:40 +01:00
Kawe Mazidjatari
1bd1ef6330 Make patching code compatible with older compilers
Make it compatible with older versions of the Visual Studio 2017 compiler.
2023-03-20 00:21:03 +01:00
Kawe Mazidjatari
b33fa424b5 Fix edge case crash in VDF parser
Check if 'curObj' isn't nullptr.
2023-03-19 11:25:19 +01:00
Kawe Mazidjatari
bdeadc039f Finish 'FindFileAbsoluteList' prototype
'CUtlString' has been implemented recently; finish function prototype.
2023-03-18 21:37:11 +01:00
Kawe Mazidjatari
f7e7858dae HexDump: optimizations
Optimize hexdump utility by packing as many trace calls as possible and by changing single character pointers to immediate values. Also adjusted function to support newer versions of the spdlog library.
2023-03-18 13:31:56 +01:00
Kawe Mazidjatari
ed7186e4d3 Add STL string formatters
Add STL string formatters, these formatters allow for formatting the STL strings using C-style format specifiers.
2023-03-13 21:34:09 +01:00
Kawe Mazidjatari
be3690d0b3 Light cleanup for IsValidUTF8 2023-03-13 21:30:16 +01:00
Kawe Mazidjatari
cae5037324 Initial fix for older game builds
SDK compiles and works for the S1 game now, still needs to be debugged further.
2023-03-01 00:09:38 +01:00
Kawe Mazidjatari
853aab9c81 Increment sigdb version
Protobuf has been updated, increased major version to enforce full rebuild.
2023-02-26 22:25:18 +01:00
Kawe Mazidjatari
367b2cf5bc Renames and new setters for CNetChan
* Renamed hooking class to 'VNetChan'
* Added new setters for setting the remote frame times, and the remote server CPU statistics.
2023-02-18 00:05:55 +01:00
Kawe Mazidjatari
eec9c21648 Implement SVC_ServerTick properly
* Message handler is now part of the CNetMessage base class.
* SVC_ServerTick has been implemented, and is ready for use.
2023-02-18 00:03:30 +01:00
Kawe Mazidjatari
7f127ddcbe Rename 'nettick_s' members 2023-02-15 21:43:15 +01:00
Kawe Mazidjatari
559f15a459 Fix compile errors
This belongs to commit 8550d7a8.
2023-02-15 20:46:37 +01:00
Kawe Mazidjatari
8550d7a865 Rename 'TickUpdate' to 'nettick_t' and move to public
Renamed, and moved to public. also added additional static assertions to avoid alignment mistakes in the future.
2023-02-15 17:52:25 +01:00
Kawe Mazidjatari
3d5ad71f25 Force full rebuild of SMap
Force rebuild due to invalid RVA in shipped cache map.
2023-02-13 23:53:53 +01:00
Kawe Mazidjatari
9a8db42575 Improve and fix 'CStudioHdr'
* Fixed crash that occurred due to misaligned member 'm_pMdlCacheVTable' which has been retyped to 'CMDLCache*' and renamed to 'm_pMDLCache' (actual object).
* Added mapped out member 'm_pModelName'.
2023-02-13 23:46:37 +01:00
Kawe Mazidjatari
246312840b Force full rebuild of SMap
Force full rebuild due to changed/added/removed signatures.
2023-02-12 20:07:27 +01:00
Kawe Mazidjatari
cbed704bab Performance improvements for str tools
Improve performance for 'StringToMaskedBytes' and 'PatternToMaskedBytes' by appending characters as immediate (char) values instead of pointers.
2023-02-12 19:05:34 +01:00
Kawe Mazidjatari
b1f2f47058 Update names across codebase 2023-02-12 15:06:08 +01:00
Kawe Mazidjatari
c888422d51 Remove unnecessary padding and add static assert 2023-02-12 14:57:39 +01:00
Kawe Mazidjatari
d2c8f7becc Update 'CGlobalVarsBase'
Mapped it out a little bit better.
2023-02-12 14:54:04 +01:00
Kawe Mazidjatari
a8c5ed45fd Fix IAppSystem VFTable
Destruvtor is prepended on every class in-engine. Reflected in SDK. Also removed extraneous method from ICvar causing other methods below it to misalign after the IAppSystem change.
2023-02-06 02:15:01 +01:00
Kawe Mazidjatari
a8ef2b74cd Implement ConCommand completion logic
Implementation of the ConCommand completion logic for the Dear ImGui console panel.
2023-02-05 19:21:39 +01:00
Kawe Mazidjatari
87ff71675b Implement ICvar interface class
Reversed ICvar interface class. Has been tested and verified on assembly level.
2023-02-05 11:01:27 +01:00
Kawe Mazidjatari
22d2cc5a7a Change 'FileFindHandle_t' type
Make 64 bits for target.
2023-02-04 16:00:14 +01:00
Kawe Mazidjatari
60ab35b5c4 Light optimizations for string utils
* Changed 'CreateDirectories' to only copy sanitized path if pointer to string is passed.
* Changed 'IsValidBase64' to only tokenize base64 value if pointer to string is passed.
2023-02-04 15:59:45 +01:00
Kawe Mazidjatari
4c123e20d0 CIOStream and CSigCache class improvements
CIOStream:
* Use flag based system instead (common flags are aliased; uses std::ios_base::openmode).
* 'ReadString' now writes into a string buffer (reference) that needs to be passed in by programmer (avoids copy).
* 'm_nSize' is now synced with any write operations.

CSigCache:
* Fixed bug causing crash when 'DecompressBlob' failed (results were never checked).
* Light formatting improvements.
2023-02-04 00:36:05 +01:00
Kawe Mazidjatari
3ea7cc1cd4 CModule: class improvements
* Added 'GetImportedFunction'.
* Remove extraneous std::string copy constructors during construction of 'm_vModuleSections'.
* Added extra constructor using base address.
2023-01-31 23:52:11 +01:00
Kawe Mazidjatari
af42dfafe3 Bump sig cache version
Signatures have changed, force rebuild of db.
2023-01-31 23:46:26 +01:00
Kawe Mazidjatari
34f69a5b1e Move crashhandler implementation to tier0 2023-01-31 22:13:40 +01:00
Kawe Mazidjatari
281addc68e Fix crash whitelist not working on client.dll
Unregister gamesdk's crash handler if -noworkerdll is passed. This is required as both crashhandlers will be called during an exception, and on one, the whitelist wouldn't work.
2023-01-31 21:48:42 +01:00
Kawe Mazidjatari
f0512d7f92 Add 'CAppSystemGroup::Destroy' callback
* Add hook for 'CAppSystemGroup::Destroy'.
* Moved 'IAppSystem.h' header file to public.
2023-01-30 21:22:17 +01:00
Kawe Mazidjatari
6df498e5c8 Rename 'v_netadr_t' to 'netadr_t'
Name was used for compatibility reasons. No longer necessary.
2023-01-29 15:12:27 +01:00
Kawe Mazidjatari
500a7c1925 Finish libcurl implementation
Master server queries now use SSL.
2023-01-26 20:06:48 +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
5a9824d30c Remove useless assert
Invalid assert as rebuilding cache map happens prior to initialization.
2023-01-24 00:54:13 +01:00
Kawe Mazidjatari
888989d2b3 Fully working implementation of 'sv_showhitboxes'
Setting 'sv_showhitboxes' to 0 will enable it on everything deriving from CBaseAnimating, and having a valid studiohdr/hitbox. -1 means off, value > 0 will select entity by index (value of 'sv_showhitbox').
2023-01-24 00:53:45 +01:00
Kawe Mazidjatari
2c7636ec0d Initial 'EntityByIndex' implementation 2023-01-23 23:40:40 +01:00
Kawe Mazidjatari
66ef9fb6a0 Fix crash in hitbox drawing code and light restructure
* Fix null pointer dereference crash in server hitbox drawing code; implemented a proper getter for CStudioHdr.
* Moved 'baseentity.h/cpp' to 'game/server/' instead.
* Overall light cleanup.
2023-01-23 23:21:29 +01:00
Kawe Mazidjatari
eede2b65f3 Force signature dictionary full rebuild
Launch times become slower in debug builds due to the many added signatures; force full rebuild of dictionary.
2023-01-23 02:24:41 +01:00
Kawe Mazidjatari
502a1d2324 Switch box overlay transform type to 'matrix3x4_t'
Actual type turned out to be 'matrix3x4_t' after further reverse engineering.
2023-01-23 02:20:21 +01:00
Kawe Mazidjatari
6f02e3ae13 Make CBaseEntity members protected 2023-01-23 02:08:12 +01:00
Kawe Mazidjatari
932f73530f Studio hdr improvements
* More mapped-out version of 'CStudioHdr'.
* Added hitbox getters for 'mstudiobbox_t'.
2023-01-23 02:07:42 +01:00
Kawe Mazidjatari
07ef57536d Add modelinfo vftable pointers 2023-01-22 16:48:16 +01:00
Kawe Mazidjatari
2cd28ab304 Obtain debug overlay interface through factory 2023-01-22 13:08:02 +01:00
Kawe Mazidjatari
4ebe031341 Disable BHit raytrace z-buffer by default 2023-01-22 12:28:48 +01:00
Kawe Mazidjatari
3b0ed17c0d Ray_t structure improvements
Apparently it has 2 flag fields?
2023-01-22 12:05:28 +01:00
Kawe Mazidjatari
aa353f76cb Update bspflags.h 2023-01-22 12:04:21 +01:00
Kawe Mazidjatari
437b80eac4 Update trace masks
Changed trace masks to reflect that of the engine.
2023-01-22 01:43:31 +01:00