예제 #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);
 }