Closed oreleraki closed 3 years ago
I'm not totally sure what's up with this one. Every other ut99 server I tried (from gametracker) seems to respond properly, either with a list of players, or with an empty callback if the server is empty.
@sonicsnes This doesn't happen in every server, i suspect it happening in server that support "XServerQuery" extended info, but not yet sure.
Reproduce:
type: 'ut',
//host: '139.162.235.20',
host: 'de2.zkyp.nl',
//port: '7777'
debug: true,
After debugging i'm noticing it extracting "\info\" but it doesn't receive socket callback for "\players\", i tried creating a dgram and fire to \players\ to the same ip and got response.
ut gamespy1 request can be built and is being built by 3 parts: \info\ \rules \players\ I found out that only the first 2 sections are work: "\info\" and "\rules\" while the third request "\players\" is failing. But when i comment out "\rules\" and left it to "\info" and "\players\" it's working. This leads me to think that sometimes there is an issue with the 3rd(or because it last) request. I verified it by switching the order of \rules\ and \players\ so now it's \players\ \rules\ and not i'm failing on rules and not players. Something apparently is not recycle correctly.
If you have any suggestion will glad to here them.
Most likely the "port" parameter should be of the type Number (Personally, I had a problem with this)
type: 'ut', host: '139.162.235.20", port: 7777, debug: true
Most likely the "port" parameter should be of the type Number (Personally, I had a problem with this)
type: 'ut', host: '139.162.235.20", port: 7777, debug: true
Nope, that isn't the issue.
Is there a server up consistently which exhibits this issue?
Is there a server up consistently which exhibits this issue?
31.220.4.155:2250 66.85.80.155:7797 - Problematic, XServerQuery reply
Probably a problem with how it interacts with XServerQuery servers.
It seems that both of these servers are working properly for me locally 🤔
Only suspicious thing I see is that player names aren't getting extracted properly.
Are you running gamedig on a server? Is it possible 66.85.80.155 is blocking your address? (Some game server providers block dedicated server blocks to avoid vpn abuse by cheaters).
Perhaps the response udp packet is too large to navigate your network equipment?
Are you running gamedig on a server? Is it possible 66.85.80.155 is blocking your address? (Some game server providers block dedicated server blocks to avoid vpn abuse by cheaters).
Perhaps the response udp packet is too large to navigate your network equipment?
It's on my local computer and it works well except few servers i identify as running XServerQuery. I will give you more servers in couple of hours when there will be more activity.
Here is my testing code
GameDig = require('gamedig');
//var address = "31.220.4.155:2250";
var address = "66.85.80.155:7797"; //\XServer
const host = address.split(':')[0];
const port = address.split(':').length == 1 ? 7777 : address.split(':')[1];
console.log(`Host: ${host}, Port: ${port}`);
const res = GameDig.query({
type: 'ut',
host: host,
port: +port,
debug: true,
}, (error, state) => {
//console.error(error);
console.log(state);
})
res.then(console.log);
Yep, it also works for me locally using your test code 😓
Query this: "31.186.251.18:7777"
Host: 31.186.251.18, Port: 7777
(node:15824) UnhandledPromiseRejectionWarning: Error: Failed all 2 attempts
at QueryRunner.run (I:\New folder\MyDev\utquery\node_modules\gamedig\lib\QueryRunner.js:88:21)
Attempt #1 - Port=7778 Retry=0:
Error: UDP - Timed out after 2000ms
at Timeout.<anonymous> (I:\New folder\MyDev\utquery\node_modules\gamedig\lib\Promises.js:7:25)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Attempt #2 - Port=7777 Retry=0:
Error: UDP - Timed out after 2000ms
at Timeout.<anonymous> (I:\New folder\MyDev\utquery\node_modules\gamedig\lib\Promises.js:7:25)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
(node:15824) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled
with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Strangely, I can't get that server to respond to xserverquery packets at all, making me think it isn't running xserverquery. However, it DOES respond to a combination \rules\players\ query, including both the rules and players in a single packet. I wasn't aware this was possible with gamespy1, but it was mentioned on the xserverquery wiki as valid. If this works for all gamespy1 servers, we could probably just switch all of them, since it's definitely more efficient to only need to send a single query packet...
Q#0 31.186.251.18:7778 UDP-->
Q#0 Buffer length: 16 bytes
5c 72 75 6c 65 73 5c 5c 70 6c 61 79 65 72 73 5c
\ r u l e s \ \ p l a y e r s \
31.186.251.18:7778 <--UDP
Buffer length: 468 bytes
5c 6d 75 74 61 74 6f 72 73 5c 49 47 2b 36 44 20 55 54 50 75 72
\ m u t a t o r s \ I G + 6 D U T P u r
65 2c 20 49 47 2b 36 44 20 53 54 5f 4d 75 74 61 74 6f 72 2c 20
e , I G + 6 D S T _ M u t a t o r ,
49 47 2b 36 44 20 4e 65 77 4e 65 74 49 47 2c 20 50 47 20 46 6c
I G + 6 D N e w N e t I G , P G F l
61 67 73 2c 20 4d 61 70 20 56 6f 74 65 20 55 6c 74 69 6d 61 74
a g s , M a p V o t e U l t i m a t
65 20 32 2e 34 5c 6c 69 73 74 65 6e 73 65 72 76 65 72 5c 46 61
e 2 . 4 \ l i s t e n s e r v e r \ F a
6c 73 65 5c 70 61 73 73 77 6f 72 64 5c 54 72 75 65 5c 74 69 6d
l s e \ p a s s w o r d \ T r u e \ t i m
65 6c 69 6d 69 74 5c 32 30 5c 67 6f 61 6c 74 65 61 6d 73 63 6f
e l i m i t \ 2 0 \ g o a l t e a m s c o
72 65 5c 30 5c 6d 69 6e 70 6c 61 79 65 72 73 5c 30 5c 63 68 61
r e \ 0 \ m i n p l a y e r s \ 0 \ c h a
6e 67 65 6c 65 76 65 6c 73 5c 54 72 75 65 5c 6d 61 78 74 65 61
n g e l e v e l s \ T r u e \ m a x t e a
6d 73 5c 32 5c 62 61 6c 61 6e 63 65 74 65 61 6d 73 5c 46 61 6c
m s \ 2 \ b a l a n c e t e a m s \ F a l
73 65 5c 70 6c 61 79 65 72 73 62 61 6c 61 6e 63 65 74 65 61 6d
s e \ p l a y e r s b a l a n c e t e a m
73 5c 46 61 6c 73 65 5c 66 72 69 65 6e 64 6c 79 66 69 72 65 5c
s \ F a l s e \ f r i e n d l y f i r e \
30 25 5c 74 6f 75 72 6e 61 6d 65 6e 74 5c 54 72 75 65 5c 67 61
0 % \ t o u r n a m e n t \ T r u e \ g a
6d 65 73 74 79 6c 65 5c 48 61 72 64 63 6f 72 65 5c 41 64 6d 69
m e s t y l e \ H a r d c o r e \ A d m i
6e 4e 61 6d 65 5c 70 67 20 61 64 6d 69 6e 73 5c 70 6c 61 79 65
n N a m e \ p g a d m i n s \ p l a y e
72 5f 30 5c 73 4d 66 5c 66 72 61 67 73 5f 30 5c 30 5c 70 69 6e
r _ 0 \ s M f \ f r a g s _ 0 \ 0 \ p i n
67 5f 30 5c 20 35 34 5c 74 65 61 6d 5f 30 5c 31 5c 6d 65 73 68
g _ 0 \ 5 4 \ t e a m _ 0 \ 1 \ m e s h
5f 30 5c 46 65 6d 61 6c 65 20 43 6f 6d 6d 61 6e 64 6f 5c 73 6b
_ 0 \ F e m a l e C o m m a n d o \ s k
69 6e 5f 30 5c 46 43 6f 6d 6d 61 6e 64 6f 53 6b 69 6e 73 2e 63
i n _ 0 \ F C o m m a n d o S k i n s . c
6d 64 6f 5c 66 61 63 65 5f 30 5c 46 43 6f 6d 6d 61 6e 64 6f 53
m d o \ f a c e _ 0 \ F C o m m a n d o S
6b 69 6e 73 2e 4e 69 6b 69 74 61 5c 6e 67 73 65 63 72 65 74 5f
k i n s . N i k i t a \ n g s e c r e t _
30 5c 66 61 6c 73 65 5c 71 75 65 72 79 69 64 5c 34 37 2e 31 5c
0 \ f a l s e \ q u e r y i d \ 4 7 . 1 \
66 69 6e 61 6c 5c
f i n a l \
Q#0 Registered RTT: 139ms
Q#0 Received part num=1 queryId=47 final=true
Q#0 Received part #1 of 1
Q#0 Received all parts
Q#0 {
mutators: 'IG+6D UTPure, IG+6D ST_Mutator, IG+6D NewNetIG, PG Flags, Map Vote Ultimate 2.4',
listenserver: 'False',
password: 'True',
timelimit: '20',
goalteamscore: '0',
minplayers: '0',
changelevels: 'True',
maxteams: '2',
balanceteams: 'False',
playersbalanceteams: 'False',
friendlyfire: '0%',
tournament: 'True',
gamestyle: 'Hardcore',
AdminName: 'pg admins',
player_0: 'sMf',
frags_0: '0',
ping_0: ' 54',
team_0: '1',
mesh_0: 'Female Commando',
skin_0: 'FCommandoSkins.cmdo',
face_0: 'FCommandoSkins.Nikita',
ngsecret_0: 'false'
}
Q#0 UDP send finished by callback
Q#0 31.186.251.18:7778 UDP-->
Q#0 Buffer length: 9 bytes
5c 70 6c 61 79 65 72 73 5c
\ p l a y e r s \
Q#0 UDP timeout detected
What more strange is if you switch between the order of them, and query players
and then rules
then rules
get a timeout. (From what i tested few months ago)
Give 3.0.3 a shot.
Looks like the commit fixed the issue. Thank you mate :)
It seems that a perfectly function servers are returning "Server is offline". When i enabled debug, i received in logs all messages. But it seems that some expected udp response got timeouts.