- Recovery

This commit is contained in:
2022-10-09 12:27:47 +09:00
parent f53695b228
commit 9052652122
30 changed files with 1112 additions and 219 deletions

View File

@@ -14,14 +14,15 @@ namespace Mitria_Minecraft_Updater
private static void InitializationConfig()
{
// 줄여야함
config.Source = "./Source";
config.Target = "./Target";
config.Source = "../Source";
config.Target = "../Target";
config.InformationToLauncher = "/Launcher.xml";
config.InformationToData = "/Data.xml";
config.InformationToLauncher = "/launcher.xml";
config.InformationToData = "/data.xml";
config.InformationToServer = "/server.xml";
config.LauncherSource = "/Launcher";
config.LauncherUrl = "/Data/Launcher";
config.LauncherUrl = "/Launcher";
config.LauncherFileName = "MitriaMLauncher.exe";
config.RuntimeSource = "/Runtime";
config.RuntimeUrl = "/Data/Runtime";
@@ -37,7 +38,7 @@ namespace Mitria_Minecraft_Updater
{
if (System.IO.File.Exists(configPath))
{
config = CommonLibrary.XMLSystem.LoadFromPath<Config>(configPath);
config = CommonLibrary.XmlSystem.LoadFromPath<Config>(configPath);
}
else
{
@@ -48,7 +49,7 @@ namespace Mitria_Minecraft_Updater
public static void SaveConfig()
{
CommonLibrary.XMLSystem.Save(configPath, config);
CommonLibrary.XmlSystem.Save(configPath, config);
}
public static CommonLibrary.LauncherPatchInformation LoadLauncherPatchInformation()
@@ -57,7 +58,7 @@ namespace Mitria_Minecraft_Updater
string fullPath = CommonLibrary.Extensions.PathCombineL(config.Target, config.InformationToLauncher);
if (System.IO.File.Exists(fullPath))
{
launcherPatchInformation = CommonLibrary.XMLSystem.LoadFromPath<CommonLibrary.LauncherPatchInformation>(fullPath);
launcherPatchInformation = CommonLibrary.XmlSystem.LoadFromPath<CommonLibrary.LauncherPatchInformation>(fullPath);
}
else
{
@@ -69,6 +70,18 @@ namespace Mitria_Minecraft_Updater
return launcherPatchInformation;
}
public static CommonLibrary.ServerInformation LoadServerInformation()
{
CommonLibrary.ServerInformation serverInformation = new CommonLibrary.ServerInformation();
string fullPath = CommonLibrary.Extensions.PathCombineL(config.Target, config.InformationToServer);
if(System.IO.File.Exists(fullPath))
{
serverInformation = CommonLibrary.XmlSystem.LoadFromPath<CommonLibrary.ServerInformation>(fullPath);
}
return serverInformation;
}
public static void SaveLauncherPatchInformation(CommonLibrary.LauncherPatchInformation launcherPatchInformation)
{
@@ -77,16 +90,16 @@ namespace Mitria_Minecraft_Updater
{
System.IO.Directory.CreateDirectory(config.Target);
}
CommonLibrary.XMLSystem.Save(fullPath, launcherPatchInformation);
CommonLibrary.XmlSystem.Save(fullPath, launcherPatchInformation);
}
public static CommonLibrary.DataPatchInformation LoadDataPatchInformation()
public static CommonLibrary.DataPatchInformation LoadDataPatchInformation(string serverName)
{
CommonLibrary.DataPatchInformation dataPatchInformation = new CommonLibrary.DataPatchInformation();
string fullPath = config.Target + config.InformationToData;
string fullPath = CommonLibrary.Extensions.PathCombineL(config.Target, "Servers", serverName, config.InformationToData);
if (System.IO.File.Exists(fullPath))
{
dataPatchInformation = CommonLibrary.XMLSystem.LoadFromPath<CommonLibrary.DataPatchInformation>(fullPath);
dataPatchInformation = CommonLibrary.XmlSystem.LoadFromPath<CommonLibrary.DataPatchInformation>(fullPath);
}
else
{
@@ -106,14 +119,14 @@ namespace Mitria_Minecraft_Updater
return dataPatchInformation;
}
public static void SaveDataPatchInformation(CommonLibrary.DataPatchInformation dataPatchInformation)
public static void SaveDataPatchInformation(string serverName, CommonLibrary.DataPatchInformation dataPatchInformation)
{
string fullPath = CommonLibrary.Extensions.PathCombineL(config.Target , config.InformationToData);
string fullPath = CommonLibrary.Extensions.PathCombineL(config.Target, "Servers", serverName, config.InformationToData);
if (!System.IO.Directory.Exists(config.Target))
{
System.IO.Directory.CreateDirectory(config.Target);
}
CommonLibrary.XMLSystem.Save(fullPath, dataPatchInformation);
CommonLibrary.XmlSystem.Save(fullPath, dataPatchInformation);
}
}
@@ -126,7 +139,7 @@ namespace Mitria_Minecraft_Updater
public string InformationToLauncher { get; set; } //{InformationDirectory}/Launcher.xml
public string InformationToData { get; set; } // {InformationDirectory}/Data.xml
public string InformationToServer { get; set; }
public string LauncherSource { get; set; } // {Source}/Launcher
public string LauncherUrl { get; set; } // {Target}/Launcher
public string LauncherFileName { get; set; } // 런처 파일이름