gamedig / node-gamedig

Query game servers and not only! Node.JS/Deno/Bun or Bash (via the CLI).
https://www.npmjs.com/package/gamedig
MIT License
606 stars 148 forks source link

Added c query requests for gtasao (open.mp) #547

Closed Focus04 closed 7 months ago

Focus04 commented 7 months ago

This is a follow-up to #388. User who opened the issue was right and has been backed up by various open.mp devs. D query is not yet supported by omp, which breaks regular gtasam queries on these servers, resulting in an empty players array. A workaround is using C queries instead, similarly to how vcm is handled, which returns a less detailed, but handy array of players along with their scores. This adds a separate protocol for the already existing gtasao query type, which extends base samp. This new protocol sends a C packet instead of D and will consequently return a populated array of players, as expected. Below are 2 queries for a server running open.mp with these changes added. More of a before and afer since both queries previously returned empty players arrays.

image (2)