Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
tweak(server): add unified OneSync variables
This is to reduce confusion for new installs and make 'Infinity/Beyond' modes considered default. Mapping of new to old: - `onesync on`: onesync_enabled true + onesync_enableInfinity true - `onesync legacy`: onesync_enabled true + onesync_enableInfinity false - `onesync off`: onesync_enabled false - `onesync_population true` (default): onesync_enableBeyond true (if on) - `onesync_population false`: onesync_enableBeyond false A future commit will also enable `onesync_population` for legacy OneSync.
- Loading branch information
1 parent
e89d675
commit 4572da2
Showing
5 changed files
with
122 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #pragma once | ||
|
|
||
| #include <console/Console.Commands.h> | ||
|
|
||
| namespace fx | ||
| { | ||
| enum class OneSyncState | ||
| { | ||
| Off, | ||
| Legacy, | ||
| On | ||
| }; | ||
| } | ||
|
|
||
| template<> | ||
| struct ConsoleArgumentType<fx::OneSyncState> | ||
| { | ||
| static std::string Unparse(const fx::OneSyncState& input) | ||
| { | ||
| switch (input) | ||
| { | ||
| case fx::OneSyncState::Off: | ||
| return "off"; | ||
| case fx::OneSyncState::On: | ||
| return "on"; | ||
| case fx::OneSyncState::Legacy: | ||
| return "legacy"; | ||
| default: | ||
| return "unk"; | ||
| } | ||
| } | ||
|
|
||
| static bool Parse(const std::string& input, fx::OneSyncState* out) | ||
| { | ||
| if (_stricmp(input.c_str(), "on") == 0 || _stricmp(input.c_str(), "true") == 0) | ||
| { | ||
| *out = fx::OneSyncState::On; | ||
| return true; | ||
| } | ||
| else if (_stricmp(input.c_str(), "legacy") == 0) | ||
| { | ||
| *out = fx::OneSyncState::Legacy; | ||
| return true; | ||
| } | ||
| else if (_stricmp(input.c_str(), "off") == 0 || _stricmp(input.c_str(), "false") == 0) | ||
| { | ||
| *out = fx::OneSyncState::Off; | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
| }; | ||
|
|
||
| template<> | ||
| struct ConsoleArgumentName<fx::OneSyncState> | ||
| { | ||
| inline static const char* Get() | ||
| { | ||
| return "fx::OneSyncState"; | ||
| } | ||
| }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters