로그인 신규유저 여부 확인 및 유닛 count추가

This commit is contained in:
김판돌 2024-03-09 19:23:19 +09:00
parent 09eb956650
commit 453775ea9a
2 changed files with 9 additions and 8 deletions

View File

@ -80,6 +80,7 @@ namespace Server.Manager
{
DeckUnitInfo deckUnitInfo = new DeckUnitInfo();
deckUnitInfo.user_id = user.id;
deckUnitInfo.count = 1;
deckUnitInfo.unit_data_id = unitDataId;
box.Add(deckUnitInfo);
}

View File

@ -16,6 +16,7 @@ namespace Server.Service
{
User user;
bool newUser = false;
#region
List<DynamicData> dynamicDataList = Statics.dynamicDataSQL.Select();
List<DeckInfo> deckInfoList = null;
@ -50,6 +51,7 @@ namespace Server.Service
throw new RuntimeException("Not User", Error.nodata);
}
#region
newUser = true;
user = new User();
user.mail = req.mail;
user.uuid = Guid.NewGuid().ToString();
@ -89,11 +91,7 @@ namespace Server.Service
}
#endregion
//#region 상점 아이템
//List<ShopItemData> shopItemDatas = Statics.shopItemExcel.getShopItemData();
//#endregion
return makeResp(user, dynamicDataList, deckInfoList, itemManager);
return makeResp(user, dynamicDataList, deckInfoList, itemManager, newUser);
}
public override Protocol ProtocolValue() => Protocol.Login;
@ -104,16 +102,17 @@ namespace Server.Service
return req;
}
private string makeResp(User user, List<DynamicData> dynamic_data, List<DeckInfo> deck_info, ItemManager itemManager)
private string makeResp(User user, List<DynamicData> dynamicData, List<DeckInfo> deckInfo, ItemManager itemManager, bool newUser)
{
LoginResp resp = new LoginResp();
resp.nickname = user.nickname;
resp.uuid = user.uuid;
resp.gold = (ulong)user.gold;
resp.cash = (ulong)(user.free_cash + user.pay_cash);
resp.dynamic_data = dynamic_data;
resp.new_user = newUser;
resp.dynamic_data = dynamicData;
resp.deck_unit = itemManager.box.deckUnitInfo;
resp.deck_info = deck_info;
resp.deck_info = deckInfo;
resp.equipment = itemManager.box.equipment;
resp.consumableItem = itemManager.box.consumableItem;
resp.etcItem = itemManager.box.etcItem;
@ -142,6 +141,7 @@ namespace Server.Service
public string nickname;
public ulong gold;
public ulong cash;
public bool new_user;
public List<DynamicData> dynamic_data;
public List<DeckUnitInfo> deck_unit;
public List<DeckInfo> deck_info;