-
Notifications
You must be signed in to change notification settings - Fork 0
/
adventure.sh
38 lines (34 loc) · 1.04 KB
/
adventure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Launch script for BashVenture. This sets up a new user instance (so many users on the same server can play).
# Please enjoy playing the game - and playing with the code. Please do give me a mention, and be
# sure to link back to the original GitHub page so people can fork and build something of their own.
#
# Keep it open. Spread the love.
# - @KesGai
#
# Here we check to see if uuidgen is installed - if not it will default to single-user mode. To run this on a server
# and support multipe-users, check you have everthing set up correctly. Follow the instructions in the ReadMe file on GitHub.
if hash uuidgen 2>/dev/null; then
homefolder=$(pwd)
newplayer=$(uuidgen)
mkdir $newplayer
cp -r rooms $newplayer/rooms
cp -r art $newplayer/art
cp -r script $newplayer/script
cp -r logic $newplayer/logic
fi
echo "Loading..."
echo
sleep 4
if hash uuidgen 2>/dev/null; then
cd $newplayer/rooms
else
cd rooms
fi
./start.sh
if hash uuidgen 2>/dev/null; then
cd "$homefolder"
rm -r $newplayer
fi
echo
exit