Skip to content

Commit

Permalink
fix:修复了无法启动的致命Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
HRxiaohu committed Dec 10, 2022
1 parent c672037 commit c9d4961
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
19 changes: 12 additions & 7 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using SodaCL.Launcher;
using static SodaCL.Launcher.LauncherLogging;

Expand All @@ -16,6 +14,16 @@ public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
try
{
Directory.CreateDirectory(LauncherInfo._SodaCLBasePath);
Directory.CreateDirectory(LauncherInfo._MCDir);
Directory.CreateDirectory(LauncherInfo._SodaCLLogPath);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
int _fileNum = GetFileNum();
SortAsFileCreationTime(ref _logFiles);
if (_fileNum == 5)
Expand All @@ -24,8 +32,8 @@ protected override void OnStartup(StartupEventArgs e)
}
if (_fileNum > 5)
{
for (int i; _fileNum >= 5;_fileNum--)
File.Delete(_logFiles[_fileNum-1].ToString());
for (int i; _fileNum >= 5; _fileNum--)
File.Delete(_logFiles[_fileNum - 1].ToString());
}
try
{
Expand All @@ -40,9 +48,6 @@ protected override void OnStartup(StartupEventArgs e)
SplashScreen splashScreen = new SplashScreen("/Resources/Images/Dev.ico");
splashScreen.Show(true);
Log(moduleList.Main, logInfo.Info, "显示启动画面");
Directory.CreateDirectory(LauncherInfo._SodaCLBasePath);
Directory.CreateDirectory(LauncherInfo._MCDir);
Directory.CreateDirectory(LauncherInfo._SodaCLLogPath);
base.OnStartup(e);
Log(moduleList.Main, logInfo.Info, "开始加载主窗体");
}
Expand Down
4 changes: 0 additions & 4 deletions Launcher/LauncherLogging.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Shapes;
using SodaCL.Launcher;
namespace SodaCL.Launcher
{
public class LauncherLogging
Expand Down
2 changes: 1 addition & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using static SodaCL.Launcher.LauncherLogging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand All @@ -12,6 +11,7 @@
using SodaCL.Core.Minecraft;
using SodaCL.Launcher;
using SodaCL.Pages;
using static SodaCL.Launcher.LauncherLogging;

namespace SodaCL
{
Expand Down
15 changes: 1 addition & 14 deletions Pages/MSLogin.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows;

namespace SodaCL.Pages
{
Expand Down

0 comments on commit c9d4961

Please sign in to comment.