init commit

This commit is contained in:
2025-05-12 18:07:43 -07:00
commit b410345c18
1023 changed files with 57521 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
using Godot;
public partial class SessionHandler : Panel {
Options _Options;
Reference _Reference;
[Export] LineEdit UsernameBox;
[Export] LineEdit PasswordBox;
public override void _Ready() {
_Options = GetNode<Options>( "/root/Options" );
_Reference = GetNode<Reference>("/root/Reference");
_Reference.SessionHandler = this;
}
public async void onLogin() {
(bool, Account) User = await _Reference.MistoxNet.TryLogin( UsernameBox.Text, PasswordBox.Text );
if( User.Item1 ) {
_Reference.Alert.PerformAlert( "Login Success" );
_Options._SettingsFile.Game.UserName = User.Item2.UserName;
_Options._SettingsFile.Game.SessionToken = User.Item2.PasswordHash;
_Options._SettingsFile.Save();
GetParent<Control>().Visible = false;
} else {
_Reference.Alert.PerformAlert("Login Failed");
}
}
public void onRegister() {
OS.ShellOpen("https://www.mistox.net/account/register");
}
}