Update To new godot system, Migrate the login system to auth.mistox.com
This commit is contained in:
@@ -1 +1 @@
|
||||
uid://05tlk373hpor
|
||||
uid://c6d2sk2xkad6q
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public partial class MainMenu : Control {
|
||||
Options _Options;
|
||||
@@ -18,25 +20,24 @@ public partial class MainMenu : Control {
|
||||
public async void _on_join_game_pressed() {
|
||||
SettingsFile sf = _Options._SettingsFile;
|
||||
GameSettings gs = sf.Game;
|
||||
string userN = gs.UserName;
|
||||
string passW = gs.SessionToken;
|
||||
(bool, Account) User = await _Reference.MistoxNet.TrySession( userN, passW );
|
||||
if( User.Item1 ) {
|
||||
_Reference.Lighting.Environment.SsrEnabled = sf.Display.ScreenSpaceReflections;
|
||||
_Reference.Lighting.Environment.SsaoEnabled = sf.Display.ScreenSpaceAmbiantOcclusion;
|
||||
_Reference.Lighting.Environment.SdfgiEnabled = sf.Display.GlobalIllumination;
|
||||
_Reference.GameHandler.Visible = true;
|
||||
_Reference.GameUI.Visible = true;
|
||||
Visible = false;
|
||||
_Options.Host = GetNode<TextEdit>("Host").Text;
|
||||
_Reference.GameHandler.StartClient();
|
||||
this.Visible = false;
|
||||
_Reference.PreGame.Visible = true;
|
||||
|
||||
} else {
|
||||
(bool, Account) tAccount = await _Reference.MistoxNet.TryValidateSessionToken( gs.SessionToken );
|
||||
if( !tAccount.Item1 ) {
|
||||
_Reference.Alert.PerformAlert( "Login failed" );
|
||||
_Reference.SessionHandler.GetParent<Control>().Visible = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_Reference.Lighting.Environment.SsrEnabled = sf.Display.ScreenSpaceReflections;
|
||||
_Reference.Lighting.Environment.SsaoEnabled = sf.Display.ScreenSpaceAmbiantOcclusion;
|
||||
_Reference.Lighting.Environment.SdfgiEnabled = sf.Display.GlobalIllumination;
|
||||
_Reference.GameHandler.Visible = true;
|
||||
_Reference.GameUI.Visible = true;
|
||||
Visible = false;
|
||||
_Options.Host = GetNode<TextEdit>("Host").Text;
|
||||
_Reference.GameHandler.StartClient();
|
||||
this.Visible = false;
|
||||
_Reference.PreGame.Visible = true;
|
||||
}
|
||||
|
||||
public void _on_start_server_pressed(){
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bl0rkhiv11xlw
|
||||
uid://cgk3ybaxnvan6
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://dng4m5svd37r6
|
||||
uid://cgra737ky483a
|
||||
|
||||
@@ -15,11 +15,12 @@ public partial class SessionHandler : Panel {
|
||||
}
|
||||
|
||||
public async void onLogin() {
|
||||
(bool, Account) User = await _Reference.MistoxNet.TryLogin( UsernameBox.Text, PasswordBox.Text );
|
||||
if( User.Item1 ) {
|
||||
|
||||
(bool, string) tSessionToken = await _Reference.MistoxNet.TryGetSessionToken( UsernameBox.Text, PasswordBox.Text );
|
||||
if( tSessionToken.Item1 ) {
|
||||
_Reference.Alert.PerformAlert( "Login Success" );
|
||||
_Options._SettingsFile.Game.UserName = User.Item2.UserName;
|
||||
_Options._SettingsFile.Game.SessionToken = User.Item2.PasswordHash;
|
||||
_Options._SettingsFile.Game.UserName = UsernameBox.Text;
|
||||
_Options._SettingsFile.Game.SessionToken = tSessionToken.Item2;
|
||||
_Options._SettingsFile.Save();
|
||||
GetParent<Control>().Visible = false;
|
||||
} else {
|
||||
@@ -28,6 +29,6 @@ public partial class SessionHandler : Panel {
|
||||
}
|
||||
|
||||
public void onRegister() {
|
||||
OS.ShellOpen("https://www.mistox.net/account/register");
|
||||
OS.ShellOpen("https://auth.mistox.com/account/register");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
uid://66m0tj8fp24l
|
||||
uid://dxxwl4k43ihnx
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://dj0pgl0vcm6gc
|
||||
uid://6m6sspt1v1ot
|
||||
|
||||
Reference in New Issue
Block a user