1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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);
- }
-
-
- /// <summary>
- /// 发送协议给ActorLocation
- /// </summary>
- /// <param name="id">注册Actor的Id</param>
- /// <param name="message"></param>
- public static void SendToLocationActor(long id, IActorLocationMessage message)
- {
- ActorLocationSenderComponent.Instance.Send(id, message);
- }
-
- /// <summary>
- /// 发送协议给Actor
- /// </summary>
- /// <param name="actorId">注册Actor的InstanceId</param>
- /// <param name="message"></param>
- public static void SendActor(long actorId, IActorMessage message)
- {
- ActorMessageSenderComponent.Instance.Send(actorId, message);
- }
-
- /// <summary>
- /// 发送RPC协议给Actor
- /// </summary>
- /// <param name="actorId">注册Actor的InstanceId</param>
- /// <param name="message"></param>
- /// <returns></returns>
- public static async ETTask<IActorResponse> CallActor(long actorId, IActorRequest message)
- {
- return await ActorMessageSenderComponent.Instance.Call(actorId, message);
- }
-
- /// <summary>
- /// 发送RPC协议给ActorLocation
- /// </summary>
- /// <param name="id">注册Actor的Id</param>
- /// <param name="message"></param>
- /// <returns></returns>
- public static async ETTask<IActorResponse> CallLocationActor(long id, IActorLocationRequest message)
- {
- return await ActorLocationSenderComponent.Instance.Call(id, message);
- }
- }
- }
|