La eliminación de la página wiki 'Installation' no se puede deshacer. ¿Continuar?
we will create a new user for the bot and the gameserver, creating their own home-directory and adding them to the sudoers group, then taking steps to make the shell look good (optional)!
sudo useradd -m -d /opt/bot_test bot_test
sudo passwd bot_test
sudo nano -w /etc/sudoers.d/bot_test
bot_test ALL=(ALL:ALL) NOPASSWD:ALL
sudo chmod 0440 /etc/sudoers.d/bot_test
sudo cp /root/.bashrc /opt/bot_test
sudo chown bot_test:bot_test /opt/bot_test/.bashrc
If it ain't looking good now, you might need to add the standard shell to your /etc/passwd file. Find your user and take care that it ends like this one:
sudo nano -w /etc/passwd
bot_test:x:1000:1000:PvE Server Administrator:/opt/bot_test:/bin/bash
we will become our new user, download steamcmd, create a directory for it, not arguing if it already exists (-p) and then extract steamcmd into it. we will then remove the steamcmd archive
su - bot_test
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
mkdir -p steamcmd && tar xvzf steamcmd_linux.tar.gz -C ./steamcmd/
rm steamcmd_linux.tar.gz
mkdir -p 7dtd_a19
./steamcmd/steamcmd.sh
login anonymous
force_install_dir /opt/bot_test/7dtd_a19
app_update 294420 validate or app_update 294420 -beta latest_experimental
quit
mkdir -p 7dtd_a19_UserData 7dtd_a19_SaveGames 7dtd_a19_Logs
cp 7dtd_a19/serverconfig.xml 7dtd_a19_SaveGames/bot_test_xxxxxxxx.xml
GameName must NOT contain any spaces! The bot will not work correctly with spaces in GameName
nano -w 7dtd_a18_SaveGames/bot_test_xxxxxxxx.xml
tmux new-session -s bot_test
CTRL+b followed by , -> rename current window to chrani-bot-tng
git clone https://code.chrani.net/wwevo/chrani-bot-tng.git
cd chrani-bot-tng && git pull origin development && cd ..
python -m venv cb-tng-venv
source cb-tng-venv/bin/activate
pip install --upgrade pip
pip install -r chrani-bot-tng/requirements.txt
host would be your IP address, or if the bot is on the same machine, localhost
port + password is what you have set up in your 7dtd serverconfig
chrani-bot-tng/bot/options/default/module_telnet.json
{
"host": "127.0.0.1",
"port": 26902,
"password": "supersecret"
}
You might want to set the telnet buffer to a higher value if you have a high-pop server or are using mods like Darkness Falls. the standard 16k is too small for extensive amount of entities
"max_telnet_buffer": 32768
host would be your servers public IP address port and secret-key can be whatever you feel is clever
chrani-bot-tng/bot/options/default/module_webserver.json
{
"host": "YOUR PUBLIC SERVER IP",
"port": 26905,
"Flask_secret_key": "whateverisclever"
}
With those two files in place and some sensible data to populate them, the bot should start up and provide it's webinterface and should start listening to the games telnet.
CTRL+b followed by c -> creates new window CTRL+b followed by w -> opens window selection select the new window
CTRL+b followed by , -> rename window to 7dtd_a19
7dtd_a19/startserver.sh -configfile=/opt/bot_test/7dtd_a19_SaveGames/bot_test_xxxxxxxx.xml
CTRL+b followed by w -> opens window selection select chrani-bot-tng window
##### using default options:
python /opt/bot_test/chrani-bot-tng/app.py
##### using custom options:
python /opt/bot_test/chrani-bot-tng/app.py custom_options_foldername
CTRL+b followed by d -> exit tmux
exit
To get back to our shell, all we have to do is to log in as our bot_test user and get tmux back with
tmux attach
cd 7dtd_a19
wget https://code.chrani.net/chrani.net/chrani-bot-tng/wiki/startserver_loop.sh
cd ..
chmod +x 7dtd_a19/startserver_loop.sh
7dtd_a19/startserver_loop.sh bot_test xxxxxxxx
nothing much here for now. You could always open up another tmux window and run a tail on the latest logs
tail -f -- "$(find ./7dtd_a19_Logs/ -maxdepth 1 -type f -printf '%T@.%p\0' | sort -znr -t. -k1,2 | while IFS= read -r -d '' -r record ; do printf '%s' "$record" | cut -d. -f3- ; break ; done)"
La eliminación de la página wiki 'Installation' no se puede deshacer. ¿Continuar?