diff --git a/.gitignore b/.gitignore index fcffa6b..492e8a0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ encrypt_credentials.go src/anticheat/*credentials* src/anticheat/key* dist +fly.io Dockertrigger !/**/.gitkeep diff --git a/Makefile b/Makefile index d6438fa..075f639 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ apply-patches: $(PATCH) < patches/serverbotbalanceearly.patch $(PATCH) < patches/filterservers.patch $(PATCH) < patches/bans.patch + $(PATCH) < patches/enet_mtu_1300.patch cd src && make depend gzip-cfgs: diff --git a/anticheat.sh b/anticheat.sh index 773759b..735dbff 100755 --- a/anticheat.sh +++ b/anticheat.sh @@ -3,7 +3,6 @@ cd $(dirname $0) # change into script directory in case it's called from somewhere else # SAUER_OPTIONS contains any command line options you would like to start Sauerbraten with. -#SAUER_OPTIONS="-f" SAUER_OPTIONS="-q${HOME}/.sauerbraten" if [ "${XDG_SESSION_TYPE}" = wayland ] diff --git a/patches/enet_mtu_1300.patch b/patches/enet_mtu_1300.patch new file mode 100644 index 0000000..355832e --- /dev/null +++ b/patches/enet_mtu_1300.patch @@ -0,0 +1,16 @@ +this patch is needed in order to run servers on fly.io. due to their anycast setup, they tunnel and encrypt the UDP traffic. +see https://fly.io/docs/app-guides/udp-and-tcp/#you-might-need-to-be-mindful-of-mtus + +diff --git src/enet/include/enet/enet.h src/enet/include/enet/enet.h +index fc45cbd..2246327 100644 +--- src/enet/include/enet/enet.h ++++ src/enet/include/enet/enet.h +@@ -212,7 +212,7 @@ enum + ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024, + ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024, + ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000, +- ENET_HOST_DEFAULT_MTU = 1400, ++ ENET_HOST_DEFAULT_MTU = 1300, + ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024, + ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024, + diff --git a/src/enet/include/enet/enet.h b/src/enet/include/enet/enet.h index fc45cbd..ee607f7 100644 --- a/src/enet/include/enet/enet.h +++ b/src/enet/include/enet/enet.h @@ -212,7 +212,7 @@ enum ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024, ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024, ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000, - ENET_HOST_DEFAULT_MTU = 1400, + ENET_HOST_DEFAULT_MTU = 1300, ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024, ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024,