152 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e12de45eaa Light RTech code cleanup
Use dedicated function for returning pak status as string instead of std::map. reduced compiled code size by 10kb.
2023-02-26 19:43:02 +01:00
Kawe Mazidjatari
3f2216337e Add completion for pak decompress
* Renamed 'rtech_decompress' to 'pak_decompress'.
* Added completion func for 'pak_decompress'.
2023-02-19 13:38:06 +01:00
Kawe Mazidjatari
7649d16e6a Rename 'CAutoCompleteFileList'
Rename 'CAutoCompleteFileList' to 'CBaseAutoCompleteFileList' (official name).
2023-02-19 13:26:38 +01:00
Kawe Mazidjatari
354e25633c Don't compile for client.dll
Don't compile 'CC_CreateFakePlayer_f' for the client.dll.
2023-02-06 23:01:53 +01:00
Kawe Mazidjatari
f9245a4070 Fix bug in RPak auto completion
RPaks that have a name larger than 123 chars will have their extension delimiter removed due to the way 'CAutoCompleteFileList::AutoCompletionFunc' works. Ideally this functions receives a full rewrite in the SDK to support dynamic extension lengths.
2023-02-06 21:46:03 +01:00
Kawe Mazidjatari
e4df03c4f2 Add RPak completion callbacks
Add completion for 'pak_requestload' and 'pak_requestunload'.
2023-02-06 02:16:02 +01:00
Kawe Mazidjatari
836839e6a5 Add completion logic for 'give' command
* Implemented class 'CAutoCompleteFileList' (features engine's implementation for 'AutoCompletionFunc').
* Added completion callback for 'give' command.
2023-02-05 23:01:01 +01:00
Kawe Mazidjatari
ddba8cf9b8 Install more robust 'map' completion callback
This one will list all maps, as maps should have a vpk file to be loaded correctly due to the way rpak files are formatted internally to be loaded/parsed.
2023-02-05 21:13:03 +01:00
Kawe Mazidjatari
c17913bfe9 Light cleanup of pak load api var names
* Rename some pakload api vars.
* Removed 2 duplicate pointers from (g_ClientState_Shifted and g_pakLoadJobID).
* Removed unnecessary signonstate check in 'Mod_ProcessPakQueue' for dedicated.
2023-01-31 16:09:30 +01:00
Kawe Mazidjatari
5f56c23af2 Compile CRConServer for gamesdk
RCON can now be used on the host game as well (previously dedicated exclusive).
2023-01-29 16:07:02 +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
e281aea990 Fix client.dll/dedicated.dll compile errors 2023-01-24 18:39:12 +01:00
Kawe Mazidjatari
19447f1122 Improve debug draw depth test toggle logic
* Add box depth test cvar from engine for 'CBaseAnimating::DrawServerHitboxes'.
* Use noDepthTest field from OverlayBox_t instead of the cvar.
2023-01-24 12:05:09 +01:00
Kawe Mazidjatari
4ebe031341 Disable BHit raytrace z-buffer by default 2023-01-22 12:28:48 +01:00
Kawe Mazidjatari
e8a5bbcb9f BHit_f: split server and client rendering 2023-01-22 12:12:06 +01:00
Kawe Mazidjatari
a281768ac9 BHit performance improvements
Use ray trace directly instead of build-in drawline command.
2023-01-22 12:09:12 +01:00
Kawe Mazidjatari
ab86bf3317 Improve 'sv_addbot' command usage text 2023-01-20 17:22:06 +01:00
Kawe Mazidjatari
dcf05a0adf CClientEntityList reversal
Slightly reversed CClientEntityList while looking around its singleton.
2023-01-20 00:28:49 +01:00
Kawe Mazidjatari
78960f6bbd Finish initial implementation of basic bots 2023-01-17 00:08:15 +01:00
Kawe Mazidjatari
202e4525a1 Fix linker error
Unresolved external symbols due to declaration without definitions for server game interface globals.
2023-01-16 21:16:34 +01:00
Kawe Mazidjatari
21f4d0fa07 Initial working bots implementation
* Changed 'CClient' handle time to 'edict_t' which is an alias of 'uint16_t'.
* Changed 'g_pServerGameDLL' and 'g_pServerGameClients' init (obtain from factory instead).
* Use interface version macro's for obtaining factory pointers instead.
* Added 'g_pServerGameEntities'.
2023-01-16 21:09:21 +01:00
Amos
11648d4932 Additional bot stuff 2023-01-16 16:54:01 +01:00
Amos
68f197dcef Initial fake client (bot) implementation
New bots can be added using 'sv_addbot <name> <teamid>'.
2023-01-16 15:52:33 +01:00
Kawe Mazidjatari
1abc14b828 Improve string pooling
Changed some string concats back to the old approach as this will pool strings a lot better, especially common strings such as "%s - %s". Also removed from a few other (not all) functions to maintain consistency with logs emitted from the game itself.
2022-12-28 22:00:06 +01:00
rexx
c4d23ebcc8 Remove unnecessary comment 2022-12-22 21:45:39 +00:00
rexx
3c3e1c46df Add pak_listtypes command 2022-12-22 21:44:38 +00:00
Marvin D
89bc31de10 pass directly instead of ref. 2022-12-22 01:05:39 +01:00
Marvin D
35afca2cf4 Unify string conversion and __FUNCTION__ uses in callback 2022-12-22 01:01:29 +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
f6c26464c7 Add IKeyValuesSystem class from Valve Source SDK 2013 2022-11-27 21:53:54 +01:00
Kawe Mazidjatari
277e05b2b8 Improve logging throughout SDK
Used proper enum for context. The low level tier1 stuff should print in COMMON.
Also added newlines where missing, the logging system will undergo a change where a newline will only be appended if we are logging in the same context without a newline.
2022-11-25 23:03:56 +01:00
Kawe Mazidjatari
00bf56a6bb Log RPak patch header descriptors as well 2022-11-25 02:15:25 +01:00
Kawe Mazidjatari
9bc1a7f4e4 Fix RPak patch header size fields not getting set properly
Small mistake that happened when porting the decompressor over to the engine FileSystem API.
2022-11-25 02:12:54 +01:00
Kawe Mazidjatari
ad690379ab Log RPak build date/time properly during decompress
Log the date stored in the RPak header in full detail.
2022-11-25 00:57:32 +01:00
Kawe Mazidjatari
57f17a3aad Use engine's FileSystem API for decompressing and patching RPak files 2022-11-25 00:11:17 +01:00
Kawe Mazidjatari
634184eb56 Fix bug where 'atof' was used instead of 'atoi'
This operation obtains the entity index, which requires 'atoi'. compiler casted it to int, but ideally we just convert it to an int right away.
2022-11-24 15:43:26 +01:00
Kawe Mazidjatari
368c4218b4 Move some CPackedStore methods to VPKDir_t
These methods where only used for and by the VPKDir_t structure.
Also renamed variable and method names to reflect new changes regarding the use of KeyValues by creating a structure with all values defined during file lookup rather than doing this during the pack process.
2022-11-23 17:09:48 +01:00
Kawe Mazidjatari
0ab31606eb CPackedStore refactor
The CPackedStore class now heavily relies on the engine's FileSystem and KeyValues API. Since its part of the engine, it would make more sense to utilize the engine's features instead. It also allows for easier modifications.
* The logic behind the build process hasn't changed.
2022-11-23 12:18:33 +01:00
Kawe Mazidjatari
a9ac75cfee Improve VPK pack/unpack callback code
* Use CFastTimer class for logging performance.
* Don't create unnecessary threads for packing/unpacking.
2022-11-17 20:41:34 +01:00
Kawe Mazidjatari
34d8ea578a Improve consistency throughout packedstore class
No modifications to the existing logic have been performed. Some parameter names have been renamed to improve code readability and maintainability.
2022-11-16 00:54:51 +01:00
Kawe Mazidjatari
32a158903f Rename 'cl_showconsole' and 'cl_showbrowser' to 'toggleconsole' and 'togglebrowser'
Suppress engine warnings due to missing commands (stripped for retail but still bound to key).
2022-11-10 15:36:04 +01:00
Marvin D
d00aaa933d CRenderView init, GetWorldMatrixForView()
* Fixed .gitignore for root /game/
* Fixed bug in WalkVTable where it would offset self.
* General clean up: VAR -> CON, CON -> VAR
2022-11-10 00:53:12 +01:00
Kawe Mazidjatari
dc8ad3dd53 Log all mounted/unmounted VPK files
* Log all mounted/unmounted VPK files.
* Add command for unmounting a VPK file.
* Increased logging buffer size to 4096 for all loggers that weren't updated to this yet.
2022-11-06 12:21:21 +01:00
Kawe Mazidjatari
8147431b0f Rename Detour_Free() to Detour_LevelShutdown()
Added the missing call to v_Detour_LevelInit(), which was removed for debugging purposes.
2022-11-05 00:11:17 +01:00
Kawe Mazidjatari
4bd164a535 NavMesh hot swap system improvements
* Check if server is active in command callback before attempting to hot swap.
* Hook 'v_Detour_LevelInit', and log NavMeshes that failed to load.
* Split free/destroy logic into separate function.
* Created constants for NavMesh and AI Network paths/extensions.
* Added performance profiler for hot swap logic in command callback.
* Renamed "navmesh_reload" to "navmesh_hotswap".
* "navmesh_hotswap" is now development only.
2022-11-03 17:12:22 +01:00
Kawe Mazidjatari
ba252c8e98 Implement logic for hot swapping NavMesh
The new command 'navmesh_reload' hot swaps the current NavMesh for all hulls in memory, with that of the 'new' files on the disk. The memory of the old NavMesh gets freed and destroyed.
2022-11-03 10:44:59 +01:00
Kawe Mazidjatari
44f2f87460 CConsole: heavy cleanup
* Move all default assignments to constructor.
* Rename cvar 'con_max_size_logvector' to 'con_max_lines'.
* Rename cvar 'con_max_size_history' to 'con_max_history'.
* Use array indexes instead of hardcoding context prefixes.
* Added netcon context prefix to help legend.
* Added public method to obtain history as string vector.
* Added public method to clear history.
* Internal CConsole::AddLog no longer locks the mutex.
* CConsole::LoadFlagIcons accesses resource vector by reference.
* Implemented "HELP", "HISTORY" and "CLEAR" as real console commands: "con_help", "con_history", "con_clearlines".
* Added a new command "con_clearhistory" (clears the dev console submission history).
2022-10-20 12:29:50 +02:00
Kawe Mazidjatari
d113774a6d Console improvements and new command
* Commented "ImGui::SetItemDefaultFocus()", this seems to somewhat fix the issue where the input field does not claim focus on console invocation.
* Added command "con_removeline" (removes lines from start to end index).
2022-10-20 12:29:49 +02:00
Kawe Mazidjatari
19d514d7f4 Pak_ListPaks_f cleanup
* Get RPakLoadedInfo_t as const reference from g_pLoadedPakInfo array.
* Improve formatting.
2022-10-16 15:41:23 +02:00
Kawe Mazidjatari
ae8f0cb2ab RTech_Decompress_f cleanup
Improve log and code readability.
2022-10-16 15:31:21 +02:00