キモブロ

Please spy check please, Fucking retard

Linuxでqstat(quakestat)を動かすまでの手順

まず、qstat (quakestate) をyumで入れます。いつのまにかパッケージ化されていた! ので簡単。

$ sudo yum install qstat

ただyumでいれると/usr/binに、quakenetって名前でインストールされてしまう (おそらくqstatっていうjob-queue関係の他のシステムとyumにおいてはかぶってるからと思われる)、ので自力でシンボリックリンクを貼ります。

$ cd /usr/bin
$ ln -s ./quakenet ./qstat

これでqstatと入力するだけでいけるようになる

$ qstat
Usage: qstat [options ...]
     [-default server-type] [-cfg file] [-f file] [host[:port]] ...
Where host is an IP address or host name
-a2s          query Half-Life 2 new server
-ams          query America's Army v2.x server
-bfs          query BFRIS server
-cod2m          query Call of Duty 2 Master server
-cod2s          query Call of Duty 2 server
-cod4m          query Call of Duty 4 Master server
-cod4s          query Call of Duty 4 server
...


俺の作ったruby-qstatはこの状態で普通に動くようになる。たとえば現在起動中のping100以下のLeft4Dead2のサーバーのサーバー名を配列で取得するコードはこんな感じ。too easy!

$ gem install ruby-qstat
$ irb
irb(main):001:0> require 'ruby-qstat'
irb(main):002:0> QStat.query_serverlist("hl2master.steampowered.com:27011", "stm", "left4dead2", maxping = 100).map(&:server_name)
=> ["DAGEKI L4D2 SRCDS #02-05 (HyperCloud)", "DAGEKI L4D2 SRCDS #03-05 (HyperCloud) [Easy]", "..:: FiveSeven #08 [ex_ConfoglHardEight+8 *nokit*:Normal] JPonl", "DAGEKI L4D2 SRCDS #02-01 (HyperCloud)", "..:: FiveSeven #04 [Coop:Advanced] *", "..:: FiveSeven #05 [Coop:Expert] JPonly", "DAGEKI L4D2 SRCDS #03-02 (HyperCloud) [Normal]", "Left 4 Dead 2", "..:: FiveSeven #01 [---] *", "// -Halms Coop- [Ex.Expert] #0 //", "DAGEKI L4D2 SRCDS #03-03 (HyperCloud) [Normal]", "[NJUR] Medoi #1 <COOP>[NORMAL]", "..:: FiveSeven #06 [---] JPonly", "..:: FiveSeven #03 [Coop:Normal] *", "DAGEKI L4D2 SRCDS #02-04 (HyperCloud)", "DAGEKI L4D2 SRCDS #03-01 (HyperCloud) [Normal]", "..:: FiveSeven #02 [---] *", "DAGEKI L4D2 SRCDS #02-03 (HyperCloud) [Normal]", "DAGEKI L4D2 SRCDS #02-02 (HyperCloud) [Normal]", "..:: FiveSeven #07 [---] JPonly", "// -Halms Coop- [Ex.Expert] #1 //", "Core2Duo Takesi Goda xx", "DAGEKI L4D2 SRCDS #03-04 (HyperCloud) [Expert]", "Core2Duo Takesi Goda xx", "skullsaba.jp L4D2 Server #08 (JPONLY)", "skullsaba.jp L4D2 Server #METAFOGL1 (JPONLY)", "skullsaba.jp L4D2 Server #B (JPONLY)", "Core2Duo Takesi Goda xx", "Core2Duo Takesi Goda xx", "Core2Duo Takesi Goda xxx", "ANM 4P [Uncommon Zombies] (Normal)", "DAGEKI L4D2 SRCDS #01-02 [Normal]", "DAGEKI L4D2 SRCDS #01-01", "Core2Duo Takesi Goda", "ANM 8P [Hard Eight][Uncommon Zombies] (Normal)", "skullsaba.jp L4D2 Server #04", "skullsaba.jp L4D2 Server #01", "skullsaba.jp L4D2 Server #13 (JPONLY)", "ANM 4P [Uncommon Zombies] (Normal)", "[JP]No Reload Coop Server", "skullsaba.jp L4D2 Server #09 (JPONLY)", "custom-DEEP-EXP", "skullsaba.jp L4D2 Server #03", "Core2Duo Takesi Goda", "Core2Duo Takesi Goda xxx", "Core2Duo Takesi Goda xxxx", "custom-DEEP-ADV [ver.8]", "skullsaba.jp L4D2 Server #05 (JPONLY)", "skullsaba.jp L4D2 Server #06 (JPONLY)", "[NJUR] Medoi #2 <COOP>[NORMAL]", "ANM 8P [Hard Eight][Uncommon Zombies] (Normal)", "skullsaba.jp L4D2 Server #12 (JPONLY)", "skullsaba.jp L4D2 Server #METAFOGL4 (JPONLY)", "skullsaba.jp L4D2 Server #METAFOGL3 (JPONLY)", "ANM 8P [Hard Eight][Uncommon Zombies] (Normal)", "Core2Duo Takesi Goda xxxx", "skullsaba.jp L4D2 Server #07 (JPONLY)", "Core2Duo Takesi Goda", "Core2Duo Takesi Goda xxxx", "skullsaba.jp L4D2 Server #02", "skullsaba.jp L4D2 Server #A (JPONLY)", "skullsaba.jp L4D2 Server #14 (JPONLY)", "Core2Duo Takesi Goda xxx", "DAGEKI L4D2 SRCDS #01-05", "survival server", "ANM 8P [Hard Eight][Uncommon Zombies] (Normal)", "", "DAGEKI L4D2 SRCDS #01-03 [Expert]", "skullsaba.jp L4D2 Server #10 (JPONLY)", "Core2Duo Takesi Goda", "skullsaba.jp L4D2 Server #11 (JPONLY)", "ANM 4P [Uncommon Zombies] (Normal)", "Core2Duo Takesi Goda xxxx", "DAGEKI L4D2 SRCDS #01-04 [Normal]", "ANM 4P [Uncommon Zombies] (Advanced)", "[JP]ken-saba", "Core2Duo Takesi Goda xxx", "KR.L4D2", "[KR] CHAOS COOP SERVER", "PenPen Confogl #04 [Coop:Normal] JP/TW/KR Only", "PenPen Confogl #01 [Coop:Normal] JP Only", "PenPen Confogl #05 [Coop:Normal] JP/TW/KR Only", "entEr_Clan Server", "PenPen Confogl #02 [Coop:Normal] JP Only", "PenPen Confogl #03 [Coop:Normal] JP Only", "Left 4 Dead 2 coop", "Neo's server"]