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.cs22
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
{