Skip to content

Player list cutoff - #164

Open
sebwitt1987 wants to merge 1 commit into
xPaw:masterfrom
sebwitt1987:player-list-cutoff
Open

Player list cutoff#164
sebwitt1987 wants to merge 1 commit into
xPaw:masterfrom
sebwitt1987:player-list-cutoff

Conversation

@sebwitt1987

@sebwitt1987 sebwitt1987 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Some servers / games cut of the packets instead of sending split packets.
Because of read functions which throw, we loose the hole list parsed so far. By catching it, we can break out of the loop and keep already parsed data.
This PR stops at this point, as i persoanlly think such a cutoff is not worthy of throwing.
Yes, list is not complete, but it contains data

To still allow catching outside, one possibility would be:

  1. In the method, set $this->PlayerList[ ] = $Player; instead of returning a isolated array, we return the property.
  • By using a property set and return, we have access to the data when we throw
  1. We catch InvalidPacketException as in the PR
  2. In the catch, we rethrow a new type, to make the throw descriptive and very specific
  3. Outside world could for example:
try
{
     $players = $query->GetPlayers();
}
catch(PlayerCutoffException $e)
{
    // Even on player cutoffs, im interested in what was parsed already
    $players = $query->PlayerList;
}

// display players in a table here, whatever
var_dump($players)

The same thing basicly should be done in rules, but it just reads non throw methods.
Worst thing happening there is a broken key/value pair at the end.

Some servers cut of the packets instead of sending split packets.
If we encounter such a server and we use functions which throw, we should catch the throw to break out of the loop to not loose the hole player list parsed so far
@xPaw

xPaw commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Hmm not really a fan of this. Do some servers do this intentionally? What does Steam server info display in this case?

@sebwitt1987

Copy link
Copy Markdown
Contributor Author

I'll try to find such a server again and report a bit more details on the matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants