release
This commit is contained in:
parent
e18a94cca3
commit
f774879a1b
24
App.xaml.cs
24
App.xaml.cs
@ -19,7 +19,7 @@ namespace Zerolauncher
|
|||||||
Directory.Delete(path, recursive);
|
Directory.Delete(path, recursive);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (IOException)
|
catch (UnauthorizedAccessException)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -28,18 +28,6 @@ namespace Zerolauncher
|
|||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
if (e.Args.Length == 1)
|
|
||||||
{
|
|
||||||
switch (e.Args[0])
|
|
||||||
{
|
|
||||||
case "updateDone":
|
|
||||||
{
|
|
||||||
for (int i = 0; i < 3 && !TryDeleteDirectory(@"./cache", true); i++)
|
|
||||||
Thread.Sleep(3000);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
@ -50,9 +38,17 @@ namespace Zerolauncher
|
|||||||
UpDateManager.DoUpdate();
|
UpDateManager.DoUpdate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
if (Directory.Exists("./cache/"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 3 && !TryDeleteDirectory(@"./cache", true); i++) await Task.Delay(3000);
|
||||||
|
}
|
||||||
|
});
|
||||||
DataStream.Load();
|
DataStream.Load();
|
||||||
_ = WebApiManager.StartListener();
|
_ = WebApiManager.StartListener();
|
||||||
AccountManager.initLoadData(); }
|
AccountManager.initLoadData();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnExit(ExitEventArgs e)
|
protected override void OnExit(ExitEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,9 +17,8 @@ namespace Zerolauncher.Manager
|
|||||||
return string.Format("{0}{1}{2}", account.providerId, account.serverId, account.userName);
|
return string.Format("{0}{1}{2}", account.providerId, account.serverId, account.userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CreateGame(Account account, out bool showDialog)
|
public static bool CreateGame(Account account)
|
||||||
{
|
{
|
||||||
showDialog = false;
|
|
||||||
if (UpDateData.is_check == false)
|
if (UpDateData.is_check == false)
|
||||||
{
|
{
|
||||||
MessageBox.Show("正在更新游戏数据,请等待1-3秒。\n 请检查网络", "错误", MessageBoxButton.OK, MessageBoxImage.Warning);
|
MessageBox.Show("正在更新游戏数据,请等待1-3秒。\n 请检查网络", "错误", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
@ -27,7 +26,7 @@ namespace Zerolauncher.Manager
|
|||||||
}
|
}
|
||||||
if (UpDateData.state)
|
if (UpDateData.state)
|
||||||
{
|
{
|
||||||
showDialog = true;
|
UpDateManager.DoUpdate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var key = AccToKey(account);
|
var key = AccToKey(account);
|
||||||
@ -57,9 +56,9 @@ namespace Zerolauncher.Manager
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CreateGame(int memberId, out bool showDialog)
|
public static bool CreateGame(int memberId)
|
||||||
{
|
{
|
||||||
return CreateGame(AccountManager.accountsList[memberId], out showDialog);
|
return CreateGame(AccountManager.accountsList[memberId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int CheckGameState(Account account)
|
public static int CheckGameState(Account account)
|
||||||
@ -237,7 +236,7 @@ namespace Zerolauncher.Manager
|
|||||||
bool is_first_luancher = EngineManager.CheckEmpy();
|
bool is_first_luancher = EngineManager.CheckEmpy();
|
||||||
if (mod == StaticHandleA.UpdateMode)
|
if (mod == StaticHandleA.UpdateMode)
|
||||||
{
|
{
|
||||||
if (DataStream.dataStream.ecs != "")
|
if (DataStream.dataStream.ecs.Length > 10)
|
||||||
{
|
{
|
||||||
string? now_bit;
|
string? now_bit;
|
||||||
using (SHA256 sha256 = SHA256.Create())
|
using (SHA256 sha256 = SHA256.Create())
|
||||||
|
|||||||
@ -85,9 +85,13 @@ namespace Zerolauncher.Manager
|
|||||||
|
|
||||||
public static void DoUpdate1()
|
public static void DoUpdate1()
|
||||||
{
|
{
|
||||||
updateProcess.Send($"{StaticHandleS.ShowWindow} 自助更新");
|
Task.Run(async () =>
|
||||||
updateProcess.Send($"{StaticHandleS.UseBrowser} {UpDateData.lanzou + UpDateData.auto_packet_url}");
|
{
|
||||||
updateProcess.Send($"{StaticHandleS.UpdateInfo} {UpDateData.tis}");
|
updateProcess.Send($"{StaticHandleS.ShowWindow} 自助更新");
|
||||||
|
await Task.Delay(1000);
|
||||||
|
updateProcess.Send($"{StaticHandleS.UpdateInfo} {UpDateData.tis}");
|
||||||
|
updateProcess.Send($"{StaticHandleS.UseBrowser} {UpDateData.lanzou + UpDateData.auto_packet_url}");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnDownLoadDone(string path)
|
public static void OnDownLoadDone(string path)
|
||||||
@ -95,15 +99,16 @@ namespace Zerolauncher.Manager
|
|||||||
updateProcess.Send(StaticHandleS.CloseGame);
|
updateProcess.Send(StaticHandleS.CloseGame);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (Directory.Exists("./cache/")) Directory.Delete("./cache/", true);
|
||||||
ZipFile.ExtractToDirectory(path, "./cache/");
|
ZipFile.ExtractToDirectory(path, "./cache/");
|
||||||
File.Delete(path);
|
File.Delete(path);
|
||||||
}catch(Exception e)
|
}catch(Exception e)
|
||||||
{
|
{
|
||||||
MessageBox.Show($"尝试更新文件时发生错误\n{e.Message}", "错误", MessageBoxButton.OKCancel, MessageBoxImage.Error);
|
MessageBox.Show($"尝试更新文件时发生错误\n{e.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
App.needUpdate = true;
|
App.needUpdate = true;
|
||||||
MainWindow.Instance.Close();
|
Application.Current.Dispatcher.Invoke(() => Application.Current.Shutdown());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,7 @@ namespace Zerolauncher.Manager
|
|||||||
break;
|
break;
|
||||||
case "/LoginGame":
|
case "/LoginGame":
|
||||||
{
|
{
|
||||||
if (EngineManager.CreateGame(acc, out _))
|
if (EngineManager.CreateGame(acc))
|
||||||
{
|
{
|
||||||
rb = new ResponesBody(0, 0, $"Account [{nick}] successful to start.");
|
rb = new ResponesBody(0, 0, $"Account [{nick}] successful to start.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,13 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="runtimes\**" />
|
||||||
|
<EmbeddedResource Remove="runtimes\**" />
|
||||||
|
<None Remove="runtimes\**" />
|
||||||
|
<Page Remove="runtimes\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="res\1.png" />
|
<None Remove="res\1.png" />
|
||||||
<None Remove="res\2.png" />
|
<None Remove="res\2.png" />
|
||||||
|
|||||||
@ -35,9 +35,7 @@ namespace Zerolauncher.controls
|
|||||||
if (!isMouseDown) return;
|
if (!isMouseDown) return;
|
||||||
RenderTransform = new TranslateTransform(0, 0);
|
RenderTransform = new TranslateTransform(0, 0);
|
||||||
if (e.ChangedButton == MouseButton.Right) return;
|
if (e.ChangedButton == MouseButton.Right) return;
|
||||||
bool needDialog;
|
if (!EngineManager.CreateGame(memberId)) MessageBox.Show("账号已启动!请勿重复启动", "提示");
|
||||||
if (!EngineManager.CreateGame(memberId, out needDialog)) MessageBox.Show("账号已启动!请勿重复启动", "提示");
|
|
||||||
if (needDialog) UpdateDialog.CreateDailog();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 鼠标离开事件
|
// 鼠标离开事件
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user