Merge branch 'main' of https://gitea.pandoli365.com/Team.thewar/thewar_server
This commit is contained in:
commit
654c643b08
|
|
@ -1,5 +1,6 @@
|
|||
using NLog;
|
||||
using Server.SQL;
|
||||
using Server.SQL.Excel;
|
||||
using Server.System;
|
||||
|
||||
namespace Server.Manager
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using Server.Git;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class ConsumableItemData
|
||||
public class ConsumableItemData
|
||||
{
|
||||
[Key]
|
||||
public long index { get; set; }
|
||||
|
|
@ -36,7 +36,7 @@ namespace Server.SQL
|
|||
}
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.consumableItemData = new Dictionary<long, ConsumableItemData>();
|
||||
consumableItemData = new Dictionary<long, ConsumableItemData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
ConsumableItemData consumableItemData = new ConsumableItemData();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using Server.Git;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class EquipmentData
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@ namespace Server.SQL
|
|||
}
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.equipmentData = new Dictionary<long, EquipmentData>();
|
||||
equipmentData = new Dictionary<long, EquipmentData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
EquipmentData equipmentData = new EquipmentData();
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class RandomRewardData
|
||||
{
|
||||
|
|
@ -46,7 +46,7 @@ namespace Server.SQL
|
|||
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.randomRewardData = new Dictionary<long, RandomRewardData>();
|
||||
randomRewardData = new Dictionary<long, RandomRewardData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
RandomRewardData randomRewardData = new RandomRewardData();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using Server.Git;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class ResetShopItemData
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@ namespace Server.SQL
|
|||
}
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.resetShopItemData = new Dictionary<long, ResetShopItemData>();
|
||||
resetShopItemData = new Dictionary<long, ResetShopItemData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
ResetShopItemData resetShopItemData = new ResetShopItemData();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using Server.Git;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class RewardData
|
||||
{
|
||||
|
|
@ -40,7 +40,7 @@ namespace Server.SQL
|
|||
}
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.rewardData = new Dictionary<long, RewardData>();
|
||||
rewardData = new Dictionary<long, RewardData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
RewardData rewardData = new RewardData();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using Server.Git;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Server.SQL
|
||||
namespace Server.SQL.Excel
|
||||
{
|
||||
public class ShopItemData
|
||||
{
|
||||
|
|
@ -37,7 +37,7 @@ namespace Server.SQL
|
|||
}
|
||||
public void init(Sheet data)
|
||||
{
|
||||
this.shopItemData = new Dictionary<long, ShopItemData>();
|
||||
shopItemData = new Dictionary<long, ShopItemData>();
|
||||
foreach (var item in data.dicViewer)
|
||||
{
|
||||
ShopItemData shopItemData = new ShopItemData();
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using Server.SQL.Excel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Server.SQL
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ namespace Server.Service
|
|||
private string makeResp()
|
||||
{
|
||||
BuyShopGachaResp resp = new BuyShopGachaResp();
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Server.SQL;
|
|||
using Server.Manager;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using Server.SQL.Excel;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
|
|
@ -121,7 +122,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 +136,6 @@ namespace Server.Service
|
|||
|
||||
public class BuyShopItemReq : Req
|
||||
{
|
||||
public string uuid;
|
||||
public long shopItemIndex;
|
||||
public long reset_id;
|
||||
public override bool IsReceivedAllField()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ namespace Server.Service
|
|||
DownlodeResp resp = new DownlodeResp();
|
||||
resp.data = data;
|
||||
resp.version = ProtocolProcessor.version;
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Server.System;
|
||||
using Newtonsoft.Json;
|
||||
using Server.SQL;
|
||||
using Server.SQL.Excel;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
|
|
@ -131,7 +132,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 +141,6 @@ namespace Server.Service
|
|||
|
||||
public class EquipChangeReq : Req
|
||||
{
|
||||
public string uuid;
|
||||
public long unit_id;
|
||||
public long equipment_id;
|
||||
public bool is_equipment;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Server.SQL;
|
|||
using Server.Manager;
|
||||
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||
using System.Collections.Generic;
|
||||
using Server.SQL.Excel;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
|
|
@ -285,7 +286,6 @@ namespace Server.Service
|
|||
public class LoginReq : Req
|
||||
{
|
||||
public string mail;
|
||||
public string uuid;
|
||||
public override bool IsReceivedAllField()
|
||||
{
|
||||
if(mail == null && uuid == null)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ namespace Server.Service
|
|||
{
|
||||
public override bool IsReceivedAllField()
|
||||
{
|
||||
if(uuid == string.Empty)
|
||||
return false;
|
||||
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()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
|||
/// </summary>
|
||||
public abstract class Resp
|
||||
{
|
||||
public int status;
|
||||
public int status = 200;
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this);
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
Test = 0,
|
||||
AddUser = 1,
|
||||
|
||||
|
||||
|
||||
|
||||
//100~199 로그인이나 시스템과 연관된 프로토콜
|
||||
Downlode = 100,//기획 데이터 다운로드
|
||||
Login = 101,//로그인 유저정보 요청
|
||||
|
|
@ -18,12 +15,12 @@
|
|||
|
||||
//300~399 상점 관련 프로토콜
|
||||
BuyShopItem = 300,//상점 아이템 구매
|
||||
BuyShopGacha = 301,//가챠 아이탬 사용
|
||||
UseItem = 302,//소모품 사용
|
||||
BuyShopGacha = 301,//가챠 아이탬 사용(보류)
|
||||
UseItem = 302,//소모품 사용(보류)
|
||||
BuyItem = 303,//아이탬 판매(보류)
|
||||
|
||||
//400~499 스토리 관련 프로토콜
|
||||
//유저의 스토리 진행 상황을 저장시킬 프로토콜 추가
|
||||
//id, userid, story, chapter
|
||||
UpdateStory = 400,//유저의 스토리 진행 상황 저장(작업 중)
|
||||
}
|
||||
|
||||
public enum Error
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Server.SQL;
|
||||
using Server.SQL.Excel;
|
||||
|
||||
namespace Server.System
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue