224 Commits

Author SHA1 Message Date
Kawe Mazidjatari
8dbc2024c6 CMake code improvements
Use the 'add_module' macro to add modules without creating duplicate code. This macro also takes a reuse PCH as parameter, so modules that need a precompiled header, could reuse those from different targets that compile them. This commit also restructures the group order of the generated solution files for easier code navigation.
2023-05-13 00:14:53 +02:00
Kawe Mazidjatari
f120354e96 Initial port to CMake
* All libraries have been isolated from each other, and build into separate artifacts.
* Project has been restructured to support isolating libraries.
* CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example).
* Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp).

TODO:
* Add a batch file to autogenerate all projects.
* Add support for dedicated server.
* Add support for client dll.

Bugs:
* Game crashes on the title screen after the UI script compiler has finished (root cause unknown).
* Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
2023-05-10 00:05:38 +02:00
Kawe Mazidjatari
75ccebb4b6 Squirrel system restructure
Properly decouple squirrel and game code. This makes it easier to reverse engineer more of this squirrel system, and to compile them as individual libraries later on when moving to CMake to significantly decrease compile times.
2023-05-06 16:23:56 +02:00
Kawe Mazidjatari
199c4caede Fix compiler warning
Cast to 'size_t' to suppress warnings.
2023-05-03 23:59:56 +02:00
Kawe Mazidjatari
d978d0c745 Reduce address buffer size to 128
128 is the max size that the entire address string could be (with it being ipv6 and bracketed with ports).
2023-04-30 02:10:57 +02:00
Kawe Mazidjatari
4554a92e27 Prevent connecting to null address string
Add check to prevent connect code getting fired if address buffer is empty.
2023-04-30 02:08:40 +02:00
Kawe Mazidjatari
8898b44dee Fix memory leak in ImGui panels
Properly release texture buffers.
2023-04-23 20:34:36 +02:00
Kawe Mazidjatari
8bf105b072 Smoother fade animation for ImGui panels
Fade out when disabled too, in steps of 0.5f. SDK fixed frame has been increased to 100tps.
2023-04-16 02:45:22 +02:00
Kawe Mazidjatari
096091e56f CConsole::LoadFlagIcons: Break out on failure 2023-04-16 00:41:48 +02:00
Kawe Mazidjatari
617b7b1948 Fix bug caused by compiler optimization
The 'private' server icon did not load in release builds due to the call to 'LoadTextureBuffer' getting optimized away by the use of the const qualifier. Removing the qualifier fixed the bug.
2023-04-16 00:40:44 +02:00
Kawe Mazidjatari
dbf3b5b91d Improve ImGui logger API
* Better structure packing (reduced padding).
* 'CTextLogger::GetFilter' now returns a reference to 'm_itFilter'.
* Added additional setters and getters.
2023-04-09 22:35:55 +02:00
Kawe Mazidjatari
a7cab1d891 Fix potential security flaws caused by uncontrolled format strings
Make sure format strings are string literals to avoid an uncontrolled format string situation.
2023-04-08 19:10:59 +02:00
Kawe Mazidjatari
dc6bdc4a3a Fix incorrect ctor order 2023-04-08 17:46:08 +02:00
Kawe Mazidjatari
16910aa45c Use custom string formatter
Enforce consistency through code base by using the same format specifiers.
2023-04-08 10:50:32 +02:00
Kawe Mazidjatari
a63d66b667 /W4: Fix unreferenced symbol bugs
Return value of 'g_pMasterServer->GetServerByToken' was never checked. Added check to improve the error messages that could be displayed.
2023-04-02 17:14:29 +02:00
Kawe Mazidjatari
ae431c6ac2 /W4: Fix unreferenced symbol warnings
Fix verbose unreferenced symbol warnings.
2023-04-02 17:02:04 +02:00
Kawe Mazidjatari
a4a2f34c10 /W4: Fix signed/unsigned mismatch
This commit fixes warnings and bugs caused by signed/unsigned mismatch.
2023-04-02 12:09:43 +02:00
Kawe Mazidjatari
4357c9dbf3 Fix many compiler warnings
Fix many compiler warnings indicating potentially unwanted implicit conversions/truncations.
2023-04-02 00:59:24 +02:00
Kawe Mazidjatari
a7158d0881 CConsole::AddLog optimizations
Use FormatV to format the string, and use the move constructor to move it into the conlog structure.
2023-04-01 21:42:34 +02:00
Kawe Mazidjatari
29616f4810 Rename 'g_vAllMaps' to 'g_InstalledMaps' 2023-03-31 00:35:01 +02:00
Kawe Mazidjatari
f9c5986245 Upgrade Dear ImGui to 1.89.4
Upgrade and light restructure of ImGui directory.
2023-03-29 00:19:19 +02:00
Kawe Mazidjatari
4e12402c76 Fix bug causing completion list to never update
Use actual 'partial' command input buffer instead of the explicit command name.
2023-03-17 19:24:54 +01:00
Kawe Mazidjatari
fd1a5d76cf Utilize the internal autocomplete suggest system
Utilize 'ConCommand::AutoCompleteSuggest' instead of our temporary inline console solution. This fixes all crashes caused by calling command autocomplete callbacks that uses the newer system (e.g. 'ent_fire').
2023-03-17 00:17:35 +01:00
Kawe Mazidjatari
612ab83b20 Use 'GetNumClients' for hosting and status bar
Use 'GetNumClients' instead of iterating over the client array twice. Also fixed a bug causing the status bar only to display real clients, buts were never counted.
2023-02-12 15:21:33 +01:00
Kawe Mazidjatari
3139948141 Rename mutex guard lock
Already one named 'l' in this scope. It will work just fine, but having a different name is better.
2023-02-12 11:24:34 +01:00
Kawe Mazidjatari
26f52eea28 Server browser hosting logic improvements
* Added missing mutex lock in 'CBrowser::UpdateHostingStatus' when host status is 'NOT_HOSTING'.
* Use server's remote checksum to test whether or not the checksum is valid, as this is the one that will be used for hosting.
* Construct 'NetGameServer_t' from the main thread instead, and dispatch back into separate thread for remote query.
2023-02-12 11:22:18 +01:00
Kawe Mazidjatari
e98a6c31e9 Improve netkey logic
Removed extraneous copy of the base64 netkey. The base64 key is now directly obtained from the netkey singleton.
2023-02-12 02:28:03 +01:00
Kawe Mazidjatari
99b057438f More fixes for console
* Fix 'ClearAutoComplete' getting called recursively for some single operations.
* Fix unnecessary mutex lock.
2023-02-06 21:43:43 +01:00
Kawe Mazidjatari
308a700e25 Fix console bug
Fix bug causing autocomplete to not work correctly when command is picked from the suggestion list.
2023-02-06 02:12:53 +01:00
Kawe Mazidjatari
9e9614f908 Only reclaim focus where necessary
Only reclaim it when its actually needed to be reclaimed, else other UI components will not work properly.
2023-02-06 00:04:08 +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
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
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
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
0227f1bca3 Adjust the width too 2023-01-30 01:59:25 +01:00
Kawe Mazidjatari
3eae093dc6 Console theme improvements
* Adjust window min size based on theme to always make the log lines line up when the window height is set to its min.
* Pad logger border with 1 for all themes.
2023-01-30 01:52:32 +01:00
Kawe Mazidjatari
a872c9ac7a Server browser theme improvements
* Pad server list tables properly.
* Pad and size private server modal properly for each theme.
* Light code cleanup.
2023-01-30 01:18:51 +01:00
Kawe Mazidjatari
9164856b95 Fix browser display defect
Fix defect causing frames to not animate properly when browser menu is invoked.
2023-01-29 19:30:37 +01:00
Kawe Mazidjatari
682f29e69a Console UX improvements 2023-01-28 14:21:18 +01:00
Kawe Mazidjatari
96e482f814 Server browser UX improvements 2023-01-28 14:20:57 +01:00
Kawe Mazidjatari
1b3223d5cb Sync 'sv_globalBanlist' with global banned list toggle 2023-01-28 13:05:02 +01:00
Kawe Mazidjatari
61684ddf87 Create cvar for global banned list queries
This was planned to be changed a long time ago. This change allows dedicated server users to disable the logic as well.
2023-01-26 21:20:11 +01:00
Kawe Mazidjatari
34fddd52a8 Add cvar/command flag tooltip
Show a more detailed description of all flags set on cvar/command when user hovers its mouse over the flags texture.
2022-12-29 13:30:33 +01:00
Kawe Mazidjatari
604e4a6705 Fix console bug stripping all spaces from paste
Fixed a bug that gets triggered when pasting some text in the input field that containing space characters. All spaces will be lost during the paste.
Issue has been fixed by removing an extraneous check for space characters, the initial space character input already gets blocked in case 'ImGuiInputTextFlags_CallbackEdit'.
2022-12-21 23:46:27 +01:00
Kawe Mazidjatari
81154df155 Improve Server Browser host panel
* Immediately display the "Stop Server" and "Change Level" buttons when hoststate indicated there is an active game, since stopping the server or switching levels is still valid when the server is not simulating.
* Only display the AINetwork/NavMesh rebuild/reload and Settings Reparse buttons when the server is simulating.
2022-11-26 17:04:12 +01:00
Kawe Mazidjatari
6eb31ad881 Only activate server command panel when server is simulating
Only activate the command panel in the host section of the Server Browser when the server is actually simulating. Else we can crash the server by submitting commands when its in an uninitialized state.
Client AI Settings reparse is also only executed when the client is simulating from now on.
2022-11-23 12:30:15 +01:00
Kawe Mazidjatari
9533afc628 Add new 'shortcut' buttons to host panel
* Added "Rebuild AI Network" (rebuilds the AIN file).
* Added "NavMesh Hot Swap" (hot reloads the navmesh files).
* Added "AI Settings Reparse" (reparses ai settings on the server and client).
2022-11-14 01:04:01 +01:00
Kawe Mazidjatari
11fa1c5119 Add case insensitive search for developer console input field
This has been requested by a user. This change will allow for searching convars from partial input regardless of the case.
2022-11-13 23:44:30 +01:00
Kawe Mazidjatari
cf1adef1a2 Add FCVAR_RELEASE unknown and extended flag textures
If FCVAR_RELEASE but not restricted by context, then display this texture in the console suggestion window.
2022-11-11 20:12:20 +01:00