HLTV сервер на Linux

В данной статье рассказано как запустить HLTV сервер на Linux, распространённые ошибки при запуске HLTV сервера на Linux.
Для работы HLTV сервера на Linux нужны следующие файлы:
hltv
./hlds_dir/
core_i386.so
./hlds_dir/
proxy_i386.so
./hlds_dir/
filesystem_stdio_i386.so
./hlds_dir/
director_i386.so
./hlds_dir/cstrike/dlls/
hltv.cfg (создать самому если нету)
./hlds_dir/
Проверяем их наличие, как правило нету файла director_i386.so, скачиваем его во вложении.
Запустить HLTV сервер можно по-разному, напишем для HLTV следующий скрипт:
Назовём его hltv_start.sh
#!/bin/sh
LD_LIBRARY_PATH=/home/user/hlds_dir/; export LD_LIBRARY_PATH
./hltv +connect strike64.ru:27015 -port 27020 +maxclients 20 +exec hltv.cfg
LD_LIBRARY_PATH=/home/user/hlds_dir/; export LD_LIBRARY_PATH
./hltv +connect strike64.ru:27015 -port 27020 +maxclients 20 +exec hltv.cfg
Рассмотрим более детально:
/home/user/hlds_dir/
Главная директория вашего сервера
connect
Присоединяем демку к вашему серверу, например +connect amxmodmenu.ru:27015
port
Порт HLTV сервера, по которому игроки смогут присоединиться для просмотра трансляции
maxclients
Количество слотов для просмотра трансляции. Максимально - 255
exec hltv.cfg
Подгружаем конфиг нашего HLTV сервера (если его нет, то создайте сами.).
Пример hltv.cfg
// HLTV Proxy configuration file
// HLTV proxy runs this file on start up
// This file should only be edited if you want to broadcast a game
// set HLTV proxy name as shown in score board
name "HLTV amxmodmenu.ru"
// set HLTV name, how it should appear in game server browsers
// hostname "HLTV Proxy amxmodmenu.ru"
// set offline info text clients will see as reject reason if HLTV isn't broadcasting yet
offlinetext "Sorry, game is delayed. Please try again later."
// delays broadcasting for 30 seconds
delay 30.0
// allow 3.5 KByte/sec as client rate. This is good a value
// for internet broadcasts. On LAN you may set this value to 10000
maxrate 3500
// log HLTV console in proxy.log
// logfile 1
// local chatting for HLTV spectators enabled
chatmode 1
// if game server is password protected, enable this line
// serverpassword "mypassword"
// proxy's adim password for rcon, commentator etc.
// adminpassword "mypassword"
// show message for 5 seconds each 60 seconds in center of X axis (-1) and
// above help text bar (0.85). Color given as hexadecimal RGBA .
loopcmd 1 60 localmsg "You're watching HLTV. Visit www.valvesoftware.com" 5 -1 0.85 FFA000FF
// hltv.tga will be shown instead of the default HLTV logo in spectator GUI
// bannerfile "hltv.tga"
// these commands will be executed on connecting spectator client and may be used
// to adjust settings for HLTV (for example voice parameters)
signoncommands "voice_scale 2; voice_overdrive 16; volume 0.5; echo Voice adjusted for HLTV"
echo hltv.cfg loaded.
// HLTV proxy runs this file on start up
// This file should only be edited if you want to broadcast a game
// set HLTV proxy name as shown in score board
name "HLTV amxmodmenu.ru"
// set HLTV name, how it should appear in game server browsers
// hostname "HLTV Proxy amxmodmenu.ru"
// set offline info text clients will see as reject reason if HLTV isn't broadcasting yet
offlinetext "Sorry, game is delayed. Please try again later."
// delays broadcasting for 30 seconds
delay 30.0
// allow 3.5 KByte/sec as client rate. This is good a value
// for internet broadcasts. On LAN you may set this value to 10000
maxrate 3500
// log HLTV console in proxy.log
// logfile 1
// local chatting for HLTV spectators enabled
chatmode 1
// if game server is password protected, enable this line
// serverpassword "mypassword"
// proxy's adim password for rcon, commentator etc.
// adminpassword "mypassword"
// show message for 5 seconds each 60 seconds in center of X axis (-1) and
// above help text bar (0.85). Color given as hexadecimal RGBA .
loopcmd 1 60 localmsg "You're watching HLTV. Visit www.valvesoftware.com" 5 -1 0.85 FFA000FF
// hltv.tga will be shown instead of the default HLTV logo in spectator GUI
// bannerfile "hltv.tga"
// these commands will be executed on connecting spectator client and may be used
// to adjust settings for HLTV (for example voice parameters)
signoncommands "voice_scale 2; voice_overdrive 16; volume 0.5; echo Voice adjusted for HLTV"
echo hltv.cfg loaded.
Сохраняем hltv_start.sh в директории вашего сервера, на примере это ./home/user/hlds_dir/ и даем ему права на выполнение:
chmod +x hltv_start.sh
Переходим в директорию с нашим сервером это ./home/user/hlds_dir/ и запускаем наш HLTV сервер с помощью скрипта, в фоновом режиме через screen
screen -d -m -S hltv ./hltv_start.sh
Для того чтобы войти в фоновый режим пишите
screen -r hltv
Для выхода из фонового режима Ctrl+A,D.
Для закрытия скрина Ctrl+C.
Рассмотрим распространённые ошибки при запуске HLTV сервера на Linux
Ошибка libSteamValidateUserIDTickets
Error:libSteamValidateUserIDTickets_i386.so: cannot open shared object file: No such file or directory
***** FATAL ERROR *****
***** FATAL ERROR *****
Выполните команду
cp libSteamValidateUserIDTickets_i386.so /usr/lib
Ошибка director
Error:director_i386.so: cannot open shared object file: No such file or directory
Скачайте файл director_i386.so и скопируйте его в ./cstrike/dlls/
При копировании ссылка на источник Strike64.ru обязательна.
Комментариев 0