Дата: 2011-01-17 12:05:24
Комментариев: 0
Сегодня будем поднимать CSS Dedicated Server, как и в прошлый раз нам понадобится HLDSUpdatetool:
wget http://www.steampowered.com/download/hldsupdatetool.bin

2. Далее выполняем:
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin

Набираем yes, и жмем enter
3. Теперь выполняем такую команду:
./steam -command update -game "Counter-Strike Source" -dir ~/srcds/cstrike

4. Создаем ~/srcds/cstrike/orangebox/cstrike/cfg/server.cfg и вписываем следующие строки:
gedit server.cfg
// *********** SERVER & PASSWORD INFO ***************
// Change it to 1 if you want a LAN only Server
sv_lan 0
// contact & geo 0=US East coast, 1=US West coast, 2= South America, 3=Europe, 4=Asia, 5=Australia, 6=Middle East, 7=Africa and 255=world.
// Change the number to the region you live in!!!
sv_region 3
// Give your server a name here
hostname "Название вашего сервера"
// Rcon password is used to give your server orders by using console, so think of a good password
rcon_password "РКОН-пароль"
// If you want your server to be private, fill in a password and delete the // in front of sv_password
//sv_password "admin2010"
 
 
// *********** GAME SETTINGS, YOU CAN CHANGE THESE THE WAY YOU LIKE IT ***************
// Sets the amount of minutes players are able to buy
mp_buytime 1
// Sets the amount of starting money, max=16000
mp_startmoney 8000
// Sets the amount of secs before C4 explodes
mp_c4timer 30
// 1 enables flashlight, 0 disables it
mp_flashlight 1
// 1 enables hearing footsteps, 0 disables it
mp_footsteps 1
// 1 enables falling damage, 0 disables it
mp_falldamage 1
// Sets the number of hostages a player can kill before they are booted from the server. 0 is disabled
mp_hostagepenalty 0
 
// TIME, WIN & ROUND SETTINGS
// Timelimit is how many minutes for a map.
mp_timelimit 45
// When a team reaches this amount of wins (before the timelimit or the roundlimit is 
// reached), it has won the map. 0=disabled
mp_winlimit 14
// When two teams finish playing this amount of rounds (before the timelimit or the 
// winlimit is reached) the map ends. 0=disabled
mp_maxrounds 21
// Round time, in minutes. After this amount of minutes has passed, 
// a scenario win is awarded. Min 1, Max 9
mp_roundtime 3
// Sets the seconds before players can move in the beginning of a round
mp_freezetime 4
 
// TEAMBALANCING
// Toggles the forcing of clients to join teams to make it balanced. 1=on and 0=off
mp_autoteambalance 1
// Sets the maximum number of players that one team can have more than the 
// other team. Use a setting of '0' to completely disable the team limiting.
mp_limitteams 1
 
// FF & TEAMKILL & IDLE
// Toggles friendly fire 1=on and 0=off
mp_friendlyfire 0
// Toggles the forcing of a player to sit out the next round if he 
// has just killed a teammate. 1=on and 0=off
mp_tkpunish 1
// Kick idle/team-killing players. 1=on and 0=off
mp_autokick 1
// Kick players who team-kill within this many seconds of a round restart.
mp_spawnprotectiontime 10
// After this many seconds without a message from a client, the client is dropped
sv_timeout 40 
 
// SPECTATORS
// Restricts spectatorcamera view for dead players. 1=on and 0=off
mp_forcecamera 1
// toggles whether the server allows spectator mode or not. 1=on and 0=off
mp_allowspectators 1
 
 
// ************ IF YOU HAVE LAG ISSUES YOU CAN CHANGE THESE SETTINGS, IF YOU KNOW WHAT YOU ARE DOING *****************
// SET RATES
// Max bandwidth rate allowed on server, 0=unlimited, max=20000
sv_maxrate 8000
// Min bandwidth rate allowed on server, 0=unlimited, 4000=good to keep dialup gamers off the server
sv_minrate 1000
// Maximum updates per second that the server will allow, increasing this will take more cpu power, 100 is max
sv_maxupdaterate 60
// Frame rate limiter
fps_max 300
 
// DOWNLOAD
// Allow clients to download files
sv_allowdownload 1
// Allow clients to upload customizations files like logospray files
sv_allowupload 1
 
 
// *********** IF YOU KNOW WHAT YOU ARE DOING YOU CAN CHANGE THESE SETTINGS AS WELL *************
// SERVER LOGGING, creates a logfile (needed for statsprograms), "log off" to turn off logging
log on
 
// VOICE disabled, if you want VOICE enabled then change 0 into 1
sv_voiceenable 0
 
// CHEATS & PAUSE
sv_cheats 0
// disable clients' ability to pause the server
sv_pausable 0
 
// OTHER SETTINGS
// amount of seconds players can chat after the game is over
mp_chattime 15
// if not 0 then game will restart in the specified number of seconds
mp_restartgame 0
 
// Exec files on startup...these are placed in the "C:\srcds\cstrike\cfg\" folder.
// No big deal if you don't have these files!
exec banned_users.cfg
exec bot.cfg
exec mani_server.cfg

5. Переходим в папку ~/srcds/cstrike/orangebox/srcds_run и запускаем сервер:
./srcds_run -console -game cstrike +maxplayers 20 +map de_dust

Не забываем делать перенаправление портов (port forwarding) на маршрутизаторе. Если сервер запустился без проблем, работает и виден из интернета можно перейти к скриптам автозапуска:
cat cs_server.sh
#!/bin/bash
echo -n "Start CSS Server:";
export LD_LIBRARY_PATH=/путь/до/srcds/cstrike/orangebox:$LD_LIBRARY_PATH 
cd /путь/до/srcds/cstrike/orangebox 
/usr/bin/screen -A -m -d -S contra /путь/до/srcds/cstrike/orangebox/srcds_run -console -game cstrike +maxplayers 8 +map de_dust
 

Сохраните файл и выполните «chmod +x cs_server.sh» для запуска.
Для старта своего сервера просто запустите «server.sh». Ваш сервер запустится в фоновом режиме, для того, чтобы вернуть вывод на экран выполните:
screen -x contra

Можно ещё сделать в виде сервиса:
cat css_server
#!/bin/bash
NAME='css_server'
DIR='/путь/до/srcds/cstrike/orangebox'
 
case "$1" in
    start)
        cd $DIR;
        ./srcds_run -console -game cstrike +maxplayers 8 +map de_dust > /dev/null 2>&1 &
        ;;
    stop)
        killall -w srcds_run
        killall -w srcds_linux
        ;;
    restart)
        killall -w srcds_run
        killall -w srcds_linux
        sleep 5
        cd $DIR;
        ./srcds_run -console -game cstrike +maxplayers 8 +map de_dust > /dev/null 2>&1 &
        ;;
*)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
esac

---
Если у вас как и у меня есть nokia 5800 то заходите на сайт, в котором есть все для nokia 5800. Много нужных и полезных программ.
теги: server

0 комментариев

Оставить комментарий: