feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环
This commit is contained in:
@@ -56,6 +56,20 @@ namespace GameCore
|
||||
public string popupPanelNode;
|
||||
public GuidanceGroupDefine curGroupDefine;
|
||||
public GuidanceDefineSetting guidanceDefineSetting;
|
||||
|
||||
internal static game.PlayerDataStorage.PlayerKVGuideState DecodeForKVLoad(IReadOnlyDictionary<string,string> raw,
|
||||
game.PlayerDataStorage.PlayerKVSchemaDiagnostics errors) => game.PlayerDataStorage.PlayerKVSaveSchema.DecodeGuides(raw,errors);
|
||||
internal void ResetForKVLoad()
|
||||
{
|
||||
GuideSaveDataDic = new Dictionary<string,GuideSaveData>(StringComparer.Ordinal);
|
||||
curSaveData = null; curDefine = null; curGroupDefine = null; popupPanelNode = null; CurPanelName = null;
|
||||
}
|
||||
internal void ReplaceFromKVDecoded(game.PlayerDataStorage.PlayerKVGuideState state)
|
||||
{
|
||||
if (state == null) throw new ArgumentNullException(nameof(state));
|
||||
GuideSaveDataDic = state.Values.ToDictionary(p=>p.Key,
|
||||
p=>new GuideSaveData { guideSubIndex=p.Value.Index, isFinish=p.Value.Finished, groupName=p.Value.Group },StringComparer.Ordinal);
|
||||
}
|
||||
//待释放
|
||||
IDisposable disposable;
|
||||
IDisposable disposable2;
|
||||
@@ -101,6 +115,13 @@ namespace GameCore
|
||||
|
||||
if (GuideSaveDataDic.TryGetValue(item.groupName.ToString(), out _saveData))
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if (DeferUnavailablePotionGuide(item, _saveData))
|
||||
{
|
||||
keyValuePairs[item.groupName.ToString()] = _saveData;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (!_saveData.isFinish && _saveData.guideSubIndex > 0)
|
||||
{
|
||||
for (int i = _saveData.guideSubIndex; i < item.guidanceDefines.Length; i++)
|
||||
@@ -153,6 +174,29 @@ namespace GameCore
|
||||
}
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
private static bool DeferUnavailablePotionGuide(GuidanceGroupDefine group, GuideSaveData saved)
|
||||
{
|
||||
if (!game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled || !game.PlayerDataStorage.PlayerKVGameplayLoop.Ready ||
|
||||
group.groupName != GroupName.EventPotion01 || saved == null || saved.isFinish || saved.guideSubIndex <= 0 ||
|
||||
group.guidanceDefines == null || saved.guideSubIndex >= group.guidanceDefines.Length ||
|
||||
group.guidanceDefines[saved.guideSubIndex] == null ||
|
||||
group.guidanceDefines[saved.guideSubIndex].panelName != "EventPotionPanel")
|
||||
return false;
|
||||
try
|
||||
{
|
||||
// Existing potion activity classification; availability query does not initialize activity data.
|
||||
const int potionEventType = 4;
|
||||
const int potionEventSubType = 5;
|
||||
return GContext.container.Resolve<FishingEventData>().GetEvent(potionEventType, potionEventSubType) == -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning("Potion guide availability query failed; retaining original guide recovery: " + ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
public bool GetIsFinish(string groupName)
|
||||
{
|
||||
return GuideSaveDataDic.ContainsKey(groupName) && GuideSaveDataDic[groupName].isFinish;
|
||||
|
||||
Reference in New Issue
Block a user