서버 뽑기 작업 중...
This commit is contained in:
parent
c543d6cb79
commit
088b9012e8
|
|
@ -20,6 +20,7 @@ public class GetServerTables
|
||||||
Get_ServerTable("PetList", new List<string> { "e_AttackType", "n_DefaultATK", "n_DefaultDEF", "n_DefaultM_DEF", "n_DefaultHP", "f_PetStatRate", "f_AttackRange", "s_PetAttackPrefab", "f_PetMoveSPD", "f_PetAttackSPD", "n_PetActiveSkill", "n_PetPassiveSkill", "s_PetPrefab", "f_Scale", "f_UIScale", "f_UIOffSet_y" });
|
Get_ServerTable("PetList", new List<string> { "e_AttackType", "n_DefaultATK", "n_DefaultDEF", "n_DefaultM_DEF", "n_DefaultHP", "f_PetStatRate", "f_AttackRange", "s_PetAttackPrefab", "f_PetMoveSPD", "f_PetAttackSPD", "n_PetActiveSkill", "n_PetPassiveSkill", "s_PetPrefab", "f_Scale", "f_UIScale", "f_UIOffSet_y" });
|
||||||
Get_ServerTable("OptionConfig", new List<string> { "e_OptionType", "f_ExtraValue1", "f_ExtraValue2", "f_ExtraValue3", "f_ExtraValue4" });
|
Get_ServerTable("OptionConfig", new List<string> { "e_OptionType", "f_ExtraValue1", "f_ExtraValue2", "f_ExtraValue3", "f_ExtraValue4" });
|
||||||
Get_ServerTable("CollectionList", new List<string> { "e_FirstRewardType", "n_FirstRewardValue", "n_FirstRewardCount", "e_RepeatRewardType", "n_RepeatRewardValue", "n_RepeatRewardCount" });
|
Get_ServerTable("CollectionList", new List<string> { "e_FirstRewardType", "n_FirstRewardValue", "n_FirstRewardCount", "e_RepeatRewardType", "n_RepeatRewardValue", "n_RepeatRewardCount" });
|
||||||
|
Get_ServerTable("GachaConfig", new List<string> { "n_Title", "s_Banner" });
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Get_ServerTable(string path, List<string> except)
|
static void Get_ServerTable(string path, List<string> except)
|
||||||
|
|
|
||||||
|
|
@ -1763,6 +1763,54 @@ handlers.Save_Collection_GetAll = function(args)
|
||||||
}
|
}
|
||||||
return Get_Return(1);
|
return Get_Return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handlers.Save_Gacha = function(args)
|
||||||
|
{
|
||||||
|
var readonlydata = Get_UserReadOnlyData();
|
||||||
|
var error = Get_Error(readonlydata, args.Token);
|
||||||
|
if (error < 0) return Get_Return(error);
|
||||||
|
|
||||||
|
var urod = Get_JsonUserData(readonlydata);
|
||||||
|
var table = Get_MissionTable();
|
||||||
|
var gachatable = Get_GachaConfigTable();
|
||||||
|
var gachaData = Get_GachaConfigTable().find(f=>f.n_ID == args.GachaID);
|
||||||
|
|
||||||
|
var gachaType = 0;
|
||||||
|
if (Check_ItemAmount(urod, gachaData.n_GachaTicketID, args.Count))
|
||||||
|
{ // 뽑기권이 충분하면 뽑기권만
|
||||||
|
gachaType = 1;
|
||||||
|
Use_Item(table, urod, gachaData.n_GachaTicketID, args.Count);
|
||||||
|
}
|
||||||
|
else if (Get_ItemAmount(urod, gachaData.n_GachaTicketID) > 0)
|
||||||
|
{
|
||||||
|
var ticketAmount = Get_ItemAmount(urod, gachaData.n_GachaTicketID);
|
||||||
|
var remaincount = args.Count - ticketAmount;
|
||||||
|
var needgem = parseInt(remaincount * gachaData.n_GachaPrice);
|
||||||
|
if (Check_ItemAmount(urod, gachaData.n_GachaGoodsID, needgem))
|
||||||
|
{
|
||||||
|
gachaType = 1;
|
||||||
|
Use_Item(table, urod, gachaData.n_GachaTicketID, ticketAmount);
|
||||||
|
Use_Item(table, urod, gachaData.n_GachaTicketID, needgem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var need = args.Count * gachaData.n_GachaPrice;
|
||||||
|
if (Check_ItemAmount(urod, gachaData.n_GachaGoodsID, need))
|
||||||
|
{
|
||||||
|
gachaType = 1;
|
||||||
|
Use_Item(table, urod, gachaData.n_GachaTicketID, need);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gachaType == 1)
|
||||||
|
{
|
||||||
|
var items = [];
|
||||||
|
|
||||||
|
return Get_Return(0, { gacha : items });
|
||||||
|
}
|
||||||
|
return Get_Return(1);
|
||||||
|
}
|
||||||
/////////////////////////////////// 서버 처리
|
/////////////////////////////////// 서버 처리
|
||||||
|
|
||||||
handlers.Write_UnityInApp = function(args)
|
handlers.Write_UnityInApp = function(args)
|
||||||
|
|
@ -21902,6 +21950,66 @@ function Get_CollectionTable()
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get_GachaConfigTable()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"n_ID": "10001",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "50",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "401",
|
||||||
|
"n_NormalRandombag": "30001",
|
||||||
|
"n_Extra10_Randombag": "30001",
|
||||||
|
"n_PickupReward": "20001",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10002",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "40",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "402",
|
||||||
|
"n_NormalRandombag": "30002",
|
||||||
|
"n_Extra10_Randombag": "30002",
|
||||||
|
"n_PickupReward": "20002",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10003",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "30",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "403",
|
||||||
|
"n_NormalRandombag": "30003",
|
||||||
|
"n_Extra10_Randombag": "30003",
|
||||||
|
"n_PickupReward": "20003",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10004",
|
||||||
|
"b_StageLv": "False",
|
||||||
|
"n_GachaPrice": "100",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "404",
|
||||||
|
"n_NormalRandombag": "30004",
|
||||||
|
"n_Extra10_Randombag": "30004",
|
||||||
|
"n_PickupReward": "20004",
|
||||||
|
"n_RepeatRewardPoint": "200"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"n_ID": "10001",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "50",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "401",
|
||||||
|
"n_NormalRandombag": "30001",
|
||||||
|
"n_Extra10_Randombag": "30001",
|
||||||
|
"n_PickupReward": "20001",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10002",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "40",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "402",
|
||||||
|
"n_NormalRandombag": "30002",
|
||||||
|
"n_Extra10_Randombag": "30002",
|
||||||
|
"n_PickupReward": "20002",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10003",
|
||||||
|
"b_StageLv": "True",
|
||||||
|
"n_GachaPrice": "30",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "403",
|
||||||
|
"n_NormalRandombag": "30003",
|
||||||
|
"n_Extra10_Randombag": "30003",
|
||||||
|
"n_PickupReward": "20003",
|
||||||
|
"n_RepeatRewardPoint": "100"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n_ID": "10004",
|
||||||
|
"b_StageLv": "False",
|
||||||
|
"n_GachaPrice": "100",
|
||||||
|
"n_GachaGoodsID": "1",
|
||||||
|
"n_GachaTicketID": "404",
|
||||||
|
"n_NormalRandombag": "30004",
|
||||||
|
"n_Extra10_Randombag": "30004",
|
||||||
|
"n_PickupReward": "20004",
|
||||||
|
"n_RepeatRewardPoint": "200"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7feaaa9565615bb4e95782d8fd889191
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -3003,4 +3003,8 @@ public class SC_CollectionResultData
|
||||||
{
|
{
|
||||||
public int id, addvalue;
|
public int id, addvalue;
|
||||||
}
|
}
|
||||||
|
public class SC_GachaResult
|
||||||
|
{
|
||||||
|
public List<int> gacha;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -2011,6 +2011,43 @@ public class ServerInfo : MyCoroutine
|
||||||
Set_Coroutine(() => { Save_Collection_GetAll(condition, eMenuCategory, _act); }, 2f);
|
Set_Coroutine(() => { Save_Collection_GetAll(condition, eMenuCategory, _act); }, 2f);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Save_Gacha(int id, int count, Action<SC_GachaResult> _act)
|
||||||
|
{
|
||||||
|
NetWait.Ins.Set(true);
|
||||||
|
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||||
|
{
|
||||||
|
FunctionName = MethodBase.GetCurrentMethod().Name,
|
||||||
|
GeneratePlayStreamEvent = true,
|
||||||
|
FunctionParameter = new
|
||||||
|
{
|
||||||
|
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||||
|
GachaID = id,
|
||||||
|
Count = count,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
result =>
|
||||||
|
{
|
||||||
|
if (result.Error == null)
|
||||||
|
{
|
||||||
|
NetWait.Ins.Set(false);
|
||||||
|
var str_result = result.FunctionResult.ToString();
|
||||||
|
var error = MyErrorCheck(str_result);
|
||||||
|
// (0 성공, 1 실패 (재화 부족))
|
||||||
|
switch (error)
|
||||||
|
{
|
||||||
|
case 0: _act?.Invoke(JsonConvert.DeserializeObject<SC_GachaResult>(str_result)); break;
|
||||||
|
case 1: ToastUI.Ins.Set(388); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Set_Coroutine(() => { Save_Gacha(id, count, _act); }, 2f);
|
||||||
|
},
|
||||||
|
fail =>
|
||||||
|
{
|
||||||
|
Set_Coroutine(() => { Save_Gacha(id, count, _act); }, 2f);
|
||||||
|
});
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 우편
|
#region 우편
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ using UnityEngine;
|
||||||
|
|
||||||
public class btn_gacha : MonoBehaviour
|
public class btn_gacha : MonoBehaviour
|
||||||
{
|
{
|
||||||
public TextMeshProUGUI[] texts; // 0 0회 뽑기
|
public TextMeshProUGUI[] texts; // 0 {0}회 뽑기
|
||||||
public MoneyForm[] moneyForms;
|
public MoneyForm[] moneyForms;
|
||||||
|
|
||||||
enum eGachaBtnType { OnlyTicket, TicketAndCash, OnlyCash, CantGacha }
|
enum eGachaBtnType { OnlyTicket, TicketAndCash, OnlyCash, CantGacha }
|
||||||
|
|
||||||
GachaConfigTableData m_Data;
|
GachaConfigTableData m_Data;
|
||||||
public ObscuredInt _count;
|
ObscuredInt _count;
|
||||||
public int m_Count
|
public int m_Count
|
||||||
{
|
{
|
||||||
get { return _count; }
|
get { return _count; }
|
||||||
|
|
@ -68,6 +68,11 @@ public class btn_gacha : MonoBehaviour
|
||||||
|
|
||||||
public void OnClick_Gacha()
|
public void OnClick_Gacha()
|
||||||
{
|
{
|
||||||
|
ServerInfo.Ins.Save_Gacha(m_Data.n_ID, m_Count, result =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
return;
|
||||||
var sdata = ServerInfo.Ins.m_ServerData;
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||||||
switch (Get_BtnType())
|
switch (Get_BtnType())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue