IMsgGenerator.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. namespace XGame.Framework.Network
  2. {
  3. /// <summary>
  4. /// 网络消息对象生成器
  5. /// </summary>
  6. public interface IMsgGenerator
  7. {
  8. /// <summary>
  9. /// 获取网络消息
  10. /// </summary>
  11. /// <param name="protoId">协议号</param>
  12. /// <returns>网络消息对象</returns>
  13. IMessage GetMessage(int protoId);
  14. /// <summary>
  15. /// 消息ID转类型,
  16. /// 用Json反序列化消息时会用到Type
  17. /// </summary>
  18. /// <param name="protoId"></param>
  19. /// <returns></returns>
  20. System.Type IdToType(int protoId);
  21. /// <summary>
  22. /// 回收网络消息
  23. /// </summary>
  24. /// <param name="message">网络消息对象</param>
  25. void RecycleMessage(IMessage message);
  26. /// <summary>
  27. /// 获取网络消息应用服务
  28. /// </summary>
  29. /// <param name="protoId"></param>
  30. /// <returns></returns>
  31. IMsgController GetController(int protoId);
  32. }
  33. }