133 Commits

Author SHA1 Message Date
Kawe Mazidjatari
02303d0ffc Merge branch 'indev' into launcher_rework 2024-06-01 12:02:06 +02:00
Kawe Mazidjatari
569ee78df7 Launcher: parse maps and playlists on surface setup
This allows you to scroll through the combo list with the scroll wheel without uncollapsing it.
2024-06-01 11:52:52 +02:00
Kawe Mazidjatari
bdc7929286 Launcher: several fixes and improvements
- Reload map list each time the combo box is opened (needs to refresh if user installed a new map while launcher is still open).
- Reload playlists each time the combo box is opened (makes sure that the list is up-to-date if user modified it in any way).
- Use global VPK dir regex to parse out map names.
2024-06-01 11:49:16 +02:00
Kawe Mazidjatari
9792ce6951 Launcher: initialize all member vars
Suppress IntelliSense warnings.
2024-06-01 11:49:15 +02:00
Kawe Mazidjatari
c4a2d61905 Launcher: fix use after free (ASAN)
The launcher would regularly throw the PSA (Program Compatibility Assistance) notification upon exit. Running the program with address sanitizer revealed 'CSurface::GetControlValue()' returned a pointer to a temporary buffer, this is destroyed as 'Forms::Control::Text()' returns class String by value. 'CSurface::GetControlValue()' is no longer necessary since we moved to the official KeyValues class, so this function has been removed all together and the issue has therefore been fixed.
2024-06-01 11:49:14 +02:00
Kawe Mazidjatari
33f926da74 Launcher: fix compiler error
Prototype changed in commit c261db243e7de0a57445ed9bb036238a7171e572.
2024-06-01 11:46:05 +02:00
Kawe Mazidjatari
861b4b6b2b Launcher: surface and launcher code overhaul
- SDK Launcher is now a proper GUI app (no longer defaults to terminal, but can of course still be used in the terminal).
- Set uniform font on all controls (GetStockObject sometimes returns fonts that isn't currently supported on the UI layout causing text to clip; we don't show in other languages or character encodings so we should just default to Microsoft Sans Serif).
- Make anchors uniform for all controls (resize not yet supported).
- Don't attempt to send commands to game instances if command string is null or empty.
- Clamp surface console list size to window size.
- Remove surface console logger boilerplate (surface logging is now a dedicated function).
- Use actual SDK logging system for console prints/warnings/errors.
- Fixed bug where the use of a shared stack buffer caused truncated parts of the file name to end up in the command line text.
2024-06-01 11:43:10 +02:00
Kawe Mazidjatari
cb72778a25 Core: allow launching dedicated server without terminal window
The terminal window isn't always necessary, especially on Linux systems. In fact, it causes issues on some Wine environments. Allow user to disable it with -noconsole. This option only exists on the dedicated server. The client builds have the console disabled by default, and can enable them with -wconsole.
2024-06-01 11:43:09 +02:00
Kawe Mazidjatari
6a99c1bd5c Launcher: untoggle windowed mode by default and rename field
Untoggled by default due to popular demand (most wanted to launch full screen). Also renamed maxFPS field to fpsMax to remain consistency with the actual cvar name.
2024-06-01 11:43:08 +02:00
Kawe Mazidjatari
890ffa923e Launcher: light overhaul and use KeyValues class
Reworked some of the code to make globals static and used KeyValues class to parse VDF files instead.
2024-06-01 11:35:07 +02:00
Kawe Mazidjatari
3e281d785c Merge branch 'indev' into launcher_rework 2024-06-01 11:13:27 +02:00
Kawe Mazidjatari
eae0d0964b Tier0: iostream light cleanup
- Take const char* directly instead of making extraneous copies
- Add overload for reading strings into fixed size buffers
2024-04-05 17:56:51 +02:00
Kawe Mazidjatari
ff98df556c Fix unresolved external symbols
These projects used 'V_FixSlashes' but weren't licked to Tier1.
2024-04-05 17:56:50 +02:00
Kawe Mazidjatari
ec825962b6 These files are now located in the bin dir 2024-04-05 16:34:28 +02:00
Kawe Mazidjatari
aa13725f15 Add table for affinity mask
Small usage table.
2024-04-05 15:57:33 +02:00
Kawe Mazidjatari
7a07731457 Don't reinstall the entire game if an update was pushed with no updated files 2023-11-18 17:07:48 +01:00
Kawe Mazidjatari
dfc9f50176 Multiple bug fixes
The initial install, and all subsequent updates were always looking for prereleases. But the prerelease checks were also bugged so it grabbed the latest release. Now this has been fixed, the bug became apparent. Now defaulted to latest (non-prerelease). Also only toggle update view if the game is installed. Also added an error message if 'SDKLauncher_WriteLocalManifest()' fails
2023-11-01 01:44:21 +01:00
Kawe Mazidjatari
69c6de4638 Save settings before restart, and check the value afterwards
Must not be "", else keep the toggle disabled.
2023-10-29 23:17:56 +01:00
Kawe Mazidjatari
c87ee1b81d Fix launch after update bug
Build command line properly, must prepend executable name first since that gets populated into arg 0.
2023-10-29 23:16:58 +01:00
Kawe Mazidjatari
a7277b47fc Launcher UX Improvements
* Fix bug regarding searching for prerelease builds, prerelease was assumed to be always at the top but this isn't true.
* Make the prerelease toggle button check for updates instantly.
* Automatically launch the game after the update has finished.
2023-10-29 20:08:10 +01:00
Kawe Mazidjatari
633292a820 Add comprehensive error logging for downloads and fix CPU in progress callback
The game will now not be installed if the download fails (this should've never happened in the first place). The CPU usage fix should also fix download speed throttling.
2023-10-23 00:08:25 +02:00
Kawe Mazidjatari
47632d89fa Implement incremental patching
Only replace files that has changed from the previous depot, don't just copy and replace all the existing assets.
2023-10-22 22:15:13 +02:00
Kawe Mazidjatari
5ea9cd985a Swap greying out code
Only Advanced Options needs to be greyed out if no install is found, youtube should always work.
2023-10-22 01:54:43 +02:00
Kawe Mazidjatari
ac9d45b567 Fix SDK Launcher display bug
If depot vector is empty, the SDK launcher will download all files in depot json, but still use the depot vector as the count for how many packages instead of the depot json array.
2023-10-21 19:12:33 +02:00
Kawe Mazidjatari
ae098603bb Overall launcher cleanup and improvements
Use clean_sdk.bat to clean the SDK install.
2023-10-21 18:00:25 +02:00
Kawe Mazidjatari
f4df4e0fc0 Show actual to-install package count + WIP callback fix
Progress callback gets called too often eating CPU, work in progress fix added but not yet utilized.
2023-10-21 17:57:59 +02:00
Kawe Mazidjatari
cc3b17b342 Implement manifest based update logic
This checks the local manifest with that of the remote, and updates the game as necessary.
2023-10-15 21:37:45 +02:00
Kawe Mazidjatari
97dc1f646e Update SDK updater 2023-10-15 18:05:32 +02:00
Kawe Mazidjatari
11944f2476 Remove false error entirely
Just don't log it at all, the 'WaitForSingleObject()' will take care of most things.
2023-08-07 22:15:21 +02:00
Kawe Mazidjatari
933761b290 Create define for manifest path 2023-08-01 01:05:18 +02:00
Kawe Mazidjatari
9a1b2e9263 Light progress window cleanup 2023-08-01 00:02:35 +02:00
Kawe Mazidjatari
d60d05115c Make wrapper for forcing existing instance on top
Also renamed constant 'DEFAULT_WINDOW_CLASS_NAME' to 'GAME_WINDOW_CLASS_NAME'.
2023-08-01 00:02:13 +02:00
Kawe Mazidjatari
2a4ff1fe51 Properly format the bytes during download 2023-07-31 18:42:40 +02:00
Kawe Mazidjatari
1b9707e461 Improve updater reliability
Raise privileges so its more likely to being able to terminate the launcher process, also continue if TerminateProcess fails, as there could be a race condition between TerminateProcess and ExitProcess (called from launcher). We just want to make sure launcher is fully closed before proceeding to replace it.
2023-07-31 02:53:50 +02:00
Kawe Mazidjatari
9642ea18f3 New features
- check if game is running, and if so, warn and discard update/install request.
- check if launcher instance is running, and if so, not create another one but instead move focus to existing one
- periodic update checks and update installations
2023-07-31 02:51:27 +02:00
Kawe Mazidjatari
b5626cff23 Major cleanup
Decouple all logic from installer to shared utils, group all constants into 'sdklauncher_const.h'.
2023-07-30 16:51:44 +02:00
Kawe Mazidjatari
ee0ca5c9b9 Add zip file extraction and self replacing
The installer is now capable of fully installing r5reloaded and itself! Download code has been temporarily commented for debugging with local cached files.
2023-07-29 17:06:27 +02:00
Kawe Mazidjatari
4da3977409 Disable the control box in the update progress window
Disables the close (X) button and the dropdown button embedded in the application icon.
2023-07-29 16:55:49 +02:00
Kawe Mazidjatari
a3ea28e70c Add standalone SDK updater
Compiled to 'game/bin/', current purpose is to just replace launcher.exe after update as launcher.exe is the main updater, but needs to be killed to update itself.
2023-07-29 16:55:34 +02:00
Kawe Mazidjatari
072eca55de Light rename 2023-07-28 16:44:16 +02:00
Kawe Mazidjatari
e69d7d79b7 Add libraries 2023-07-28 16:44:10 +02:00
Kawe Mazidjatari
14b0106521 Remove old non-existent source files from makelist 2023-07-28 15:46:22 +02:00
Kawe Mazidjatari
bc5e4feabe Fix crash when canceling 2023-07-28 15:45:44 +02:00
Kawe Mazidjatari
41ebc431b2 Finish downloading of game and sdk files
Moved entire logic to dedicated wrappers.
2023-07-28 14:50:46 +02:00
Kawe Mazidjatari
b85d91defb Add basic dashboard panel
Basic dashboard for the average user, along with an install/repair button that is yet to be implemented.
2023-07-26 15:56:08 +02:00
Kawe Mazidjatari
85f988dcd7 Launch center screen
Make the SDK launcher appear on the center of the client's screen.
2023-07-25 01:05:05 +02:00
Kawe Mazidjatari
ddfaea6ce2 Fix client.dll loading
* Moved dedicated server command line parameter init to 'init.cpp'.
* Registered 'SV_Main' on the client, this is engine code (lower level 'local' server wrappers).
* Disabled registration of Weapon_Bolt, although this is shared game code, this particular file is only used for the SERVER at this moment.
* Added the '-noserverdll' command lien parameter to instruct our loader.dll to load the client.dll instead.
* Adjusted the loader and sdklauncher project to support the loading of client.dll.
2023-07-19 16:00:36 +02:00
Kawe Mazidjatari
df5a8bdd68 SDK launcher defines cleanup
Some of its defines were located in the 'launcher' library directory, but it only contained defines for the SDK launcher, this has been moved to 'sdklauncher_const.h'. Also renamed the 'launcher_pch.h' PCH to 'sdklauncher_pch.h' to avoid confusion with 'launcher' and 'sdklauncher'.
2023-07-15 18:43:25 +02:00
Kawe Mazidjatari
c46d80872a Implement launcher settings check
Discard and overwrite the settings file if the file version has changed.
2023-07-15 17:50:54 +02:00
Kawe Mazidjatari
afb09e1d05 Cleanup CFG directory
Move to dedicated subdirectories.
2023-07-13 23:15:10 +02:00