Skip to content

Commit bc2ac57

Browse files
authored
querySendPacket
replacing `sleep 1` with a while loop that checks if the `query.out` is empty or not with a timeout of 1 second
1 parent 9427216 commit bc2ac57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msctl

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

0 commit comments

Comments
 (0)