增加刷新机制

This commit is contained in:
wuwenbo 2025-10-30 15:09:42 +08:00
parent 928d94d5f3
commit 55fab505ec
2 changed files with 4 additions and 9 deletions

View File

@ -16,6 +16,8 @@ using Logic.AI;
using Logic.CrashSight;
using Logic.Skill;
using MemoryPack;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Core;
using TH1_Logic.Net;
using TH1_Logic.Steam;
@ -137,14 +139,9 @@ namespace RuntimeData
var hash128 = new Hash128();
hash128.Append(bytes);
var hash = hash128.ToString();
if (string.IsNullOrEmpty(_hash))
{
_hash = hash;
return;
}
if (hash == _hash) return;
_hash = hash;
EventManager.Publish(new UpdateUIOutsideMultiplayRoomSetting());
if (LobbyManager.Instance.Lobby.IsLobbyOwner())
GameNetSender.Instance.UpdateLobbyData(Main.Instance.MapConfig);
}

View File

@ -200,8 +200,6 @@ namespace TH1_Logic.Steam
if (!LobbyManager.Instance.Lobby.IsLobbyOwner()) return;
if (message.Civ == null) return;
Main.Instance.MapConfig.UpdateMemberCiv(message.Civ);
Debug.Log("UpdateUIOutsideMultiplayRoomSetting");
EventManager.Publish(new UpdateUIOutsideMultiplayRoomSetting());
}
// 只有玩家会收到
@ -215,7 +213,7 @@ namespace TH1_Logic.Steam
if (LobbyManager.Instance.Lobby.IsLobbyOwner()) return;
if (message.Config == null) return;
Main.Instance.MapConfig = message.Config;
EventManager.Publish(new UpdateUIOutsideMultiplayRoomSetting());
Main.Instance.MapConfig.CheckMapConfigChanged();
}
}
}