withSIX.Play.Core.Games.Legacy.ServerQuery.ServerQueryState.ProcessParser C# (CSharp) Method

ProcessParser() public method

public ProcessParser ( IServerQueryParser parser ) : void
parser IServerQueryParser
return void
        public void ProcessParser(IServerQueryParser parser) {
            if (Pings.Count == 0)
                Pings.Add(Common.MagicPingValue);
            Result = parser.ParsePackets(this);
            ReceivedPackets = null;
            Succeed();
        }

Usage Example

        async Task FetchAsync()
        {
            try {
                await ProcessAllPackets().ConfigureAwait(false);

                _state.ProcessParser(_parser);
                if (_state.Success)
                {
                    _state.Server.UpdateInfoFromResult(_state.Result);
                }
            } catch (TimeoutException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (ObjectDisposedException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (Exception e) {
                _state.Exception = e;
                _state.Cancel();
                throw;
            } finally {
                _state.StopSW();
            }
        }
All Usage Examples Of withSIX.Play.Core.Games.Legacy.ServerQuery.ServerQueryState::ProcessParser