From 624f5691ba13d85e0c59a93c1370a042370ace3a Mon Sep 17 00:00:00 2001 From: Anders Wiberg Olsen Date: Wed, 12 Jan 2022 20:06:24 +0100 Subject: [PATCH] Force IPv4 ping in ServerStart.bat when using DNS resolution Ping does not respond with a TTL if the server responds with an IPv6 address. This essentially means that the script will think the user does not have internet, if they have a public IPv6 address. Forcing IPv4 in the ping command, ensures TTL gets returned, and the startup can proceed. This issue is only relevant in the batch script, as that is the only script that asserts on TTL being present in the output. It is also only an issue when pinging minecraftforge.net, as that relies on DNS resolution. This means the output differs if the DNS server returns IPv4 (the A record) or IPv6 (the AAAA record). Closes #88 --- ServerStart.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ServerStart.bat b/ServerStart.bat index fa6d6f2..2b439f6 100644 --- a/ServerStart.bat +++ b/ServerStart.bat @@ -609,7 +609,7 @@ IF NOT %MC_SERVER_IGNORE_OFFLINE% EQU 0 ( ) REM Ping minecraftforge before attempting download -%MC_SYS32%\PING.EXE -n 2 -w 1000 minecraftforge.net | %MC_SYS32%\FIND.EXE "TTL=" 1>> "%~dp0logs\serverstart.log" 2>&1 +%MC_SYS32%\PING.EXE -n 2 -w 1000 minecraftforge.net -4 | %MC_SYS32%\FIND.EXE "TTL=" 1>> "%~dp0logs\serverstart.log" 2>&1 IF %ERRORLEVEL% EQU 0 ( ECHO INFO: Ping of "minecraftforge.net" Successfull 1>> "%~dp0logs\serverstart.log" 2>&1 ) ELSE (