85 Commits

Author SHA1 Message Date
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
Kawe Mazidjatari
f6236359aa Fix debugger working directory for SDK launcher
Working directory was incorrect.
2023-07-13 00:15:37 +02:00
Kawe Mazidjatari
dca89a32d3 SDK launcher bug fixes and improvements
- Added missing implementation for 'numworkerthreads' text box.
- Swapped 'single-core server' toggle with 'processor affinity' text box.
- Performed additional light code cleanup.

The single-core dedi cvar now only gets set when 1 bit is set in the affinity mask, as that implies single core usage.
2023-07-13 00:14:47 +02:00
Kawe Mazidjatari
8ea2eac0fc Move launcher/loader consts
Move to shared PCH as these are low level defines.
2023-07-02 02:46:58 +02:00
Kawe Mazidjatari
0207c69b36 Fix SDK launcher compatibility with SDK loader
Since the SDK loader (loader.dll) is taking care of loading the DLL with the process, the SDK launcher no longer needs to inject it. Replaced call 'DetourCreateProcessWithDllsA' with 'CreateProcessA', and performed additional cleanup
2023-07-01 23:27:29 +02:00
Kawe Mazidjatari
884decd090 Set default debugger parameters
The debugger can now be immediately invoked on all runtime projects after generating the solution without having to set anything up.
2023-06-24 15:46:56 +02:00
Kawe Mazidjatari
3f8baf6f68 Allow setting compile options for specific targets
Previously, it was all controlled from the global init (applied to all projects), but some projects need different options. With these changes, you can disable the common options applied in the 'add_module' macro, and set your own if desired.
2023-06-17 00:45:27 +02:00
Kawe Mazidjatari
11f20348ac Move GdiPlus header to launcher PCH
Only used by the SDK launcher for the dashboard.
2023-05-26 21:53:25 +02:00
Kawe Mazidjatari
9f44bcc818 Treat compiler warnings as errors
Treat them as errors globally. Most of the time a warning is a bug, or problem in code that could be solved in a different (better) manner. Thirdparty code have this disabled. The warnings as errors option can be globally disabled through the CMake GUI, but this is not recommended.
2023-05-15 09:44:26 +02:00
Kawe Mazidjatari
5577d4fe87 Use dedicated PCH for sdklauncher
SDKLauncher now uses its own PCH.
2023-05-14 01:23:31 +02:00
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
359820615f Move low level code to tier0/tier1
Moved to tier0/tier1 so it could be compiled into a static library in the future.
2023-05-06 22:59:01 +02:00
Kawe Mazidjatari
de572f675c Fix launcher bug
No Queued Packets Thread has been renamed to Queued Packets Thread, and therefore its toggle should be inverted. Enabled by default.
2023-04-30 21:44:06 +02:00
Kawe Mazidjatari
0399d753f4 Properly toggle cvars in sdk launcher
Toggle them on or off instead of just on. Else disabling the toggle wouldn't disable then in the runtime as the default value of these cvars is '1'.
2023-04-25 00:47:44 +02:00
Kawe Mazidjatari
32d04645ca Put launcher playlists parsing code in try catch block
Avoid crash due to exceptions.
2023-04-03 18:38:20 +02:00
Kawe Mazidjatari
87831050e9 Fix SDK launcher compiler warning
Unused param.
2023-04-03 13:12:36 +02:00
Kawe Mazidjatari
fee5f7608e Fix SDK launcher bug
Add missing argument for string format specifier. Fixed additional compiler warnings by casting types/commenting unused.
2023-04-03 13:12:22 +02:00
Kawe Mazidjatari
5aea2f4261 RCON system upgrade
RCON upgrade with additional logging system improvements:
* Netconsole's can now log received messages in color, even when the RCON server has ANSI colors disabled; logs are fully composed locally.
* RCON server now also sends the log type over the wire, along with the (already existing) context.
* SDK logging code is now shared with the standalone netconsole application.
* Improved logging readability for the standalone netconsole application.
2023-03-27 02:01:48 +02:00
Kawe Mazidjatari
13d9ba3e13 Save SDK Launcher state in settings file
Store the state of the SDK launcher (toggled/text options) to a file on the disk to persist state.
2023-03-24 00:10:48 +01:00
Kawe Mazidjatari
b169a78542 Force consistency within code
* Use C-style format specifiers everywhere.
* Use std::string as much as possible.
* Reorder CSurface class structure by groups.
* Light optimizations in 'CSurface::ForwardCommandToGame'.
2023-03-22 00:28:41 +01:00
Kawe Mazidjatari
8177707413 SDK Launcher light refactor
* Fixed bug causing command line interface not to work properly.
* Optimized warning text and instructions.
* Terminal will not be freed when compiled in Debug/Profile.
* The console will now forward the command to all game window instances.
2023-03-21 00:14:54 +01:00
Kawe Mazidjatari
6a8085f024 Rename UI class to 'CSurface' 2023-03-20 11:16:29 +01:00
Kawe Mazidjatari
7b2a5d5d12 Initial major launcher code refactor
* Removed most boilerplate/duplicate code from launcher API.
* Make launcher API more friendly for external usage.
2023-03-20 10:26:43 +01:00
Kawe Mazidjatari
8a95c956d5 Make launcher UI code compatible with older compilers
Make it compatible with older versions of the Visual Studio 2017 compiler.
2023-03-20 00:01:49 +01:00
Kawe Mazidjatari
180d762089 Fix SDK launcher bugs
Fixed bugs preventing the SDK launcher from working when compiled using the Visual Studio 2017 compiler.
2023-03-19 11:20:04 +01:00
Kawe Mazidjatari
46ddaf9b01 Add ability to deselect a map in the SDK launcher 2023-02-12 20:30:35 +01:00
Kawe Mazidjatari
7928ac3b4c Fix SDK Launcher compiler error
Path has to be changed due to project include changes. The r5dev directory is no longer a system include, however, the compiler expects includes from system when compiling resources.
2023-02-06 23:53:32 +01:00
Kawe Mazidjatari
3af4ccebc3 Fix SDK launcher bug
Asan: used destroyed temporary to construct '-numreservedcores'.
Changed logic to only pass to engine when input is actually a number and its value is > -1.
2023-01-21 15:34:37 +01:00
Kawe Mazidjatari
aed8656d56 SDK Launcher: slight UX improvement
Make UI more symmetrical by aligning elements more precisely together.
2023-01-21 14:59:42 +01:00
Kawe Mazidjatari
54f08bd887 Work-in-progress user command executor
* Added some getters in 'CBaseEntity' and 'CServerNetworkProperty'.
* Implemented 'CPlayer::SetTimeBase'.
* WIP implementation of 'CPlayer::RunNullCommand'.
2023-01-19 15:25:45 +01:00
Kawe Mazidjatari
96fb0519d9 Update launcher help text 2023-01-16 17:59:49 +01:00
Kawe Mazidjatari
91d55bb670 Launcher improvements
* Enabled '-forceborder' as this has been fixed in the engine.
* Enabled 'UpdateSDK', we will attempt to create an updater using a batch file.
* Less boilerplate code (will be reduced even more in the future).
* Renamed 'No border' to 'Borderless'.
2022-12-07 01:07:26 +01:00
Kawe Mazidjatari
f171d629d8 Disable '-forceborder' hook and light fix for launcher
Disabled as this code is only ran if the VideoConfig file is getting written. To fix this bug, the executable has to be patched. This will be documented and shipped in the next release.
2022-12-06 12:04:44 +01:00
Kawe Mazidjatari
ebf7bb5e0b Fix engine bug regarding forcing application borders
In Respawn's engine, the '-forceborder' command line parameter does the same thing as '-noborder'. '-forceborder' should remove the flags (nand) while '-noborder' should append the borderless flag. This code is an attempt to mitigate the problem. There was not enough bytes to assemble the nand operation for this code path without involving code caves or shifting.
2022-12-06 00:48:11 +01:00
Kawe Mazidjatari
484f6a779a Clear SDK Launcher console on launch
Clear session
2022-11-23 12:30:38 +01:00
Kawe Mazidjatari
4bc0aaf1e6 Fix launcher command line for client.dll
Launcher command line did not pass "-noworkerdll" which is required if the game is launched as game client only.
2022-10-20 14:23:24 +02:00
Kawe Mazidjatari
3dc330e5df Add minimize button to SDK launcher 2022-10-20 14:23:24 +02:00
Kawe Mazidjatari
bc3b580525 Add logic for preventing recursive SDK initialization
This allows for loading the game with the client.dll without loading the main worker/sdk dll. gamesdk.dll is imported by the game executable, so we cannot circumvent its loading without some hacks, so instead, we just check if -noworkerdll is passed and not perform any init if its present.
2022-10-09 12:41:22 +02:00
Kawe Mazidjatari
8880f4e7f0 Rename "Enable Development" to "Enable Developer" in SDK launcher
Renamed to "Developer" as this is the name of the cvar, and the global define within the script API. This should express the intention more clearly.
2022-10-07 22:33:37 +02:00
Kawe Mazidjatari
46d3819f63 Update sdklauncher.cpp 2022-10-03 01:23:00 +02:00
Kawe Mazidjatari
65f17cfa8e Remove extraneous semicolons from string concat in sdklauncher 2022-10-03 01:16:56 +02:00
Kawe Mazidjatari
b34446029b Set developer and cheats cvar when "Enable Cheats" is ticked
This is required for the in-game dev-menu to work.
2022-09-25 22:20:32 +02:00
Kawe Mazidjatari
524962ac44 Pass -dev from the launcher
Must be passed from the launcher, as this is removed from the configuration files for prod. Ticking the development box will pass '-dev' and '-devsdk'.
2022-09-22 22:25:32 +02:00
Kawe Mazidjatari
c269d297b8 Update basepanel.cpp 2022-09-21 20:41:10 +02:00
Kawe Mazidjatari
8e75c57f0d Use retail/dev naming convention
Renamed 'debug' cfg's to 'dev', refered anything in code as retail/dev/prod.
2022-09-21 20:40:34 +02:00
Kawe Mazidjatari
4fb39f13dd Increase 'Playlists file' text rect 2022-09-11 16:37:14 +02:00
Kawe Mazidjatari
fb7ab18a0b Minor spelling fixes 2022-09-11 00:19:31 +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