广播聊天

This commit is contained in:
bob
2025-08-07 17:51:25 +08:00
parent 70bfe43a80
commit e1a4db89ae
19 changed files with 347 additions and 21 deletions

View File

@@ -52,4 +52,19 @@ public static class GateUnitManageComponentSystem
unit.Dispose();
}
}
/// <summary>
/// 回话迭代器
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
public static IEnumerable<Session> ForEachUnitSession(this GateUnitManageComponent self)
{
foreach (var (_, gateUnit) in self.Units)
{
Session gateSession = gateUnit.Session;
if (gateSession == null) continue;
yield return gateSession;
}
}
}