Comments (6)
The error is pretty clear : the request timed out
With the current implementation, the timeout is fixed at 1 second and you can't really change it globally. I opened a PR to support this (#72)
Your problem is either that the server is actually down, or that it's too slow (could be too far way from you too) to reply in under 1 second
from node-gamedig.
sorry for late reply.
after almost 2 weeks dealing with this module i can't really rely on it for my huge project..it works for 3/10 queries for the same server. i know most of the time it's because of the servers that i query but i can't find a better solution.
any suggestions for a reliable solution?
from node-gamedig.
I'm not the author of the module, all the magic and the actual work here is in parsing the responses from the servers. It's an ancient protocol, that can vary greatly between games. The underlying technology provided by Steam is - to be a bit blunt about it - quite shit.
I think the inconsistencies you're experiencing are due in part to that, and I don't think there's another solution (no other - more modern - protocol that I know of, and based on my research, this is already one of the most comprehensive library out there).
I would however increase the global timeout to see if it fixes some of your problems, for me it did very significantly. For instance, when pinging 10k servers at a 1s timeout I will get something like 6k replies. With a 2s timeout, I'll get 8 or 9k. Maybe it's your problem too, just servers taking a while to reply.
If you want to try this right now without messing around to much, uninstall the official Gamedig (npm uninstall gamedig
) and install my version which has all the PRs currently opened merged into main (npm i git+https://github.com/Coriou/node-gamedig.git
). It just will give you a few more options, but won't break your existing code. Then, increase the timeout globally (GameDig.query({ type: 'XXX', host: 'xxx.xxx.xxx.xxx', port: xxx, timeout: 2000})
) and try again. If you don't see a real improvement after doing that, then maybe you can open a new issue with the extensive logs from Gamedig in debug mode and maybe the real problem will be identified.
from node-gamedig.
Hi, sorry for the delayed reply. You can actually already increase the udp watchdog timeout by passing socketTimeout: 3000
(or even higher) along with your query options. Feel free to re-open if this does not solve your problem.
from node-gamedig.
thank you all for the detailed answers, you guys are awesome and this module is awesome, i'll try to do all your recommendations mentioned above. you are a great team.
from node-gamedig.
Apologise in advance for the bump a year later, but mine still doesn't work even after passing socketTimeout: 5000. I'm attempting to query a Garry's Mod server.
Error: Failed all 1 attempts at QueryRunner.run (/home/runner/node_modules/gamedig/lib/QueryRunner.js:88:21) Attempt #1 - Port=27015 Retry=0: Error: UDP - Timed out after 5000ms
Let me know what you've got, thanks. 👍
from node-gamedig.
Related Issues (20)
- bug: Terraria protocol doesn't seem to be working HOT 2
- Battebit Remastered Support HOT 20
- feat: custom info to add to the embeds HOT 2
- bug: steam://connect link now
- feat: Add status object player's online time HOT 8
- bug: Assetto Corsa's incorrect numplayers value HOT 1
- bug: valheim player count is wrong HOT 17
- bug: Just Cause 2 Gamedig 5 error HOT 2
- Myth of Empires support HOT 5
- bug: TeamSpeak2 server name not showing HOT 1
- bug: Squad now using EOS instead of Valve HOT 8
- bug: beammp maxplayers incorrect
- feat: add pull request templates
- Gamedig not working witch Minecraft velocity: mc.elenox.net HOT 9
- Palworld only listed if using default game port HOT 17
- Palworld broken after update HOT 32
- feat: Support torque game engine based games HOT 2
- feat: Support Minecraft favicon HOT 1
- bug: TypeScript types not working for package types `module` HOT 5
- Support Soulmask game HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gamedig.