feat: add world chat UI
This commit is contained in:
@@ -38,6 +38,19 @@ namespace XWorld.Server.Gateway
|
||||
|
||||
public Session Get(int pid) => _byPid.TryGetValue(pid, out var s) ? s : null;
|
||||
|
||||
public IReadOnlyList<int> ConnectedPlayerIds()
|
||||
{
|
||||
List<int> players = null;
|
||||
foreach (var kv in _byPid)
|
||||
{
|
||||
if (kv.Value.Connected)
|
||||
{
|
||||
(players ??= new List<int>()).Add(kv.Key);
|
||||
}
|
||||
}
|
||||
return players ?? (IReadOnlyList<int>)Array.Empty<int>();
|
||||
}
|
||||
|
||||
/// <summary>移除断线且"严格越过"重连窗口的会话(currentTick - DisconnectedAtTick > windowTicks)。返回被移除的会话;无则空数组。</summary>
|
||||
public IReadOnlyList<Session> SweepExpired(long currentTick, long windowTicks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user