1.2.1 version bump

This commit is contained in:
Max Chaev 2025-02-26 17:04:42 +03:00
parent de64c08364
commit 93b619228e
8 changed files with 52 additions and 32 deletions

View File

@ -37,11 +37,13 @@ static public class Utils
var loginHandler = JELoginHandlerBuilder.BuildDefault(); var loginHandler = JELoginHandlerBuilder.BuildDefault();
var authenticator = loginHandler.CreateAuthenticatorWithNewAccount(default); var authenticator = loginHandler.CreateAuthenticatorWithNewAccount(default);
authenticator.AddMsalOAuth(app, msal => msal.DeviceCode(deviceCode => authenticator.AddMsalOAuth(app, msal => msal.SystemBrowser());
{ // authenticator.AddMsalOAuth(app, msal => msal.DeviceCode(deviceCode =>
Console.WriteLine(deviceCode.Message); // {
return Task.CompletedTask; // Console.WriteLine(deviceCode.Message);
})); // return Task.CompletedTask;
// }));
// Im too lazy to implement this type of auth
authenticator.AddMsalOAuth(app, msal => msal.Silent()); authenticator.AddMsalOAuth(app, msal => msal.Silent());
authenticator.AddXboxAuthForJE(xbox => xbox.Basic()); authenticator.AddXboxAuthForJE(xbox => xbox.Basic());
authenticator.AddJEAuthenticator(); authenticator.AddJEAuthenticator();

View File

@ -62,7 +62,7 @@ public class ConfigManager
TomlTable table = TOML.Parse(reader); TomlTable table = TOML.Parse(reader);
// If config don't contains it means it's oudated or broken. // 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"); WriteInConfig(key, "NaN");
} }
@ -73,10 +73,26 @@ public class ConfigManager
if ((key == "tweaks-version") & (table[key] != currentTweaksVersion)) if ((key == "tweaks-version") & (table[key] != currentTweaksVersion))
{ {
Console.WriteLine("Warning! Tweaks version mismatch!"); Console.WriteLine("Warning! Tweaks version mismatch!");
WriteInConfig("tweaks-version", "wrong-version");
} }
return table[key]; return table[key];
} }
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 // Handling out-dated or broken toml files by filling with defaults
switch (key) switch (key)
{ {
@ -90,14 +106,11 @@ public class ConfigManager
case "tweaks-version": case "tweaks-version":
{ {
WriteInConfig(key, currentTweaksVersion); WriteInConfig(key, currentTweaksVersion);
Console.WriteLine("Warning! Can't locate tweaks version! Attempting auto recovery...");
return "possibly broken"; return "possibly broken";
} }
} }
return null; return null;
}
} }
public static void WriteInConfig(string key, dynamic value) public static void WriteInConfig(string key, dynamic value)

View File

@ -16,7 +16,7 @@
MinHeight="400" MinHeight="400"
MaxWidth="500" MaxWidth="500"
MaxHeight="400" MaxHeight="400"
Background="#353535" Background="#542434"
> >
<StackPanel> <StackPanel>
@ -39,7 +39,7 @@
Text="Session nickname: " Text="Session nickname: "
FontFamily="{StaticResource QuicksandFont}" FontFamily="{StaticResource QuicksandFont}"
/> />
<TextBlock x:Name="currentNickname" /> <TextBlock x:Name="currentNickname" Foreground="#d9ccfb"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@ -47,7 +47,7 @@
Text="Session login method: " Text="Session login method: "
FontFamily="{StaticResource QuicksandFont}" FontFamily="{StaticResource QuicksandFont}"
/> />
<TextBlock x:Name="loginMethod" /> <TextBlock x:Name="loginMethod" Foreground="#d9ccfb" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@ -55,7 +55,7 @@
Text="Session uuid: " Text="Session uuid: "
FontFamily="{StaticResource QuicksandFont}" FontFamily="{StaticResource QuicksandFont}"
/> />
<TextBlock x:Name="currentUuid" /> <TextBlock x:Name="currentUuid" Foreground="#d9ccfb" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>

View File

@ -29,6 +29,10 @@ public partial class SessionManagmentWindow : Window
if (sender is not Button button) return; if (sender is not Button button) return;
_mainWindowVM.Usernick = inputNickname.Text; _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}"); Console.WriteLine($"Changing nickname to {inputNickname.Text}");
button.Content = "Saved!"; button.Content = "Saved!";

View File

@ -21,3 +21,4 @@ Licensed in MIT!
- [Minecraft](https://www.minecraft.net) - [Minecraft](https://www.minecraft.net)
- [Cmllib](https://github.com/CmlLib/CmlLib.Core.git) - MIT license - [Cmllib](https://github.com/CmlLib/CmlLib.Core.git) - MIT license
- [Avalonia UI](https://github.com/AvaloniaUI/Avalonia) - MIT license - [Avalonia UI](https://github.com/AvaloniaUI/Avalonia) - MIT license
- [Tommy](https://github.com/dezhidki/Tommy) - MIT license

View File

@ -1,7 +1,7 @@
cd ../Launcher-UI cd ../Launcher-UI
out_dir=../package/out/build 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 rm -r $out_dir

View File

@ -1,7 +1,7 @@
cd ../Launcher-UI cd ../Launcher-UI
out_dir=../package/out/build 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 rm -r $out_dir

View File

@ -1,7 +1,7 @@
cd ../Launcher-UI cd ../Launcher-UI
out_dir=../package/out/build 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 rm -r $out_dir