req uuid추가
This commit is contained in:
parent
ec87da508f
commit
9baf15f9d9
|
|
@ -22,7 +22,6 @@ namespace Server.Service
|
||||||
private string makeResp()
|
private string makeResp()
|
||||||
{
|
{
|
||||||
BuyShopGachaResp resp = new BuyShopGachaResp();
|
BuyShopGachaResp resp = new BuyShopGachaResp();
|
||||||
resp.status = 200;
|
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ namespace Server.Service
|
||||||
private string makeResp(User user, ItemManager itemManager)
|
private string makeResp(User user, ItemManager itemManager)
|
||||||
{
|
{
|
||||||
BuyShopItemResp resp = new BuyShopItemResp();
|
BuyShopItemResp resp = new BuyShopItemResp();
|
||||||
resp.status = 200;
|
|
||||||
resp.gold = user.gold;
|
resp.gold = user.gold;
|
||||||
resp.cash = user.free_cash + user.pay_cash;
|
resp.cash = user.free_cash + user.pay_cash;
|
||||||
resp.deck_unit = itemManager.box.addDeckUnitInfo;
|
resp.deck_unit = itemManager.box.addDeckUnitInfo;
|
||||||
|
|
@ -136,7 +135,6 @@ namespace Server.Service
|
||||||
|
|
||||||
public class BuyShopItemReq : Req
|
public class BuyShopItemReq : Req
|
||||||
{
|
{
|
||||||
public string uuid;
|
|
||||||
public long shopItemIndex;
|
public long shopItemIndex;
|
||||||
public long reset_id;
|
public long reset_id;
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ namespace Server.Service
|
||||||
private string makeResp(DeckInfo changeDeck)
|
private string makeResp(DeckInfo changeDeck)
|
||||||
{
|
{
|
||||||
DeckChangeResp resp = new DeckChangeResp();
|
DeckChangeResp resp = new DeckChangeResp();
|
||||||
resp.status = 200;
|
|
||||||
resp.deck_info = changeDeck;
|
resp.deck_info = changeDeck;
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +94,6 @@ namespace Server.Service
|
||||||
|
|
||||||
public class DeckChangeReq : Req
|
public class DeckChangeReq : Req
|
||||||
{
|
{
|
||||||
public string uuid;
|
|
||||||
public long deck_id;
|
public long deck_id;
|
||||||
public long[] deck_unit;
|
public long[] deck_unit;
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ namespace Server.Service
|
||||||
DownlodeResp resp = new DownlodeResp();
|
DownlodeResp resp = new DownlodeResp();
|
||||||
resp.data = data;
|
resp.data = data;
|
||||||
resp.version = ProtocolProcessor.version;
|
resp.version = ProtocolProcessor.version;
|
||||||
resp.status = 200;
|
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
SaveSQL();
|
SaveSQL();
|
||||||
EquipChangeResp resp = new EquipChangeResp();
|
EquipChangeResp resp = new EquipChangeResp();
|
||||||
resp.status = 200;
|
|
||||||
resp.equipment = equipment;
|
resp.equipment = equipment;
|
||||||
resp.deck_unit_info = deck_unit_info;
|
resp.deck_unit_info = deck_unit_info;
|
||||||
resp.change_equipment = change_equipment;
|
resp.change_equipment = change_equipment;
|
||||||
|
|
@ -141,7 +140,6 @@ namespace Server.Service
|
||||||
|
|
||||||
public class EquipChangeReq : Req
|
public class EquipChangeReq : Req
|
||||||
{
|
{
|
||||||
public string uuid;
|
|
||||||
public long unit_id;
|
public long unit_id;
|
||||||
public long equipment_id;
|
public long equipment_id;
|
||||||
public bool is_equipment;
|
public bool is_equipment;
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,6 @@ namespace Server.Service
|
||||||
public class LoginReq : Req
|
public class LoginReq : Req
|
||||||
{
|
{
|
||||||
public string mail;
|
public string mail;
|
||||||
public string uuid;
|
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
if(mail == null && uuid == null)
|
if(mail == null && uuid == null)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
SaveSQL();
|
SaveSQL();
|
||||||
NicknameChangeResp resp = new NicknameChangeResp();
|
NicknameChangeResp resp = new NicknameChangeResp();
|
||||||
resp.status = 200;
|
|
||||||
resp.nickname = user.nickname;
|
resp.nickname = user.nickname;
|
||||||
resp.cash = (ulong)(user.free_cash + user.pay_cash);
|
resp.cash = (ulong)(user.free_cash + user.pay_cash);
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
|
|
@ -74,7 +73,6 @@ namespace Server.Service
|
||||||
|
|
||||||
public class NicknameChangeReq : Req
|
public class NicknameChangeReq : Req
|
||||||
{
|
{
|
||||||
public string uuid;
|
|
||||||
public string newNickname;
|
public string newNickname;
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
|
if(uuid == string.Empty)
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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<UpdateStoryReq>(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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -22,7 +22,6 @@ namespace Server.Service
|
||||||
private string makeResp()
|
private string makeResp()
|
||||||
{
|
{
|
||||||
UseItemResp resp = new UseItemResp();
|
UseItemResp resp = new UseItemResp();
|
||||||
resp.status = 200;
|
|
||||||
return resp.ToJson();
|
return resp.ToJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,6 +32,8 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
public override bool IsReceivedAllField()
|
public override bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
|
if(uuid == string.Empty)
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ namespace Server.System
|
||||||
{
|
{
|
||||||
public Protocol cmd;
|
public Protocol cmd;
|
||||||
|
|
||||||
|
public string uuid;
|
||||||
public virtual bool IsReceivedAllField()
|
public virtual bool IsReceivedAllField()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -29,7 +30,7 @@ namespace Server.System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class Resp
|
public abstract class Resp
|
||||||
{
|
{
|
||||||
public int status;
|
public int status = 200;
|
||||||
public virtual string ToJson()
|
public virtual string ToJson()
|
||||||
{
|
{
|
||||||
return JsonConvert.SerializeObject(this);
|
return JsonConvert.SerializeObject(this);
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@
|
||||||
|
|
||||||
//300~399 상점 관련 프로토콜
|
//300~399 상점 관련 프로토콜
|
||||||
BuyShopItem = 300,//상점 아이템 구매
|
BuyShopItem = 300,//상점 아이템 구매
|
||||||
BuyShopGacha = 301,//가챠 아이탬 사용
|
BuyShopGacha = 301,//가챠 아이탬 사용(보류)
|
||||||
UseItem = 302,//소모품 사용
|
UseItem = 302,//소모품 사용(보류)
|
||||||
|
|
||||||
//400~499 스토리 관련 프로토콜
|
//400~499 스토리 관련 프로토콜
|
||||||
//유저의 스토리 진행 상황을 저장시킬 프로토콜 추가
|
UpdateStory = 400,//유저의 스토리 진행 상황 저장
|
||||||
//id, userid, story, chapter
|
//id, userid, story, chapter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue