2488 Commits

Author SHA1 Message Date
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
d93e5f9d97 Fix a few console bugs
* Fix console always reclaiming focus when input field is empty.
* Always clear auto complete vector once item has been selected.
2023-02-05 22:50:11 +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
116d2acae8 Don't update every frame
Don't update completion callback every frame, only when the input has changed.
2023-02-05 21:10:39 +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
dc10b2305a Remove 'cdll_engine_int' from dedicated
No longer required.
2023-02-05 19:19:03 +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
4116edfe4c Server browser UX improvement
Auto focus token input field when private server modal is invoked or a token is submitted without success.
2023-02-04 20:04:23 +01:00
Kawe Mazidjatari
66f31916d1 Pylon logic imporvements
* Removed duplicate json parsing that was part of a PR that required a small refactor.
* Only check if response buffer is empty when we are going to parse the error message (this helps finding bugs in master server, since failure to parse has an exception handler).
* Log private server token and error messages to dedicated server console.
2023-02-04 19:18:18 +01:00
Kawe Mazidjatari
654e4e4271 Fix color mismatch
Fix mismatching marker color.
2023-02-04 19:15:08 +01:00
Kawe Mazidjatari
df7e80077f Make sure winsock errors always gets logged
Make sure it always gets logged to the disk.
2023-02-04 19:14:45 +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
588cb146bf Cleanup ebisusdk init 2023-02-04 15:55:32 +01:00
Kawe Mazidjatari
0dace8eea3 Fix crash during init
If an error occurs during init, and 'Error' is called, the program will segfault. Fixed by only running the 'send' code from RCON after it has been initialized.
2023-02-04 01:34:08 +01:00
Kawe Mazidjatari
14aff2d7b7 CCrashHandler: improve readability
Use macro instead of the code directly.
2023-02-04 01:04:06 +01:00
Kawe Mazidjatari
b160f39379 Improve server browser styling
Set minimum window size based on theme, so that if there are more servers than displayable, the last listing wouldn't clip under the panel frame.
2023-02-04 01:03:18 +01:00
Kawe Mazidjatari
649e6cb63c CBaseAnimating: move trailing padding
Move trailing padding from 'CBaseAnimating' to start of 'CBaseAnimatingOverlay' (VFTable).
2023-02-04 01:01:32 +01:00
Kawe Mazidjatari
c9fa7f7767 Rename origin globals 2023-02-04 00:39:34 +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
abf56ac43b Sha256 > 4gb support
Make size parameters 64 bits.
2023-02-01 23:24:18 +01:00
Kawe Mazidjatari
b0880f8f0e Fix wrong function name
Should be 'ThreadInterlockedCompareExchange'.
2023-02-01 21:41:16 +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
ffcefdd64e Rename 'g_pNetKey' to 'g_NetKey'
Not a pointer in engine code, only in SDK.
2023-01-31 23:44:01 +01:00
Kawe Mazidjatari
c2efdb59ae Move CViewRender vtable init to GetCon 2023-01-31 23:43:29 +01:00
Kawe Mazidjatari
8537881781 Fix stream overlay bug
Unfree texture memory displayed the value of total texture memory. Offset search with 4 bytes to yield correct results.
2023-01-31 23:42:43 +01:00
Kawe Mazidjatari
b51baee6cd Correct vtable name
First vtable in the hierarchy of ConVar is the base table.
2023-01-31 23:09:22 +01:00
Kawe Mazidjatari
e50601ed29 Rename 'g_bDedicated' to 'm_bIsDedicated' 2023-01-31 22:40:15 +01:00
Kawe Mazidjatari
6e32464519 Rename 's_bDedicated' to 's_bIsDedicated'
's_bIsDedicated' is the original name (see TRACEINIT in game executable).
2023-01-31 22:30:45 +01:00
Kawe Mazidjatari
419bf12e06 Add abstracted functions to determine build type
Allow scripters to determine whether or not this is a dedicated server or client only build. Note that these should not be abused in scripts! Since the client dll doesn't support running games locally, loading up the lobby isn't going to work when you leave a match (which is the current implementation in the scripts). with this, the scripter could do other things such as loading the title screen, or connecting to a remote lobby server if this happens to be a client only build.
2023-01-31 22:26:29 +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
ad71360dcd Don't register 'HSV_Main' on client dll 2023-01-31 20:55:15 +01:00
Kawe Mazidjatari
2ecc556d08 Fix CClientState shifted pointer
Shifted pointer address was wrong, this approach is more robust.
2023-01-31 20:54:58 +01:00
Kawe Mazidjatari
b33c8794a0 Reorder registration order
Slight reorder, removed 'VStudioRenderContext' from dedicated.
2023-01-31 17:21:16 +01:00
Kawe Mazidjatari
462439b1dc Improve string formatting
Flip bracket.
2023-01-31 17:10:17 +01:00
Kawe Mazidjatari
b7dd5e11c1 Fix bug causing init errors not getting logged
Initialize console and spdlog before anything else that is using the console to log errors to (in this case, winsock init errors were never getting logged).
2023-01-31 17:09:56 +01:00
Kawe Mazidjatari
13a31febd4 GetUserCmd: Return 'CUserCmd*' 2023-01-31 16:23:16 +01:00
Kawe Mazidjatari
c0a38a6c26 Additional renames 2023-01-31 16:21:51 +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
8b6e22473e Fix clang-cl compile errors
Unfortunately clang-cl doesn't support __FUNCTION__ macro concat. Some SSE stuff in mathlib/navmesh rendering also needs to be made portable at some point.
2023-01-31 14:31:17 +01:00
Kawe Mazidjatari
918535ff0f Fix crash during bots simulation
Wrong ptr to 'CUserCmd::Reset'.
2023-01-31 00:03:40 +01:00
Kawe Mazidjatari
e783309d76 Add hook error detection in system hooking 2023-01-30 22:09:15 +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
0895adff35 Disable server hitbox debug draw by default
Disabled by default in development cfg's.
2023-01-30 21:47:30 +01:00
Kawe Mazidjatari
2e6381cfc6 Add hook error detection in input hooking 2023-01-30 21:45:53 +01:00
Kawe Mazidjatari
fd5d09d843 Fix small mistake
Input hooking must be done during SDK init, only DX should be initialized later due to late binding of game pointers.
2023-01-30 21:44:28 +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
c84622cfd6 DirectX hook refactor
Refactored code to only feature game pointers, this avoids the unnecessary overhead that was previously caused by creating our own device pointers, swapchain, etc.. This commit also fixes the classic 'black screen' problem when the aspect ratio is set to 4:3 - 5:4, however, a similar bug returned for this causing Dear ImGui to not draw at all when the aspect ratio is set to 4:3 - 5:4. This commit also moves the old HwndProc hook to 'CGame::WindowProc'.
2023-01-30 20:18:11 +01:00