广播聊天
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user