Skip stale ready-to-join notifications (#6808)

This commit is contained in:
2026-05-29 18:29:10 -07:00
committed by GitHub
parent 2536e43e56
commit b987277f8b
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Net.Eagle0.Eagle.Views;
using UnityEngine;
namespace eagle.Notifications.ARNNotifications {
using ProvinceId = Int32;
@@ -12,8 +13,16 @@ namespace eagle.Notifications.ARNNotifications {
Net.Eagle0.Eagle.Common.Notification notification,
IGameModel currentModel) {
var details = notification.Details.HeroReadyToJoinDetails;
var hero = currentModel.Heroes[details.HeroId];
var province = currentModel.Provinces[details.ProvinceId];
if (!currentModel.Heroes.TryGetValue(details.HeroId, out var hero)) {
Debug.LogWarning(
$"Skipping Ready to Join notification: hero {details.HeroId} is not present in the current model.");
yield break;
}
if (!currentModel.Provinces.TryGetValue(details.ProvinceId, out var province)) {
Debug.LogWarning(
$"Skipping Ready to Join notification: province {details.ProvinceId} is not present in the current model.");
yield break;
}
string textTemplate =
$"{{ReadyHero}} is ready to join your faction in {province.Name}.\n\n";