mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace ET.Server
|
||||
{
|
||||
|
||||
public static partial class RoomMessageHelper
|
||||
{
|
||||
public static void BroadCast(Room room, IActorMessage message)
|
||||
{
|
||||
// 广播的消息不能被池回收
|
||||
(message as MessageObject).IsFromPool = false;
|
||||
|
||||
RoomServerComponent roomServerComponent = room.GetComponent<RoomServerComponent>();
|
||||
|
||||
ActorLocationSenderComponent actorLocationSenderComponent = room.Root().GetComponent<ActorLocationSenderComponent>();
|
||||
foreach (var kv in roomServerComponent.Children)
|
||||
{
|
||||
RoomPlayer roomPlayer = kv.Value as RoomPlayer;
|
||||
|
||||
if (!roomPlayer.IsOnline)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
actorLocationSenderComponent.Get(LocationType.GateSession).Send(roomPlayer.Id, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user