IMsgSender.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. 
  2. namespace XGame.Framework.Network
  3. {
  4. /// <summary>
  5. /// 网络消息发送器
  6. /// </summary>
  7. public interface IMsgSender
  8. {
  9. /// <summary>
  10. /// 是否可以发送
  11. /// 若可以发送,则会刷新消息的instanceId
  12. /// </summary>
  13. /// <param name="message"></param>
  14. /// <param name="useFilter">过滤参数</param>
  15. /// <returns></returns>
  16. bool IsCanSend(IMessage message, bool useFilter);
  17. /// <summary>
  18. /// 发送消息
  19. /// </summary>
  20. /// <param name="msg"></param>
  21. /// <param name="isFilter">过滤参数</param>
  22. /// <returns>默认返回零,失败则返回SendError相关错误码</returns>
  23. ESessionCode Send(IMessage message, bool openEncrypt);
  24. /// <summary>
  25. /// 验证本次收到的消息id和上次发送的是否一致
  26. /// </summary>
  27. /// <param name="instanceID"></param>
  28. /// <returns></returns>
  29. bool VerifyInstanceID(int instanceID);
  30. }
  31. }