Merge pull request #277 from Sehnryr/time_optimisation

querySendPacket runtime optimisation
This commit is contained in:
Jason M. Wood 2021-03-16 14:19:24 -05:00 committed by GitHub
commit 7791e7850a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
msctl
View File

@ -1822,7 +1822,7 @@ querySendPacket() {
print map { pack ("C", hex($_)) } ($packet =~ /(..)/g);
' -- -packet="$PACKET" >>"$WORLD_DIR/query.in"
# Give the Query server a moment to respond.
sleep 1
timeout 1 sh -c "while [ ! -s '$WORLD_DIR/query.out' ]; do :; done"
# Unpack the response packet from the query.out buffer file. There are a
# variable amount of null bytes at the start of the response packet, so
# find the start of the response by searching for the packet type and ID.