aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Server/SaveManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Server/SaveManager.cs')
-rw-r--r--ShiftOS.Server/SaveManager.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/ShiftOS.Server/SaveManager.cs b/ShiftOS.Server/SaveManager.cs
index d52d32a..cf0c00e 100644
--- a/ShiftOS.Server/SaveManager.cs
+++ b/ShiftOS.Server/SaveManager.cs
@@ -139,6 +139,27 @@ namespace ShiftOS.Server
catch { }
}
+ [MudRequest("delete_save", typeof(ClientSave))]
+ public static void DeleteSave(string guid, object contents)
+ {
+ var cSave = contents as ClientSave;
+
+ foreach(var saveFile in Directory.GetFiles("saves"))
+ {
+ try
+ {
+ var save = JsonConvert.DeserializeObject<Save>(ReadEncFile(saveFile));
+ if(save.Username == cSave.Username && save.Password == cSave.Password)
+ {
+ File.Delete(saveFile);
+ return;
+ }
+ }
+ catch { }
+ }
+
+ }
+
[MudRequest("usr_givecp", typeof(Dictionary<string, object>))]
public static void GiveCodepoints(string guid, object contents)
{