초기화 수정
This commit is contained in:
parent
8083bb196e
commit
9d9ffa3309
|
|
@ -572,14 +572,14 @@ handlers.Save_Init = function(args)
|
|||
if (error < 0) return Get_Return(error);
|
||||
|
||||
let add_farmshop = null;
|
||||
let isInit = false;
|
||||
var table = Get_MissionTable();
|
||||
var itemtable = Get_ItemTable();
|
||||
var urod = Get_JsonUserData(readonlydata);
|
||||
var dayofyear = Get_DayOfYear();
|
||||
let isInitDaily = false;
|
||||
if (urod.Common[3] != dayofyear)
|
||||
{ // 일일 초기화
|
||||
isInit = true;
|
||||
isInitDaily = true;
|
||||
|
||||
urod.Common[3] = dayofyear;
|
||||
add_farmshop = Get_UniqueFarmShopList(Get_FarmShopTable(), 8);
|
||||
|
|
@ -598,30 +598,37 @@ handlers.Save_Init = function(args)
|
|||
Init_Shop(urod, 1);
|
||||
}
|
||||
|
||||
let isInitWeek = false;
|
||||
var weekofyear = Get_WeekOfYear();
|
||||
if (urod.Common[4] != weekofyear)
|
||||
{ // 주간 초기화
|
||||
isInit = true;
|
||||
isInitWeek = true;
|
||||
|
||||
urod.Common[4] = weekofyear;
|
||||
Init_Mission(table, urod, 2);
|
||||
Init_Shop(urod, 2);
|
||||
}
|
||||
|
||||
let isInitMonth = false;
|
||||
var curTime = Get_CurKoreaTime();
|
||||
var month = curTime.getMonth() + 1;
|
||||
if (urod.Common[5] != month)
|
||||
{ // 월간 초기화
|
||||
isInit = true;
|
||||
isInitMonth = true;
|
||||
|
||||
urod.Common[5] = month;
|
||||
Init_Shop(urod, 3);
|
||||
}
|
||||
|
||||
if (isInit)
|
||||
if (isInitDaily || isInitWeek || isInitMonth)
|
||||
{
|
||||
Set_JsonUserData(urod);
|
||||
return Get_Return(0, { farmshop: add_farmshop ?? [] });
|
||||
return Get_Return(0, {
|
||||
initDaily : isInitDaily,
|
||||
initWeek : isInitWeek,
|
||||
initMonth : isInitMonth,
|
||||
farmshop: add_farmshop ?? []
|
||||
});
|
||||
}
|
||||
return Get_Return(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,12 +141,19 @@ public class StageDropData
|
|||
{
|
||||
public ObscuredUInt GetExp;
|
||||
Dictionary<int, ObscuredInt> Item = new Dictionary<int, ObscuredInt>();
|
||||
public ObscuredDouble UseGold;
|
||||
Dictionary<eMainStatType, ObscuredInt> AddMainStat = new Dictionary<eMainStatType, ObscuredInt>
|
||||
{ { eMainStatType.STR, 0 }, { eMainStatType.DEX, 0 }, { eMainStatType.INT, 0 } };
|
||||
|
||||
public void Init()
|
||||
{
|
||||
GetExp = 0;
|
||||
GetExp.RandomizeCryptoKey();
|
||||
GetExp = 0; GetExp.RandomizeCryptoKey();
|
||||
Item.Clear();
|
||||
|
||||
UseGold = 0; UseGold.RandomizeCryptoKey();
|
||||
AddMainStat[eMainStatType.STR] = 0; AddMainStat[eMainStatType.STR].RandomizeCryptoKey();
|
||||
AddMainStat[eMainStatType.DEX] = 0; AddMainStat[eMainStatType.DEX].RandomizeCryptoKey();
|
||||
AddMainStat[eMainStatType.INT] = 0; AddMainStat[eMainStatType.INT].RandomizeCryptoKey();
|
||||
}
|
||||
|
||||
public void Add_Item(int itemid, int count)
|
||||
|
|
@ -156,4 +163,10 @@ public class StageDropData
|
|||
Item[itemid].RandomizeCryptoKey();
|
||||
}
|
||||
public Dictionary<int, ObscuredInt> Get_Item() { return Item; }
|
||||
|
||||
public void Add_MainStat(eMainStatType stat, int gold)
|
||||
{
|
||||
UseGold += gold; UseGold.RandomizeCryptoKey();
|
||||
++AddMainStat[stat]; AddMainStat[stat].RandomizeCryptoKey();
|
||||
}
|
||||
}
|
||||
|
|
@ -3003,6 +3003,7 @@ public class SC_GetUserInfoResult
|
|||
public class SC_InitResult
|
||||
{
|
||||
public int error;
|
||||
public bool initDaily, initWeek, initMonth;
|
||||
public List<List<int>> farmshop;
|
||||
}
|
||||
public class SC_Items
|
||||
|
|
|
|||
|
|
@ -76,13 +76,14 @@ public class MainStatLvUpCard : CardBase
|
|||
else
|
||||
{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
if (sdata.Check_ItemAmount(2, Get_Price()))
|
||||
if (sdata.Check_ItemAmount(2, price))
|
||||
{
|
||||
sdata.Use_Item(2, price);
|
||||
sdata.MapData_Add_StatLv(curmap.n_MapID, curmap.n_Difficult, m_Data.mainStatType);
|
||||
Set_UI();
|
||||
Set_Price();
|
||||
|
||||
DropItemInfo.Ins.m_StageDropData.Add_MainStat(m_Data.mainStatType, price);
|
||||
if (MyInfoUI.isIns) MyInfoUI.Ins.Set_MainStats();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,18 +65,9 @@ public class DataCheckMgr : MyCoroutine
|
|||
{
|
||||
checkinit = false;
|
||||
callinit = false;
|
||||
switch (result.error)
|
||||
{
|
||||
case 0:
|
||||
sdata.Init_Daily(result.farmshop);
|
||||
break;
|
||||
case 1:
|
||||
sdata.Init_Week(SamplesCalendar.Get_WeekOfYear(ServerInfo.ServerTime));
|
||||
break;
|
||||
case 2:
|
||||
sdata.Init_Month();
|
||||
break;
|
||||
}
|
||||
if (result.initDaily) sdata.Init_Daily(result.farmshop);
|
||||
if (result.initWeek) sdata.Init_Week(SamplesCalendar.Get_WeekOfYear(ServerInfo.ServerTime));
|
||||
if (result.initMonth) sdata.Init_Month();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue