更新环境依赖
# Ubuntu 或 Debian
$ sudo apt-get update
$ sudo apt-get upgrade
sudo apt-get install lib32gcc1 libc6-i386
sudo apt-get install lib32gcc-s1
新建一个用户(也可以不用新建)
$ adduser dragon
安装依赖项
# Ubuntu
$ sudo apt-get install glibc.i686 libstdc++i686 -y
# CentOS
$ yum install glibc.i686 libstdc++i686 -y
安装终端复用器
# Ubuntu
$ sudo apt-get install tmux
# CentOS
$ sudo yum install tmux
切换用户
su - dragon
cd /home/dragon
创建窗口
#Tmux
tmux new -s dragon
下载SteamCMD
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_liunx.tar.gz
下载龙之日(2G)
./steamcmd.sh
login steam用户 密码
force_install_dir /home/dragon/dargon
app_update 739930 validate
exit
启动服务
cd 你设置的路径 dayofdragons_server
bash DragonsServer.sh
后台启动:
nohup bash DragonsServer.sh >> game.log &
自定义服务器名称,端口
#!/bin/sh
UE4_TRUE_SCRIPT_NAME=$(echo \"$0\" | xargs readlink -f)
UE4_PROJECT_ROOT=$(dirname "$UE4_TRUE_SCRIPT_NAME")
chmod +x "$UE4_PROJECT_ROOT/Dragons/Binaries/Linux/DragonsServer-Linux-Shipping"
echo "$UE4_PROJECT_ROOT/Dragons/Binaries/Linux/DragonsServer-Linux-Shipping"
"$UE4_PROJECT_ROOT/Dragons/Binaries/Linux/DragonsServer-Linux-Shipping" -SteamServerName="房间名称" -QueryPort=27015 -log
注意端口协议是UDP,要在防火墙打开