1
0
mirror of https://e.coding.net/circlecloud/CTZLauncher.git synced 2024-11-22 02:08:49 +00:00

Updata...

This commit is contained in:
j502647092 2015-08-06 20:49:15 +08:00
parent af5d9e3ec7
commit 1b86b02383
3 changed files with 25 additions and 18 deletions

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EC25362D-5BA7-4CB3-BDA2-C575B9318086}</ProjectGuid> <ProjectGuid>{EC25362D-5BA7-4CB3-BDA2-C575B9318086}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CTZLauncher</RootNamespace> <RootNamespace>CTZLauncher</RootNamespace>
<AssemblyName>CTZLauncher</AssemblyName> <AssemblyName>CTZLauncher</AssemblyName>

View File

@ -4,8 +4,7 @@
xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="CTZLauncher.MainWindow" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="CTZLauncher.MainWindow"
ResizeMode = "NoResize" ResizeMode = "NoResize"
MouseMove="Window_MouseMove" Title="MainWindow" Height="600" Width="800" Background="#FF3A3A3A" AllowsTransparency="True" WindowStyle="None" Visibility="Visible" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Icon="ico.ico" VerticalAlignment="Center" VerticalContentAlignment="Center" WindowStartupLocation="CenterScreen" Initialized="Window_Initialized" FontFamily="Microsoft YaHei" Loaded="s">
Title="MainWindow" Height="600" Width="800" Background="#FF3A3A3A" AllowsTransparency="True" WindowStyle="None" Visibility="Visible" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Icon="ico.ico" VerticalAlignment="Center" VerticalContentAlignment="Center" WindowStartupLocation="CenterScreen" Initialized="Window_Initialized" Loaded="Window_Loaded" FontFamily="Microsoft YaHei">
<Window.Resources> <Window.Resources>
<!-- s:Double表示了变量类型 x:key表示了变量名 --> <!-- s:Double表示了变量类型 x:key表示了变量名 -->
@ -55,9 +54,9 @@
<Grid Margin="0,20,20,0" HorizontalAlignment="Right" Width="300"> <Grid Margin="0,20,20,0" HorizontalAlignment="Right" Width="300">
<Grid> <Grid>
<Grid Margin="10,10,10,0" Height="174" VerticalAlignment="Top"> <Grid Margin="10,10,10,0" Height="174" VerticalAlignment="Top">
<Label Content="————— XX XX 帐 号 —————" VerticalAlignment="Top" Margin="10,0" HorizontalContentAlignment="Center" FontSize="15"/> <Label Content="————— 游 戏 帐 号 —————" VerticalAlignment="Top" Margin="10,0" HorizontalContentAlignment="Center" FontSize="15"/>
<TextBox x:Name="username" Template="{StaticResource CornerTextBox}" Height="34" TextWrapping="Wrap" Text="" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,30,30,0" /> <TextBox x:Name="username" Template="{StaticResource CornerTextBox}" Height="34" TextWrapping="Wrap" Text="" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,30,30,0" />
<Label Content="————— XX XX 密 码 —————" VerticalAlignment="Top" Margin="10,69,10,0" HorizontalContentAlignment="Center" FontSize="15"/> <Label Content="————— 游 戏 密 码 —————" VerticalAlignment="Top" Margin="10,69,10,0" HorizontalContentAlignment="Center" FontSize="15"/>
<TextBox x:Name="password" Template="{StaticResource CornerTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,104,30,0" Height="34" VerticalAlignment="Top" /> <TextBox x:Name="password" Template="{StaticResource CornerTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,104,30,0" Height="34" VerticalAlignment="Top" />
<Button Margin="217,106,33,0" Template="{StaticResource CornerButton}" Height="30" Content="?" VerticalAlignment="Top" /> <Button Margin="217,106,33,0" Template="{StaticResource CornerButton}" Height="30" Content="?" VerticalAlignment="Top" />
</Grid> </Grid>

View File

@ -19,6 +19,7 @@ using KMCCC.Modules.JVersion;
using CityCraft; using CityCraft;
using System.IO; using System.IO;
using System.Windows.Threading; using System.Windows.Threading;
using System.Windows.Media.Animation;
namespace CTZLauncher namespace CTZLauncher
{ {
@ -28,6 +29,7 @@ namespace CTZLauncher
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
LauncherCore launcher = null; LauncherCore launcher = null;
int serverport = 25580;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -42,16 +44,6 @@ namespace CTZLauncher
launcher = LauncherCore.Create(".minecraft"); launcher = LauncherCore.Create(".minecraft");
} }
private void Window_Loaded(object sender, RoutedEventArgs e)
{
}
private void Window_MouseMove(object sender, MouseEventArgs e)
{
}
private void barclick_MouseDown(object sender, MouseButtonEventArgs e) private void barclick_MouseDown(object sender, MouseButtonEventArgs e)
{ {
Label bar = (Label)sender; Label bar = (Label)sender;
@ -79,11 +71,16 @@ namespace CTZLauncher
private void Login_Click(object sender, RoutedEventArgs e) private void Login_Click(object sender, RoutedEventArgs e)
{ {
if (username.Text.Length == 0 || password.Text.Length == 0)
{
MessageBox.Show("请输入账号密码!");
return;
}
Login.IsEnabled = false; Login.IsEnabled = false;
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "127.0.0.1", 2000); CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "citycraft.cn", serverport);
if (auth.isLogin()) if (auth.isLogin())
{ {
MessageBox.Show("当前玩家已登录!"); MessageBox.Show("当前玩家已登录服务器!");
} }
else else
{ {
@ -97,6 +94,12 @@ namespace CTZLauncher
else else
{ {
ServerWindow.Visibility = System.Windows.Visibility.Visible; ServerWindow.Visibility = System.Windows.Visibility.Visible;
RotateTransform rtf = new RotateTransform();
ServerWindow.RenderTransform = rtf;
LoginWindow.RenderTransform = rtf;
DoubleAnimation dbAscending = new DoubleAnimation(0, 360, new Duration(TimeSpan.FromSeconds(0.75)));
dbAscending.RepeatBehavior = new RepeatBehavior(1);
rtf.BeginAnimation(RotateTransform.AngleProperty, dbAscending);
} }
} }
Login.IsEnabled = true; Login.IsEnabled = true;
@ -172,7 +175,7 @@ namespace CTZLauncher
MessageBox.Show("请输入账号密码!"); MessageBox.Show("请输入账号密码!");
return; return;
} }
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "127.0.0.1", 2000); CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "citycraft.cn", serverport);
if (auth.isRegistered()) if (auth.isRegistered())
{ {
MessageBox.Show("该用户名已注册 请更换用户名!"); MessageBox.Show("该用户名已注册 请更换用户名!");
@ -187,5 +190,10 @@ namespace CTZLauncher
else else
MessageBox.Show("注册失败!"); MessageBox.Show("注册失败!");
} }
private void s(object sender, RoutedEventArgs e)
{
}
} }
} }