mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 00:55:43 +00:00
Skip stale ready-to-join notifications (#6808)
This commit is contained in:
+11
-2
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user