64 Commits

Author SHA1 Message Date
Kawe Mazidjatari
1c29d5aed5 CEngineAPI vftable implementation 2022-08-29 01:14:53 +02:00
Marvin D
55a620aa4d CPluginSystem init, for native mods.
* Not finished yet.
* Need to make a proper ModuleManager
* Handle PluginSystem_Reload()
2022-08-20 01:59:36 +02:00
Kawe Mazidjatari
6764b5e56e Implement frame tasks
Run all Cbuf_Execute calls in the main thread. This should fix every problem related to (but not only):
* Connecting to server while RUI dialogue is still open.
* Connecting to server while in an active game.
* Running 'weapon_reparse'.
2022-08-19 21:33:31 +02:00
Kawe Mazidjatari
bb6a05cb81 More mapped out network interface classes
More interface classes directly usable with the engine.
2022-08-15 14:44:54 +02:00
Kawe Mazidjatari
bf3b7bdace Server browser cleanup
* Moved server utility to dedicated class shared by browser panel and UI script VM.
* Additional code improvements and optimizations.
2022-08-14 15:43:49 +02:00
Kawe Mazidjatari
fad1a092e4 More CCvar reversing
Still work-in-progress
2022-08-13 19:41:45 +02:00
Kawe Mazidjatari
aa72579656 Heavy FileSystem upgrades
Implement VFTable's to interface with engine (for the most part mapped out, only the new VPK methods needs further reversing).
This exposes a good majority of the FileSystem implementation of the engine, to the SDK.
2022-08-13 11:24:55 +02:00
Kawe Mazidjatari
4cc0d085d4 Add generichash, utlfixedmemory and utlrbtree
Generichash for future reversing of CCvar.
2022-08-12 15:53:58 +02:00
Kawe Mazidjatari
f9ea1b0f65 Rename bits.h/.cpp to fbits.h/.cpp (floatbits) 2022-08-09 18:07:32 +02:00
Kawe Mazidjatari
329621c6ad Move all public headers into root of 'public' 2022-08-09 17:18:07 +02:00
Kawe Mazidjatari
ade1de41a9 Implement abstract class 'IEngine'
Also reversed one new method: IEngine::GetPlaylistCount (gets the number of playlists read from the playlists file, the other 2 unknown methods after this one also do stuff with the playlists, but rather on KeyValues level, one checks if something exists i think, the other returns a const char. Haven't ran these yet).
2022-08-09 11:53:33 +02:00
Kawe Mazidjatari
20d1fabd0c Implement CUtlMemory, CUtlBlockMemory and CUtlVector
CUtlMemory has been modified to fit the size of the in-engine structure.
The new types seem to be either int64 or unsigned (size_t?).
2022-08-04 01:28:07 +02:00
Kawe Mazidjatari
fcc409cfcb Add icliententitylist.h to ClientSDK project 2022-07-30 00:44:13 +02:00
Kawe Mazidjatari
2206c24683 Add worldsize.h 2022-07-29 17:41:50 +02:00
Kawe Mazidjatari
9556b05209 CCommand improvements
Add constructor and work-in-progress tokenizer.
2022-07-29 17:30:05 +02:00
Kawe Mazidjatari
25e2581f2b Implement fully mapped out ConCommandBase VFTable interface class 2022-07-25 20:06:06 +02:00
Kawe Mazidjatari
19d264ec11 Implement RCON_PasswordChanged_f and ConVar improvements
* Changing RCON passwords on the server now closes all connections and re-initializes the system.
* Fully mapped out VFTable interface for IConVar* (used for ConVar callbacks, see callback.cpp).
2022-07-25 19:35:08 +02:00
Kawe Mazidjatari
799dac882a Add 'MainViewOrigin()' and 'MainViewAngles()'
Implemented g_vecRenderOrigin and g_vecRenderAngles to SDK.
2022-07-25 12:46:57 +02:00
Kawe Mazidjatari
f314b9b4e7 Start of C_Player reversing 2022-07-24 12:59:40 +02:00
Kawe Mazidjatari
c405c23934 Implement memory allocation singleton wrappers
* Pointer to g_pMemAllocSingleton
* New wrapper for returning the singleton, and creating one if not yet initialized (game shares the same pointer, and is aware of its creation).
2022-07-22 16:34:10 +02:00
Kawe Mazidjatari
b3ed5d4052 Fix client.dll compile errors
Stripped more server only stuff from client.dll.
2022-07-21 15:13:48 +02:00
Kawe Mazidjatari
bd3fe5b445 Public IVDebugOverlay VFTable interface.
New public interface to add debug overlays on the go (memory is managed by the game module).
3 new commands:
* line.
* sphere.
* capsule.
2022-07-12 17:46:47 +02:00
Kawe Mazidjatari
86c9ac5292 Upgrade mathlib to latest
Latest SourceSDK MathLib with minor modifications.
2022-07-08 00:55:01 +02:00
Kawe Mazidjatari
d8a45ae563 Overlay improvements
* Move render utils to dedicated file.
* Implement more render/mesh utils.
* Added structure for OverlayTriangle_t, OverlaySweptBox_t and OverlayCapsule_t.
OverlayCapsule_t has been modified to accommodate the size in r5 (2 new vectors).
2022-07-07 21:31:00 +02:00
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
cdcc87b54b Renamed master server related stuff 2022-07-01 10:29:27 +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
4095424b7c Add clock/time function patterns
Added:
* Sys_GetProcessUpTime
* Plat_FloatTime
* Plat_MSTime
2022-06-20 14:58:53 +02:00
Kawe Mazidjatari
e70e4d1a8c Add DebugOverlay implementation 2022-06-15 01:24:29 +02:00
Kawe Mazidjatari
ad0f94e973 Implement data sharing algorithm in VPK packing
This reduces size of the resulting VPK (checks entry block in hash map).
mp_common compresses to 32mb instead of 37.3mb (original is 38.5mb).
2022-06-04 13:55:24 +02:00
Kawe Mazidjatari
e735683940 SquirrelVM refactor
The game uses 2 types, CSquirrelVM (mostly exposed to the VScript API of the engine) and HSQUIRRELVM (mostly used for internal squirrel functions like sq_pushbool etc..).

This refactor properly splits the CSquirrelVM* functions from the HSQUIRRELVM (SQVM*) ones. The functions have also been renamed accordingly and the prototypes have been adjusted to use the correct pointer type.
2022-05-28 22:02:00 +02:00
Kawe Mazidjatari
dc9798d455 Add KeyValue leak tracing
CUtlVector has to be rebuild for this to work
2022-05-28 16:28:26 +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
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
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
8816a28372 SQVM cleanup
The SDK could now obtain context index for builds before S3
2022-05-19 02:19:43 +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
107a516f9e Implement CBaseClientState structure 2022-05-15 00:29:25 +02:00
Kawe Mazidjatari
46134434a9 Show script error callstacks and context in colors in the external console
Show colors on console and use color constant to determine color instead of comparing strings in the console render loop. removed 5 string compares which should once again bump the performance quite a bit. The last string compares will be removed soon
2022-05-09 21:21:05 +02:00
Kawe Mazidjatari
44f6f5e06b Update projects 2022-05-06 01:04:33 +02:00
PixieCore
6ea81db14f ClientClass implementation and CHLClient::GetAllClasses.
* ClientClass is currently included in dedicated so it compiles for now. Please remove it at a later point it should not be compiled into dedicated.
2022-05-02 23:53:26 +02:00
PixieCore
096ecdd333 IClientEntityList and CUtlDict.
* IClientEntityList is the full virtual function table.
* CUtlDict "implementation" is temporary.
2022-05-01 23:03:20 +02:00
Kawe Mazidjatari
a4314b1c37 Add to other project 2022-04-30 19:05:56 +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
Kawe Mazidjatari
30ce3e949f Add ConVar's and hooks for disabling the rendering of world brush entity
This is mainly for development only and in the event so many models/textures/shaders are missing, the engine would effectively crash otherwise (if some of these aren't disabled).
2022-04-29 20:12:54 +02:00
Kawe Mazidjatari
3cb4976c23 Start or 'mdl/error.rmdl' fallback implementation (see description)
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback.

In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure.

This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool.

This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work).

Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way.

The gather props functions are kind of daunting

NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
2022-04-29 05:30:06 +02:00
PixieCore
867072e814 SVC_Print::Process will print the server message to console now.
* Added new function to CMemory allowing you to hook a virtual method from a virtual method table.
* Added SVC_Print Class
* Hooked SVC_Print::Process and print the messages the server sends.
*!! Still needs verification for earlier seasons.
2022-04-27 16:29:14 +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
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