Skip to content

Commit

Permalink
update mod with ModSDK Sep 6 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
SoScared committed Sep 6, 2018
1 parent 3b6498e commit 0bd352a
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 26 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 25 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"; \
Expand All @@ -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

Expand Down
31 changes: 27 additions & 4 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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).



Expand Down
8 changes: 6 additions & 2 deletions fetch-engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions launch-dedicated.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

set Name="Dedicated Server"
set ListenPort=1234
set ExternalPort=1234
set AdvertiseOnline=True
set EnableSingleplayer=False
set Password=""
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions launch-dedicated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-""}"
Expand All @@ -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
14 changes: 9 additions & 5 deletions packaging/linux/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions packaging/linux/include/AppRun.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
11 changes: 8 additions & 3 deletions packaging/osx/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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}"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packaging/package-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')))")
Expand Down
8 changes: 5 additions & 3 deletions packaging/windows/buildpackage.sh
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit 0bd352a

Please sign in to comment.