From 0bd352a11ec2673f7204931cc0a50c52e2f5f36d Mon Sep 17 00:00:00 2001 From: SoScared Date: Thu, 6 Sep 2018 18:41:27 +0200 Subject: [PATCH] update mod with ModSDK Sep 6 2018 --- .travis.yml | 1 + Makefile | 27 +++++++++++++++++++++++++-- changelog.txt | 31 +++++++++++++++++++++++++++---- fetch-engine.sh | 8 ++++++-- launch-dedicated.cmd | 3 +-- launch-dedicated.sh | 3 +-- packaging/linux/buildpackage.sh | 14 +++++++++----- packaging/linux/include/AppRun.in | 5 +++-- packaging/osx/buildpackage.sh | 11 ++++++++--- packaging/package-all.sh | 2 +- packaging/windows/buildpackage.sh | 8 +++++--- 11 files changed, 87 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61ea43c..17e0641 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ addons: script: - make - . mod.config; + awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format. File must be saved using unix-style (CR, not CRLF) line endings.\n"; travis_terminate 1); if [ "${TRAVIS_TEST_MOD}" == "True" ]; then make test || travis_terminate 1; fi; if [ "${TRAVIS_TEST_PACKAGING}" == "True" ]; then ./packaging/package-all.sh test-0 || travis_terminate 1; fi diff --git a/Makefile b/Makefile index 4ecdb4b..bdd2e20 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,31 @@ HAS_LUAC = $(shell command -v luac 2> /dev/null) LUA_FILES = $(shell find mods/*/maps/* -iname '*.lua') PROJECT_DIRS = $(shell dirname $$(find . -iname "*.csproj" -not -path "$(ENGINE_DIRECTORY)/*")) +scripts: + @awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format: file must be saved using unix-style (CR, not CRLF) line endings.\n"; exit 1) + @if [ ! -x "fetch-engine.sh" ] || [ ! -x "launch-dedicated.sh" ] || [ ! -x "launch-game.sh" ] || [ ! -x "utility.sh" ]; then \ + echo "Required SDK scripts are not executable:"; \ + if [ ! -x "fetch-engine.sh" ]; then \ + echo " fetch-engine.sh"; \ + fi; \ + if [ ! -x "launch-dedicated.sh" ]; then \ + echo " launch-dedicated.sh"; \ + fi; \ + if [ ! -x "launch-game.sh" ]; then \ + echo " launch-game.sh"; \ + fi; \ + if [ ! -x "utility.sh" ]; then \ + echo " utility.sh"; \ + fi; \ + echo "Repair their permissions and try again."; \ + echo "If you are using git you can repair these permissions by running"; \ + echo " git update-index --chmod=+x *.sh"; \ + echo "and commiting the changed files to your repository."; \ + exit 1; \ + fi + variables: - @if [ -z "$(MOD_ID)" ] || [ -z "$(ENGINE_DIRECTORY)" ];then \ + @if [ -z "$(MOD_ID)" ] || [ -z "$(ENGINE_DIRECTORY)" ]; then \ echo "Required mod.config variables are missing:"; \ if [ -z "$(MOD_ID)" ]; then \ echo " MOD_ID"; \ @@ -47,7 +70,7 @@ variables: exit 1; \ fi -engine: variables +engine: variables scripts @./fetch-engine.sh || (printf "Unable to continue without engine files\n"; exit 1) @cd $(ENGINE_DIRECTORY) && make core diff --git a/changelog.txt b/changelog.txt index 9cf0de1..4959d39 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,11 +1,34 @@ -!No more logs after July 29 2018 +OpenRAModSDK: https://github.com/OpenRA/OpenRAModSDK/commits/master +OpenRA Engine: https://github.com/OpenRA/OpenRA/commits/bleed -Latest commit tag: 5d1c37a4c55e1ec4d8ab7d83501e4ca6eb77c985 - 5d1c37a +uRA mod: https://github.com/RAunplugged/uRA (mod feature changelog WIP) +Unplugged OpenRA Engine fork: https://github.com/RAunplugged/OpenRA -Unplugged Engine - commits beyond the OpenRA engine -(https://github.com/RAunplugged/OpenRA/commits/bleed) +Unplugged OpenRA Engine Fork, added commits: + +1* Mask OpenRA IRC notifications: +https://github.com/OpenRA/OpenRA/commit/b53a3645753ecf8823c11e5c818b9d777b7b020e +2* Spec UI engine changes: +https://github.com/OpenRA/OpenRA/commit/493603b130d53991c08544015bc87a66a9658bd5 +3* Spec UI mods changes: +https://github.com/OpenRA/OpenRA/commit/91097078da479c83a004e9604cdf4b5b3f71c1ba +4* Add FlyCircleOnIdle trait: +https://github.com/OpenRA/OpenRA/commit/ca5c83a4f73cafb6f760da5c4eddf9c0f3093c83 +5* add MustaphaTR CustomProductionCost and Time traits: +https://github.com/OpenRA/OpenRA/commit/ca5c83a4f73cafb6f760da5c4eddf9c0f3093c83 + + + +Latest updates: + +OpenRAModSDK commit tag: 8c42cfb - 8c42cfb630602d23b0c30ea60a82c2b356277964 +OpenRA Engine commit tag: 5d1c37a - 5d1c37a4c55e1ec4d8ab7d83501e4ca6eb77c985 + + + +! No more mod logs after July 29 2018 (info below outdated). diff --git a/fetch-engine.sh b/fetch-engine.sh index 1cbd3ee..1eab9b4 100755 --- a/fetch-engine.sh +++ b/fetch-engine.sh @@ -2,7 +2,7 @@ # Helper script used to check and update engine dependencies # This should not be called manually -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } require_variables() { @@ -53,7 +53,11 @@ if [ "${AUTOMATIC_ENGINE_MANAGEMENT}" = "True" ]; then fi echo "Downloading engine..." - curl -s -L -o "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" -O "${AUTOMATIC_ENGINE_SOURCE}" || exit 3 + if command -v curl > /dev/null 2>&1; then + curl -s -L -o "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" -O "${AUTOMATIC_ENGINE_SOURCE}" || exit 3 + else + wget -cq "${AUTOMATIC_ENGINE_SOURCE}" -O "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" || exit 3 + fi # Github zipballs package code with a top level directory named based on the refspec # Extract to a temporary directory and then move the subdir to our target location diff --git a/launch-dedicated.cmd b/launch-dedicated.cmd index 19cd5cc..ac75753 100644 --- a/launch-dedicated.cmd +++ b/launch-dedicated.cmd @@ -4,7 +4,6 @@ set Name="Dedicated Server" set ListenPort=1234 -set ExternalPort=1234 set AdvertiseOnline=True set EnableSingleplayer=False set Password="" @@ -26,7 +25,7 @@ if not exist %ENGINE_DIRECTORY%\OpenRA.Game.exe goto noengine cd %ENGINE_DIRECTORY% :loop -OpenRA.Server.exe Game.Mod=%MOD_ID% Server.Name=%Name% Server.ListenPort=%ListenPort% Server.ExternalPort=%ExternalPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% +OpenRA.Server.exe Game.Mod=%MOD_ID% Server.Name=%Name% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% goto loop :noengine diff --git a/launch-dedicated.sh b/launch-dedicated.sh index 3feac05..2751541 100755 --- a/launch-dedicated.sh +++ b/launch-dedicated.sh @@ -37,7 +37,6 @@ require_variables "MOD_ID" "ENGINE_VERSION" "ENGINE_DIRECTORY" NAME="${Name:-"Dedicated Server"}" LAUNCH_MOD="${Mod:-"${MOD_ID}"}" LISTEN_PORT="${ListenPort:-"1234"}" -EXTERNAL_PORT="${ExternalPort:-"1234"}" ADVERTISE_ONLINE="${AdvertiseOnline:-"True"}" ENABLE_SINGLE_PLAYER="${EnableSingleplayer:-"False"}" PASSWORD="${Password:-""}" @@ -53,7 +52,7 @@ cd "${ENGINE_DIRECTORY}" while true; do MOD_SEARCH_PATHS="${MOD_SEARCH_PATHS}" mono --debug OpenRA.Server.exe Game.Mod="${LAUNCH_MOD}" \ - Server.Name="${NAME}" Server.ListenPort="${LISTEN_PORT}" Server.ExternalPort="${EXTERNAL_PORT}" \ + Server.Name="${NAME}" Server.ListenPort="${LISTEN_PORT}" \ Server.AdvertiseOnline="${ADVERTISE_ONLINE}" \ Server.EnableSingleplayer="${ENABLE_SINGLE_PLAYER}" Server.Password="${PASSWORD}" done diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 712409a..c2290bb 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -5,7 +5,7 @@ set -e command -v make >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires make."; exit 1; } command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } command -v tar >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires tar."; exit 1; } -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } require_variables() { missing="" @@ -70,7 +70,7 @@ MOD_VERSION=$(grep 'Version:' mods/${MOD_ID}/mod.yaml | awk '{print $2}') if [ "${PACKAGING_OVERWRITE_MOD_VERSION}" == "True" ]; then make version VERSION="${TAG}" -else +else echo "Mod version ${MOD_VERSION} will remain unchanged."; fi @@ -90,10 +90,14 @@ popd > /dev/null # Add native libraries echo "Downloading dependencies" -curl -s -L -o "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" || exit 3 +if command -v curl >/dev/null 2>&1; then + curl -s -L -o "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" || exit 3 + curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 +else + wget -cq "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" || exit 3 + wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 +fi tar xf "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" - -curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage chmod a+x appimagetool-x86_64.AppImage echo "Building AppImage" diff --git a/packaging/linux/include/AppRun.in b/packaging/linux/include/AppRun.in index d2fbc4d..647d6b1 100644 --- a/packaging/linux/include/AppRun.in +++ b/packaging/linux/include/AppRun.in @@ -4,7 +4,7 @@ MINIMUM_MONO_VERSION="4.2" prompt_apt_install_mono_complete() { - command -v mono >/dev/null 2>&1 && return 1 + command -v mono >/dev/null 2>&1 && command -v cert-sync >/dev/null 2>&1 && return 1 command -v apt-cache > /dev/null || return 1 command -v xdg-mime > /dev/null || return 1 command -v xdg-open > /dev/null || return 1 @@ -19,6 +19,7 @@ make_version() { mono_missing_or_old() { command -v mono >/dev/null 2>&1 || return 0 + command -v cert-sync >/dev/null 2>&1 || return 0 MONO_VERSION=$(mono --version | head -n1 | cut -d' ' -f5) [ "$(make_version "${MONO_VERSION}")" -lt "$(make_version "${MINIMUM_MONO_VERSION}")" ] && return 0 return 1 @@ -43,7 +44,7 @@ if prompt_apt_install_mono_complete; then fi if mono_missing_or_old; then - ERROR_MESSAGE="{MODNAME} requires Mono ${MINIMUM_MONO_VERSION} or greater.\nPlease install Mono using your system package manager." + ERROR_MESSAGE="{MODNAME} requires Mono ${MINIMUM_MONO_VERSION} or greater and the cert-sync utility.\nPlease install Mono using your system package manager." if command -v zenity > /dev/null; then zenity --no-wrap --error --title "{MODNAME}" --text "${ERROR_MESSAGE}" 2> /dev/null elif command -v kdialog > /dev/null; then diff --git a/packaging/osx/buildpackage.sh b/packaging/osx/buildpackage.sh index 42d4b78..2bf0a43 100755 --- a/packaging/osx/buildpackage.sh +++ b/packaging/osx/buildpackage.sh @@ -4,7 +4,7 @@ set -e command -v make >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires make."; exit 1; } command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } require_variables() { missing="" @@ -56,7 +56,12 @@ modify_plist() { } echo "Building launcher" -curl -s -L -o "${PACKAGING_OSX_LAUNCHER_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_OSX_LAUNCHER_SOURCE}" || exit 3 + +if command -v curl >/dev/null 2>&1; then + curl -s -L -o "${PACKAGING_OSX_LAUNCHER_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_OSX_LAUNCHER_SOURCE}" || exit 3 +else + wget -cq "${PACKAGING_OSX_LAUNCHER_SOURCE}" -O "${PACKAGING_OSX_LAUNCHER_TEMP_ARCHIVE_NAME}" || exit 3 +fi unzip -qq -d "${BUILTDIR}" "${PACKAGING_OSX_LAUNCHER_TEMP_ARCHIVE_NAME}" rm "${PACKAGING_OSX_LAUNCHER_TEMP_ARCHIVE_NAME}" @@ -82,7 +87,7 @@ MOD_VERSION=$(grep 'Version:' mods/${MOD_ID}/mod.yaml | awk '{print $2}') if [ "${PACKAGING_OVERWRITE_MOD_VERSION}" == "True" ]; then make version VERSION="${TAG}" -else +else echo "Mod version ${MOD_VERSION} will remain unchanged."; fi diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 3bb1909..dbb92d3 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -15,7 +15,7 @@ fi command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } command -v make >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires make."; exit 1; } -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } command -v makensis >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires makensis."; exit 1; } PACKAGING_DIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('$0')))") diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index 7ad36e8..47e53a7 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -1,7 +1,5 @@ #!/bin/bash set -e - -command -v curl >/dev/null 2>&1 || { echo >&2 "Windows packaging requires curl."; exit 1; } command -v makensis >/dev/null 2>&1 || { echo >&2 "Windows packaging requires makensis."; exit 1; } require_variables() { @@ -69,7 +67,7 @@ MOD_VERSION=$(grep 'Version:' mods/${MOD_ID}/mod.yaml | awk '{print $2}') if [ "${PACKAGING_OVERWRITE_MOD_VERSION}" == "True" ]; then make version VERSION="${TAG}" -else +else echo "Mod version ${MOD_VERSION} will remain unchanged."; fi @@ -93,6 +91,10 @@ cp -Lr "${TEMPLATE_ROOT}/mods/"* "${BUILTDIR}/mods" cp "mod.ico" "${BUILTDIR}/${MOD_ID}.ico" cp "${SRC_DIR}/OpenRA.Game.exe.config" "${BUILTDIR}" +# We need to set the loadFromRemoteSources flag for the launcher, but only for the "portable" zip package. +# Windows automatically un-trusts executables that are extracted from a downloaded zip file +cp "${SRC_DIR}/OpenRA.Game.exe.config" "${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe.config" + echo "Compiling Windows launcher" sed "s|DISPLAY_NAME|${PACKAGING_DISPLAY_NAME}|" "${SRC_DIR}/packaging/windows/WindowsLauncher.cs.in" | sed "s|MOD_ID|${MOD_ID}|" | sed "s|FAQ_URL|${PACKAGING_FAQ_URL}|" > "${BUILTDIR}/WindowsLauncher.cs" mcs -sdk:4.5 "${BUILTDIR}/WindowsLauncher.cs" -warn:4 -codepage:utf8 -warnaserror -out:"${BUILTDIR}/${PACKAGING_WINDOWS_LAUNCHER_NAME}.exe" -t:winexe ${LAUNCHER_LIBS} -win32icon:"${BUILTDIR}/${MOD_ID}.ico"