From 725f450da7e64c144902e02cb384a15e7cae2540 Mon Sep 17 00:00:00 2001 From: anth64 Date: Mon, 24 Aug 2026 19:26:53 +0200 Subject: [PATCH] fix: resolve offline members' names in info output instead of showing raw uid --- ClaimLink/ClaimLinkChatCommand.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ClaimLink/ClaimLinkChatCommand.cs b/ClaimLink/ClaimLinkChatCommand.cs index bc7bac9..0919c0c 100644 --- a/ClaimLink/ClaimLinkChatCommand.cs +++ b/ClaimLink/ClaimLinkChatCommand.cs @@ -1034,6 +1034,9 @@ public static class ClaimLinkChatCommand return string.IsNullOrEmpty(claim.Description) ? $"claim {claimIndex}" : claim.Description; } + private static string PlayerNameForUid(string uid) => + ClaimLinkModSystem.PlayerData.GetPlayerDataByUid(uid)?.LastKnownPlayername ?? uid; + private static string FormatInfo(string groupName, int groupId, bool showDetails) { int memberCount = GroupMemberCount(groupId); @@ -1045,7 +1048,7 @@ public static class ClaimLinkChatCommand foreach (string uid in GroupMemberUids(groupId)) { - string name = ClaimLinkModSystem.World.PlayerByUid(uid)?.PlayerName ?? uid; + string name = PlayerNameForUid(uid); if (!showDetails) { @@ -1070,7 +1073,7 @@ public static class ClaimLinkChatCommand sb.AppendLine("Buffer access granted:"); foreach (var (uid, flags) in permittedPlayers) { - string name = ClaimLinkModSystem.World.PlayerByUid(uid)?.PlayerName ?? uid; + string name = PlayerNameForUid(uid); sb.AppendLine($" {name}: {DescribeAccess(flags)}"); } foreach (var (targetGroupId, flags) in permittedGroups)