Skip to content

Commit 472db34

Browse files
Copilotkirre-bylund
andcommitted
Add command line overrides for all LootLockerConfig properties
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
1 parent 724529c commit 472db34

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

Runtime/Game/Resources/LootLockerConfig.cs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ private void CheckForSettingOverrides()
7474
string[] args = System.Environment.GetCommandLineArgs();
7575
for (int i = 0; i < args.Length; i++)
7676
{
77+
// Ensure there's a next argument for value parameters
78+
if (i + 1 >= args.Length)
79+
{
80+
continue;
81+
}
82+
7783
if (args[i] == "-apikey")
7884
{
7985
apiKey = args[i + 1];
@@ -86,6 +92,59 @@ private void CheckForSettingOverrides()
8692
{
8793
UrlCoreOverride = args[i + 1];
8894
}
95+
else if (args[i] == "-gameversion")
96+
{
97+
game_version = args[i + 1];
98+
}
99+
else if (args[i] == "-timeout")
100+
{
101+
if (float.TryParse(args[i + 1], out float timeout))
102+
{
103+
clientSideRequestTimeOut = timeout;
104+
}
105+
}
106+
else if (args[i] == "-loglevel")
107+
{
108+
if (System.Enum.TryParse<LootLockerLogger.LogLevel>(args[i + 1], true, out LootLockerLogger.LogLevel level))
109+
{
110+
logLevel = level;
111+
}
112+
}
113+
else if (args[i] == "-prettifyjson")
114+
{
115+
if (bool.TryParse(args[i + 1], out bool prettify))
116+
{
117+
prettifyJson = prettify;
118+
}
119+
}
120+
else if (args[i] == "-obfuscatelogs")
121+
{
122+
if (bool.TryParse(args[i + 1], out bool obfuscate))
123+
{
124+
obfuscateLogs = obfuscate;
125+
}
126+
}
127+
else if (args[i] == "-logerrorsaswarnings")
128+
{
129+
if (bool.TryParse(args[i + 1], out bool errorsAsWarnings))
130+
{
131+
logErrorsAsWarnings = errorsAsWarnings;
132+
}
133+
}
134+
else if (args[i] == "-loginbuilds")
135+
{
136+
if (bool.TryParse(args[i + 1], out bool inBuilds))
137+
{
138+
logInBuilds = inBuilds;
139+
}
140+
}
141+
else if (args[i] == "-allowtokenrefresh")
142+
{
143+
if (bool.TryParse(args[i + 1], out bool allowRefresh))
144+
{
145+
allowTokenRefresh = allowRefresh;
146+
}
147+
}
89148
}
90149
#endif
91150
}

0 commit comments

Comments
 (0)