Exemplo n.º 1
0
        public void StartInfoQuery(SQPQuery q)
        {
            GameDebug.Assert(q.m_State == SQPClientState.Idle);

            q.StartTime = NetworkUtils.stopwatch.ElapsedMilliseconds;

            var writer = new ByteOutputStream(m_Buffer);
            var req    = new ChallangeRequest();

            req.ToStream(ref writer);

            m_Socket.SendTo(m_Buffer, writer.GetBytePosition(), SocketFlags.None, q.m_Server);
            q.m_State = SQPClientState.WaitingForChallange;
        }
Exemplo n.º 2
0
        unsafe public void StartInfoQuery(SQPQuery q)
        {
            GameDebug.Assert(q.m_State == SQPClientState.Idle);

            q.StartTime = NetworkUtils.stopwatch.ElapsedMilliseconds;

            var writer = new DataStreamWriter(m_Buffer.Length, Unity.Collections.Allocator.Temp);
            var req    = new ChallangeRequest();

            req.ToStream(ref writer);

            writer.CopyTo(0, writer.Length, ref m_Buffer);
            m_Socket.SendTo(m_Buffer, writer.Length, SocketFlags.None, q.m_Server);
            q.m_State = SQPClientState.WaitingForChallange;
        }
Exemplo n.º 3
0
        void SendServerInfoQuery(SQPQuery q)
        {
            q.StartTime = NetworkUtils.stopwatch.ElapsedMilliseconds;
            var req = new QueryRequest();

            req.Header.ChallangeId = q.ChallangeId;
            req.RequestedChunks    = (byte)SQPChunkType.ServerInfo;

            var writer = new ByteOutputStream(m_Buffer);

            req.ToStream(ref writer);

            q.m_State = SQPClientState.WaitingForResponse;
            m_Socket.SendTo(m_Buffer, writer.GetBytePosition(), SocketFlags.None, q.m_Server);
        }
Exemplo n.º 4
0
        void SendServerInfoQuery(SQPQuery q)
        {
            q.StartTime = NetworkUtils.stopwatch.ElapsedMilliseconds;
            var req = new QueryRequest();

            req.Header.ChallangeId = q.ChallangeId;
            req.RequestedChunks    = (byte)SQPChunkType.ServerInfo;

            var writer = new DataStreamWriter(m_Buffer.Length, Unity.Collections.Allocator.Temp);

            req.ToStream(ref writer);

            q.m_State = SQPClientState.WaitingForResponse;
            writer.CopyTo(0, writer.Length, ref m_Buffer);
            m_Socket.SendTo(m_Buffer, writer.Length, SocketFlags.None, q.m_Server);
            writer.Dispose();
        }
Exemplo n.º 5
0
        public SQPQuery GetSQPQuery(IPEndPoint server)
        {
            SQPQuery q = null;

            foreach (var pending in m_Queries)
            {
                if (pending.m_State == SQPClientState.Idle && pending.m_Server == null)
                {
                    q = pending;
                    break;
                }
            }
            if (q == null)
            {
                q = new SQPQuery();
                m_Queries.Add(q);
            }

            q.Init(server);

            return(q);
        }
Exemplo n.º 6
0
 public void ReleaseSQPQuery(SQPQuery q)
 {
     q.m_Server = null;
 }