|
4 | 4 |
|
5 | 5 | #include "Core/AccelByteServerSettings.h" |
6 | 6 | #include "Core/AccelByteRegistry.h" |
| 7 | +#include "Core/AccelByteUtilities.h" |
7 | 8 |
|
8 | 9 | using namespace AccelByte; |
9 | 10 |
|
@@ -93,16 +94,7 @@ void ServerSettings::LoadSettings(const FString& SectionPath) |
93 | 94 | QosPingTimeout = .6; |
94 | 95 | } |
95 | 96 |
|
96 | | - FParse::Value(FCommandLine::Get(), TEXT("dsid="), DSId); |
97 | | - if (!FParse::Value(FCommandLine::Get(), TEXT("watchdog_url="), AMSServerWatchdogUrl)) |
98 | | - { |
99 | | - GConfig->GetString(*DefaultServerSection, TEXT("WatchdogUrl"), AMSServerWatchdogUrl, GEngineIni); |
100 | | - } |
101 | | - |
102 | | - if (!FParse::Value(FCommandLine::Get(), TEXT("heartbeat="), AMSHeartbeatInterval)) |
103 | | - { |
104 | | - GConfig->GetInt(*DefaultServerSection, TEXT("AMSHeartbeatInterval"), AMSHeartbeatInterval, GEngineIni); |
105 | | - } |
| 97 | + LoadAMSSettings(); |
106 | 98 |
|
107 | 99 | LoadFallback(SectionPath, TEXT("StatsDUrl"), StatsDServerUrl); |
108 | 100 | FString StatsDPortString; |
@@ -168,6 +160,21 @@ void ServerSettings::Reset(ESettingsEnvironment const Environment) |
168 | 160 | LoadSettings(SectionPath); |
169 | 161 | } |
170 | 162 |
|
| 163 | +bool AccelByte::ServerSettings::LoadAMSSettings() |
| 164 | +{ |
| 165 | + if (!FAccelByteUtilities::GetValueFromCommandLineSwitch(TEXT("watchdog_url"), AMSServerWatchdogUrl)) |
| 166 | + { |
| 167 | + GConfig->GetString(*DefaultServerSection, TEXT("WatchdogUrl"), AMSServerWatchdogUrl, GEngineIni); |
| 168 | + } |
| 169 | + |
| 170 | + if (!FAccelByteUtilities::GetValueFromCommandLineSwitch(TEXT("heartbeat"), AMSHeartbeatInterval)) |
| 171 | + { |
| 172 | + GConfig->GetInt(*DefaultServerSection, TEXT("AMSHeartbeatInterval"), AMSHeartbeatInterval, GEngineIni); |
| 173 | + } |
| 174 | + |
| 175 | + return FAccelByteUtilities::GetValueFromCommandLineSwitch(TEXT("dsid"), DSId); |
| 176 | +} |
| 177 | + |
171 | 178 | FString UAccelByteBlueprintsServerSettings::GetClientId() |
172 | 179 | { |
173 | 180 | return FRegistry::ServerSettings.ClientId; |
|
0 commit comments