12345678910111213141516171819202122232425262728293031 |
-
- namespace XGame.Framework.Network
- {
- /// <summary>
- /// 网络消息发送器
- /// </summary>
- public interface IMsgSender
- {
- /// <summary>
- /// 是否可以发送
- /// 若可以发送,则会刷新消息的instanceId
- /// </summary>
- /// <param name="message"></param>
- /// <param name="useFilter">过滤参数</param>
- /// <returns></returns>
- bool IsCanSend(IMessage message, bool useFilter);
- /// <summary>
- /// 发送消息
- /// </summary>
- /// <param name="msg"></param>
- /// <param name="isFilter">过滤参数</param>
- /// <returns>默认返回零,失败则返回SendError相关错误码</returns>
- ESessionCode Send(IMessage message, bool openEncrypt);
- /// <summary>
- /// 验证本次收到的消息id和上次发送的是否一致
- /// </summary>
- /// <param name="instanceID"></param>
- /// <returns></returns>
- bool VerifyInstanceID(int instanceID);
- }
- }
|