Skip to content

Commit cacbc3d

Browse files
committed
added "appear" command to cli
The "appear" command lists players appearances. This is only really useful for debugging, as the "players" command shows pretty much the same info.
1 parent 6ffc3d8 commit cacbc3d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

FezMultiplayerDedicatedServer/FezDedicatedServer.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,24 @@ static void Main(string[] args)
101101
Console.WriteLine(s);
102102
})
103103
},
104+
{
105+
"appear".ToLowerInvariant(),
106+
("Lists players appearances", () =>
107+
{
108+
string s = "Player appearances:\n";
109+
int count = 0;
110+
foreach (var kvpair in server.PlayerAppearances)
111+
{
112+
count++;
113+
s += $"{kvpair.Key}: Name=\"{kvpair.Value.PlayerName}\" Appearance=\"{kvpair.Value.CustomCharacterAppearance}\"\n";
114+
}
115+
if(count == 0)
116+
{
117+
s += "None";
118+
}
119+
Console.WriteLine(s);
120+
})
121+
},
104122
};
105123
int maxCommandLength = cliActions.Max(kv => kv.Key.Length);
106124
(string desc, Action action) HelpCommand;

Shared/Shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public abstract class SharedNetcode<P> where P : PlayerMetadata
273273
public volatile Exception FatalException = null;
274274

275275
public abstract ConcurrentDictionary<Guid, P> Players { get; }
276-
protected ConcurrentDictionary<Guid, PlayerAppearance> PlayerAppearances = new ConcurrentDictionary<Guid, PlayerAppearance>();
276+
public ConcurrentDictionary<Guid, PlayerAppearance> PlayerAppearances = new ConcurrentDictionary<Guid, PlayerAppearance>();
277277
/// <summary>
278278
/// Note: only the Keys of this dictionary are used. Optimally, we'd use a concurrent hashset, but .NET doesn't have that.
279279
/// </summary>

0 commit comments

Comments
 (0)