修复登录检测 修改登录流程...
parent
b7af6c9b70
commit
5796c2c3a1
|
@ -68,7 +68,7 @@ namespace KMCCC.Authentication
|
||||||
|
|
||||||
public bool getResult(string url)
|
public bool getResult(string url)
|
||||||
{
|
{
|
||||||
return http.Send(HttpMethod.GET, url) == "true" ? true : false;
|
return http.Send(HttpMethod.GET, url).Contains("true") ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Grid Margin="20,60,20,20" Background="White" x:Name="ServerWindow">
|
<Grid Margin="20,60,20,20" Background="White" x:Name="ServerWindow" Visibility="Hidden">
|
||||||
<!--Visibility="Hidden"-->
|
<!--Visibility="Hidden"-->
|
||||||
<Grid HorizontalAlignment="Left" Width="400" Margin="20,20,0,20">
|
<Grid HorizontalAlignment="Left" Width="400" Margin="20,20,0,20">
|
||||||
<Grid Height="80" VerticalAlignment="Top" Margin="0,0,0,0">
|
<Grid Height="80" VerticalAlignment="Top" Margin="0,0,0,0">
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid HorizontalAlignment="Right" Width="300" ShowGridLines="True" Height="206" VerticalAlignment="Bottom">
|
<Grid HorizontalAlignment="Right" Width="300" ShowGridLines="True" Height="206" VerticalAlignment="Bottom">
|
||||||
<Button x:Name="StartGame" BorderBrush="#FF3299CC" Content="启动游戏" Template="{StaticResource CornerButton}" Margin="10,0,10,10" Height="64" VerticalAlignment="Bottom" FontSize="16" Click="StartGame_Click" IsEnabled="False"/>
|
<Button x:Name="StartGame" BorderBrush="#FF3299CC" Content="启动游戏" Template="{StaticResource CornerButton}" Margin="10,0,10,10" Height="64" VerticalAlignment="Bottom" FontSize="16" Click="StartGame_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace CTZLauncher
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
LauncherCore launcher;
|
LauncherCore launcher = null;
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -39,7 +39,7 @@ namespace CTZLauncher
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(".minecraft");
|
Directory.CreateDirectory(".minecraft");
|
||||||
}
|
}
|
||||||
LauncherCore launcher = LauncherCore.Create(".minecraft");
|
launcher = LauncherCore.Create(".minecraft");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
@ -84,20 +84,19 @@ namespace CTZLauncher
|
||||||
if (auth.isLogin())
|
if (auth.isLogin())
|
||||||
{
|
{
|
||||||
MessageBox.Show("当前玩家已登录!");
|
MessageBox.Show("当前玩家已登录!");
|
||||||
Login.IsEnabled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!auth.Login())
|
|
||||||
{
|
|
||||||
MessageBox.Show("登录失败 账号不存在 或 密码错误 !");
|
|
||||||
Login.IsEnabled = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ServerWindow.Visibility = System.Windows.Visibility.Visible;
|
if (!auth.Login())
|
||||||
return;
|
{
|
||||||
|
MessageBox.Show("登录失败 账号不存在 或 密码错误 !");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ServerWindow.Visibility = System.Windows.Visibility.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Login.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue