Update To new godot system, Migrate the login system to auth.mistox.com
This commit is contained in:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user