示例#1
0
        public void SendResponse(int typeId, Zeze.Net.Binary fullEncodedProtocol)
        {
            var send = new gnet.Provider.Send();

            send.Argument.LinkSids.Add(SessionId);
            send.Argument.ProtocolType      = typeId;
            send.Argument.ProtocolWholeData = fullEncodedProtocol;

            if (null != Link && null != Link.Socket)
            {
                Link.Send(send);
                return;
            }
            // 可能发生了重连,尝试再次查找发送。网络断开以后,已经不可靠了,先这样写着吧。
            if (Game.App.Instance.Server.Links.TryGetValue(LinkName, out var link))
            {
                if (link.IsHandshakeDone)
                {
                    Link = link.Socket;
                    link.Socket.Send(send);
                }
            }
        }
示例#2
0
文件: Onlines.cs 项目: e2wugui/zeze
 public void SendReliableNotifyWhileRollback(long roleId, string listenerName, int typeId, Zeze.Net.Binary fullEncodedProtocol)
 {
     Transaction.Current.RunWhileRollback(() => SendReliableNotify(roleId, listenerName, typeId, fullEncodedProtocol));
 }
示例#3
0
 public void SendResponse(Zeze.Net.Binary fullEncodedProtocol)
 {
     SendResponse(Zeze.Serialize.ByteBuffer.Wrap(fullEncodedProtocol).ReadInt4(), fullEncodedProtocol);
 }