Closed xenouch closed 8 months ago
The problem appears when i use the "socketTimeout" option. Default "2000" or custom "250" same thing crash
gamedig.GameDig.query({ type: ''+game+'', host: ''+host+'',
debug: true, socketTimeout: '2000', }).then((state) => { return state; })
Only work without "socketTimeout"
gamedig.GameDig.query({ type: ''+game+'', host: ''+host+'',
debug: true, }).then((state) => { return state; })
Hello @xenouch! I'm not sure I follow your issue...
You should not see a difference when using a function or the CLI. What could be the case here, is that you are running different gamedig versions. Palworld was just recently added and some bugs were found, so make sure you're using the latest version on both scenarios.
—
About the socketTimeout, 2000
is the default time. If you're using 250
, theres a big chance you'll get an error, as 250
might not be enough time to query and it will timeout.
Tried querying a random Palworld server and it didn't work when using 250
, as expected.
// Works fine
gamedig --type palworld 195.18.27.172:8211 --socketTimeout 2000
// Error
gamedig --type palworld 195.18.27.172:8211 --socketTimeout 250
Hello @podrivo
I'm using: 5.0.0-beta.0 when i get the error.
Yes, if i specify"socketTimeout" "default or custom value" for Palworld i get the error. If i dont specify "socketTimeout" i dont have any error
The "socketTimeout 250" is for my MC server. I understand it not work with all game and i adjust for specific game.
I'm not sure I follow... Are you having problems with Palworld or Minecraft?
@xenouch Are you still having problems querying your server?
Sorry for the delay.
I dont have problem if i dont set socketTimeout "default value or custom"
This dont work
gamedig.GameDig.query({ type: ''palworld", host: ''+host+'',
debug: true, socketTimeout: '2000', }).then((state) => { return state; })
This work
gamedig.GameDig.query({ type: ''palworld", host: ''+host+'',
debug: true, }).then((state) => { return state; })
2000
is the default for socketTimeout
, so even though you don't specify a socketTimeout
, it's still being passed as 2000
. So it should not have a difference from both codes you posted.
@xenouch Would you mind posting the debug
log from both options, please?
With and without socketTimeout: '2000'
.
Thank you!
This is the result for palword:
Without socketTimeout https://pastebin.com/G7uxzf6x
With socketTimeout: '2000' https://pastebin.com/4h3XrzA8
With socketTimeout: 2000 "quote removed" https://pastebin.com/tJg6aRwe
I think the problem is the quote but i dont have problem with minecraft.
This is the result for minecraft:
Without socketTimeout https://pastebin.com/E0vwjYVb
With socketTimeout: '2000' https://pastebin.com/mcCES2Wn
With socketTimeout: 2000 "quote removed" https://pastebin.com/GUGXrFuQ
Yeah, so the problem is definitely when using single quotes in your implementation.
Minecraft is a special gem and may have different ways of working with socketTimeout
, which may also be related to this other issue https://github.com/gamedig/node-gamedig/issues/370.
@xenouch That said, would you mind trying other games other than Minecraft to check this? No need to paste query responses, it would be just to confirm the use of single quotes breaking your implementation.
Best.
I try with ts3 server when AT home !
I try with teamspeak3 and counterstrike2
socketTimeout: '2000' - No problem
socketTimeout: 2000 - No problem
I try with Ark: Survival Ascended who use [EOS Protocol] like Palworld
Same problem
socketTimeout: '2000' - Error
socketTimeout: 2000 - No problem
Maybe problem with EOS protocol !
You aren't supposed to pass the socketTimeout
value as a string
(with quotes), as documented in the readme, it must be a number (without quotes), regardless of protocol used.
TeamSpeak 3, CS2 and Minecraft all use raw sockets to get their data, ASA uses EOS which does a HTTP request.
Apparently, got
(a library we use for http requests) throws an error if we pass the timeout as a string, here:
Closing this as its not related to Palworld and this option is already documented to be passed as a number. Thanks for pointing this out! Feel free to reopen if problems still arise regarding this.
Hey,
I got this error when i call my function to get my Palworld server info. No probleme with other game "'Mincraft"
No probleme when i use cli
Thanks in advance !