Fix delta arch-spawn propagation and viewer private lookup
This commit is contained in:
@@ -473,20 +473,30 @@ func _apply_delta(delta: Dictionary) -> void:
|
||||
if counts.has("deckCount") and counts["deckCount"] != null: player["deckCount"] = int(counts["deckCount"])
|
||||
if counts.has("discardCount") and counts["discardCount"] != null: player["discardCount"] = int(counts["discardCount"])
|
||||
|
||||
# 7. ArchSpirit deltas by account
|
||||
# 7. ArchSpirit updates by account
|
||||
var arch_by_account = delta.get("archSpiritByAccount")
|
||||
if arch_by_account is Dictionary:
|
||||
for aid_v: Variant in arch_by_account.keys():
|
||||
var aid := str(aid_v)
|
||||
var arch_delta := arch_by_account.get(aid, {}) as Dictionary
|
||||
if arch_delta.is_empty():
|
||||
var arch_update := arch_by_account.get(aid, {}) as Dictionary
|
||||
if arch_update.is_empty():
|
||||
continue
|
||||
var player := _player_by_id(aid)
|
||||
if player.is_empty():
|
||||
continue
|
||||
var full_arch := arch_update.get("full")
|
||||
if full_arch is Dictionary and not (full_arch as Dictionary).is_empty():
|
||||
player["archSpirit"] = full_arch
|
||||
continue
|
||||
var arch_delta := arch_update.get("delta") as Dictionary
|
||||
if arch_delta.is_empty():
|
||||
continue
|
||||
var arch: Dictionary = player.get("archSpirit", {})
|
||||
if not arch.is_empty():
|
||||
_merge_unit_delta(arch, arch_delta)
|
||||
if arch.is_empty():
|
||||
# Missing baseline (likely first sight of this arch). Ask for full sync.
|
||||
request_sync()
|
||||
continue
|
||||
_merge_unit_delta(arch, arch_delta)
|
||||
|
||||
# 8. Player stats by account
|
||||
var stats_by_account = delta.get("playerStatsByAccount")
|
||||
|
||||
Reference in New Issue
Block a user