ActorHelper.cs 527 B

1234567891011121314151617
  1. using System;
  2. using System.IO;
  3. namespace ET.Server
  4. {
  5. public static class ActorHelper
  6. {
  7. public static IActorResponse CreateResponse(IActorRequest iActorRequest, int error)
  8. {
  9. Type responseType = OpcodeTypeComponent.Instance.GetResponseType(iActorRequest.GetType());
  10. IActorResponse response = (IActorResponse)Activator.CreateInstance(responseType);
  11. response.Error = error;
  12. response.RpcId = iActorRequest.RpcId;
  13. return response;
  14. }
  15. }
  16. }