Save_Buff

This commit is contained in:
Ino 2025-07-25 07:10:35 +09:00
parent 6ef1d9b202
commit 1dd27e6697
5 changed files with 71 additions and 8 deletions

View File

@ -471,8 +471,8 @@ handlers.Get_AllMail = function(args)
handlers.Save_Init = function(args)
{
var readonlydata = Get_UserReadOnlyData();
//var error = Get_Error(readonlydata, args.Token);
//if (error < 0) return Get_Return(error);
var error = Get_Error(readonlydata, args.Token);
if (error < 0) return Get_Return(error);
let add_farmshop = null;
let isInit = false;
@ -2315,6 +2315,29 @@ handlers.Save_MissionAll = function(args)
}
return Get_Return(1);
}
handlers.Save_Buff = 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.Buff.Infinity > 0 || urod.Buff.Time[args.Index] <= 0)
{
if (urod.Buff.Infinity <= 0)
urod.Buff.Time[args.Index] = 600;
var table = Get_MissionTable();
Add_MissionCount(table, urod, "WATCH_AD_ALL", 0, 1);
Add_MissionCount(table, urod, "WATCH_AD_ACC", 0, 1);
Set_JsonUserData(urod);
return Get_Return(0);
}
return Get_Return(1);
}
/////////////////////////////////// 서버 처리
handlers.Write_UnityInApp = function(args)

View File

@ -2623,6 +2623,7 @@ public class SD_Buff
return rtn;
}
public bool ApplyBuff(int index) { return isInfinity() || Get_RemainTime(index) > 0; }
public bool isInfinity() { return Infinity > 0; }
public int Get_RemainTime(int index) { return isInfinity() ? 1 : Time[index]; }
public void Set_Time(int index, int time) { Time[index] = time; Time[index].RandomizeCryptoKey(); }

View File

@ -2328,6 +2328,42 @@ public class ServerInfo : MyCoroutine
Set_Coroutine(() => { Save_MissionAll(group, _act); }, 2f);
});
}
public void Save_Buff(int index, Action _act)
{
NetWait.Ins.Set(true);
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
{
FunctionName = MethodBase.GetCurrentMethod().Name,
GeneratePlayStreamEvent = true,
FunctionParameter = new
{
Token = m_LoginInfo.EntityToken.EntityToken,
Index = index,
}
},
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(); break;
case 1: ToastUI.Ins.Set(999900026); break;
}
}
else
Set_Coroutine(() => { Save_Buff(index, _act); }, 2f);
},
fail =>
{
Set_Coroutine(() => { Save_Buff(index, _act); }, 2f);
});
}
#endregion
#region

View File

@ -62,9 +62,12 @@ public class BuffADCard : CardBase
ADInfo.Ins.Show_AD(() =>
{
sdata.Buff.Set_Time(m_Index, 600);
Set_UI();
MyInfoUI.Ins.Set_Buff();
ServerInfo.Ins.Save_Buff(m_Index, () =>
{
sdata.Buff.Set_Time(m_Index, 600);
Set_UI();
MyInfoUI.Ins.Set_Buff();
});
});
}
}

View File

@ -415,13 +415,13 @@ public class ActorStatInfo
Set_Stat(true, eStat.FinalMoveSpeed, Get_BuffStat(eStat.FinalMoveSpeed) + Get_DebuffStat(eStat.FinalMoveSpeed));
// 최종 골드
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.GOLD_Multiplier, m_sdata.Buff.Get_RemainTime(0) > 0 ? 0.5 : 0);
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.GOLD_Multiplier, m_sdata.Buff.ApplyBuff(0) ? 0.5 : 0);
// 최종 경험치
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.EXP_Multiplier, m_sdata.Buff.Get_RemainTime(1) > 0 ? 0.5 : 0);
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.EXP_Multiplier, m_sdata.Buff.ApplyBuff(1) ? 0.5 : 0);
// 최종 아이템
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.ITEM_Multiplier, m_sdata.Buff.Get_RemainTime(2) > 0 ? 0.5 : 0);
if (!DSUtil.CheckNull(m_sdata)) Set_Stat(true, eStat.ITEM_Multiplier, m_sdata.Buff.ApplyBuff(2) ? 0.5 : 0);
if (isPet)
{ // 펫의 경우