This commit is contained in:
김판돌 2024-03-30 00:47:02 +09:00
commit 654c643b08
21 changed files with 86 additions and 33 deletions

View File

@ -1,5 +1,6 @@
using NLog; using NLog;
using Server.SQL; using Server.SQL;
using Server.SQL.Excel;
using Server.System; using Server.System;
namespace Server.Manager namespace Server.Manager

View File

@ -1,7 +1,7 @@
using Server.Git; using Server.Git;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class ConsumableItemData public class ConsumableItemData
{ {
@ -36,7 +36,7 @@ namespace Server.SQL
} }
public void init(Sheet data) public void init(Sheet data)
{ {
this.consumableItemData = new Dictionary<long, ConsumableItemData>(); consumableItemData = new Dictionary<long, ConsumableItemData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
ConsumableItemData consumableItemData = new ConsumableItemData(); ConsumableItemData consumableItemData = new ConsumableItemData();

View File

@ -1,7 +1,7 @@
using Server.Git; using Server.Git;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class EquipmentData public class EquipmentData
{ {
@ -27,7 +27,7 @@ namespace Server.SQL
} }
public void init(Sheet data) public void init(Sheet data)
{ {
this.equipmentData = new Dictionary<long, EquipmentData>(); equipmentData = new Dictionary<long, EquipmentData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
EquipmentData equipmentData = new EquipmentData(); EquipmentData equipmentData = new EquipmentData();

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class RandomRewardData public class RandomRewardData
{ {
@ -46,7 +46,7 @@ namespace Server.SQL
public void init(Sheet data) public void init(Sheet data)
{ {
this.randomRewardData = new Dictionary<long, RandomRewardData>(); randomRewardData = new Dictionary<long, RandomRewardData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
RandomRewardData randomRewardData = new RandomRewardData(); RandomRewardData randomRewardData = new RandomRewardData();

View File

@ -1,7 +1,7 @@
using Server.Git; using Server.Git;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class ResetShopItemData public class ResetShopItemData
{ {
@ -32,7 +32,7 @@ namespace Server.SQL
} }
public void init(Sheet data) public void init(Sheet data)
{ {
this.resetShopItemData = new Dictionary<long, ResetShopItemData>(); resetShopItemData = new Dictionary<long, ResetShopItemData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
ResetShopItemData resetShopItemData = new ResetShopItemData(); ResetShopItemData resetShopItemData = new ResetShopItemData();

View File

@ -1,7 +1,7 @@
using Server.Git; using Server.Git;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class RewardData public class RewardData
{ {
@ -40,7 +40,7 @@ namespace Server.SQL
} }
public void init(Sheet data) public void init(Sheet data)
{ {
this.rewardData = new Dictionary<long, RewardData>(); rewardData = new Dictionary<long, RewardData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
RewardData rewardData = new RewardData(); RewardData rewardData = new RewardData();

View File

@ -1,7 +1,7 @@
using Server.Git; using Server.Git;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Server.SQL namespace Server.SQL.Excel
{ {
public class ShopItemData public class ShopItemData
{ {
@ -37,7 +37,7 @@ namespace Server.SQL
} }
public void init(Sheet data) public void init(Sheet data)
{ {
this.shopItemData = new Dictionary<long, ShopItemData>(); shopItemData = new Dictionary<long, ShopItemData>();
foreach (var item in data.dicViewer) foreach (var item in data.dicViewer)
{ {
ShopItemData shopItemData = new ShopItemData(); ShopItemData shopItemData = new ShopItemData();

View File

@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json; using Newtonsoft.Json;
using Server.SQL.Excel;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Server.SQL namespace Server.SQL

View File

@ -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();
} }

View File

@ -4,6 +4,7 @@ using Server.SQL;
using Server.Manager; using Server.Manager;
using NLog; using NLog;
using System.Diagnostics; using System.Diagnostics;
using Server.SQL.Excel;
namespace Server.Service namespace Server.Service
{ {
@ -121,7 +122,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 +136,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()

View File

@ -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()

View File

@ -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();
} }

View File

@ -1,6 +1,7 @@
using Server.System; using Server.System;
using Newtonsoft.Json; using Newtonsoft.Json;
using Server.SQL; using Server.SQL;
using Server.SQL.Excel;
namespace Server.Service namespace Server.Service
{ {
@ -131,7 +132,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 +141,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;

View File

@ -4,6 +4,7 @@ using Server.SQL;
using Server.Manager; using Server.Manager;
using Microsoft.AspNetCore.DataProtection.KeyManagement; using Microsoft.AspNetCore.DataProtection.KeyManagement;
using System.Collections.Generic; using System.Collections.Generic;
using Server.SQL.Excel;
namespace Server.Service namespace Server.Service
{ {
@ -285,7 +286,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)

View File

@ -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()
{ {

View File

@ -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;
} }
} }

View File

@ -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
{
}
}

View File

@ -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;
} }
} }

View File

@ -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);

View File

@ -4,9 +4,6 @@
Test = 0, Test = 0,
AddUser = 1, AddUser = 1,
//100~199 로그인이나 시스템과 연관된 프로토콜 //100~199 로그인이나 시스템과 연관된 프로토콜
Downlode = 100,//기획 데이터 다운로드 Downlode = 100,//기획 데이터 다운로드
Login = 101,//로그인 유저정보 요청 Login = 101,//로그인 유저정보 요청
@ -18,12 +15,12 @@
//300~399 상점 관련 프로토콜 //300~399 상점 관련 프로토콜
BuyShopItem = 300,//상점 아이템 구매 BuyShopItem = 300,//상점 아이템 구매
BuyShopGacha = 301,//가챠 아이탬 사용 BuyShopGacha = 301,//가챠 아이탬 사용(보류)
UseItem = 302,//소모품 사용 UseItem = 302,//소모품 사용(보류)
BuyItem = 303,//아이탬 판매(보류)
//400~499 스토리 관련 프로토콜 //400~499 스토리 관련 프로토콜
//유저의 스토리 진행 상황을 저장시킬 프로토콜 추가 UpdateStory = 400,//유저의 스토리 진행 상황 저장(작업 중)
//id, userid, story, chapter
} }
public enum Error public enum Error

View File

@ -1,4 +1,5 @@
using Server.SQL; using Server.SQL;
using Server.SQL.Excel;
namespace Server.System namespace Server.System
{ {