Merge branch 'master' into localization

This commit is contained in:
GenZmeY 2020-08-11 18:46:19 +03:00
commit 18cbb36f55
3 changed files with 24 additions and 18 deletions

View File

@ -1 +1 @@
Server-Ext (RPG mod) ServerExt (RPG mod)

Binary file not shown.

40
make.sh
View File

@ -41,13 +41,22 @@ function show_help ()
function compile () function compile ()
{ {
rm -f "$MutBinUnpublish/ServerExt.u" "$MutBinUnpublish/ServerExtMut.u" rm -rf "$MutUnpublish"
mkdir -p \
"$MutUnpublish" \
"$MutStructScript" \
"$MutStructPackages" \
"$MutStructLocalization"
cp -rf "$MutSource/Localization"/* "$MutStructLocalization"
cp -rf "$MutSource/ServerExtMut"/*.upk "$MutStructPackages"
CMD //C $(unixpath2win "$KFEditor") make -useunpublished & CMD //C $(unixpath2win "$KFEditor") make -useunpublished &
local PID="$!" local PID="$!"
while ps -p "$PID" &> /dev/null while ps -p "$PID" &> /dev/null
do do
if [[ -e "$MutBinUnpublish/ServerExt.u" ]] && if [[ -e "$MutStructScript/ServerExt.u" ]] &&
[[ -e "$MutBinUnpublish/ServerExtMut.u" ]]; then [[ -e "$MutStructScript/ServerExtMut.u" ]]; then
kill "$PID"; break kill "$PID"; break
fi fi
sleep 2 sleep 2
@ -63,20 +72,13 @@ function brew ()
function brew_unpublished () function brew_unpublished ()
{ {
rm -rf "$MutPublish" rm -rf "$MutPublish"
if ! [[ -e "$MutBinUnpublish/ServerExt.u" ]] || if ! [[ -e "$MutStructScript/ServerExt.u" ]] ||
! [[ -e "$MutBinUnpublish/ServerExtMut.u" ]]; then ! [[ -e "$MutStructScript/ServerExtMut.u" ]]; then
compile compile
fi fi
cp -rf "$MutUnpublish" "$MutPublish" cp -rf "$MutUnpublish" "$MutPublish"
} }
function prepare_package_dir () # $1: package dir
{
mkdir -p "$1/Localization/INT"
cp -rf "$MutPublish"/* "$1"
cp -f "$MutSource/Localization/INT/ServerExt.int" "$1/Localization/INT"
}
function generate_wsinfo () # $1: package dir function generate_wsinfo () # $1: package dir
{ {
local Description=$(cat "$MutPubContent/description.txt") local Description=$(cat "$MutPubContent/description.txt")
@ -96,7 +98,7 @@ function generate_wsinfo () # $1: package dir
function upload () function upload ()
{ {
PackageDir=$(mktemp -d -u -p "$KFDoc") PackageDir=$(mktemp -d -u -p "$KFDoc")
prepare_package_dir "$PackageDir" cp -rf "$MutPublish"/* "$PackageDir"
generate_wsinfo "$PackageDir" generate_wsinfo "$PackageDir"
CMD //C $(unixpath2win "$KFWorkshop") "$MutWsInfoName" CMD //C $(unixpath2win "$KFWorkshop") "$MutWsInfoName"
rm -rf "$PackageDir" rm -rf "$PackageDir"
@ -123,7 +125,7 @@ function game_test ()
} }
ScriptFullname=$(readlink -e "$0") ScriptFullname=$(readlink -e "$0")
ScriptName=$(echo "$ScriptFullname" | awk -F '/' '{print $NF;}') ScriptName=$(basename "$0")
SteamPath=$(reg_readkey "HKCU\Software\Valve\Steam" "SteamPath") SteamPath=$(reg_readkey "HKCU\Software\Valve\Steam" "SteamPath")
DocumentsPath=$(reg_readkey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Personal") DocumentsPath=$(reg_readkey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Personal")
@ -135,15 +137,19 @@ KFGame="$KFBin/Win64/KFGame.exe"
KFWorkshop="$KFBin/WorkshopUserTool.exe" KFWorkshop="$KFBin/WorkshopUserTool.exe"
KFDoc="$DocumentsPath/My Games/KillingFloor2" KFDoc="$DocumentsPath/My Games/KillingFloor2"
MutSource="$KFDoc/KFGame/src" MutSource="$KFDoc/KFGame/src"
MutPubContent="$MutSource/PublicationContent"
MutUnpublish="$KFDoc/KFGame/Unpublished" MutUnpublish="$KFDoc/KFGame/Unpublished"
MutPublish="$KFDoc/KFGame/Published" MutPublish="$KFDoc/KFGame/Published"
MutBinUnpublish="$MutUnpublish/BrewedPC/Script"
MutBinPublish="$MutPublish/BrewedPC/Script" MutStructScript="$MutUnpublish/BrewedPC/Script"
MutStructPackages="$MutUnpublish/BrewedPC/Packages"
MutStructLocalization="$MutUnpublish/BrewedPC/Localization"
MutTestingIni="$MutSource/testing.ini" MutTestingIni="$MutSource/testing.ini"
MutWsInfoName="wsinfo_serverext.txt" MutWsInfoName="wsinfo_serverext.txt"
MutWsInfo="$KFDoc/$MutWsInfoName" MutWsInfo="$KFDoc/$MutWsInfoName"
MutPubContent="$MutSource/PublicationContent"
if [[ $# -eq 0 ]]; then show_help; exit 0; fi if [[ $# -eq 0 ]]; then show_help; exit 0; fi
case $1 in case $1 in