コード例 #1
0
        /// <summary>
        /// Send query when expired
        /// </summary>
        /// <param name="requestType">Request type</param>
        /// <param name="milliseconds">Milliseconds</param>
        public void SendQueryWhenExpired(ERequestType requestType, uint milliseconds)
        {
            uint t = (uint)(DateTime.Now.Subtract(requestsRequired.GetLastRequestTime(requestType)).TotalMilliseconds);

            if (t >= milliseconds)
            {
                SendQueryAsync(requestType);
            }
        }
コード例 #2
0
ファイル: Server.cs プロジェクト: impactjr/SAMPLauncherNET
        /// <summary>
        /// Send query when expired
        /// </summary>
        /// <param name="requestType">Request type</param>
        /// <param name="milliseconds">Milliseconds</param>
        /// <returns>"true" if attempted sending query, othewrwise "false"</returns>
        public bool SendQueryWhenExpiredAsync(ERequestResponseType requestType, uint milliseconds)
        {
            uint t   = (uint)(DateTime.Now.Subtract(requestsRequired.GetLastRequestTime(requestType)).TotalMilliseconds);
            bool ret = (t >= milliseconds);

            if (ret)
            {
                SendQueryAsync(requestType);
            }
            return(ret);
        }