From 91f97a65b2c6d1fad3a211a6739a49d9908f69a2 Mon Sep 17 00:00:00 2001 From: Michael VanOverbeek Date: Wed, 15 Feb 2017 21:30:58 +0000 Subject: whoa mud refactoring --- ShiftOS.Server/ShopBackend.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ShiftOS.Server/ShopBackend.cs') diff --git a/ShiftOS.Server/ShopBackend.cs b/ShiftOS.Server/ShopBackend.cs index 071417a..d8267b9 100644 --- a/ShiftOS.Server/ShopBackend.cs +++ b/ShiftOS.Server/ShopBackend.cs @@ -13,7 +13,7 @@ namespace ShiftOS.Server { public static class ShopBackend { - [MudRequest("update_shop_by_user")] + [MudRequest("update_shop_by_user", typeof(Dictionary))] public static void UpdateShopByUser(string guid, object contents) { var args = contents as Dictionary; @@ -37,7 +37,7 @@ namespace ShiftOS.Server Program.ClientDispatcher.DispatchTo("shop_added", guid, ""); } - [MudRequest("create_shop")] + [MudRequest("create_shop", typeof(Dictionary))] public static void CreateShop(string guid, object contents) { var args = contents as Dictionary; @@ -45,7 +45,7 @@ namespace ShiftOS.Server if (File.Exists("shops.json")) shopFile = JsonConvert.DeserializeObject>(File.ReadAllText("shops.json")); - var newShop = JsonConvert.DeserializeObject(contents as string); + var newShop = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(contents)); foreach (var shop in shopFile) { @@ -64,7 +64,7 @@ namespace ShiftOS.Server } - [MudRequest("user_shop_check")] + [MudRequest("user_shop_check", typeof(Dictionary))] public static void UserShopCheck(string guid, object contents) { var args = contents as Dictionary; @@ -85,7 +85,7 @@ namespace ShiftOS.Server Program.ClientDispatcher.DispatchTo("user_shop_check_result", guid, res.ToString()); } - [MudRequest("shop_getitems")] + [MudRequest("shop_getitems", typeof(Dictionary))] public static void GetShopItems(string guid, object contents) { var args = contents as Dictionary; @@ -111,7 +111,7 @@ namespace ShiftOS.Server } - [MudRequest("shop_getall")] + [MudRequest("shop_getall", null)] public static void GetAllShops(string guid, object contents) { var args = contents as Dictionary; @@ -129,7 +129,7 @@ namespace ShiftOS.Server Program.ClientDispatcher.DispatchTo("shop_all", guid, shops); } - [MudRequest("user_get_shop")] + [MudRequest("user_get_shop", typeof(string))] public static void GetShop(string guid, object contents) { string shopOwner = contents as string; -- cgit v1.2.3