diff options
| author | Michael VanOverbeek <[email protected]> | 2017-02-23 22:05:09 +0000 |
|---|---|---|
| committer | Michael VanOverbeek <[email protected]> | 2017-02-23 22:05:15 +0000 |
| commit | dcc9d72046266d2bb398252d4265ee87bfb75277 (patch) | |
| tree | 50e5b1996b25c36509b52ed01008aad0fd0392fc /ShiftOS.Server/SaveManager.cs | |
| parent | eb4c65f1921f8f74e6a0ea086444f7c034f50f44 (diff) | |
| download | shiftos_thereturn-dcc9d72046266d2bb398252d4265ee87bfb75277.tar.gz shiftos_thereturn-dcc9d72046266d2bb398252d4265ee87bfb75277.tar.bz2 shiftos_thereturn-dcc9d72046266d2bb398252d4265ee87bfb75277.zip | |
Save deletion (server)
Diffstat (limited to 'ShiftOS.Server/SaveManager.cs')
| -rw-r--r-- | ShiftOS.Server/SaveManager.cs | 21 |
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) { |
