hjorslev / SteamPS

Module that utilizes PowerShell as a wrapper for SteamCMD and interacts with various Steam APIs.
https://www.powershellgallery.com/packages/SteamPS
MIT License
71 stars 14 forks source link

Get-SteamServerInfo Cmdlet fails for linux based "The Isle" servers #47

Closed sock3t closed 2 years ago

sock3t commented 3 years ago

Describe "Module Bug or Issue"

Get-SteamServerInfo Cmdlet works for windows based game servers (The Isle) but not for linux based.

Context "The Problem"

Lately the The Isle game developers have introduced new servers which are now based on linux (that is the only change that I know of). For these servers the query fails:

PS c:\> Get-SteamServerInfo -IPAddress '34.244.178.139' -Port 27015
Exception calling "ReadByte" with "0" argument(s): "Unable to read beyond the end of the stream."
At C:\Program Files\WindowsPowerShell\Modules\SteamPS\3.2.1\Private\Server\Get-PacketString.ps1:31 char:13
+             $byte = $Stream.ReadByte()
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : EndOfStreamException

This error loops endlessly and you have to ctrl+c to stop the Cmdlet.

Context "Expected Behavior"

It is possible to query this server (it is based on windows):

PS c:\> Get-SteamServerInfo -IPAddress '3.250.191.172' -Port 27015

Protocol      : 17
ServerName    : UP4 - Mechanic Test - EU 1
Map           : Isla_Spiro
InstallDir    : theisle
GameName      : Evrima 0.8.29.04
AppID         : 0
Players       : 75
MaxPlayers    : 75
Bots          : 0
ServerType    : Dedicated
Environment   : Windows
Visibility    : Public
VAC           : Secured
Version       : 0.8.29.04
ExtraDataFlag : 177
IPAddress     : 3.250.191.172
Port          : 27015

Context "Additional Information"

PS c:\> Get-Module -Name SteamPS -ListAvailable | Select-Object -Property Name, Version

Name    Version
----    -------
SteamPS 3.2.1

PS c:\> $PSVersionTable | Out-String

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
hjorslev commented 2 years ago

Hey @sock3t

Sorry for not getting back to you before now.

Do you by any chance have an updated IP for an Linux based The Isle server? I tried approximately 10 or so from https://serverranks.com/the-isle/ but they were of course Windows based.

ThePoShWolf commented 2 years ago

@hjorslev - First off, thank you for taking the time to share this module!

I ran into this same problem with a Linux based Rust server and have figured out the issue. In the docs, it references a challenge that is sent which can be recognized by a first byte (after the 4 byte header) of 'A' or 0x41. If that challenge is sent, the client needs to resend the original query but include the final four bytes from the challenge.

I've implemented this and submitted #51 .