로그인 버그 수정
This commit is contained in:
parent
636c070d2b
commit
80ba7b83f5
|
|
@ -84,6 +84,14 @@ namespace Server.Manager
|
|||
}
|
||||
}
|
||||
|
||||
public void addUnit(long unitDataId)
|
||||
{
|
||||
DeckUnitInfo deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = unitDataId;
|
||||
box.Add(deckUnitInfo);
|
||||
}
|
||||
|
||||
//리워드 아이탬 획득 코드 작성
|
||||
//패키지 구매시 패키지를 전부 풀어서 아이탬을 획득하는 코드 작성
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using Server.System;
|
||||
using Newtonsoft.Json;
|
||||
using Server.SQL;
|
||||
using Server.Manager;
|
||||
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
|
|
@ -16,9 +18,8 @@ namespace Server.Service
|
|||
User user;
|
||||
#region 로그인
|
||||
List<DynamicData> dynamicDataList = Statics.dynamicDataSQL.Select();
|
||||
List<DeckUnitInfo> deckUnitInfoList = null;
|
||||
List<DeckInfo> deckInfoList = null;
|
||||
List<Equipment> equipmentList = null;
|
||||
ItemManager itemManager = null;
|
||||
if (req.uuid == "")
|
||||
{
|
||||
//최초 메일 로그인
|
||||
|
|
@ -27,19 +28,20 @@ namespace Server.Service
|
|||
|
||||
if (user != null)
|
||||
{
|
||||
deckUnitInfoList = Statics.deckUnitInfoSQL.SelectUid(user.id);
|
||||
deckInfoList = Statics.deckInfoSQL.SelectUid(user.id);
|
||||
equipmentList = Statics.equipmentrSQL.SelectUid(user.id);
|
||||
itemManager = new ItemManager(user);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//기존 유저 로그인
|
||||
user = Statics.userSQL.SelectUuid(req.uuid);
|
||||
|
||||
deckUnitInfoList = Statics.deckUnitInfoSQL.SelectUid(user.id);
|
||||
if (user == null)
|
||||
{
|
||||
throw new RuntimeException("Not User", Error.nodata);
|
||||
}
|
||||
deckInfoList = Statics.deckInfoSQL.SelectUid(user.id);
|
||||
equipmentList = Statics.equipmentrSQL.SelectUid(user.id);
|
||||
itemManager = new ItemManager(user);
|
||||
}
|
||||
if(user == null)
|
||||
{
|
||||
|
|
@ -53,67 +55,36 @@ namespace Server.Service
|
|||
user.uuid = Guid.NewGuid().ToString();
|
||||
user.nickname = Statics.dynamicDataSQL.SelectName("defaultNick").value;
|
||||
Statics.userSQL.Insert(user); //저장하고 유닛의 id를 얻어오기 위함.
|
||||
itemManager = new ItemManager(user);
|
||||
#endregion
|
||||
#region 초기 유닛 지급
|
||||
deckUnitInfoList = new List<DeckUnitInfo>();
|
||||
DeckUnitInfo deckUnitInfo;
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100001;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100002;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100003;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100004;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100005;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100006;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100007;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100008;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
deckUnitInfo = new DeckUnitInfo();
|
||||
deckUnitInfo.user_id = user.id;
|
||||
deckUnitInfo.unit_data_id = 100009;
|
||||
deckUnitInfoList.Add(deckUnitInfo);
|
||||
Statics.deckUnitInfoSQL.Insert(deckUnitInfoList);
|
||||
itemManager.addUnit(100001);
|
||||
itemManager.addUnit(100002);
|
||||
itemManager.addUnit(100003);
|
||||
itemManager.addUnit(100004);
|
||||
itemManager.addUnit(100005);
|
||||
itemManager.addUnit(100006);
|
||||
itemManager.addUnit(100007);
|
||||
itemManager.addUnit(100008);
|
||||
itemManager.addUnit(100009);
|
||||
itemManager.box.SaveSQL();
|
||||
#endregion
|
||||
#region 신규 덱 추가
|
||||
deckInfoList = new List<DeckInfo>();
|
||||
DeckInfo deckInfo;
|
||||
deckInfo = new DeckInfo();
|
||||
deckInfo.user_id= user.id;
|
||||
deckInfo.deck_type = 1;
|
||||
deckInfo.deck_unit0_id = deckUnitInfoList[0].id;
|
||||
deckInfo.deck_unit1_id = deckUnitInfoList[1].id;
|
||||
deckInfo.deck_unit2_id = deckUnitInfoList[2].id;
|
||||
deckInfo.deck_unit3_id = deckUnitInfoList[3].id;
|
||||
deckInfo.deck_unit4_id = deckUnitInfoList[4].id;
|
||||
deckInfo.deck_unit5_id = deckUnitInfoList[5].id;
|
||||
deckInfo.deck_unit6_id = deckUnitInfoList[6].id;
|
||||
deckInfo.deck_unit7_id = deckUnitInfoList[7].id;
|
||||
deckInfo.deck_unit8_id = deckUnitInfoList[8].id;
|
||||
deckInfoList.Add(deckInfo);
|
||||
Statics.deckInfoSQL.Insert(deckInfoList);
|
||||
|
||||
equipmentList = new List<Equipment>();
|
||||
deckInfo.deck_unit0_id = itemManager.box.deckUnitInfo[0].id;
|
||||
deckInfo.deck_unit1_id = itemManager.box.deckUnitInfo[1].id;
|
||||
deckInfo.deck_unit2_id = itemManager.box.deckUnitInfo[2].id;
|
||||
deckInfo.deck_unit3_id = itemManager.box.deckUnitInfo[3].id;
|
||||
deckInfo.deck_unit4_id = itemManager.box.deckUnitInfo[4].id;
|
||||
deckInfo.deck_unit5_id = itemManager.box.deckUnitInfo[5].id;
|
||||
deckInfo.deck_unit6_id = itemManager.box.deckUnitInfo[6].id;
|
||||
deckInfo.deck_unit7_id = itemManager.box.deckUnitInfo[7].id;
|
||||
deckInfo.deck_unit8_id = itemManager.box.deckUnitInfo[8].id;
|
||||
Statics.deckInfoSQL.Insert(deckInfo);
|
||||
deckInfoList = new List<DeckInfo> { deckInfo };
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
|
@ -122,7 +93,7 @@ namespace Server.Service
|
|||
//List<ShopItemData> shopItemDatas = Statics.shopItemExcel.getShopItemData();
|
||||
//#endregion
|
||||
|
||||
return makeResp(user, dynamicDataList, deckUnitInfoList, deckInfoList, equipmentList);
|
||||
return makeResp(user, dynamicDataList, deckInfoList, itemManager);
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.Login;
|
||||
|
|
@ -133,7 +104,7 @@ namespace Server.Service
|
|||
return req;
|
||||
}
|
||||
|
||||
private string makeResp(User user, List<DynamicData> dynamic_data, List<DeckUnitInfo> deck_unit, List<DeckInfo> deck_info, List<Equipment> equipment)
|
||||
private string makeResp(User user, List<DynamicData> dynamic_data, List<DeckInfo> deck_info, ItemManager itemManager)
|
||||
{
|
||||
LoginResp resp = new LoginResp();
|
||||
resp.nickname = user.nickname;
|
||||
|
|
@ -141,9 +112,11 @@ namespace Server.Service
|
|||
resp.gold = (ulong)user.gold;
|
||||
resp.cash = (ulong)(user.free_cash + user.pay_cash);
|
||||
resp.dynamic_data = dynamic_data;
|
||||
resp.deck_unit = deck_unit;
|
||||
resp.deck_unit = itemManager.box.deckUnitInfo;
|
||||
resp.deck_info = deck_info;
|
||||
resp.equipment = equipment;
|
||||
resp.equipment = itemManager.box.equipment;
|
||||
resp.consumableItem = itemManager.box.consumableItem;
|
||||
resp.etcItem = itemManager.box.etcItem;
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
|
@ -173,5 +146,7 @@ namespace Server.Service
|
|||
public List<DeckUnitInfo> deck_unit;
|
||||
public List<DeckInfo> deck_info;
|
||||
public List<Equipment> equipment;
|
||||
public List<ConsumableItem> consumableItem;
|
||||
public List<EtcItem> etcItem;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue