mirror of
https://gitlab.com/nullmax17/PlombirLauncher.git
synced 2025-03-14 18:01:12 +03:00
1.2.1 version bump
This commit is contained in:
parent
de64c08364
commit
93b619228e
@ -37,11 +37,13 @@ static public class Utils
|
||||
var loginHandler = JELoginHandlerBuilder.BuildDefault();
|
||||
|
||||
var authenticator = loginHandler.CreateAuthenticatorWithNewAccount(default);
|
||||
authenticator.AddMsalOAuth(app, msal => msal.DeviceCode(deviceCode =>
|
||||
{
|
||||
Console.WriteLine(deviceCode.Message);
|
||||
return Task.CompletedTask;
|
||||
}));
|
||||
authenticator.AddMsalOAuth(app, msal => msal.SystemBrowser());
|
||||
// authenticator.AddMsalOAuth(app, msal => msal.DeviceCode(deviceCode =>
|
||||
// {
|
||||
// Console.WriteLine(deviceCode.Message);
|
||||
// return Task.CompletedTask;
|
||||
// }));
|
||||
// Im too lazy to implement this type of auth
|
||||
authenticator.AddMsalOAuth(app, msal => msal.Silent());
|
||||
authenticator.AddXboxAuthForJE(xbox => xbox.Basic());
|
||||
authenticator.AddJEAuthenticator();
|
||||
|
@ -62,7 +62,7 @@ public class ConfigManager
|
||||
TomlTable table = TOML.Parse(reader);
|
||||
|
||||
// If config don't contains it means it's oudated or broken.
|
||||
if (!table.TryGetNode(key, out var node))
|
||||
if (!IsValueExists(table, key))
|
||||
{
|
||||
WriteInConfig(key, "NaN");
|
||||
}
|
||||
@ -73,33 +73,46 @@ public class ConfigManager
|
||||
if ((key == "tweaks-version") & (table[key] != currentTweaksVersion))
|
||||
{
|
||||
Console.WriteLine("Warning! Tweaks version mismatch!");
|
||||
WriteInConfig("tweaks-version", "wrong-version");
|
||||
}
|
||||
return table[key];
|
||||
}
|
||||
|
||||
// Handling out-dated or broken toml files by filling with defaults
|
||||
switch (key)
|
||||
{
|
||||
case "runtime-path": { WriteInConfig(key, defaultRuntime); return defaultRuntime; }
|
||||
case "last-version-launched": { WriteInConfig(key, defaultVersion); return defaultVersion; }
|
||||
case "nickname": { WriteInConfig(key, defaultNickname); return defaultNickname; }
|
||||
|
||||
case "accsess-token": { WriteInConfig(key, defaultAccsessToken); return defaultAccsessToken; }
|
||||
case "uuid": { WriteInConfig(key, defaultUuid); return defaultUuid; }
|
||||
case "login-method": { WriteInConfig(key, defaultLoginType); return defaultLoginType; }
|
||||
case "tweaks-version":
|
||||
{
|
||||
WriteInConfig(key, currentTweaksVersion);
|
||||
Console.WriteLine("Warning! Can't locate tweaks version! Attempting auto recovery...");
|
||||
return "possibly broken";
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return RepairConfig(key);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValueExists(TomlTable table, string key)
|
||||
{
|
||||
if (table.TryGetNode(key, out var _))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string? RepairConfig(string key)
|
||||
{
|
||||
Console.WriteLine($"Warning! Can't locate {key} in tweaks! Fallback to defaults!");
|
||||
// Handling out-dated or broken toml files by filling with defaults
|
||||
switch (key)
|
||||
{
|
||||
case "runtime-path": { WriteInConfig(key, defaultRuntime); return defaultRuntime; }
|
||||
case "last-version-launched": { WriteInConfig(key, defaultVersion); return defaultVersion; }
|
||||
case "nickname": { WriteInConfig(key, defaultNickname); return defaultNickname; }
|
||||
|
||||
case "accsess-token": { WriteInConfig(key, defaultAccsessToken); return defaultAccsessToken; }
|
||||
case "uuid": { WriteInConfig(key, defaultUuid); return defaultUuid; }
|
||||
case "login-method": { WriteInConfig(key, defaultLoginType); return defaultLoginType; }
|
||||
case "tweaks-version":
|
||||
{
|
||||
WriteInConfig(key, currentTweaksVersion);
|
||||
return "possibly broken";
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void WriteInConfig(string key, dynamic value)
|
||||
{
|
||||
if (!File.Exists("tweaks.toml"))
|
||||
|
@ -16,7 +16,7 @@
|
||||
MinHeight="400"
|
||||
MaxWidth="500"
|
||||
MaxHeight="400"
|
||||
Background="#353535"
|
||||
Background="#542434"
|
||||
>
|
||||
|
||||
<StackPanel>
|
||||
@ -39,7 +39,7 @@
|
||||
Text="Session nickname: "
|
||||
FontFamily="{StaticResource QuicksandFont}"
|
||||
/>
|
||||
<TextBlock x:Name="currentNickname" />
|
||||
<TextBlock x:Name="currentNickname" Foreground="#d9ccfb"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@ -47,7 +47,7 @@
|
||||
Text="Session login method: "
|
||||
FontFamily="{StaticResource QuicksandFont}"
|
||||
/>
|
||||
<TextBlock x:Name="loginMethod" />
|
||||
<TextBlock x:Name="loginMethod" Foreground="#d9ccfb" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@ -55,7 +55,7 @@
|
||||
Text="Session uuid: "
|
||||
FontFamily="{StaticResource QuicksandFont}"
|
||||
/>
|
||||
<TextBlock x:Name="currentUuid" />
|
||||
<TextBlock x:Name="currentUuid" Foreground="#d9ccfb" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
@ -29,6 +29,10 @@ public partial class SessionManagmentWindow : Window
|
||||
if (sender is not Button button) return;
|
||||
|
||||
_mainWindowVM.Usernick = inputNickname.Text;
|
||||
_mainWindowVM.LoginMethod = "offline"; // Swapping to offline method
|
||||
_mainWindowVM.UUID = "offline"; // Just to be sure
|
||||
_mainWindowVM.AccsesToken = "offline";
|
||||
|
||||
Console.WriteLine($"Changing nickname to {inputNickname.Text}");
|
||||
|
||||
button.Content = "Saved!";
|
||||
|
@ -21,3 +21,4 @@ Licensed in MIT!
|
||||
- [Minecraft](https://www.minecraft.net)
|
||||
- [Cmllib](https://github.com/CmlLib/CmlLib.Core.git) - MIT license
|
||||
- [Avalonia UI](https://github.com/AvaloniaUI/Avalonia) - MIT license
|
||||
- [Tommy](https://github.com/dezhidki/Tommy) - MIT license
|
||||
|
@ -1,7 +1,7 @@
|
||||
cd ../Launcher-UI
|
||||
|
||||
out_dir=../package/out/build
|
||||
archieve_name=PlombirLinux-v1-1-0.tar.gz
|
||||
archieve_name=PlombirLinux-v1-2-1.tar.gz
|
||||
|
||||
rm -r $out_dir
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
cd ../Launcher-UI
|
||||
|
||||
out_dir=../package/out/build
|
||||
archieve_name=PlombirOSX-v1-1-0.tar.gz
|
||||
archieve_name=PlombirOSX-v1-2-1.tar.gz
|
||||
|
||||
rm -r $out_dir
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
cd ../Launcher-UI
|
||||
|
||||
out_dir=../package/out/build
|
||||
archieve_name=PlombirWindows-v1-1-0.tar.gz
|
||||
archieve_name=PlombirWindows-v1-2-1.tar.gz
|
||||
|
||||
rm -r $out_dir
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user