feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环
This commit is contained in:
@@ -125,6 +125,55 @@ namespace game
|
||||
|
||||
#region 数据相关
|
||||
private EventPotionData m_PotionData;
|
||||
|
||||
internal static PlayerDataStorage.PlayerKVPotionState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
|
||||
PlayerDataStorage.PlayerKVSchemaDiagnostics errors) => PlayerDataStorage.PlayerKVSaveSchema.DecodePotion(raw,errors);
|
||||
internal void ResetForKVLoad()
|
||||
{
|
||||
m_PotionData=null; m_PendingFirstPlayedEventId=0; m_SpriteAtlas=null; m_Tables=null;
|
||||
m_TbEventPotionMain=null; m_TbEventPotionStage=null; m_TbEventPotionBlock=null; m_TbEventPotionBottle=null;
|
||||
m_PotionResDict=new Dictionary<int,EventPotionResource>(); m_WallsBefore=new List<PotionItemData>(); m_WallsAfter=new List<PotionItemData>();
|
||||
m_UIPanel=m_InfoPanel=m_RewardPopupPanel=null; m_ScrollerDataList=new List<PotionItemData>();
|
||||
}
|
||||
static PotionItemData MaterializeKVPotionItem(PlayerDataStorage.PlayerKVPotionItem value) => new PotionItemData {
|
||||
name=value.Name,index=value.Index,isOver=value.IsOver,DataType=(EventPotionDataType)value.DataType,
|
||||
ColorTypeList=new List<int>(value.Colors),ShelfTypeList=value.Shelves.Select(n=>(EventPotionShelfType)n).ToList(),
|
||||
GridStateList=value.Grids.Select(n=>(EventPotionGridState)n).ToList(),FromDisplayAreaIndexList=new List<int>(value.FromDisplay)
|
||||
};
|
||||
internal void ReplaceFromKVDecoded(PlayerDataStorage.PlayerKVPotionState state)
|
||||
{
|
||||
if(state==null) throw new ArgumentNullException(nameof(state));
|
||||
m_PotionData=!state.IsPresent ? null : new EventPotionData {
|
||||
EventID=state.EventID,
|
||||
PotionID=state.PotionID,
|
||||
StageID=state.StageID,
|
||||
Stage1TotalLevel=state.Stage1TotalLevel,
|
||||
Stage2TotalLevel=state.Stage2TotalLevel,
|
||||
LevelID=state.LevelID,
|
||||
LevelIndex=state.LevelIndex,
|
||||
CorrectNum=state.CorrectNum,
|
||||
SubmitNum=state.SubmitNum,
|
||||
Token=state.Token,
|
||||
ConsumedToken=state.ConsumedToken,
|
||||
Rule=state.Rule,
|
||||
PreEventID=state.PreEventID,
|
||||
PrePotionID=state.PrePotionID,
|
||||
PreStageID=state.PreStageID,
|
||||
PreLevelID=state.PreLevelID,
|
||||
Round=state.Round,
|
||||
FirstPlayedEventId=state.FirstPlayedEventId,
|
||||
IsOver=state.IsOver,
|
||||
Name=state.Name,
|
||||
InflationRate=state.InflationRate,
|
||||
LevelTargetData=MaterializeKVPotionItem(state.LevelTargetData),
|
||||
LevelDisplayData=MaterializeKVPotionItem(state.LevelDisplayData),
|
||||
LevelProcessedList=state.LevelProcessedList.Select(MaterializeKVPotionItem).ToList()
|
||||
};
|
||||
}
|
||||
internal bool IsInactiveForKVValidation => m_PendingFirstPlayedEventId==0 && m_SpriteAtlas==null && m_Tables==null &&
|
||||
m_TbEventPotionMain==null && m_TbEventPotionStage==null && m_TbEventPotionBlock==null && m_TbEventPotionBottle==null &&
|
||||
m_PotionResDict.Count==0 && m_WallsBefore.Count==0 && m_WallsAfter.Count==0 && m_ScrollerDataList.Count==0 &&
|
||||
m_UIPanel==null && m_InfoPanel==null && m_RewardPopupPanel==null;
|
||||
public EventPotionData PotionData { get { return m_PotionData; } }
|
||||
|
||||
public void InitLevel()
|
||||
|
||||
Reference in New Issue
Block a user