using System.Collections.Generic; using System.IO; namespace ET.Server { public static class MessageHelper { public static void SendToClient(Player player, IActorMessage message) { SendActor(player.Id, message); } /// /// 发送协议给ActorLocation /// /// 注册Actor的Id /// public static void SendToLocationActor(long id, IActorLocationMessage message) { ActorLocationSenderComponent.Instance.Send(id, message); } /// /// 发送协议给Actor /// /// 注册Actor的InstanceId /// public static void SendActor(long actorId, IActorMessage message) { ActorMessageSenderComponent.Instance.Send(actorId, message); } /// /// 发送RPC协议给Actor /// /// 注册Actor的InstanceId /// /// public static async ETTask CallActor(long actorId, IActorRequest message) { return await ActorMessageSenderComponent.Instance.Call(actorId, message); } /// /// 发送RPC协议给ActorLocation /// /// 注册Actor的Id /// /// public static async ETTask CallLocationActor(long id, IActorLocationRequest message) { return await ActorLocationSenderComponent.Instance.Call(id, message); } } }