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; }
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; }
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); }
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(); }
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); }
public void ReleaseSQPQuery(SQPQuery q) { q.m_Server = null; }