cemahseri / SteamQuery.NET

Yet another Steam server queries .NET wrapper.
The Unlicense
12 stars 1 forks source link

Exception when call player query #4

Closed Runninginsilence1 closed 6 days ago

Runninginsilence1 commented 1 week ago

code:

var gameServer = new GameServer(addr)
    {
        SendTimeout = 3000,
        ReceiveTimeout = 3000,
    };
    IReadOnlyList<SteamQueryPlayer> steamQueryPlayers = await gameServer.GetPlayersAsync();

stackmsg:

System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding codepage '65001' and fallback 'System.Text.DecoderReplacementFallback'. (Parameter 'chars')
   at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded)
   at System.Text.DecoderNLS.DrainLeftoverDataForGetChars(ReadOnlySpan`1 bytes, Span`1 chars, Int32& bytesConsumed)
   at System.Text.Encoding.GetCharsWithFallback(Byte* pOriginalBytes, Int32 originalByteCount, Char* pOriginalChars, Int32 originalCharCount, Int32 bytesConsumedSoFar, Int32 charsWrittenSoFar, DecoderNLS decoder)
   at System.IO.BinaryReader.Read()
   at System.IO.BinaryReader.ReadChar()
   at SteamQuery.Extensions.BinaryReaderExtensions.ReadNullTerminatedString(BinaryReader reader)
   at SteamQuery.ResponseReader.ParsePlayers(Byte[] response)
   at SteamQuery.GameServer.GetPlayersAsync(CancellationToken cancellationToken)
   at Program.<>c.<<<Main>$>b__0_9>d.MoveNext() in C:\Users\zzk\RiderProjects\l4d2serverquery\L4d2ServerQuery\Program.cs:line 321

Sometime happens.

cemahseri commented 1 week ago

Can you send me the server that you are having this issue with?

Runninginsilence1 commented 6 days ago

42.192.4.35:42300 I'm not sure if this is related to a specific server. It occurs occasionally. I scrape data from the website https://www.steamserverbrowser.com/games.

cemahseri commented 6 days ago

I'm not sure if this is related to a specific server.

Yup, it's not related to a specific server. I just wanted to reproduce the error. Someone contacted me via Steam and reported an IP address. I have successfully reproduced and fixed the error. I'll be releasing a patch in an hour. Thank you for reporting!

cemahseri commented 6 days ago

untitlemente