Skip to content

Commit

Permalink
TritonDataCenter#40: When map renders overwrite, old tiles are left b…
Browse files Browse the repository at this point in the history
…ehind.

TritonDataCenter#64: Map render result uploading should be done in a single process
  • Loading branch information
Nate Fitch committed Jan 23, 2015
1 parent 27fe7cd commit f751f88
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions scripts/prepare_render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ if [ ! -d "$DEST" ]; then
wget --no-check-certificate https://s3.amazonaws.com/Minecraft.Download/versions/${MINECRAFT_VERSION}/${MINECRAFT_VERSION}.jar -P $DEST
fi

npm install -g manta-sync

git clone git://github.com/overviewer/Minecraft-Overviewer.git overviewer

cd overviewer
Expand Down Expand Up @@ -106,29 +108,6 @@ WORLD=\$(echo \$MANTA_INPUT_FILE | cut -f 7 -d/)
UPLOAD_PATH="/\$USER/public/minecrab/servers/\$WORLD/map/view"
echo starting upload to \$UPLOAD_PATH
./mputr ./minecraft/render/world1 "\${UPLOAD_PATH}"
manta-sync -d ./minecraft/render/world1 "\${UPLOAD_PATH}"
EOF
chmod 755 ./render.sh

cat > ./mputr <<EOF
set -o errexit
mputr () {
owd=\$(pwd)
local=\$1
remote=\$2
if [ -z "\$remote" ]; then
echo "[ERROR] \$0: missing required options"
exit 1
fi
cd "\$local"
mmkdir -p "\$remote"
# directories
find . -type d | sort | xargs -n 1 -I {} mmkdir \$remote/{} || return 1
# files
find . -type f | xargs -n 1 -I {} mput -q \$remote/{} -f {} || return 1
cd "\$owd"
return 0
}
mputr \$1 \$2
EOF
chmod 755 ./mputr

0 comments on commit f751f88

Please sign in to comment.