From 9baf15f9d97c91afddec0c51fe4d89e4249a1e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=84=9C?= Date: Thu, 28 Mar 2024 11:53:56 +0900 Subject: [PATCH] =?UTF-8?q?req=20uuid=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Service/BuyShopGacha.cs | 1 - Server/Service/BuyShopItem.cs | 2 -- Server/Service/DeckChange.cs | 2 -- Server/Service/Downlode.cs | 1 - Server/Service/EquipChange.cs | 2 -- Server/Service/Login.cs | 1 - Server/Service/NicknameChange.cs | 2 -- Server/Service/Test.cs | 2 ++ Server/Service/UpdateStory.cs | 57 ++++++++++++++++++++++++++++++++ Server/Service/UseItem.cs | 3 +- Server/System/Abstract.cs | 3 +- Server/System/Enums.cs | 6 ++-- 12 files changed, 66 insertions(+), 16 deletions(-) create mode 100644 Server/Service/UpdateStory.cs diff --git a/Server/Service/BuyShopGacha.cs b/Server/Service/BuyShopGacha.cs index 5369b3b..a636e10 100644 --- a/Server/Service/BuyShopGacha.cs +++ b/Server/Service/BuyShopGacha.cs @@ -22,7 +22,6 @@ namespace Server.Service private string makeResp() { BuyShopGachaResp resp = new BuyShopGachaResp(); - resp.status = 200; return resp.ToJson(); } diff --git a/Server/Service/BuyShopItem.cs b/Server/Service/BuyShopItem.cs index da9131d..924625b 100644 --- a/Server/Service/BuyShopItem.cs +++ b/Server/Service/BuyShopItem.cs @@ -121,7 +121,6 @@ namespace Server.Service private string makeResp(User user, ItemManager itemManager) { BuyShopItemResp resp = new BuyShopItemResp(); - resp.status = 200; resp.gold = user.gold; resp.cash = user.free_cash + user.pay_cash; resp.deck_unit = itemManager.box.addDeckUnitInfo; @@ -136,7 +135,6 @@ namespace Server.Service public class BuyShopItemReq : Req { - public string uuid; public long shopItemIndex; public long reset_id; public override bool IsReceivedAllField() diff --git a/Server/Service/DeckChange.cs b/Server/Service/DeckChange.cs index 06fb36e..de91416 100644 --- a/Server/Service/DeckChange.cs +++ b/Server/Service/DeckChange.cs @@ -87,7 +87,6 @@ namespace Server.Service private string makeResp(DeckInfo changeDeck) { DeckChangeResp resp = new DeckChangeResp(); - resp.status = 200; resp.deck_info = changeDeck; return resp.ToJson(); } @@ -95,7 +94,6 @@ namespace Server.Service public class DeckChangeReq : Req { - public string uuid; public long deck_id; public long[] deck_unit; public override bool IsReceivedAllField() diff --git a/Server/Service/Downlode.cs b/Server/Service/Downlode.cs index d3fc409..89fcf51 100644 --- a/Server/Service/Downlode.cs +++ b/Server/Service/Downlode.cs @@ -27,7 +27,6 @@ namespace Server.Service DownlodeResp resp = new DownlodeResp(); resp.data = data; resp.version = ProtocolProcessor.version; - resp.status = 200; return resp.ToJson(); } diff --git a/Server/Service/EquipChange.cs b/Server/Service/EquipChange.cs index dedee03..bc628da 100644 --- a/Server/Service/EquipChange.cs +++ b/Server/Service/EquipChange.cs @@ -131,7 +131,6 @@ namespace Server.Service { SaveSQL(); EquipChangeResp resp = new EquipChangeResp(); - resp.status = 200; resp.equipment = equipment; resp.deck_unit_info = deck_unit_info; resp.change_equipment = change_equipment; @@ -141,7 +140,6 @@ namespace Server.Service public class EquipChangeReq : Req { - public string uuid; public long unit_id; public long equipment_id; public bool is_equipment; diff --git a/Server/Service/Login.cs b/Server/Service/Login.cs index 1faf301..2494940 100644 --- a/Server/Service/Login.cs +++ b/Server/Service/Login.cs @@ -285,7 +285,6 @@ namespace Server.Service public class LoginReq : Req { public string mail; - public string uuid; public override bool IsReceivedAllField() { if(mail == null && uuid == null) diff --git a/Server/Service/NicknameChange.cs b/Server/Service/NicknameChange.cs index d517e65..c449689 100644 --- a/Server/Service/NicknameChange.cs +++ b/Server/Service/NicknameChange.cs @@ -65,7 +65,6 @@ namespace Server.Service { SaveSQL(); NicknameChangeResp resp = new NicknameChangeResp(); - resp.status = 200; resp.nickname = user.nickname; resp.cash = (ulong)(user.free_cash + user.pay_cash); return resp.ToJson(); @@ -74,7 +73,6 @@ namespace Server.Service public class NicknameChangeReq : Req { - public string uuid; public string newNickname; public override bool IsReceivedAllField() { diff --git a/Server/Service/Test.cs b/Server/Service/Test.cs index 7fc6bfd..440224a 100644 --- a/Server/Service/Test.cs +++ b/Server/Service/Test.cs @@ -33,6 +33,8 @@ namespace Server.Service { public override bool IsReceivedAllField() { + if(uuid == string.Empty) + return false; return true; } } diff --git a/Server/Service/UpdateStory.cs b/Server/Service/UpdateStory.cs new file mode 100644 index 0000000..651fdb2 --- /dev/null +++ b/Server/Service/UpdateStory.cs @@ -0,0 +1,57 @@ +using Server.System; +using Newtonsoft.Json; + +namespace Server.Service +{ + public class UpdateStory : AbstractService + { + private UpdateStoryReq req; + public override string Process() + { + return makeResp(); + } + + public override Protocol ProtocolValue() => Protocol.UpdateStory; + + public override Req Requst(string json) + { + if (req.is_clear) + { + //클리어 + } + else + { + //클리어 실패 로그용 + } + req = JsonConvert.DeserializeObject(json); + return req; + } + + private string makeResp() + { + UpdateStoryResp resp = new UpdateStoryResp(); + resp.status = 200; + return resp.ToJson(); + } + + + } + + public class UpdateStoryReq : Req + { + public long story_id; + public long chapter_id; + public bool is_clear; + public override bool IsReceivedAllField() + { + if(uuid == string.Empty || story_id == 0 || chapter_id == 0) + return false; + return true; + } + } + + public class UpdateStoryResp : Resp + { + + } +} diff --git a/Server/Service/UseItem.cs b/Server/Service/UseItem.cs index 91c08b1..d9c90ee 100644 --- a/Server/Service/UseItem.cs +++ b/Server/Service/UseItem.cs @@ -22,7 +22,6 @@ namespace Server.Service private string makeResp() { UseItemResp resp = new UseItemResp(); - resp.status = 200; return resp.ToJson(); } @@ -33,6 +32,8 @@ namespace Server.Service { public override bool IsReceivedAllField() { + if(uuid == string.Empty) + return false; return true; } } diff --git a/Server/System/Abstract.cs b/Server/System/Abstract.cs index 50bab26..eb05df7 100644 --- a/Server/System/Abstract.cs +++ b/Server/System/Abstract.cs @@ -18,6 +18,7 @@ namespace Server.System { public Protocol cmd; + public string uuid; public virtual bool IsReceivedAllField() { return true; @@ -29,7 +30,7 @@ namespace Server.System /// public abstract class Resp { - public int status; + public int status = 200; public virtual string ToJson() { return JsonConvert.SerializeObject(this); diff --git a/Server/System/Enums.cs b/Server/System/Enums.cs index 76dcd05..670ab47 100644 --- a/Server/System/Enums.cs +++ b/Server/System/Enums.cs @@ -18,11 +18,11 @@ //300~399 상점 관련 프로토콜 BuyShopItem = 300,//상점 아이템 구매 - BuyShopGacha = 301,//가챠 아이탬 사용 - UseItem = 302,//소모품 사용 + BuyShopGacha = 301,//가챠 아이탬 사용(보류) + UseItem = 302,//소모품 사용(보류) //400~499 스토리 관련 프로토콜 - //유저의 스토리 진행 상황을 저장시킬 프로토콜 추가 + UpdateStory = 400,//유저의 스토리 진행 상황 저장 //id, userid, story, chapter }