ãã®ã¬ã€ãã§ã¯ãTeam Fortress 2ã²ãŒã ãäŸãšããŠäœ¿çšããŠãLinuxçšã®è€æ°ã®å°çšSteamã²ãŒã ãµãŒããŒã®åææäœãã€ã³ã¹ããŒã«ããã³æ§æããæ¹æ³ã«ã€ããŠèª¬æããŸãã
- ã¯ããã«
- Steamã¯ã©ã€ã¢ã³ããšTeam Fortress 2ãµãŒããŒã®ã€ã³ã¹ããŒã«
- åºæ¬çãªãµãŒããŒèšå®
- çè«
- ç·Žç¿ãã
- ãããã¯ãŒã¯èšå®
- ãµãŒããŒèµ·åã¹ã¯ãªãã
- ãµãŒããŒæŽæ°
- èªå
- å®æçãªæŽæ°
- æ€èšŒã®ã¿
ã¯ããã«
å¿
èŠãªãã®ïŒ
- ãã¹ãŠã®ã²ãŒã ãµãŒããŒãåŒãåºãããšãã§ããããã»ããµããã£ã¹ã¯ãã¡ã¢ãªãåãããµãŒããŒ
- éåžžã®ã€ã³ã¿ãŒããããã£ãã«ã ãã€ã€ã«ã¢ããã§ã¯ãããŸããã ADSLã§ã¯ãããŸããã
- ç§ãã¡ã®å Žåãã€ã³ã¹ããŒã«ãããWebãµãŒããŒ-nginx
- ã€ã³ã¹ããŒã«æžã¿ã®SQLãµãŒããŒããã®å Žåã¯mysqlïŒmariadbïŒ
- ã¹ã±ãžã¥ãŒã«ã«åŸã£ãŠã¿ã¹ã¯ãå®è¡ããæ©èœïŒcronïŒ
- ã¢ãžã¥ãŒã«ä»ãã®php
- åã
ã®æ§ææé äžã®ã«ãŒãã¢ã¯ã»ã¹
- ååãªãã£ã¹ã¯å®¹éïŒ
- ã²ãŒã ãµãŒããŒ-6ã®ã¬ãã€ã以äž
- ãã°ïŒãããŠå€ãã®ç°ãªããã®ããããŸãïŒ
- ã¬ã³ãŒãïŒãªãã¬ã€ïŒ
- SQLããŒã¿ããŒã¹
- ã«ã¹ã¿ã ã«ãŒãããµãŠã³ãããã¿ãŒã³ãªã©ã
以äžã¯ãã¹ãŠãLinuxãã€ã³ã¹ããŒã«ããã³æ§æãããã³ã³ãœãŒã«ã¢ã¯ã»ã¹ã®ããç©çãµãŒããŒãŸãã¯ä»®æ³ãµãŒããŒã«é¢é£ããŠèª¬æãããŠããŸãã ãã¹ãŠã®äŸã§ããµãŒããŒã®IPã¢ãã¬ã¹ã¯192.0.2.0ã§ãããã¯ã©ã€ã¢ã³ãã³ã³ãã¥ãŒã¿ãŒã¯198.51.100.0ã§ãã
ã²ãŒã ãµãŒããŒã¯ãèµ·åããŠåäœããããã«ã«ãŒãæš©éãå¿
èŠãšããªããããéç¹æš©ãŠãŒã¶ãŒã²ãŒã ã®äžãããã¹ãŠãã€ã³ã¹ããŒã«ããŠå®è¡ããŸãã rootã«ãªãããŠãŒã¶ãŒãè¿œå ããŸãã
# useradd --user-group --create-home --comment "Source dedicated server" game
ã¹ã±ãžã¥ãŒã«ã«åŸã£ãŠå€æ°ã®ã¹ã¯ãªãããå®è¡ãããããã²ãŒã ãŠãŒã¶ãŒãcrontabãã¡ã€ã«ãäœæã§ãããã©ããã確èªããŸãã
# su - game $ crontab -e
ãšãã£ã¿ãŒãŠã£ã³ããŠãéãå Žåã¯ããããããããŸããã ç»é¢ã«äœãã衚瀺ãããå ŽåïŒ
cannot chdir(/var/spool/cron), bailing out. /var/spool/cron: Permission denied
ã§ããŸããã 次ã«ã䜿çšããcronããã°ã©ã ãšãã®èšå®ã«å¿ããŠããŠãŒã¶ãŒïŒä»¥åã«ã²ãŒã ãã«ãŒãã«æ»ãããŠãŒã¶ãŒïŒãcrontabãã¡ã€ã«ãäœæã§ããããã«ããŸãã
ãããã£ãŠããŠãŒã¶ãŒãäœæãããæ¿èªãæ§æãããŸãã ã«ãŒãã»ãã·ã§ã³ãéããã²ãŒã ã®ããã«åäœãç¶ããŸãã
Steamã¯ã©ã€ã¢ã³ããšTeam Fortress 2ãµãŒããŒã®ã€ã³ã¹ããŒã«
è€æ°ã®ã²ãŒã ãµãŒããŒã®åææäœãã€ã³ã¹ããŒã«ããŠæ§æãããšããç®æšã¯ãããŸããŸãªæ¹æ³ã§éæã§ããŸãã æãåçŽãªã±ãŒã¹ã§ã¯ãããããç¬èªã®ãã£ã¬ã¯ããªã«åå¥ã®ãµãŒããŒã€ã³ã¹ã¿ã³ã¹ãäœæããŸãã ããã«ããããã£ã¹ã¯ã¹ããŒã¹ã®éå¹ççãªäœ¿çšïŒãã¡ã€ã«ã·ã¹ãã ãŸãã¯ããŒã¿ãŠã§ã¢ããŠã¹ãéè€æé€ã䜿çšããªãå ŽåïŒãšåãæŽæ°ã®ããŠã³ããŒãã®ããã®ãã©ãã£ãã¯æ¶è²»éãå¢å ããŸãããåãIPã¢ãã¬ã¹ã䜿çšããå Žåã¯ãã¹ãŠã®ã²ãŒã ãµãŒããŒã§äœ¿çšããå¿
èŠããããŸããããµãŒããŒãåå¥ã«æ§æãæŽæ°ã管çã§ããŸãç°ãªãããŒãã å¥ã®æ¹æ³ã¯ãã²ãŒã ã«åäžã®ãã£ã¬ã¯ããªã䜿çšããããšã§ãããã²ãŒã ãµãŒããŒã«åå¥ã®èšå®ã䜿çšããŸãã ãããç§ãã¡ãè¡ãæ¹æ³ã§ãã
64ãããã®Linuxãã£ã¹ããªãã¥ãŒã·ã§ã³ãããå Žåã¯ãè¿œå ã®äºææ§ã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããå¿
èŠããããŸãïŒrootãŠãŒã¶ãŒã®äžããïŒã steamcmd x64 YOUR_DISTRIBUTIVEãšãããã¬ãŒãºã§ã°ãŒã°ã«æ€çŽ¢ãããã®ã¯ã©ãã§ãã ã Ubuntu 13.10 x64ã®å Žåãããšãã°ã apt-get install lib32gcc1
ã apt-get install lib32gcc1
å Žå-pacman pacman -S lib32-gcc-libs
ïŒ/etc/pacman.confã§multilibãªããžããªãæå¹ã«ãªã£ãŠããïŒãCentOSã®å Žåyum install glibc.i686 libstdc++.i686
ããã³ãªã©ã
ããããã€ã³ã¹ããŒã«ãããŠããªãå Žåããã©ãŒã ã®ãšã©ãŒãçºè¡ãããŸãïŒ
./steamcmd.sh: line 29: /home/game/Steam/linux32/steamcmd: No such file or directory
ã©ã¡ãã
./steamcmd.sh: /home/game/Steam/linux32/steamcmd: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
ã²ãŒã ãŠãŒã¶ãŒã®ããŒã ãã£ã¬ã¯ããªã«ããåãååã®ãã£ã¬ã¯ããªã«Steamã¯ã©ã€ã¢ã³ããã€ã³ã¹ããŒã«ããtf2ãã£ã¬ã¯ããªã«ã²ãŒã èªäœãã€ã³ã¹ããŒã«ããŸãã / etc / fstabã§ã¯ã/ homeããŒãã£ã·ã§ã³ã¯noexecãªãã§ããŠã³ããããããã«ååãªç©ºãé åããããšæ³å®ãããŠããŸãã
ãµãŒããŒçšã®ãã£ã¬ã¯ããªãäœæããæåã®ãã£ã¬ã¯ããªã«ç§»åããŸãã
$ mkdir ~/Steam $ mkdir ~/tf2 $ cd ~/Steam
Steamã³ã³ãœãŒã«ã¯ã©ã€ã¢ã³ããããŠã³ããŒãããã¢ãŒã«ã€ãã解åããŸãã
$ wget http://media.steampowered.com/client/steamcmd_linux.tar.gz $ tar -xvzf steamcmd_linux.tar.gz
æ確ã«ããããã«ã次ã®steamcmd.shã®èµ·åã2ã€ã«åå²ããŸãã ãŸããèªå·±æŽæ°æé ãå®è¡ããŸãã
$ ./steamcmd.sh +quit
Steamã¯ã©ã€ã¢ã³ããã¢ããã°ã¬ãŒãããå¿
èŠããããŸãã åé¡ãããå Žåã¯ãã/ Steam / logsã®ãã°ãèªãã§ãã ããã
次ã«ãå°çšã®ã²ãŒã ãµãŒããŒãã€ã³ã¹ããŒã«ããŸãã
$ ./steamcmd.sh +login anonymous +force_install_dir ~/tf2/ +app_update 232250 validate +quit
ã³ãã³ãã©ã€ã³ãã©ã¡ãŒã¿ãŒã®ã232250ããšããæ°åã¯ãã¢ããªã±ãŒã·ã§ã³ã®èå¥åã§ããappidã§ãããã®äŸã§ã¯ãTeam Fortress 2å°çšãµãŒããŒã§ãã ã³ãã³ãã«ã€ããŠã¯ãããµãŒããŒã®æŽæ°ãã»ã¯ã·ã§ã³ã§è©³ãã説æããŸãã
ãã¹ãŠãåé¡ãªããã°ãããŠã³ããŒãã¯å
æ°ã«å§ãŸããŸãïŒ
Redirecting stderr to '/home/game/Steam/logs/stderr.txt' ... Connecting anonymously to Steam Public...Logged in OK Waiting for license info...OK Update state (0x3) reconfiguring, progress: 0.00 (0 / 0) Update state (0x11) preallocating, progress: 8.28 (561715882 / 6785978023) Update state (0x61) downloading, progress: 0.20 (13671159 / 6785978023) Update state (0x61) downloading, progress: 0.70 (47497460 / 6785978023) ... Update state (0x61) downloading, progress: 99.96 (6783415033 / 6785978023) Update state (0x81) committing, progress: 7.66 (519615292 / 6785978023) Success! App '232250' fully installed.
æ°ååŸãTeam Fortress 2ã«6ã®ã¬ãã€ãã®å®¹éãå²ãåœãŠãããŸãïŒ2016幎10æçŸåšïŒã
ã/ tf2ãã©ã«ããŒã«ç§»åããã²ãŒã ãæåã§éå§ããŠã¿ãŠãã ããã
$ cd ~/tf2 $ ./srcds_run -game tf +map cp_cloak
次ã®ãããªãã®ãã³ã³ãœãŒã«ã«è¡šç€ºãããã¯ãã§ãã
Auto detecting CPU Using default binary: ./srcds_linux Server will auto-restart if there is a crash. WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5. Please install (lib32tinfo5 / ncurses-libs.i686 / equivalent) to enable readline. Using Breakpad minidump system. Version: 3475087 AppID: 232250 Setting breakpad minidump AppID = 232250 Using breakpad crash handler Loaded 7510 VPK file hashes from /home/game/tf2/tf/tf2_textures.vpk for pure server operation. ... Network: IP 192.0.2.0, mode MP, dedicated Yes, ports 27015 SV / 27005 CL Initializing Steam libraries for secure Internet server ... Connection to Steam servers successful. Public IP is 192.0.2.0. Assigned anonymous gameserver Steam ID [A:1:1724597452:5521]. VAC secure mode is activated. Received 3825164 bytes item schema version DBDD1115 direct data; update is queued.
ncurses-libs.i686ã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããããšã«ããããªã¯ãšã¹ããå°éã§ããŸãã ããã§ãªããã°ããã¹ãŠãããŸããããŸãã è¡13ïŒãããã¯ãŒã¯ïŒ...ïŒããã³17ïŒãããªãã¯IP ...ïŒã§ããµãŒããŒãæ£ããIPãéžæããŠããããšã確èªããŠãã ããã
ã/home/game/.steam/sdk32/steamclient.soïŒå
±æãªããžã§ã¯ããã¡ã€ã«ãéããŸããïŒãã®ãããªãã¡ã€ã«ãŸãã¯ãã£ã¬ã¯ããªã¯ãããŸãããã«é¢ãããšã©ãŒã«ã¯æ³šæãæããŸãããããã¯æ£åžžã§ãã ãã ããä¿®æ£ããããšãã§ããŸãã
$ mkdir -p ~/.steam/sdk32 $ ln -s ~/Steam/linux32/steamclient.so ~/.steam/sdk32
ã³ã³ãã¥ãŒã¿ãŒã§Team Fortress 2ãèµ·åããã³ã³ãœãŒã«ïŒ ~
ïŒãåŒã³åºãã connect 192.0.2.0:27015
ïŒ27015ã«connect 192.0.2.0:27015
ïŒãŸãã¯ããã«ã¹ããŒã ïŒ//connect/192.0.2.0ïŒ27015-ãã¹ã¯ãããã«ã·ã§ãŒãã«ãããäœæã§ããŸãïŒã ã²ãŒã ãµãŒããŒãžã®æ¥ç¶ãéå§ãããµãŒããŒã³ã³ãœãŒã«ã«ãã®æç¹ã§è¡ã衚瀺ãããŸãã
Client "Ich" connected (198.51.100.0:42380).
æ¥ç¶ã«æåããªãã£ãå ŽåããµãŒããŒãæ£ããã€ã³ã¿ãŒãã§ã€ã¹ã§ãªãã¹ã³ããŠãããã©ããã確èªããŸãã ãã¡ã€ã¢ãŠã©ãŒã«ãããå Žåãå¿
èŠãªããŒããéããŠãããã©ãããValveã®ããã¥ã¢ã«ã«åŸã£ãŠç¢ºèªããŸã ã ããè€éãªãããã¯ãŒã¯æ§æïŒNATçšã®ãµãŒããŒãªã©ïŒã®å Žåã¯ã察å¿ããããã¥ã¢ã«ãåç
§ããŠãã ããã
quit
ã³ãã³ãã䜿çšããŠã²ãŒã ãµãŒããŒãåæ¢ããã³ã³ãœãŒã«ã«å
¥åããŠãã³ãã³ãã©ã€ã³ã«æ»ããæ§æãéå§ããŸãã
åºæ¬çãªãµãŒããŒèšå®
çè«
æŽå²çã«ãé·å¹Žã®éçºã®éã«ããµãŒããŒãæ§æããããã®ããŸããŸãªå¯èœæ§ããããŸããã
ããã©ã«ãã§ã¯ããµãŒããŒã¯ã/ tf2 / tf / cfg /ã§æ€çŽ¢ããããã€ãã®ã¡ã€ã³èšå®ãã¡ã€ã«ã䜿çšããŸããautoexec.cfg-ãµãŒããŒã®èµ·åæã«1åå®è¡ãããŸããserver.cfg-ä»»æã®ã«ãŒãã®éå§æã«ã<card_name> .cfg-察å¿ããéå§æã«ã«ãŒãã
ãŸãããµãŒããŒã®èµ·åæã«ãã³ãã³ãã©ã€ã³ã§+servercfgfile my.cfg
ãã©ã¡ãŒã¿ãŒãæå®ã§ããŸãããã®å ŽåããµãŒããŒã¯server.cfgã§ã¯ãªãmy.cfgãããã³+exec file1.cfg +exec file2.cfg +exec file3.cfg
圢åŒã®ããã€ãã®ãã©ã¡ãŒã¿ãŒã䜿çšããªããªããŸãã +exec file1.cfg +exec file2.cfg +exec file3.cfg
ãããã®ãã¡ã€ã«ã¯ãautoexec.cfgã®çŽåŸã«ãµãŒããŒã®èµ·åæã«1åå®è¡ãããŸãã
ããã«ãã¡ã€ã³ãã£ã¬ã¯ããªããã§ãã¯ããåã§ãããµãŒããŒã¯èµ·åæã«ã/ tf2 / tf /ã«ã¹ã¿ã ãã¡ã€ã«ãæ€çŽ¢ããŸããæ¡åŒµåã¯.vpkã§ããã£ã¬ã¯ããªæ§é ã¯my_dir / cfg /ãmy_dir / maps /ãmy_dir / materials /ãªã©ãšããã«ãããã¡ã€ã«ã§ããåãååã®æšæºã®ä»£ããã«äœ¿çšããŸãã
ããããããã ãã§ã¯ãããŸããã 2013幎5æ14æ¥ã®Team Fortress 2æŽæ°ã§ã¯ ãæ°ããã³ãã³ãã©ã€ã³ãã©ã¡ãŒã¿ãŒ-insert_search_path
ã ã«ã¹ã¿ã ãã£ã¬ã¯ããªæ§é ïŒã«ã¹ã¿ã /ã«é¡äŒŒïŒãè¿œå ããŸããã絶察ãã¹ãæå®ããæ©èœããããŸããã€ãŸãããµãŒããŒãã£ã¬ã¯ããªã/ tf2 / tf /å
ã«ããå¿
èŠã¯ãããŸããã 以åã¯ãããã工倫ããå¿
èŠããããŸããããsrcds_runã³ãã³ãã©ã€ã³ã§-insert_search_path / var / dir1ãæå®ããã ãã§ååã§ããããã®ãã£ã¬ã¯ããªãæ€çŽ¢ãã¹ïŒ/ var / dir1 / mapsã/ var / dir1 / cfgã...ïŒãšããŠäœ¿çšããŸãcustom /ããã³æ§æãã¡ã€ã«ãå«ãã¡ã€ã³ãã£ã¬ã¯ããªã/ tf2 / tf / cfg /ã -insert_search_pathã§ã³ã³ãã䜿çšããŠè€æ°ã®ãã£ã¬ã¯ããªãæå®ã§ããŸãã ããã«ããã£ã¬ã¯ããªã¯ã¢ã«ãã¡ãããé ã«åŠçãããã«ã¹ã¿ã /ã®ãã£ã¬ã¯ããªæ§é ãšã¯å¯Ÿç
§çã«ããªã¹ããããŠããé ã«åŠçãããŸãã
ã€ãŸããç°ãªããã£ã¬ã¯ããªã«è€æ°ã®server.cfgãã¡ã€ã«ãããå ŽåïŒ
~/tf2/tf/cfg/server.cfg ~/tf2/tf/custom/my_files/cfg/server.cfg ~/tf2/tf/custom/another/cfg/server.cfg /var/dir1/cfg/server.cfg
ãŸãããµãŒããŒã®ã³ãã³ãã©ã€ã³ã§-insert_search_path /var/dir1
ãæå®ããŸãããã®åŸããµãŒããŒãèµ·åããã³ã³ãœãŒã«ãšexec server.cfg
圢åŒã®ã¹ã¯ãªãããå®è¡ãããšããã®ãã¡ã€ã«ã¯æåã«/ var / dir1 / cfgã§ã次ã«custom / anotherã§æ€çŽ¢ãããŸã/ cfg /ã次ã«custom / my_files / cfg /ïŒcustom /ã®ãã£ã¬ã¯ããªã¯ã¢ã«ãã¡ãããé ã«ãœãŒããããŸãïŒãæåŸã«åºæ¬çã«cfg /ã«ãªããŸãã ããã¯server.cfgã ãã§ãªããmotd.txtãããããªã©ã«ãé©çšãããŸããæ€çŽ¢ãã¹ã®è©³çŽ°ïŒããã³èšå®ã®éžæïŒã¯ã/ tf2 / tf / gameinfo.txtã§ç¢ºèªã§ããŸããããã§ã¯èª¬æããŠããŸããããå€ãã®èå³æ·±ãããšãããã·ã¹ãã èšèªããã
æ€çŽ¢ãã¹ã®æ€çŽ¢é åºã¯éåžžã«ç°¡åã§ã-å®è¡äžã®ãµãŒããŒã®ã³ã³ãœãŒã«ã§path
ã³ãã³ããå
¥åããã ãã§ãïŒ
path --------------- Paths: "maps/cp_cloak.bsp" "GAME" (map) "/home/game/tf2/bin/" "EXECUTABLE_PATH" "/home/game/tf2/" "BASE_PATH" "/var/dir1/" "GAME" "/var/dir1/" "MOD" "/home/game/tf2/tf/custom/another/" "GAME" "/home/game/tf2/tf/custom/another/" "MOD" "/home/game/tf2/tf/custom/my_files/" "GAME" "/home/game/tf2/tf/custom/my_files/" "MOD" , ,
ãŸãã<map name> .cfgãšãã圢åŒã®èšå®ãã¡ã€ã«ãå¿ããªãã§ãã ããã ããã«ãreplay.cfgãsourcemod.cfgãmmmãªã©ããããŸãã
ãã®ãããªåç©åã§ã¯ããµãŒããŒã®åã
ã®æ§æãã»ããã¢ãããããšãã«ãããŸããŸãªæ¹æ³ã§èªåèªèº«ãæã€ããšãã§ããŸãã ãŸããsrcdsã¯åçã«éçºãããè¥ããµãŒããŒã§ãããããããªãSUDDENãã¬ãŒã€ãŒã¯ãŠãŒã¶ãŒã«ãŒãã®ããŠã³ããŒããåæ¢ããã®ã§ãããããŠã³ããŒãã¯ãã¡ãããé«éã§ã... 2幎éã¯åé¡ãããŸããã§ããããšãã質åã«å¯Ÿããçããæ¢ããŠã ...ã
ææ¡ãããŠããè±å¯ãªéžæè¢ã®äžãããã¹ã¿ãŒãã¢ãããã©ã¡ãŒã¿ã§+ execããã³+ servercfgfileã®æ§æãã¡ã€ã«ãæå®ããããšã«çŠç¹ãåœãŠãŸãã
ã/ tf2ã®ã€ã³ã¹ããŒã«äžã«ã€ã³ã¹ããŒã«ãããå®å
šãªãã¡ã€ã«ã¯ãã/ tf2 / tf / cfgã®ãã¡ã€ã«ãå«ãã次ã®ãµãŒããŒã®æŽæ°äžã«å€æŽã§ããããšã«æ³šæããŠãã ããã ãããã£ãŠãæ¢åã®æ§æãã¡ã€ã«ãçŽæ¥äœ¿çšããã®ã§ã¯ãªããç¬èªã®æ§æãã¡ã€ã«ãäœæããŸãã
ã€ãŸããããšãã°+mapcyclefile mapcycle_quickplay_cp.txt
ããã«ãããŒããŒã·ã§ã³çšã®ãããã®ãªã¹ããå«ãæ¢åã®å®å
šãªãã¡ã€ã«ã䜿çšãã代ããã«ãããšããããå®å
šã«ç§ãã¡ã«åã£ãŠãããšããŠãããããmapcycle.txtã«ã³ããŒããŠæ¥ç¶ããŸãã
ç§ãã¡ãå€æŽãŸãã¯åé€ããå®å
šãªãã¡ã€ã«ïŒèšå®ã ãã§ãªãããã¹ãŠïŒã¯ããæ€èšŒããã©ã¡ãŒã¿ãŒã§ã²ãŒã ãµãŒããŒã®æŽæ°ãéå§ããããšã§å
ã®ç¶æ
ã«æ»ãããšãã§ããŸãsteamcmd.sh +login anonymous +force_install_dir ~/tf2/ +app_update 232250 validate +quit
ã ãã®åŸããã®ãããªæ°ããæŽæ°ããªãå Žåã§ãããã¹ãŠã®å®å
šãªãã¡ã€ã«ã®ãã§ãã¯ãµã ããã§ãã¯ãããäžäžèŽãããå Žåãå€æŽããããã¡ã€ã«ãå床ããŠã³ããŒããããŸãã
ç·Žç¿ãã
ãã®äŸã§ã¯ã2ã€ã®ã²ãŒã ãµãŒããŒãæ§æããŸãã
- 1ã€ç®ã¯å
¬éãããŠãããå
¬åŒããããå€æŽãããŠããŸããã
- 2ã€ç®ã¯ãã²ãŒã ãã¬ã€ã®å€æŽãå€æŽãããããã§ããã«ã¹ã¿ã ããããåãããã©ã€ããŒãã§ãã ãã¡ãããValve Anti-Cheatããªã³ã«ããç¶æ
ã§ã
ãµãŒããŒèšå®ãã¡ã€ã«ãä¿åãããã£ã¬ã¯ããªãäœæããŸãã åæã«ããã°çšã®ãã£ã¬ã¯ããªãäœæããŸãã çŸæç¹ã§ã¯ããã§ã«Steamã¯ã©ã€ã¢ã³ãã®ãã°ããããŸãã®ã§ãããã«ãªã³ã¯ãäœæããŠãã ããïŒ
$ mkdir ~/cfg $ mkdir ~/log $ ln -s ~/Steam/logs ~/log/steam
å¯èœã§ããã°ããã¹ãŠã®èšå®ãã¡ã€ã«ãã/ cfgã«äœæããé©åãªãµãŒããŒãã£ã¬ã¯ããªã«ã·ã³ããªãã¯ãªã³ã¯ãé
眮ããŸãã ãã®ãããªé
眮ã«ããããµãŒããŒã®ããã¯ã¢ãããšåŸ©å
ã®æé ã倧å¹
ã«ç°¡çŽ åãããããŸããŸãªãµãŒããŒã®èšå®ã®æ··åãåæžãããŸããããããå®å
šã«åé¿ããããšã¯ã§ããŸããã
èšå®ã¯æ¡ä»¶ä»ãã§3ã€ã®ã«ããŽãªã«ã°ã«ãŒãåã§ããŸãã
- ãµãŒããŒã®èµ·åã³ãã³ãã©ã€ã³ã§ã®ã¿æå®ããå¿
èŠããããã©ã¡ãŒã¿ãŒã äŸ-å€ã2ã®maxplayersããã³sv_pure
- ããããããŒãããåã«æå®ããå¿
èŠããããã©ã¡ãŒã¿ãŒã¯ãautoexec.cfgããŸãã¯ã³ãã³ãã©ã€ã³ã®ãã©ã°ã€ã³+ exec file.cfgã«ãããŸãã äŸã¯ãmapcyclefileãmotdfileãtv_enableãã¯ãããããã®å€ãã§ã
- server.cfgããã³ãã®ä»ã®ãã¡ã€ã«ã§æå®ã§ããä»ã®ãã¹ãŠã
ãã ããæ倧é·ã®å¶éã®ããããŸãã¯ã»ãã¥ãªãã£äžã®çç±ã®ããã«ããµãŒããŒã®ã³ãã³ãã©ã€ã³ã§å€ããæå®ããŸãããé©åã«ç· ãä»ãããããããããªãå Žåãã·ã§ã«ã¢ã¯ã»ã¹ãæã€LinuxãµãŒããŒäžã®ä»ã®ãŠãŒã¶ãŒã¯äºãã®ããã»ã¹ãšã³ãã³ãã©ã€ã³ã衚瀺ã§ããŸã- cat /proc/<id>/cmdline
rcon_passwordãtf_server identity <...>ãsv_setsteamaccountãsv_passwordãªã©ïŒã®ãããªéèŠãªãã©ã¡ãŒã¿ãŒã䜿çšããŸãã
ãããã£ãŠãæåã«ã5ã€ã®ãã¡ã€ã«ã®ã¿ãèšå®ã«äœ¿çšããŸããautoexec.cfgãã¡ã€ã«å
ã®äž¡æ¹ã®ãµãŒããŒã®äžè¬èšå®ãæåã®ãµãŒããŒã®åã
ã®èšå®ã¯autoexec1.cfgããã³server1.cfgãautoexec2.cfgããã³server2.cfgã®2çªç®ã®ãã¡ã€ã«ã§ãã åã
ã®èšå®ã2ã€ã®ãã¡ã€ã«ã«åããããšã®é©åæ§ã¯ãäžèšã®ãã©ã¡ãŒã¿ãŒã3ã€ã®ã«ããŽãªãŒã«åå²ããã«ãŒããå€æŽããããã³ã«å®è¡ããããã¡ã€ã«ïŒserver.cfgãªã©ïŒã䜿çšããå¿
èŠæ§ã«ãã£ãŠæ±ºãŸããŸã-åã
ã®ãããèšå®ãã¡ã€ã«ã§å€æŽããããã©ã¡ãŒã¿ãŒã埩å
ããããã³ã³ãœãŒã«ã§æåã§ãcronãŸãã¯å¥ã®æ¹æ³ã§ã çµå±ã®ãšãããautoexec.cfgãªã©ã®ãã¡ã€ã«ã¯ãã²ãŒã ãµãŒããŒã®èµ·åæã«ã®ã¿å®è¡ãããŸãã
3ã€ã®éåžžã«äŸ¿å©ãªã³ãã³ãã«èšåãããããããŸããã æåã®echo "- , "
ã§ãã åæ§æãã¡ã€ã«ã®å
é ã§äœ¿çšãããšãéèªæãªãµãŒããŒã®åäœãåæããå Žåã«ãããŸããŸãªãã¡ã€ã«ã®å®è¡ã·ãŒã±ã³ã¹ãèŠèŠçã«ç¢ºèªã§ããŸãã 2çªç®ã¯differences
ããµãŒããŒã³ã³ãœãŒã«ã«å
¥åãããšãå€ãããã©ã«ãå€ãšç°ãªããã¹ãŠã®å€æ°ã衚瀺ãããŸãã ããªããã¹ãŠãééã£ãŠããã®ãïŒãã¹ãŠããã€ãã®ããã«èŠãã...ããšãã質åã«å¯ŸããçããèŠã€ãããããªããŸãã 3çªç®exec <config>
-ããæ§æãã¡ã€ã«ãå¥ã®æ§æãã¡ã€ã«ããåŒã³åºãããšãã§ããŸãã ææ
®æ·±ãã»ããã¢ãããšããã¡ã€ã«ãcronã§çœ®ãæããæ©èœãšçµã¿åãããŠãã¹ã¯ãªãããããã¡ã€ã«ãå®è¡ããæ©èœãšçµã¿åãããŠïŒtmux send-keysã䜿çš-ããµãŒããŒã®æŽæ°ãã»ã¯ã·ã§ã³ã®update.shã¹ã¯ãªããã®äŸãåç
§ïŒãã²ãŒã ãµãŒããŒãçããçç©ã«å€ããããšãã§ããŸãèªåã®äººçã
ã²ãŒã ãµãŒããŒã®å
éšæ§æã®è©³çŽ°ãªèšå®ã«ã€ããŠã¯ããã§ã¯èª¬æããŸãããåãµãŒããŒã«ã¯ç¬èªã®èšå®ãããã2å°ã®ãµãŒããŒã®åææäœã«é¢é£ããç¬éã«ã€ããŠã®ã¿èª¬æããŸãã
åäžã®ãµãŒããŒçšã®æ¢è£œã®èšå®ãã¡ã€ã«ãæ¢ã«ããå Žåã¯ããããã䜿çšããŠéå§ã§ããŸããããã§ãªãå ŽåïŒããããªã-åããŠã®ã²ãŒã ãµãŒããŒïŒã tf2ã®èšå®server.cfgãã°ãŒã°ã«ã§æ€çŽ¢ã§ããŸãã ç§ãã¢ããã€ã¹ã§ããå¯äžã®ããšã¯ã10幎åã®èª°ãã®æãæŽç·Žãããæ§æãã¡ã€ã«ãæ¢ãããšã§ã¯ãããŸãããããã¯ãå»æ¢ããããã©ã¡ãŒã¿ãŒãå«ããå¯èœãªéããã¹ãŠããªã¹ãããŸãããã®ã»ãšãã©ã¯ãcvarlistããã®ããã©ã«ãå€ãšèª¬æã§ãæ倧éã«ææžåããã説æãããã¯ç°¡åã§ã¯ãªããããããŸããããã¯ãã
äžè¬ã«ãserver.cfgãçšæããã«èµ·åããæ¹ãè¯ã-ã²ãŒã ãµãŒããŒã¯ãããªãã§ãæ£åžžã«èµ·åããŸãããããã¯æ¢ã«ç¢ºèªããŸããããäœããå€æŽããå Žå-ã©ãŠã³ãã®æ°ãšæéãããŒã ã®èªåãã©ã³ã¹ãªã©-ãã§ã«èªèããŠããŸããããå¶åŸ¡ãããã©ã¡ãŒã¿ãŒãåŠæ¹ããŸãã
ãall-all-allããµãŒããŒã®ãããªãã¯ã³ãã³ããšå€æ°ãåŒãç¶ãç¥ãããå Žåã¯ãå®è¡äžã®ãµãŒããŒã®ã³ã³ãœãŒã«ã§æ¬¡ã®ããã«å
¥åããŸãã
cvarlist log allcvars.txt cvar list -------------- _resetgamestats : cmd : : Erases current game stats and writes out a blank stats file _restart : cmd : : Shutdown and restart the engine. ... -------------- 1908 total convars/concommands
ã/ tf2 / tf / allcvars.txtã¯ãã¹ãŠã®ã³ã³ãœãŒã«å€æ°ããªã¹ãããŸãã cvarlist tf_
ã cvarlist sv_
ãªã©ãç¹å®ã®ãã¬ãã£ãã¯ã¹ãæã€ã³ãã³ãã®ã¿ã衚瀺ã§ããŸãã substring- find log
ã ãã®å Žåãæ€çŽ¢ã¯ååãšèª¬æã®äž¡æ¹ã§å®è¡ãããŸãã
ãã®ãããæ§æãã¡ã€ã«ãäœæããŸãã
å€ãã®ããŒã ãäºãã«äŸåãåã£ãŠããããšã念é ã«çœ®ãå¿
èŠããããå Žåã«ãã£ãŠã¯ãã®é åºãéèŠã§ãã ãããã£ãŠãããšãã°ãæåã«ãã¡ã€ã«ãžã®ãã°èšé²ãæå¹ã«ãïŒãã°ãªã³ïŒã次ã«ã©ã®ãã£ã¬ã¯ããªïŒsv_logsdirïŒããã³ã©ã®ååïŒsv_logfilename_formatïŒããã€ã³ããå§ãããšãçµæã¯æåŸ
ãæºãããŸããã
ãã¡ã€ã«ã/ cfg / autoexec.cfg-æåã«å®è¡ãããäž¡æ¹ã®ãµãŒããŒã«å
±éã®èšå®ãèŠå®ããŸãïŒ
autoexec.cfg // echo "*** ~/cfg/autoexec.cfg (global)" // , exec banned_user.cfg exec banned_ip.cfg writeid writeip // , // -1 - , 0 - , 1 - , 2 - , 3 - , // 4 - , 5 - , 6 - , 7 - sv_region 3 // // (1), // (0) sv_log_onefile 0 // sv_logbans 1 // , , UDP. // sv_logfile 1 // sv_logecho 0 // (log on) // - (sv_logsdir)
ãã°ç®¡çã³ãã³ãã«ã€ããŠã¯ãããã°ãã»ã¯ã·ã§ã³ã§è©³ãã説æããŸãã
ïŒä»ã®ãšããïŒç©ºã®banned_user.cfgããã³banned_ip.cfgãã¡ã€ã«ãäœæããŸã
$ touch ~/cfg/banned_user.cfg ~/cfg/banned_ip.cfg
ãã¡ã€ã«ã/ cfg / autoexec1.cfgã«ãæåã®ãµãŒããŒã®èšå®ãæžã蟌ã¿ãŸãã
autoexec1.cfg // echo "*** ~/cfg/autoexec1.cfg" // , hostname Public Server No 1 // . // rcon_password rconPasswordServer1 // . // . map cp_granary // sv_allow_point_servercommand // message of the day motdfile motd1.html motdfile_text motd1.txt // mapcyclefile mapcycle1.txt // sv_logsdir /home/game/log/server1 // log on
motdããã³mapcyclefileãã¡ã€ã«ã«ã€ããŠã¯ã以äžã§èª¬æããŸãã ãµãŒããŒã¯ããã°èªäœã®ãã£ã¬ã¯ããªãäœæããŸãã
2çªç®ã®ãµãŒããŒã«ã¯ãæšæºã®Team Fortress 2ãã£ã¹ããªãã¥ãŒã·ã§ã³ã«å«ãŸããŠããªãcp_orange_x3ã«ãŒããã€ã³ã¹ããŒã«ããŸããã«ã¹ã¿ã ããããã€ã³ã¹ããŒã«ããæãç°¡åãªæ¹æ³ã¯ãããããã¡ã€ã«ãã/ tf2 / tf / mapsãŸãã¯æ€çŽ¢ãã¹ã®1ã€ã®ãã£ã¬ã¯ããªã«çœ®ãããšã§ã ãã ãããµãŒãããŒãã£è£œã®ã«ãŒããæ¥ç¶ããæ¹æ³ã¯ãŸã ãããŸãã ãã®ãããªããããSteamã¯ãŒã¯ã·ã§ããã§è¡šç€ºãããå Žåãmapã³ãã³ããšmapcycleãã¡ã€ã«ã®äž¡æ¹ã§ããworkshop /ããŸãã¯ãworkshop / <map name> .ugcããšåŒã¶ããšãã§ããŸãã 次ã«ãã²ãŒã ãéå§ããããšããµãŒããŒãValveãµãŒããŒããã²ãŒã ãããŠã³ããŒããããã¬ãŒã€ãŒãæ¥ç¶ãããšãã³ã³ãã¥ãŒã¿ãŒãããããããããããŠã³ããŒãããŸãã ã«ãŒããå€æŽããããã³ã«ãæŽæ°ã確èªãããŸãã Steamã¯ãŒã¯ã·ã§ããããã®ã¿éæšæºãããã䜿çšããå Žåãé«éããŠã³ããŒããæå¹ã«ããå¿
èŠã¯ãªããªããŸãã ããããã³ã€ã³ã®è£åŽã¯ãWorkshopãµãŒããŒãžã®äŸåããããšããããšã§ãã
ãããã£ãŠãSteam Workshopãã©ãŠã¶ãŒã§äžèšã®ãªã³ã¯ãéããæ€çŽ¢ããŒã«ãcp_orange_x3ããšå
¥åããæ€çŽ¢çµæã®ãããããŒãžã«ç§»åããŸã-https://steamcommunity.com/sharedfiles/filedetails/?id=454299390 ãã®URLããæ°å€IDãååŸããautoexec2.cfgã§ãworkshop / 454299390ããŸãã¯ãworkshop / cp_orange_x3.ugc454299390ãã®åœ¢åŒã§æžã蟌ã¿ãŸãã 2çªç®ã®ãªãã·ã§ã³ã¯ããæ確ã§ãã
ãã¡ã€ã«ã/ cfg / autoexec2.cfgã«ã2çªç®ã®ãµãŒããŒã®èšå®ãæžã蟌ã¿ãŸãã
autoexec2.cfg echo "*** ~/cfg/autoexec2.cfg" hostname Private Server No 2 rcon_password rconPasswordServer2 //map workshop/454299390 map workshop/cp_orange_x3.ugc454299390 sv_allow_point_servercommand always motdfile "motd2.txt" mapcyclefile "mapcycle2.txt" sv_logsdir /home/game/log/server2 log on
ããäžã€ã®å°ããªãã€ã³ãã åã«ãŒãã«å¯ŸããŠããµãã©ã€ããã¡ã€ã«<ã«ãŒãå> .cfgãäœæã§ããŸããããã¯ãserver.cfgã®å®è¡çŽåŸã«ããã®ã«ãŒãã®èµ·åæã«ãµãŒããŒã«ãã£ãŠå®è¡ãããã³ãã³ãçšã§ãã æšæºã«ãŒãã®å Žåããã¡ã€ã«ã¯ã/ tf2 / tf / cfgã«é
眮ããå¿
èŠããããŸãã Steam Workshop, "< >.ugc.cfg" ~/tf2/tf/cfg/workshop. , , Steam Workshop. cp_orange_x3, id 454299390, ~/tf2/tf/cfg/workshop/cp_orange_x3.ugc454299390.cfg
sv_allow_point_servercommand, "official" â Allowed for valve maps only. "always" autoexec2.cfg
- Steam Workshop, tf_workshop_map_sync <id >
. â changelevel wohrkshop/<id>
. tf_workshop_map_status
, ~/tf2/steamapps/workshop{1,2}/appworkshop_440.acf.
~/cfg/server1.cfg , :
server1.cfg // echo "*** ~/cfg/server1.cfg" // *** // , UDP HLstatsX // // 127.0.0.1 (!) // "log on" - ( autoexec1.cfg) logaddress_delall logaddress_add 192.0.2.0:27500 // (1 - , 0 - ) sv_cheats 0
- HLstatsX ( â , ) logaddress_delall
< >.cfg, - , logaddress_add server1.cfg . logaddress_delall logaddress_add "logaddress_add: 192.0.2.0:27500 is already in the list"
, sv_cheats "0" â , - ( , ) "1".
~/cfg/server2.cfg :
server2.cfg echo "*** ~/cfg/server2.cfg" // - 27500, - 27501 !!! logaddress_delall logaddress_add 192.0.2.0:27501 sv_cheats 0 tf_bot_quota 0
. , Control Point, mapcycle_quickplay_cp.txt, .
$ cp ~/tf2/tf/cfg/mapcycle_quickplay_cp.txt ~/cfg/mapcycle1.txt $ dos2unix ~/cfg/mapcycle1.txt $ chmod 664 ~/cfg/mapcycle1.txt
, ~/cfg/mapcycle1.txt :
mapcycle1.txt cp_5gorge cp_badlands cp_coldfront cp_fastlane cp_freight_final1 cp_granary cp_well cp_yukon_final cp_foundry cp_gullywash_final1 cp_process_final cp_standin_final cp_snakewater_final1 cp_powerhouse cp_vanguard cp_sunshine cp_metalworks
~/cfg/mapcycle2.txt . cp_orange_x3 , autoexec2.cfg â "workshop/454299390", "workshop/cp_orange_x3.ugc454299390":
mapcycle2.txt // cp_orange_x3 https://steamcommunity.com/sharedfiles/filedetails/?id=454299390 workshop/cp_orange_x3.ugc454299390
. , html , url. - 1-2 .
~/cfg/motd1.html :
motd1.html <html> <head> <title>Message of the day</title> </head> <body> <h1>Welcome to our server!</h1> </body> </html>
~/cfg/motd1.txt , html motd (cl_disablehtmlmotd 1):
motd1.txt Welcome! Have fun and be safe
~/cfg/motd2.txt url, motd :
url motdfile. motdfile_text, url .
MOTD â from Jimo , .
, , cfg :
$ ln -s -v ~/cfg/* ~/tf2/tf/cfg/
ãããã¯ãŒã¯èšå®
( ), netstat -lpn | grep srcds
, :
tcp 0 0 192.0.2.0:27015 0.0.0.0:* LISTEN 3456/./srcds_linux udp 0 0 192.0.2.0:27005 0.0.0.0:* 3456/./srcds_linux udp 0 0 192.0.2.0:27015 0.0.0.0:* 3456/./srcds_linux udp 0 0 192.0.2.0:27020 0.0.0.0:* 3456/./srcds_linux udp 0 0 192.0.2.0:26901 0.0.0.0:* 3456/./srcds_linux
. srcds:
UDP/27005
+clientport
â Game client port
UDP/27015
-port
â The port the server advertises to clients
TCP/27015
, RCON, -port
, TCP. ssh ( â ), TCP ( UDP!) , . , . .
UDP/27020
-tv_port
â SourceTV port ( "SourceTV")
UDP/26901
-steamport
â Steam/VAC connection port
, , , "-port 27015 -steamport 26900 +clientport 27005 +tv_port 27020". 26900 â , .
. , , (27015 -> 27017 -> 27019 ). . .
"-port 27016 -steamport 26901 +clientport 27006 +tv_port 27021".
, , , . , , :
WARNING: Port 27015 was unavailable - bound to port 27016 instead WARNING: Port 27005 was unavailable - bound to port 27006 instead WARNING: Port 27020 was unavailable - bound to port 27021 instead Network: IP 192.0.2.0, mode MP, dedicated Yes, ports 27016 SV / 27006 CL
. , -strictportbind
( ).
, , "-port 50000 +clientport 50001 +tv_port 50002 -steamport 50003", ISteamApps/GetServersAtAddress . .
-:
- Steam â ~/Steam/steamcmd.sh, linux32/steamcmd. ;
- , â ~/tf2/srcds_run, srcds_linux, .
, / , â ~/start1.sh ~/start2.sh. . , ~/start1.sh:
start1.sh #!/bin/sh # # . # , srcds_run GAMEFOLDER=/home/game/tf2 CMDLINE="-port 27015 -steamport 26900 +clientport 27005 +tv_port 27020 -strictportbind \ +sv_pure 2 -game tf +maxplayers 24 \ -pidfile ${GAMEFOLDER}/tf/srcds1.pid \ -ugcpath ${GAMEFOLDER}/steamapps/workshop1 \ +exec autoexec1.cfg +servercfgfile server1.cfg" # ${GAMEFOLDER}/srcds_run ${CMDLINE}
( "-") ( "+"):
-port
. â 27015. , ,
-steamport
VAC (Valve Anti-Cheat). . 26900, 26901
+clientport
+tv_port
SourceTV. , +tv_port -nohltv
-strictportbind
, , "ERROR: Port 27015 was unavailable â quitting due to "-strictportbind" command-line flag!". .
-ip
ip , . - , 0.0.0.0 â . , , ip
-game
. â "tf" â Team Fortress 2.
+maxplayers
. . â 24, 32. Mann vs. Machine 32
-pidfile
PID .
-ugcpath
Steam Workshop. â ~/tf2/steamapps/workshop. , ~/tf2/tf. , workshop , .
+sv_pure
â , ( , , ). -1, 0, 1, 2. sv_pure 0 , , ( , ), , , . pure_server_full.txt, pure_server_minimal.txt pure_server_whitelist_example.txt ~/tf2/tf/cfg/. â sv_pure 2
, srcds_run, , .vpk .
+exec
, autoexec.cfg. .
+servercfgfile
, server.cfg â ,
+map
( ). , autoexec.cfg ( server.cfg !). , . . , autoexec.cfg
Valve Developer Community wiki
~/start2.sh, CMDLINE ( ), .
start2.sh #!/bin/sh # . GAMEFOLDER=/home/game/tf2 CMDLINE="-port 27016 -steamport 26901 +clientport 27006 +tv_port 27021 -strictportbind \ +sv_pure 2 -game tf +maxplayers 24 \ -pidfile ${GAMEFOLDER}/tf/srcds2.pid \ -ugcpath ${GAMEFOLDER}/steamapps/workshop2 \ +exec autoexec2.cfg +servercfgfile server2.cfg" # ${GAMEFOLDER}/srcds_run ${CMDLINE}
$ chmod u+x ~/start{1,2}.sh
(- game, root !), -. :
... *** ~/cfg/autoexec.cfg (global) Writing cfg/banned_user.cfg. Writing cfg/banned_ip.cfg. -------------------------------------------------------- sv_pure set to 2. -------------------------------------------------------- maxplayers set to 24 *** ~/cfg/autoexec1.cfg Server logging enabled. Server logging data to file /home/game/log/server1/L1007000.log ... Executing dedicated server config file server1.cfg Using map cycle file 'cfg/mapcycle1.txt'. Set motd from file 'cfg/motd1.html' Set motd_text from file 'cfg/motd1.txt' Connection to game coordinator established. tf_server_identity_account_id not set; not logging into registered account *** ~/cfg/server1.cfg logaddress_delall: no addresses in the list logaddress_add: 192.0.2.0:27500 'cp_granary.cfg' not present; not executing. Connection to Steam servers successful. ...
, , . . , L1007000.log, l1007000.log. â Linux ! , â . . â .
, , .
... *** ~/cfg/autoexec2.cfg ... [TF Workshop] Waiting for steam connection [TF Workshop] Preparing map ID 454299390 [TF Workshop] Map ID 454299390 isn't tracked, adding ... [TF Workshop] New version available for map, download queued [ workshop/cp_orange_x3.ugc454299390 ] ... [TF Workshop] Installed subscribed map [ workshop/cp_orange_x3.ugc454299390 ] [TF Workshop] Successfully prepared client map from workshop [ workshop/cp_orange_x3.ugc454299390 ] ... 'workshop/cp_orange_x3.ugc454299390.cfg' not present; not executing. ...
, . Steam Workshop ~/tf2/steamapps/workshop2, ~/tf2/steamapps/workshop2/content/440/454299390/cp_orange_x3.bsp. , "[ workshop/cp_orange_x3.ugc454299390 ]" â , . , autoexec2.cfg
Team Fortress 2, "Find a game" â "Community servers" â "" â "" â ip "192.0.2.0" â " " â . :-). .
, - Valve Web API, ip http://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=192.0.2.0 â source , Team Fortress 2
(quit, Ctrl+C), .
, srcds_run, , quit
, "Sat Jun 18 10:28:33 VOST 2016: Server restart in 10 seconds", Ctrl+C. , â 8 . - .
, , , , .
Valve , , :
â , â () . â Valve https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlds_linux . , "Optional TF2 update released" â . "Mandatory Team Fortress 2 update released" â . . , , â hlds_linux.
.
â :
start1.sh CMDLINE="... -autoupdate -steam_dir /home/game/Steam -steamcmd_script /home/game/cfg/tf2_update \ ...
-autoupdate
.
-steam_dir
steam.sh steamcmd.sh
-steamcmd_script
, "-steam_dir",
, () ./srcds_run +runscript ~/cfg/tf2_update
~/cfg tf2_update â . , .
tf2_update @ShutdownOnFailedCommand 0 @NoPromptForPassword 1 login anonymous force_install_dir /home/game/tf2/ app_update 232250 quit
:
@ShutdownOnFailedCommand
Valve "0" .
@NoPromptForPassword
, "1", Steam , login. , .
login <username> [<password>] [<Steam guard ode>]
Steam. , "ERROR! Failed to request AppInfo update, not online or not logged in to Steam." "anonymous" â . , , . Dedicated Servers List . , , steam guard, , set_steam_guard_code.
set_steam_guard_code <ode>
steam guard. .
force_install_dir
./SteamApps/common/< >. , . app_update.
app_update <appid> [-validate] [-language <lang>] [-beta <betaname>] [-betapassword <pwd>]
( ), . appid. validate â , , . , " ..." Steam, , . , , , , .
app_set_config <appid> <key> <value>
.
Steam , steamcmd.sh . help
, find <>
.
- Steam , .
:
^CMasterRequestRestart Your server will be restarted on map change. Your server will be restarted on map change. Your server needs to be restarted in order to receive the latest update. Your server needs to be restarted in order to receive the latest update.
:
L 07/08/2016 - 05:07:17: Your server will be restarted on map change. L 07/08/2016 - 05:07:17: Your server needs to be restarted in order to receive the latest update.
, ~/cfg/tf2_update , , . .
, , .
. , , . , ( mp_maxrounds, = 0), (mp_winlimit = 0), (mp_fraglimit = 0), (mp_timelimit = 0), , , , . , - , .
.
â cron steamcmd.sh (, "-"), .
, ~/Steam/steamcmd.sh +runscript ~/cfg/tf2_update
, steamcmd.sh :
... Connecting anonymously to Steam Public...Logged in OK Waiting for license info...OK Success! App '232250' already up to date.
, :
... Update state (0x61) downloading, progress: 99.63 (3616706682 / 3630011517) Update state (0x81) committing, progress: 100.00 (606937472 / 606937472) Success! App '232250' fully installed.
"fully installed" . . ~/update.sh:
update.sh #!/bin/sh ~/Steam/steamcmd.sh +login anonymous +force_install_dir /home/game/tf2/ +app_update 232250 +quit > ~/steamcmd.log if grep --quiet "fully installed" ~/steamcmd.log; then # kill `cat /home/game/tf2/tf/srcds1.pid` # ~/start1.sh & # kill `cat /home/game/tf2/tf/srcds2.pid` # ~/start2.sh & fi rm -f ~/steamcmd.log
, , steamcmd.sh â "+login anonymous +force_install_dir ~/tf2/ +app_update 232250 +quit", tf2_update â "+runscript ~/cfg/tf2_update"
, . , " ", tmux sudo, , . :
update.sh (v2) #!/bin/sh ~/Steam/steamcmd.sh +login anonymous +force_install_dir /home/game/tf2/ +app_update 232250 +quit > ~/steamcmd.log if grep --quiet "fully installed" ~/steamcmd.log; then echo "Update installed" tmux -L socket1 send-keys "say New update installed. Server will be restarted in 10 seconds. Please join us after a minute" Enter tmux -L socket2 send-keys "say New update installed. Server will be restarted in 10 seconds. Please join us after a minute" Enter sleep 10s sudo /usr/bin/systemctl reload srcds1.service sudo /usr/bin/systemctl reload srcds2.service else echo "Update not found" fi rm -f ~/steamcmd.log
"say", SourceMod .
crontab , :
$ chmod 744 ~/update.sh $ crontab -e
:
cron , game ""
, .
Valve Steam Web API . ISteamApps/UpToDateCheck, , Team Fortress 2 â http://api.steampowered.com/ISteamApps/UpToDateCheck/v1?appid=440&version=3528598 , version ( - ). appid = 232250 (, , ), "Couldn't get app info for the app specified.". ããã
, , Team Fortress 2 dedicated server â https://api.steampowered.com/IGCVersion_440/GetServerVersion/v1?format=json . - :
{ "result": { "success": true, "deploy_version": 3531256, "active_version": 3531256, "min_allowed_version": 3528598 } }
â json, xml, vdf. â Valve Data Format , Valve, json . â items_game.txt, , .acf, .vdf .
, deploy_version active_version Valve , , . , , api.
version
, ~/tf2/tf/steam.inf
, , Web API, , . - :
update.sh (v3) #!/bin/sh wget -q --no-check-certificate "https://api.steampowered.com/IGCVersion_440/GetServerVersion/v1?format=json" -O=~/GameVersion.json VERSION_DEPLOYED=`grep deploy_version ~/GameVersion.json | sed -s 's/[^[:digit:]]//g'` VERSION_INSTALLED=`grep ServerVersion ~/tf2/tf/steam.inf | sed -s 's/[^[:digit:]]//g'` if [[ $VERSION_DEPLOYED -gt $VERSION_INSTALLED ]]; then echo "New update is ready, $VERSION_DEPLOYED vs $VERSION_INSTALLED" # - fi
, crontab.
, . , Steam Web API, ~/tf2/steamapps/appmanifest_232250.acf, "buildid". â steamcmd.sh +login anonymous +app_info_update 1 +app_info_print 232250 +quit
, "buildid" depots -> branches -> public ( app_info_print , , app_info_update 1. rm -f ~/Steam/appcache/appinfo.vdf). grep, cut, tr , , json ( sed + tr) .
" ".
- 2 â (Replay), SourceTV, Fast Download,
- 3 â MetaMod SourceMod, , , Steam
QuickPlay - 4 â HLstatsX