feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环
This commit is contained in:
@@ -41,6 +41,11 @@ public class BlackFridayCouponData
|
||||
ZZTimeHelper.UtcNow() <= ActivateTime + TimeSpan.FromSeconds(EventDuration) && !IsBought;
|
||||
public int Multiplier => GContext.container.Resolve<Tables>().TbEventCoupon[RedirectId].Multiple;
|
||||
public int EventDuration => GContext.container.Resolve<Tables>().TbEventCoupon[RedirectId].Time;
|
||||
internal void ResetForKVLoad()
|
||||
{ ActivateTime=default; EventId=0; RedirectId=0; _isBought=false; DoesPop=true; }
|
||||
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVCouponState state)
|
||||
{ if(state==null) throw new ArgumentNullException(nameof(state)); ActivateTime=state.ActivateTime; EventId=state.EventId; RedirectId=state.RedirectId; _isBought=state.Bought; }
|
||||
|
||||
public void LoadData(string s)
|
||||
{
|
||||
int[] tokens = s.Split(',').Select(int.Parse).ToArray();
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace GameCore
|
||||
}
|
||||
public class ChainPackWithProgressMigrationData : ThanksGivingPackData
|
||||
{
|
||||
internal new static game.PlayerDataStorage.PlayerKVProgressPackState DecodeForKVLoad(System.Collections.Generic.IReadOnlyDictionary<string,string> raw,
|
||||
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) =>
|
||||
game.PlayerDataStorage.PlayerKVSaveSchema.DecodeProgressPack(raw,true,errors);
|
||||
public new const string Key = "ThanksGivingPackMigrationData";
|
||||
public override string RedPointKey => "thanks_giving";
|
||||
protected override string key => Key;
|
||||
|
||||
@@ -19,6 +19,19 @@ namespace GameCore
|
||||
public class ThanksGivingPackData : IProgressChainPackData
|
||||
{
|
||||
protected Data _data = new Data(0, 0, 0, 0);
|
||||
|
||||
internal static game.PlayerDataStorage.PlayerKVProgressPackState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
|
||||
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) =>
|
||||
game.PlayerDataStorage.PlayerKVSaveSchema.DecodeProgressPack(raw,false,errors);
|
||||
internal void ResetForKVLoad() { _data = null; }
|
||||
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVProgressPackState state)
|
||||
{
|
||||
if (state == null) throw new ArgumentNullException(nameof(state));
|
||||
_data = state.IsPresent ? new Data(state.EventId,state.RedirectId,state.TokenProgress,state.ChainProgress) : null;
|
||||
}
|
||||
internal game.PlayerDataStorage.PlayerKVProgressPackState SnapshotForKVValidation() => _data == null
|
||||
? new game.PlayerDataStorage.PlayerKVProgressPackState(false,0,0,0,0)
|
||||
: new game.PlayerDataStorage.PlayerKVProgressPackState(true,_data.EventId,_data.RedirectId,_data.TokenProgress,_data.ChainProgress);
|
||||
/// <summary>
|
||||
/// Starts with 0, representing the first unclaimed reward.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user