gamedig / rust-gamedig

Game Server Query Library.
https://crates.io/crates/gamedig
MIT License
39 stars 14 forks source link

Valve Master Servers aren't filtered properly #106

Open teooko opened 1 year ago

teooko commented 1 year ago

As i was testing the requests in the graphql playground, i noticed that the data did not match the filters.

I made a request for one server with isEmpty set to false, and then the same one with isEmpty set to true. Both of them fetched the same server.

Maintainer edit: The referenced project is SESS-Backend.

Douile commented 1 year ago

Are you referring to the filters in valve master server query? The closest filter to isEmpty there is CanBeEmpty which expected behaviour would be as you described: when false shows all servers that aren't empty, when true shows all servers that are empty as well as all servers that aren't empty. If you are referring to something else could you give some more context as to how you are applying filters and what you are applying filters to please.

teooko commented 1 year ago

Yes, the filters in valve master server query. This is the query

subscription getServers($searchGame: ServersFilters!, $howMany: Int! ) {
  servers(filters: $searchGame, limit: $howMany)
  {
    name,
    appid,
    playersOnline
  }
}

I set these as the query variables

{
  "searchGame": 
  {
    "runsAppId": 440,
    "isEmpty": true
  },
  "howMany": 30
}

And i got both empty and populated servers image

Douile commented 1 year ago

I couldn't find a graphQL playground with gamedig (I haven't used graphQL much before). What's the URL of the API you're querying for this data, or is it created using a tool that automatically generates graphQL bindings for rust?

CosminPerRam commented 1 year ago

The mentioned project is this one: SESS-Backend (will also edit the initial message to make this clear). There seems to be a discrepancy related to filters going to the master server and the servers that it returns as being fit for those, I will test to see if this is a common issue, if so, we would need to implement a way to query each server and filter them afterwards.