diff options
| author | william341 <[email protected]> | 2017-06-18 16:43:30 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-06-18 16:43:30 -0700 |
| commit | ba80dcf3f80018cbb041b62ad8a40268427d1311 (patch) | |
| tree | f0bd18b2355d34c07c744c3cd82a4725a799eecd /ShiftOS.Server/SaveManager.cs | |
| parent | 771c20cfb3a703e0f1550fdcf9eb07b78298c944 (diff) | |
| parent | 12acff8742f4c64976bfabee1b70dc515190fc7c (diff) | |
| download | shiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.tar.gz shiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.tar.bz2 shiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.zip | |
Merge pull request #2 from shiftos-game/master
wew
Diffstat (limited to 'ShiftOS.Server/SaveManager.cs')
| -rw-r--r-- | ShiftOS.Server/SaveManager.cs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/ShiftOS.Server/SaveManager.cs b/ShiftOS.Server/SaveManager.cs index d81a1a7..baf5b64 100644 --- a/ShiftOS.Server/SaveManager.cs +++ b/ShiftOS.Server/SaveManager.cs @@ -207,8 +207,7 @@ namespace ShiftOS.Server { var save = JsonConvert.DeserializeObject<Save>(ReadEncFile(savefile)); - - if (save.UniteAuthToken==token) + if (save.UniteAuthToken == token) { if (save.ID == new Guid()) { @@ -216,7 +215,6 @@ namespace ShiftOS.Server WriteEncFile(savefile, JsonConvert.SerializeObject(save)); } - Program.server.DispatchTo(new Guid(guid), new NetObject("mud_savefile", new ServerMessage { Name = "mud_savefile", @@ -228,15 +226,11 @@ namespace ShiftOS.Server } catch { } } - try + Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage { - Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage - { - Name = "mud_login_denied", - GUID = "server" - })); - } - catch { } + Name = "mud_login_denied", + GUID = "server" + })); } [MudRequest("delete_save", typeof(ClientSave))] @@ -268,7 +262,7 @@ namespace ShiftOS.Server { args["username"] = args["username"].ToString().ToLower(); string userName = args["username"] as string; - long cpAmount = (long)args["amount"]; + ulong cpAmount = (ulong)args["amount"]; if (Directory.Exists("saves")) { @@ -302,7 +296,7 @@ namespace ShiftOS.Server args["username"] = args["username"].ToString().ToLower(); string userName = args["username"] as string; string passw = args["password"] as string; - int cpAmount = (int)args["amount"]; + ulong cpAmount = (ulong)args["amount"]; if (Directory.Exists("saves")) { @@ -315,7 +309,7 @@ namespace ShiftOS.Server WriteEncFile(saveFile, JsonConvert.SerializeObject(saveFileContents, Formatting.Indented)); Program.ClientDispatcher.Broadcast("update_your_cp", new { username = userName, - amount = -cpAmount + amount = -(long)cpAmount }); Program.ClientDispatcher.DispatchTo("update_your_cp", guid, new { |
