Exemple #1
0
        // UDP
        public void UdpAuth(long session, string host, int port)
        {
            UnityEngine.Debug.Assert(_udp == null);

            _udp        = new PackageSocketUdp(_ctx, _user.Secret, (uint)session);
            _udp.OnRecv = UdpRecv;
            _udp.Connect(host, port);
        }
Exemple #2
0
        // UDP
        public void UdpAuth(long session, string ip, int port)
        {
            UnityEngine.Debug.Assert(_udpflag == false);
            UnityEngine.Debug.Assert(_udp == null);
            _udpsession = session;
            _udpip      = ip;
            _udpport    = port;

            TimeSync ts = _ctx.TiSync;

            _udp        = new PackageSocketUdp(_ctx, _user.Secret, (uint)session);
            _udp.OnRecv = UdpRecv;
            _udp.OnSync = UdpSync;
            UnityEngine.Debug.Assert(_udp != null);
            _udp.Connect(ip, port);
            _udp.Sync();
        }