Save_PC_EquipJob
This commit is contained in:
parent
c18d41efa5
commit
f3334308f1
|
|
@ -774,6 +774,22 @@ handlers.Save_PC_BuyJob = function(args)
|
|||
return Get_Return(2); // 재화 부족
|
||||
}
|
||||
}
|
||||
handlers.Save_PC_EquipJob = 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);
|
||||
|
||||
if (!urod.PC.Obtain.includes(args.JobID))
|
||||
return Get_Return(1); // 없는 직업
|
||||
|
||||
urod.Equip.Equip["PC"] = args.JobID;
|
||||
|
||||
Set_JsonUserData(urod);
|
||||
return Get_Return(0);
|
||||
}
|
||||
/////////////////////////////////// 서버 처리
|
||||
|
||||
handlers.Write_UnityInApp = function(args)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1038,6 +1038,39 @@ public class ServerInfo : MyCoroutine
|
|||
Set_Coroutine(() => { Save_PC_BuyJob(jobid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
public void Save_PC_EquipJob(int jobid, Action _act)
|
||||
{
|
||||
NetWait.Ins.Set(true);
|
||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||
{
|
||||
FunctionName = "Save_PC_EquipJob",
|
||||
GeneratePlayStreamEvent = true,
|
||||
FunctionParameter = new
|
||||
{
|
||||
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||
JobID = jobid,
|
||||
}
|
||||
},
|
||||
result =>
|
||||
{
|
||||
if (result.Error == null)
|
||||
{
|
||||
NetWait.Ins.Set(false);
|
||||
var error = MyErrorCheck(result.FunctionResult.ToString());
|
||||
switch (error)
|
||||
{
|
||||
case 0: _act?.Invoke(); break;
|
||||
case 1: ToastUI.Ins.Set(999900009); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Set_Coroutine(() => { Save_PC_EquipJob(jobid, _act); }, 2f);
|
||||
},
|
||||
fail =>
|
||||
{
|
||||
Set_Coroutine(() => { Save_PC_EquipJob(jobid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 우편
|
||||
|
|
|
|||
|
|
@ -108,18 +108,21 @@ public class PCJobUI_OpenCondition : MonoBehaviour
|
|||
{ // 착용 여부
|
||||
if (sdata.Get_EqiupmentEquip(eItem.PC) != m_ClassId)
|
||||
{ // 착용하기
|
||||
sdata.Equip.Set_Equip(eItem.PC, m_ClassId);
|
||||
Set_UI();
|
||||
PCJobUI.Ins.Set();
|
||||
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
||||
ServerInfo.Ins.Save_PC_EquipJob(m_ClassId, () =>
|
||||
{
|
||||
sdata.Equip.Set_Equip(eItem.PC, m_ClassId);
|
||||
Set_UI();
|
||||
PCJobUI.Ins.Set();
|
||||
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // 전직
|
||||
//if (CanJobBuy(true))
|
||||
if (CanJobBuy(true))
|
||||
{
|
||||
var moneyid = table_GlobalValue.Ins.Get_Int("n_JobMaterialID");
|
||||
//if (sdata.Check_ItemAmount(moneyid, m_Data.n_NeedGoodsCount))
|
||||
if (sdata.Check_ItemAmount(moneyid, m_Data.n_NeedGoodsCount))
|
||||
{
|
||||
ServerInfo.Ins.Save_PC_BuyJob(m_Data.n_ClassID, () =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue