Closed Sir-Will closed 3 years ago
What game engine is this?
Source, ARK.
Might be because the online players is above the max?
It is possible that Ark deviates from the protocol specification and requires a higher maximum packet size.
I added a client option that allows you to change the maximum size here: https://github.com/rumblefrog/go-a2s/commit/4c67caf251ef40b139ab43a23355a0bf948ccde5
It's not for all ARK server IP's. I queried 2k IP's and this is one of the few which results in the error.
I assume the option just allows bigger packets while smaller ones will still work?
Yes, smaller ones should still work.
And in that scenario, I presume the server modified the a2s player payload, and sent a malformed one; judging from the # of players exceeding maximum players.
Okay, I will try it out, thanks.
Any idea why it causes a runtime error on Ubuntu and not on Windows though? If I query multiple IP's and there is one bad one it will result in no result, as it exits.
It'd have to be the underneath API that golang binds to, that error message is WSAEMSGSIZE 10040 on Windows Winsock, for Linux, it uses a different implementation underneath.
Can this be prevented by checking the length before using the index?
Actually, this will probably work to keep it running? (I'm not experienced in go).
defer func() {
if r := recover(); r != nil {
log.Println("Recovered in source query", r)
}
}()
That's what some of the official packages use as try-catch, so yes, it seems right.
I'm getting the runtime error below when querying the players of
85.190.155.172:27015
under ubuntu.When doing the same under windows it doesn't crash and just returns the error (wsarecv: A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.).