28 Commits

Author SHA1 Message Date
Kawe Mazidjatari
9f7d4f57d3 CCVarIteratorInternal cleanup
* Improve readability.
* Free allocated iterator memory.
* Enforce FCVAR_HIDDEN ConVar's in ImGui console (there are only 17 ConVar's marked 'hidden', and most of these are stryder/platform related stuff. This is usefull for if we ever wish to create a hidden cvar).
2022-08-14 02:51:15 +02:00
Kawe Mazidjatari
515487c63a Changed behavior of ConCommandBase::IsFlagSet (read description)
This commit breaks the indev branch for the time being (this will be solved very soon).
We no longer mask off dev flags from every commandbase, we only mask them off from the essential ones (map, connect, give, etc..), unless the SDK is launched as dev, then we mask everything off like usual, but this time at initialization and not whenever we encounter a var with this flag.
2022-08-13 20:21:32 +02:00
Kawe Mazidjatari
88b3336758 Many small code improvements and optimizations
* Use c++ methods as much as possible.
* Use enum types for accessing NavMesh objects from array.
* Use size_t for for loops when testing against size types.
* Don't compute strlen twice of more on the same string.
* Don't use unnecessary c string casts if there is a method with a std::string overload.
* Don't create string objects from string pointers if we could use them directly.
* Don't initialize RCON password twice on each change, and don't set if the new password equals the old.
2022-08-11 11:07:45 +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
81374e8682 Add VClientEntityList003 interface 2022-07-24 13:40:37 +02:00
Kawe Mazidjatari
e6ef3d71f1 Rename variable 'g_pIConsole' to 'g_pConsole' 2022-05-27 02:46:13 +02:00
Kawe Mazidjatari
47d2e4c915 See description
* Added new function 'GetAvailablePlaylists' to all VM's.
* Moved function 'GetAvailableMaps' from UI VM to all VM's.
* Improved logic behind 'GetAvailableMaps'.
* Server browser and SQVM now rely on 'MOD_GetAllInstalledMaps'. This new function populates the global vector 'g_vAllMaps' with all installed maps.
* Improved 'KeyValues' structure to use union for shared members.
2022-05-27 02:08:51 +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
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
3d32346b39 Fix patterns for S1 and removed redundant code 2022-04-19 00:00:45 +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
b753295a49 SDK improvements
* Dedicated SDK now supports ASLR enabled executables.
* Complete removal of CEngineClient on the dedicated server.
* Complete removal of gHLClient and g_pHLClient on the dedicated server.
* Performance improvements for the dedicated server frame loop.
* ConVar 'CVCallback_t' structure rebuild.
* Reduced overhead throughout SDK.
2022-04-14 19:18:59 +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
6a46486e99 See description
* Added 2 new FileSystem pointers with new features in their classes.
* Register all factory instances created by the GameDLL in the SDK.
* Added new command 'fs_mount_vpk' to mount a specified VPK file.
* Renamed 'fs_decompress_pak' to 'fs_unpack_vpk'.
* Some renaming of Factory and VPK types.
* Some light optimizations/cleanup.
2022-04-09 00:59:42 +02:00
Kawe Mazidjatari
5d69d7284e Slight project cleanup 2022-04-02 12:27:35 +02:00
Amos
faac1232be Make run on S1 again 2022-03-07 13:15:45 +01:00
Amos
d3c7b9baf5 Rename to make more sense 2022-02-23 21:11:35 +01:00
Amos
667b51097f Add launcher enums 2022-02-22 02:45:40 +01:00
Amos
57a5b5015e Additional cleanup 2022-02-19 16:42:40 +01:00
Amos
3eec52e79b Fix dedicated server crash for Linux (Lutris and Wine)
The issue was caused by checking if a file with '//*/' in its path exist on the disk. This causes crashes on Lutris and Wine.
2022-01-27 03:55:47 +01:00
Amos
f488b7e75e Load 'server' VPK's instead if the dedicated server is a standalone dedicated server
* Load server VPK's instead of client VPK's on standalone servers
* Dynamically search for 'g_bDedicated' global boolean instead of hardcoded address
* Add 'PatchString' to memory class
2022-01-26 23:45:58 +01:00
IcePixelx
f43c5da8ae Huge engine/host commit.
* Rebuild CModGroupApp::Main, did not include the dedicated routine with the empty class global.
* Using a template function now for virtual function calls
* Implemented most of the CEngine class and grabbing its global var now.
* Using local CEngine now in FrameUpdate
* Implemented EngineParms_t fully and grabbing its global var.
* Added macro for adding class member variables at offsets.

A lot of comments added regarding what needs to be done for this commit.

* Check other season compability, wasn't able to do that due to not having access to said binaries at the moment.
* Fix sdklauncher to use widestrings to fix the bug with other languages in path
2022-01-23 18:26:48 +01:00
Amos
df3bfafce6 Register ConCommands as early as possible 2022-01-19 23:46:14 +01:00
Amos
2bb02acd60 Implement autocomplete logic for in-game console.
Autocompletes based on user input.
Also shows ConVar's current value.
2022-01-17 23:21:43 +01:00
IcePixelx
55b708c9fe Comment regarding persistence and hardcoded variables. 2022-01-17 03:41:27 +01:00
Amos
22c0b5c867 Dedicated server improvements 2021-12-30 17:20:47 +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