-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
36 lines (29 loc) · 1.32 KB
/
run.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
ARCH="x64"
YELLOW="\e[93m"
RED="\e[91m"
RESET="\e[0m"
# 获取最新版本
echo -e $YELLOW"Checking latest version..."$RESET
VERSION=$(curl -s https://api.github.com/repos/SonolusHaniwa/sonolus-server-cpp/releases/latest | jq -r '.tag_name')
# 下载 Sonolus Server C++
echo -e $YELLOW"Downloading Sonolus Server $VERSION for $ARCH..."$RESET
wget https://github.com/SonolusHaniwa/sonolus-server-cpp/releases/download/$VERSION/sonolus-server-linux-$ARCH-$VERSION.zip -O sonolus-server/sonolus.zip
cd sonolus-server && unzip -n sonolus.zip
echo -e $YELLOW"Syncing data into database..."$RESET
wget "https://raw.githubusercontent.com/SonolusHaniwa/sonolus-server-cpp/main/data.sql" -O data.sql
sqlite3 sonolus.db ".read ./data.sql"
./sonolus serve >/dev/null 2>&1 &
# 资源导入
./sonolus import ../phigros/phistore.scp
./sonolus import ../phigros/phigros-official.scp
./sonolus import ../phigros/phigros-2024-april.scp
./sonolus buildcpp play ../phigros -DDISABLE_TRACE
./sonolus buildcpp tutorial ../phigros -DDISABLE_TRACE
./sonolus buildcpp preview ../phigros -DDISABLE_TRACE
./sonolus buildcpp watch ../phigros -DDISABLE_TRACE
# sqlite3 sonolus.db "SELECT * FROM Engine";
# 数据导出
# ./exportor "http://127.0.0.1:8080" data.json 1
# ./exportor "http://127.0.0.1:8080" engine.json 2
sudo pkill sonolus
echo -e $YELLOW"Sync finished"$RESET