Prepare 1st release
This commit is contained in:
128
Run.sh
Normal file
128
Run.sh
Normal file
@@ -0,0 +1,128 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
OUTPUT_DIR="$2"
|
||||
DEFAULT_CFG_FILE=UnrealTournament.ini
|
||||
CFG_FILE="${3:-$DEFAULT_CFG_FILE}"
|
||||
|
||||
function add_iniKeyEx() {
|
||||
crudini --set $OUTPUT_DIR/System/$1 $2 __$3 $4
|
||||
# Warning: ugly hack with sed to allow multiple key instances + to remove space around '='
|
||||
sed -i "s/[[:space:]]*__$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*/$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')=/g" $OUTPUT_DIR/System/$1
|
||||
}
|
||||
# !!Warning!! section is not considered
|
||||
function del_iniKeyEx() {
|
||||
sed -i "/[[:space:]]*$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*$(echo $4 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/d" $OUTPUT_DIR/System/$1
|
||||
}
|
||||
function add_iniKey() {
|
||||
add_iniKeyEx $CFG_FILE $1 $2 $3
|
||||
}
|
||||
# !!Warning!! section is not considered
|
||||
function del_iniKey() {
|
||||
del_iniKeyEx $CFG_FILE $1 $2 $3
|
||||
}
|
||||
function add_ServerPackage() {
|
||||
add_iniKey 'Engine.GameEngine' ServerPackages $1
|
||||
add_iniKey 'XC_Engine.XC_GameEngine' ServerPackages $1
|
||||
}
|
||||
function del_ServerPackage() {
|
||||
del_iniKey 'Engine.GameEngine' ServerPackages $1
|
||||
del_iniKey 'XC_Engine.XC_GameEngine' ServerPackages $1
|
||||
}
|
||||
function add_ServerActors() {
|
||||
add_iniKey 'Engine.GameEngine' ServerActors $1
|
||||
add_iniKey 'XC_Engine.XC_GameEngine' ServerActors $1
|
||||
}
|
||||
function del_ServerActors() {
|
||||
del_iniKey 'Engine.GameEngine' ServerActors $1
|
||||
del_iniKey 'XC_Engine.XC_GameEngine' ServerActors $1
|
||||
}
|
||||
|
||||
function getmodprefix() {
|
||||
UFile=$(find $OUTPUT_DIR/System -type f -name "IChaChaMutEngine*.u" -exec basename {} \;)
|
||||
BaseName="${UFile%.*}"
|
||||
echo "$BaseName"
|
||||
}
|
||||
|
||||
function install() {
|
||||
rsync -a $SCRIPT_DIR/System/ $OUTPUT_DIR/System --exclude '.git'
|
||||
|
||||
echo install ok
|
||||
}
|
||||
|
||||
function enable() {
|
||||
BaseName="$(getmodprefix)"
|
||||
|
||||
add_ServerPackage $BaseName
|
||||
|
||||
echo enable ok
|
||||
}
|
||||
|
||||
function disable() {
|
||||
BaseName="$(getmodprefix)"
|
||||
|
||||
del_ServerPackage $BaseName
|
||||
|
||||
echo disable ok
|
||||
}
|
||||
|
||||
function show_help() {
|
||||
echo
|
||||
echo "Usage: $0 { getmodprefix |install | enable | disable } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
|
||||
echo
|
||||
}
|
||||
|
||||
function check_cfg_file() {
|
||||
if [ -z ${CFG_FILE} ]
|
||||
then
|
||||
echo "CFG_FILE is unset, setting it to $DEFAULT_CFG_FILE"
|
||||
CFG_FILE=$DEFAULT_CFG_FILE
|
||||
else
|
||||
echo "CFG_FILE is set to '$CFG_FILE'"
|
||||
fi
|
||||
|
||||
if [ ! -f $OUTPUT_DIR/System/$CFG_FILE ]
|
||||
then
|
||||
echo "$OUTPUT_DIR/System/$CFG_FILE does not exist"
|
||||
show_help
|
||||
exit 9999 # die with error code 9999
|
||||
fi
|
||||
}
|
||||
|
||||
function check_game_dir() {
|
||||
### Check if a directory does not exist ###
|
||||
if [ -z $OUTPUT_DIR ]
|
||||
then
|
||||
echo "incorrect <UT99_INSTALL_DIR>"
|
||||
show_help
|
||||
exit 9999 # die with error code 9999
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'getmodprefix')
|
||||
check_game_dir
|
||||
getmodprefix
|
||||
;;
|
||||
'install')
|
||||
check_game_dir
|
||||
install
|
||||
;;
|
||||
'enable')
|
||||
check_game_dir
|
||||
check_cfg_file
|
||||
disable
|
||||
enable
|
||||
;;
|
||||
'disable')
|
||||
check_game_dir
|
||||
check_cfg_file
|
||||
disable
|
||||
;;
|
||||
*)
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
BIN
System/IChaChaMutEngineV1.u
Normal file
BIN
System/IChaChaMutEngineV1.u
Normal file
Binary file not shown.
7
make.bat
7
make.bat
@@ -1,2 +1,5 @@
|
||||
del %~dp0\..\System\IChaChaMutEngineV1.u
|
||||
%~dp0\..\System\ucc.exe make IChaChaMutEngineV1
|
||||
set UArtifactName=IChaChaMutEngineV1
|
||||
del %~dp0\..\System\%UArtifactName%.u
|
||||
del %~dp0\System\%UArtifactName%.u
|
||||
%~dp0\..\System\ucc.exe make %UArtifactName%
|
||||
xcopy %~dp0\..\System\%UArtifactName%.u %~dp0\System\
|
||||
Reference in New Issue
Block a user