123456789101112131415161718192021222324252627282930313233 |
- namespace XGame.Framework.Network
- {
- /// <summary>
- /// 网络消息对象生成器
- /// </summary>
- public interface IMsgGenerator
- {
- /// <summary>
- /// 获取网络消息
- /// </summary>
- /// <param name="protoId">协议号</param>
- /// <returns>网络消息对象</returns>
- IMessage GetMessage(int protoId);
- /// <summary>
- /// 消息ID转类型,
- /// 用Json反序列化消息时会用到Type
- /// </summary>
- /// <param name="protoId"></param>
- /// <returns></returns>
- System.Type IdToType(int protoId);
- /// <summary>
- /// 回收网络消息
- /// </summary>
- /// <param name="message">网络消息对象</param>
- void RecycleMessage(IMessage message);
- /// <summary>
- /// 获取网络消息应用服务
- /// </summary>
- /// <param name="protoId"></param>
- /// <returns></returns>
- IMsgController GetController(int protoId);
- }
- }
|