Egg Repository

Pterodactyl Community Egg Repository

Teeworlds

Teeworlds is a free online multiplayer game, available for all major operating systems. Battle with up to 16 players in a variety of game modes, including Team Deathmatch and Capture The Flag. You can even design your own maps!

Read Me

Teeworlds

From their Site

Teeworlds is a free online multiplayer game, available for all major operating systems. Battle with up to 16 players in a variety of game modes, including Team Deathmatch and Capture The Flag. You can even design your own maps

Server Ports

Ports required to run the server in a table format.

Port default
Game 8303
Yolks
NameTag
ghcr.io/ptero-eggs/yolks:debianghcr.io/ptero-eggs/yolks:debian
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
Server NameThe Display Name for the serverSERVER_NAMEA Pterodactyl Hosted Teeworlds ServerYesYes
Server MotDServer Message of the Day displayed to all users.SERVER_MOTDA Pterodactyl Hosted Teeworlds ServerYesYes
Install Script
## teeworlds pterodactyl installer
apt update
apt upgrade -y
apt install -y curl jq file

GITHUB_PACKAGE="teeworlds/teeworlds"
MATCH="linux_x86_64"

if [ ! -d /mnt/server ]; then
    mkdir -p /mnt/server/
fi

cd /mnt/server

if [ -z "${GITHUB_USER}" ] && [ -z "${GITHUB_OAUTH_TOKEN}" ] ; then
    echo -e "using anon api call"
else
    echo -e "user and oauth token set"
    alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '
fi

## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases")

if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
    DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
    VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
        DOWNLOAD_LINK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
    fi
fi

if [ ! -z "${DOWNLOAD_URL}"]; then 
    if curl --output /dev/null --silent --head --fail ${DOWNLOAD_URL}; then
        echo -e "link is valid. setting download link to ${DOWNLOAD_URL}"
        DOWNLOAD_LINK=${DOWNLOAD_URL}
    else        
        echo -e "link is invalid closing out"
        exit 2
    fi
fi

## setting variable names for later
FILE_NAME=${DOWNLOAD_LINK##*/}
FOLDER_NAME=${FILE_NAME%.tar.gz}

echo -e "running 'curl -sSL ${DOWNLOAD_LINK} -o ${FILE_NAME}'"
curl -sSL ${DOWNLOAD_LINK} -o ${FILE_NAME}

FILETYPE=$(file -F ',' ${FILE_NAME} | cut -d',' -f2 | cut -d' ' -f2)
if [ "$FILETYPE" == "gzip" ]; then
    tar xzvf ${FILE_NAME}
elif [ "$FILETYPE" == "Zip" ]; then
    unzip ${FILE_NAME}
elif [ "$FILETYPE" == "XZ" ]; then
    tar xvf ${FILE_NAME}
else
    echo -e "unknown filetype. Exiting"
    # exit 2 
fi

## cleanup old files
mv ${FOLDER_NAME}/* ./

rm -rf ${FILE_NAME} ${FOLDER_NAME}

## download default config
if [ ! -f /mnt/server/autoexec.cfg ]; then
    curl -sSL https://raw.githubusercontent.com/ptero-eggs/game-eggs/main/teeworlds/autoexec.cfg > /mnt/server/autoexec.cfg
fi

## download safe storage file
## overwrites any that exists.
curl -sSL https://raw.githubusercontent.com/ptero-eggs/game-eggs/main/teeworlds/storage.cfg > /mnt/server/storage.cfg

echo -e "Install complete."