From 745cf0cce6a8ec69ac29e30539a01c32f4f716d5 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Thu, 30 Nov 2023 18:29:11 -0600 Subject: [PATCH] Prefer Path.DirectorySeparatorChar. Remove unused deserializer --- LANCommander.SDK/GameSaveManager.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/LANCommander.SDK/GameSaveManager.cs b/LANCommander.SDK/GameSaveManager.cs index e229401..3b2957f 100644 --- a/LANCommander.SDK/GameSaveManager.cs +++ b/LANCommander.SDK/GameSaveManager.cs @@ -61,19 +61,15 @@ namespace LANCommander.SDK ExtractFilesFromZip(tempFile, tempLocation); - var deserializer = new DeserializerBuilder() - .WithNamingConvention(new PascalCaseNamingConvention()) - .Build(); - #region Move files foreach (var savePath in manifest.SavePaths.Where(sp => sp.Type == "File")) { bool inInstallDir = savePath.Path.StartsWith("{InstallDir}"); string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString()); - var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', '\\').Replace("{InstallDir}\\", "")); + var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}\\", "")); - destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', '\\').Replace("{InstallDir}", installDirectory)); + destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory)); if (File.Exists(tempSavePathFile)) { @@ -94,7 +90,7 @@ namespace LANCommander.SDK if (inInstallDir) { // Files are in the game's install directory. Move them there from the save path. - destination = file.Replace(tempSavePath, savePath.Path.Replace('/', '\\').TrimEnd('\\').Replace("{InstallDir}", installDirectory)); + destination = file.Replace(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory)); if (File.Exists(destination)) File.Delete(destination);