<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>EBIOS GAMES</title><link>https://ebios-games.com/</link><description>Recent content on EBIOS GAMES</description><generator>Hugo</generator><language>ja</language><lastBuildDate>Sat, 19 Sep 2026 17:04:00 +0900</lastBuildDate><atom:link href="https://ebios-games.com/index.xml" rel="self" type="application/rss+xml"/><item><title>このブログについて</title><link>https://ebios-games.com/civ4/blog/welcome-post/</link><pubDate>Fri, 11 Sep 2026 00:00:00 +0900</pubDate><guid>https://ebios-games.com/civ4/blog/welcome-post/</guid><description>Civ4 Internet Lobbyプロジェクトの技術記録を始めます</description><content:encoded><![CDATA[<p>Civilization IV のマルチプレイは、GameSpyのサービス終了後、有志によるロビーサーバーの実装によって続けられています。このブログでは、その一つとなる Civ4 Internet Lobbyプロジェクトに取り組む中で分かったことや直したこと等を記録していきます。</p>
<p>扱う予定のテーマ:</p>
<ul>
<li>GameSpyプロトコルの構造</li>
<li>NAT越え（NATNEG）の仕組み</li>
<li>運用上気づいた点</li>
</ul>
]]></content:encoded></item><item><title>Civ4 Internet lobbyとは</title><link>https://ebios-games.com/civ4/guide/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ebios-games.com/civ4/guide/about/</guid><description>GameSpy代替ロビーサーバー Civ4 Internet lobbyの概要</description><content:encoded><![CDATA[<p>Civilization IV のマルチプレイは、当初GameSpyのオンラインサービスを介して行われていました。GameSpyのサービスは終了していますが、有志によってプロトコル互換のロビーサーバーが実装され、現在もマルチプレイを続けられています。</p>
<p>このサイトで扱うCiv4 Internet lobbyはpylobbyをベースに自宅・外出先など異なるネットワーク環境にいるプレイヤー同士でも安定して対戦できるよう手を加えたバージョンです。pylobby（<a href="https://github.com/civ4-mp/pylobby">civ4-mp/pylobby</a>）はPython で書かれたオープンソースのロビーサーバーです。</p>
<h2 id="できること">できること</h2>
<ul>
<li>ロビーへのログイン、部屋の一覧・作成・参加</li>
<li>異なるネットワーク環境にいるプレイヤー同士のマッチング（NAT越え）</li>
<li>対戦の開始からターン進行までの一連の流れ</li>
</ul>
<h2 id="ゲームポートudp-2056開放が不要に">ゲームポート(UDP 2056)開放が不要に</h2>
<p>以前のCiv4のlobbyは<strong>NAT越え機能</strong>にバグがあり、ホスト⇔参加者が直接つながれなかったため、ルーターでゲームポート(UDP 2056)開放（ルーターの設定で外から内側へ転送）をしておく必要がありました。</p>
<p>Civ4 Internet lobbyでは<strong>NAT越え機能</strong>のバグを直し、実際にゲームポート(UDP 2056)転送設定を外した状態でテストしたところ、お互いのアドレスを教え合うだけで自動的に穴が開いて直接つながることを確認できました。そのためCiv4 Internet lobbyではゲームポート(UDP 2056)開放はもう不要です。</p>
<h2 id="nat越え機能とは">NAT越え機能とは</h2>
<p>多くの家庭用ルーターは「内側から外へ出ていく通信」は自由に通しますが、「外から内側への通信」は原則ブロックします（これがNAT）。そのままだと、ホストと参加者がお互いのPCに直接データを送り合うゲーム通信は届きません。</p>
<p>そこで、間に立つサーバー（Civ4 Internet lobbyのNATNEG機能）が両者に「相手はこのアドレスにいますよ」と教えます。それを合図に両者が同時に相手へパケットを送ると、ちょうど内側から外へ通信した直後の一瞬だけルーターの扉が開くタイミングが重なり、そこにお互いの通信がすれ違いで通り抜けます。この「一瞬だけ開く扉を両側から同時に通す」やり方がNAT越え（ホールパンチング）で、ルーターの設定で外から内側へ転送しなくても、この機能だけで直接通信が成立します。</p>
]]></content:encoded></item><item><title>Civ4 Internet Lobbyの成り立ち</title><link>https://ebios-games.com/civ4/blog/pylobby-origins/</link><pubDate>Sat, 19 Sep 2026 17:04:00 +0900</pubDate><guid>https://ebios-games.com/civ4/blog/pylobby-origins/</guid><description>Civ4 Internet Lobbyの成り立ち</description><content:encoded><![CDATA[<h2 id="gamespy終了後の仕組み">GameSpy終了後の仕組み</h2>
<p>オープンソースプロジェクトである <code>pylobby</code> は、<strong>Civilization IV のマルチプレイ・ロビー機能が依存していた GameSpy SDK のマスターサーバー群を、ゼロから再実装したもの</strong>である。GameSpy は2010年代にオンラインサービス事業を終了しており、公式のロビーサーバー（<code>gpcm.gamespy.com</code> 等）はすでに存在しない。Civ4 クライアント側のプロトコル実装は変更できないため、<strong>クライアントが「GameSpy のサーバーだ」と信じて話しかけてくる相手を、自前サーバー上に用意する</strong>というアプローチを取っている。具体的には、Civ4 クライアントの <code>hosts</code> ファイルで <code>gpcm.gamespy.com</code> 等のホスト名を自前サーバーの IP に向け、そこで <code>pylobby</code> をベースにしたサーバー実装(本プロジェクト「Civ4 Internet Lobby」)を稼働させている。</p>
<figure><svg viewBox="0 0 680 300" role="img" aria-labelledby="fig1-title fig1-desc" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font-family:sans-serif;"><title id="fig1-title">GameSpy終了後のなりすまし構成</title><desc id="fig1-desc">かつてCiv4クライアントは実在するGameSpyのマスターサーバー群と通信していたが、GameSpyサービス終了後はhostsファイルでホスト名を自前サーバーのIPに向けることで、クライアントを改造せずにCiv4 Internet Lobbyへ通信させている。</desc><defs><marker id="arrow-hist" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs><text x="170" y="26" font-size="15" font-weight="600" text-anchor="middle" fill="currentColor">かつて</text><text x="510" y="26" font-size="15" font-weight="600" text-anchor="middle" fill="currentColor">現在(Civ4 Internet Lobby)</text><rect x="60" y="45" width="220" height="50" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="170" y="75" font-size="13" text-anchor="middle" fill="currentColor">Civ4 クライアント</text><line x1="170" y1="95" x2="170" y2="150" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-hist)"/><rect x="40" y="152" width="260" height="80" rx="6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-dasharray="6 4" opacity="0.55"/><text x="170" y="182" font-size="13" text-anchor="middle" fill="currentColor" opacity="0.55">GameSpy マスターサーバー群</text><text x="170" y="200" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.55">(gpcm.gamespy.com 等)</text><text x="170" y="252" font-size="11" text-anchor="middle" fill="currentColor" font-style="italic" opacity="0.7">2010年代にサービス終了・現存せず</text><rect x="400" y="45" width="220" height="50" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="510" y="75" font-size="13" text-anchor="middle" fill="currentColor">Civ4 クライアント(無改造)</text><line x1="510" y1="95" x2="510" y2="132" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-hist)"/><rect x="400" y="134" width="220" height="52" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="510" y="156" font-size="12" text-anchor="middle" fill="currentColor">hosts ファイルで書き換え</text><text x="510" y="174" font-size="11" text-anchor="middle" fill="currentColor">gpcm.gamespy.com → 自前サーバー</text><line x1="510" y1="186" x2="510" y2="222" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-hist)"/><rect x="400" y="224" width="220" height="56" rx="6" fill="none" stroke="currentColor" stroke-width="2.5"/><text x="510" y="248" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor">Civ4 Internet Lobby</text><text x="510" y="266" font-size="11" text-anchor="middle" fill="currentColor">GameSpyになりすまして応答</text></svg><figcaption>クライアント側の実装は変更せず、通信先だけをhostsファイルで自前サーバーへ差し替えている。</figcaption></figure>
<h2 id="civ4-internet-lobbyの構成">Civ4 Internet Lobbyの構成</h2>
<p><code>pylobby</code> は GameSpy Presence（ログイン）とサーバーブラウザ（部屋一覧）を実装したものだが、<strong>NAT 越え（NATNEG）機能は含まれていなかった</strong>。Civ4 Internet Lobbyでは <code>pylobby</code> のコードをベースに、NATNEG サーバーを新規実装として追加し、実機検証を通じてプロトコルの確定仕様に合わせ込んだ。</p>
<figure><svg viewBox="0 0 680 300" role="img" aria-labelledby="fig2-title fig2-desc" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font-family:sans-serif;"><title id="fig2-title">pylobbyの構成(既存部分と新規追加部分)</title><desc id="fig2-desc">上流のpylobbyが実装していたGameSpy PresenceとServerBrowserに、Civ4 Internet Lobbyが新規実装したNATNEGを組み合わせて構成している。</desc><defs><marker id="arrow-compose" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs><text x="210" y="50" font-size="14" font-weight="600" text-anchor="middle" fill="currentColor">既存(pylobbyベース)</text><rect x="40" y="60" width="340" height="140" rx="8" fill="none" stroke="currentColor" stroke-width="1.5" stroke-dasharray="6 4"/><rect x="60" y="95" width="140" height="80" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="130" y="130" font-size="12" text-anchor="middle" fill="currentColor">GameSpy Presence</text><text x="130" y="148" font-size="11" text-anchor="middle" fill="currentColor">(ログイン)</text><rect x="220" y="95" width="140" height="80" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="290" y="130" font-size="12" text-anchor="middle" fill="currentColor">ServerBrowser</text><text x="290" y="148" font-size="11" text-anchor="middle" fill="currentColor">(部屋一覧)</text><text x="405" y="140" font-size="28" text-anchor="middle" fill="currentColor">+</text><rect x="430" y="75" width="210" height="110" rx="8" fill="none" stroke="currentColor" stroke-width="2.5"/><text x="535" y="115" font-size="15" font-weight="600" text-anchor="middle" fill="currentColor">NATNEG</text><text x="535" y="134" font-size="12" text-anchor="middle" fill="currentColor">(NAT越え)</text><text x="535" y="162" font-size="10.5" text-anchor="middle" fill="currentColor">Civ4 Internet Lobbyで新規実装</text><line x1="210" y1="200" x2="260" y2="236" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-compose)"/><line x1="535" y1="185" x2="460" y2="236" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-compose)"/><rect x="140" y="240" width="400" height="50" rx="6" fill="none" stroke="currentColor" stroke-width="2"/><text x="340" y="262" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor">Civ4 Internet Lobby</text><text x="340" y="280" font-size="11" text-anchor="middle" fill="currentColor">(ログイン + 部屋一覧 + NAT越え)</text></svg><figcaption>ログインと部屋一覧はpylobbyの流れを汲み、NAT越え(NATNEG)をCiv4 Internet Lobbyが新規実装して組み合わせている。</figcaption></figure>
]]></content:encoded></item><item><title>参加方法</title><link>https://ebios-games.com/civ4/guide/join/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ebios-games.com/civ4/guide/join/</guid><description>Civ4 Internet lobbyへの参加手順(hostsファイルの設定・接続方法など)</description><content:encoded><![CDATA[<h2 id="civ4-internet-lobby目次">Civ4 Internet lobby目次</h2>
<ol>
<li><a href="#1-%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB%E4%BA%8B%E5%89%8D%E6%BA%96%E5%82%99">はじめに・事前準備</a></li>
<li><a href="#2-hosts%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E6%9B%B8%E3%81%8D%E6%8F%9B%E3%81%88%E5%BF%85%E9%A0%88">hostsファイルの書き換え(必須)</a></li>
<li><a href="#3-%E3%83%AD%E3%83%93%E3%83%BC%E3%81%B8%E3%81%AE%E6%8E%A5%E7%B6%9A%E5%8F%82%E5%8A%A0%E6%89%8B%E9%A0%86">ロビーへの接続・参加手順</a></li>
<li><a href="#4-%E3%82%88%E3%81%8F%E3%81%82%E3%82%8B%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%81%A8%E5%AF%BE%E5%87%A6">よくあるトラブルと対処</a></li>
<li><a href="#5-%E4%BB%98%E9%8C%B2-linux%E7%89%88winesteam-proton%E3%81%A7%E3%81%AE%E5%8F%82%E5%8A%A0">付録: Linux版(Wine・Steam Proton)での参加</a></li>
</ol>
<h2 id="1-はじめに事前準備">1. はじめに・事前準備</h2>
<p>このページは、Civ4 Internet lobby(pylobbyをベースにしたロビーサーバー)を使ってCivilization IVのマルチプレイに参加したい方向けの手順書です。Civ4 Internet lobby自体の概要は<a href="../about/">Civ4 Internet lobbyとは</a>を参照してください。</p>
<p>参加する前に、以下を確認・用意してください。</p>
<ul>
<li>
<p><strong>Civilization IV: Beyond the Sword 本体</strong>(拡張版が必要です。無印版のみでは参加できません。Colonizationをお使いの場合も接続できます)</p>
</li>
<li>
<p><strong>バージョン3.19であること</strong></p>
<p>メインメニューまたはタイトル画面でバージョンを確認できます。3.19より古い場合は、公式パッチを適用してアップデートしてください。マルチプレイは参加者全員が同じバージョンでないと接続できません。</p>
</li>
<li>
<p><strong>hostsファイルを編集できる管理者権限</strong></p>
</li>
</ul>
<p>このページはWindowsでの参加を前提に説明します。Linux(Wine・Steam Proton)でも参加可能ですが、手順が一部異なるため末尾の<a href="#5-%E4%BB%98%E9%8C%B2-linux%E7%89%88winesteam-proton%E3%81%A7%E3%81%AE%E5%8F%82%E5%8A%A0">付録(5章)</a>にまとめています。</p>
<h3 id="steam版を利用している場合の注意">Steam版を利用している場合の注意</h3>
<p>Steam版はデフォルトで最新のリリースパッケージに追従する設定になっており、これがマルチプレイ用の3.19と一致しないことがあります。日本語化パッチを適用済みの場合は、多くのケースでそのままロビーに接続できます。接続できない場合は、Steamのライブラリで「Sid Meier&rsquo;s Civilization IV: Beyond the Sword」を右クリック→「プロパティ」→「ベータ」タブから、案内役の指示に従ってベータブランチを切り替えてください。</p>
<h2 id="2-hostsファイルの書き換え必須">2. hostsファイルの書き換え(必須)</h2>
<p>Civilization IVは、マルチプレイのログインやマッチングの際に、あらかじめプログラム内に組み込まれた「GameSpy」というサービスのドメイン名にアクセスしようとします。GameSpyのサービス自体はすでに終了しているため、そのままでは接続できません。そこで、Windowsの<code>hosts</code>ファイルを書き換えて、これらのドメイン名へのアクセス先をCiv4 Internet lobbyのサーバーに向ける必要があります(Linuxをお使いの場合は<a href="#5-%E4%BB%98%E9%8C%B2-linux%E7%89%88winesteam-proton%E3%81%A7%E3%81%AE%E5%8F%82%E5%8A%A0">付録(5章)</a>を参照してください)。</p>
<h3 id="2-1-hostsファイルを開く">2-1. hostsファイルを開く</h3>
<ol>
<li><code>C:\Windows\System32\drivers\etc\hosts</code> をコピーし、同じフォルダに<code>hosts.bak</code>など別名で保存しておく(念のためのバックアップ。編集に失敗した場合はここから復元できます)</li>
<li><code>メモ帳</code>を<strong>管理者として実行</strong>する(スタートメニューでメモ帳を検索→右クリック→「管理者として実行」)</li>
<li>メモ帳の「ファイル」→「開く」から、以下の場所を開く</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">C:\Windows\System32\drivers\etc\hosts
</span></span></code></pre></div><p>ファイルの種類が「テキスト文書」のままだと<code>hosts</code>ファイル(拡張子なし)が表示されないことがあるので、ファイル選択ダイアログの右下を「すべてのファイル」に変更してください。</p>
<ol start="4">
<li>下記2-2の内容を、ファイルの末尾に貼り付けて保存する</li>
</ol>
<p>管理者権限で開いていない場合、編集後の保存時に「アクセスが拒否されました」というエラーになります。</p>
<h3 id="2-2-追記する内容">2-2. 追記する内容</h3>
<p>以下の内容をそのまま、対象のhostsファイルの末尾に追記してください。**<code>motd.gamespy.com</code>の行だけは<code>127.0.0.1</code>のままにしてください(書き換えないでください)**。civ4(無印)・BTS(海外版)・BTS日本語版・Colonization(海外版)・Colonization日本語版の5エディション分をまとめて登録しているため、普段使わないエディションの行があっても問題ありません(削除する必要もありません)。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">127.0.0.1 motd.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 gmtest.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 peerchat.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 gpcm.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 gpsp.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 gamestats.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 natneg3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.available.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms4.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms5.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms6.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms7.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms8.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms9.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.ms18.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4.natneg3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.available.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms4.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms5.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms6.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms7.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms8.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.ms9.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4bts.natneg3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.available.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms4.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms5.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms6.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms7.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms8.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.ms9.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4btsjp.natneg3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.available.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms4.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms5.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms6.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms7.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms8.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms9.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.ms11.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4colpc.natneg3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.available.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms3.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms4.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms5.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms6.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms7.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms8.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms9.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.ms11.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.master.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.natneg1.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.natneg2.gamespy.com
</span></span><span class="line"><span class="cl">133.88.118.124 civ4coljp.natneg3.gamespy.com
</span></span></code></pre></div><p>書き換えたら保存します。</p>
<h3 id="2-3-dnsキャッシュのクリア通称フラッシュ">2-3. DNSキャッシュのクリア(通称「フラッシュ」)</h3>
<p>hostsファイルを保存しただけでは、Windowsが古い名前解決の結果を覚えたままになっていることがあります。これをクリアする作業を、コミュニティ内では通称「フラッシュ」と呼んでいます。hostsファイルの書き換えと必ずセットで行ってください。</p>
<ol>
<li>スタートメニューで「コマンドプロンプト」を検索し、こちらも<strong>管理者として実行</strong>する</li>
<li>以下のコマンドを入力してEnterを押す</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">ipconfig /flushdns
</span></span></code></pre></div><ol start="3">
<li>「DNS リゾルバー キャッシュは正常にフラッシュされました。」と表示されれば完了</li>
</ol>
<p>反映がうまくいかない場合は、PCを再起動すると確実です。</p>
<h3 id="2-4-設定できているか確認する">2-4. 設定できているか確認する</h3>
<p>コマンドプロンプト(管理者権限は不要)で以下を実行します。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">ping civ4btsjp.ms5.gamespy.com
</span></span></code></pre></div><p>追記した<code>133.88.118.124</code>が以下の様に返ってくれば設定は正しく反映されています。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">civ4btsjp.ms5.gamespy.com [133.88.118.124]に ping を送信しています
</span></span></code></pre></div><p>別の値やエラー(<code>NXDOMAIN</code>など)が返る場合は、hostsファイルの内容とフラッシュ作業(2-2・2-3)を見直してください。</p>
<h3 id="2-5-civ4クライアントを再起動する">2-5. Civ4クライアントを再起動する</h3>
<p><strong>hostsファイルを書き換えたら、必ずCivilization IVをいったん終了し、起動し直してください。</strong> 起動したままの状態では変更が反映されません。</p>
<h2 id="3-ロビーへの接続参加手順">3. ロビーへの接続・参加手順</h2>
<p>hostsファイルの設定が終わったら、Civilization IVを起動して以下の手順でロビーに参加します。</p>
<ol>
<li>Civilization IVを起動する</li>
<li>メインメニューから「マルチプレイヤー」→「インターネットゲーム」を選ぶ</li>
<li>「ログイン」画面が表示されるので、アカウントを作成(初回のみ)またはログインする</li>
<li>ロビーに接続すると、開催中の部屋の一覧が表示される</li>
<li>参加したい部屋を選んで「参加」を押すか、自分で部屋を作る場合は「ゲームを作成」を選ぶ</li>
<li>部屋の中でプレイヤーが揃ったらホストがゲームを開始する</li>
</ol>
<p>参加時にホストと自分のネットワーク環境が異なっていても(自宅・外出先などバラバラでも)、ロビー側でNAT越えの処理を行うため、通常は各プレイヤー側でのポート開放などの追加設定は必要ありません。</p>
<h2 id="4-よくあるトラブルと対処">4. よくあるトラブルと対処</h2>
<h3 id="ロビーにログインできないログイン画面にすら行けない">ロビーにログインできない・ログイン画面にすら行けない</h3>
<ul>
<li>hostsファイルの追記内容とDNSキャッシュのクリア(2章)を再確認する</li>
<li>2-4の確認コマンドで、意図したアドレスが返ってきているか確認する</li>
<li>Linux(Wine・Steam Proton)で参加している場合は、<a href="#5-%E4%BB%98%E9%8C%B2-linux%E7%89%88winesteam-proton%E3%81%A7%E3%81%AE%E5%8F%82%E5%8A%A0">付録(5章)</a>の手順(特にWineプレフィックス内のhosts)も確認する</li>
<li>ウイルス対策ソフトやファイアウォールが通信をブロックしていないか確認する</li>
</ul>
<h3 id="hostsを直したのに反映されない">hostsを直したのに反映されない</h3>
<ul>
<li><strong>Civilization IVを再起動したか確認してください</strong>(起動中には反映されません。2-5)</li>
</ul>
<h3 id="ロビー入室直後にフリーズする">ロビー入室直後にフリーズする</h3>
<ul>
<li>hostsの<code>motd.gamespy.com</code>の行が<code>127.0.0.1</code>になっているか確認してください(誤って他のアドレスに書き換えると、この症状が起きます)</li>
</ul>
<h3 id="ロビーの処理が途中で連鎖的に失敗する">ロビーの処理が途中で連鎖的に失敗する</h3>
<ul>
<li>お使いのエディションの<code>ms1</code>〜<code>ms9</code>(<code>civ4btsjp.ms1.gamespy.com</code>など)がhostsに登録されているか確認してください。2-2の内容を部分的にではなく、まとめて貼り直すと確実です</li>
</ul>
<h3 id="部屋に参加しようとすると交信していますのまま固まる">部屋に参加しようとすると「交信しています」のまま固まる</h3>
<ul>
<li>主に、それまでホスト役としてしか使ったことのない環境で初めて参加者側になった場合に起きやすい症状です</li>
<li>原因は<code>natneg1</code>〜<code>natneg3</code>(お使いのエディション名を付けたもの。例: <code>civ4btsjp.natneg1.gamespy.com</code>)がhostsに登録されていないことです</li>
<li>Windowsの場合、以下のコマンドで該当行があるか確認できます</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="n">ping</span> <span class="n">civ4btsjp</span><span class="p">.</span><span class="py">natneg1</span><span class="p">.</span><span class="py">gamespy</span><span class="p">.</span><span class="py">com</span>
</span></span></code></pre></div><p>追記した<code>133.88.118.124</code>が以下の様に返ってくれば設定は正しく反映されています。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-plain" data-lang="plain"><span class="line"><span class="cl">civ4btsjp.natneg1.gamespy.com [133.88.118.124]に ping を送信しています
</span></span></code></pre></div><p><code>NXDOMAIN</code>などが返る場合は該当行が抜けています。2-2の内容を部分的に追記するのではなく、まとめて貼り直してください</p>
<h3 id="サーバー接続不能-ゲーム検索サーバーと接続できませんでしたと表示されるまたはログイン後にエラーも無く画面が固まる">「サーバー接続不能: ゲーム検索サーバーと接続できませんでした」と表示される、またはログイン後にエラーも無く画面が固まる</h3>
<ul>
<li>サーバー側の設定に起因する可能性があります。<a href="../status"><strong>稼働状況・お知らせ</strong></a>を確認してください</li>
</ul>
<h3 id="部屋を作成したがメンバーが参加できない">部屋を作成したがメンバーが参加できない</h3>
<ul>
<li>失敗する場合は<a href="../status"><strong>稼働状況・お知らせ</strong></a>を確認してください</li>
</ul>
<h3 id="windowsのhostsファイルの編集に失敗した内容がおかしくなった">Windowsのhostsファイルの編集に失敗した・内容がおかしくなった</h3>
<ul>
<li>2-1で作成した<code>hosts.bak</code>から復元してください</li>
</ul>
<h3 id="上記で解決しない場合">上記で解決しない場合</h3>
<p>このページの手順で解決しない場合は、<a href="../../board/"><strong>Civ4</strong></a><a href="../../board/"><strong>掲示板</strong></a>で質問してください。</p>
<h2 id="5-付録-linux版winesteam-protonでの参加">5. 付録: Linux版(Wine・Steam Proton)での参加</h2>
<p>このページの本文はWindowsでの参加を前提に説明していますが、Linux上でも(Wine単体、またはSteam版をProtonで動かす形で)参加できます。基本的な流れは2〜4章と同じで、hostsファイルの編集方法のみ以下のように読み替えてください。</p>
<h3 id="5-1-hostsファイルの書き換え">5-1. hostsファイルの書き換え</h3>
<p>Linuxネイティブ版、または通常の<code>/etc/hosts</code>のみで動くWine環境の場合は、<code>/etc/hosts</code>を編集します。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo cp -a /etc/hosts /etc/hosts.bak.<span class="k">$(</span>date +%Y%m%d_%H%M%S<span class="k">)</span>   <span class="c1"># バックアップ</span>
</span></span></code></pre></div><p><a href="#2-2-%E8%BF%BD%E8%A8%98%E3%81%99%E3%82%8B%E5%86%85%E5%AE%B9">2-2. 追記する内容</a>を追記します。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo tee -a /etc/hosts   <span class="c1"># 2-2の内容を貼り付けてCtrl+D</span>
</span></span></code></pre></div><p><strong>Steam版をProton経由で動かしている場合</strong>、Civ4はWine内部の独自のhostsファイルを見るため、**<code>/etc/hosts</code>の変更だけでは反映されません**。以下のWineプレフィックス内のhostsも同様に書き換えてください(Beyond the SwordのSteam App IDは<code>8800</code>)。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">PFX</span><span class="o">=</span>~/.local/share/Steam/steamapps/compatdata/8800/pfx/drive_c/windows/system32/drivers/etc/hosts
</span></span><span class="line"><span class="cl">cp -a <span class="s2">&#34;</span><span class="nv">$PFX</span><span class="s2">&#34;</span> <span class="s2">&#34;</span><span class="nv">$PFX</span><span class="s2">.bak.</span><span class="k">$(</span>date +%Y%m%d_%H%M%S<span class="k">)</span><span class="s2">&#34;</span>   <span class="c1"># バックアップ</span>
</span></span><span class="line"><span class="cl">grep gamespy /etc/hosts &gt;&gt; <span class="s2">&#34;</span><span class="nv">$PFX</span><span class="s2">&#34;</span>
</span></span></code></pre></div><p>(このファイルが存在しない場合は、WineがLinux側の名前解決に委譲しているため、この作業は不要です)</p>
<h3 id="5-2-dnsキャッシュのクリア">5-2. DNSキャッシュのクリア</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo resolvectl flush-caches 2&gt;/dev/null <span class="o">||</span> <span class="nb">true</span>
</span></span></code></pre></div><h3 id="5-3-設定できているか確認する">5-3. 設定できているか確認する</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">getent hosts civ4btsjp.ms5.gamespy.com
</span></span></code></pre></div><p>追記した<code>133.88.118.124</code>が返ってくれば設定は正しく反映されています。</p>
<h3 id="5-4-civ4クライアントを再起動する">5-4. Civ4クライアントを再起動する</h3>
<p>Windows版と同様、<strong>hostsファイルを書き換えたら必ずCivilization IVをいったん終了し、起動し直してください。</strong></p>
<p>以降のロビーへの接続手順(3章)、トラブルシューティング(4章。Wineプレフィックスのhostsが未反映のケースを含む)は共通です。</p>
]]></content:encoded></item><item><title>システム全体像と通信シーケンス</title><link>https://ebios-games.com/civ4/blog/system-overview/</link><pubDate>Fri, 18 Sep 2026 15:43:00 +0900</pubDate><guid>https://ebios-games.com/civ4/blog/system-overview/</guid><description>3つの独立したサーバープロセスの役割と、部屋参加からNAT越えを経て直接通信が始まるまでの流れ</description><content:encoded><![CDATA[<p>システムは独立した2つのプロセス(<code>civgs-login</code>・<code>civgs-gamebrowser</code>)と、別途起動が必要なIRCサーバー(<code>civgs-ircd</code>)から成ります。2つのプロセスは互いに独立して動作しており、共有しているのはコードだけで、プロセス間通信は一切行いません。<code>civgs-ircd</code>が起動していないと、Civ4クライアントはログイン処理を完了できずフリーズしてしまいます。</p>
<h2 id="サーバー構成">サーバー構成</h2>
<figure>
<svg viewBox="0 0 680 300" role="img" aria-label="Civ4 Internet Lobbyのサーバー構成図。Civ4クライアントは civgs-login・civgs-gamebrowser・civgs-ircd という3つの独立したプロセスにそれぞれ接続する。civgs-loginとcivgs-gamebrowserはプロセス間通信を持たない。" style="max-width:100%;height:auto;">
  <defs>
    <marker id="arrow-overview" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">
      <path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>
    </marker>
  </defs>
  <rect x="250" y="20" width="180" height="48" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <text x="340" y="49" text-anchor="middle" font-size="13" fill="currentColor">Civ4クライアント</text>
  <rect x="20" y="150" width="180" height="70" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <rect x="250" y="150" width="180" height="70" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <rect x="480" y="150" width="180" height="70" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <text x="110" y="178" text-anchor="middle" font-size="13" fill="currentColor">civgs-login</text>
  <text x="110" y="198" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">TCP 29900・29901</text>
  <text x="340" y="178" text-anchor="middle" font-size="13" fill="currentColor">civgs-gamebrowser</text>
  <text x="340" y="198" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">TCP 28910</text>
  <text x="340" y="212" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">UDP 27900・27901</text>
  <text x="570" y="178" text-anchor="middle" font-size="13" fill="currentColor">civgs-ircd</text>
  <text x="570" y="198" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">TCP 6667</text>
  <line x1="300" y1="68" x2="130" y2="150" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-overview)"/>
  <line x1="340" y1="68" x2="340" y2="150" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-overview)"/>
  <line x1="380" y1="68" x2="550" y2="150" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-overview)"/>
  <text x="200" y="100" text-anchor="middle" font-size="11" fill="currentColor">ログイン・検索</text>
  <text x="362" y="100" text-anchor="start" font-size="11" fill="currentColor">部屋一覧・NAT越え</text>
  <text x="480" y="100" text-anchor="middle" font-size="11" fill="currentColor">在席確認</text>
  <line x1="200" y1="185" x2="250" y2="185" stroke="currentColor" stroke-width="1.2" stroke-dasharray="3,3"/>
  <text x="225" y="238" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">プロセス間通信なし</text>
  <text x="225" y="251" text-anchor="middle" font-size="11" fill="currentColor" opacity="0.75">(コードのみ共有)</text>
</svg>
<figcaption>Civ4クライアントは civgs-login・civgs-gamebrowser・civgs-ircd という3つの独立したプロセスにそれぞれ接続する。civgs-loginとcivgs-gamebrowserはコードを共有するだけで、プロセス間通信は行わない。</figcaption>
</figure>
<table>
	<thead>
			<tr>
					<th>プロセス</th>
					<th>ポート</th>
					<th>役割</th>
					<th>対応するGameSpyドメイン</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>civgs-login</code></td>
					<td>TCP 29900</td>
					<td>ログイン(GP presence)</td>
					<td><code>gpcm.gamespy.com</code></td>
			</tr>
			<tr>
					<td><code>civgs-login</code></td>
					<td>TCP 29901</td>
					<td>ユーザー検索(GP search)</td>
					<td><code>gpsp.gamespy.com</code></td>
			</tr>
			<tr>
					<td><code>civgs-gamebrowser</code></td>
					<td>TCP 28910</td>
					<td>部屋一覧(ServerBrowser)</td>
					<td><code>&lt;エディション&gt;.ms*.gamespy.com</code> 等</td>
			</tr>
			<tr>
					<td><code>civgs-gamebrowser</code></td>
					<td>UDP 27900</td>
					<td>ホストのハートビート(QR)</td>
					<td>同上</td>
			</tr>
			<tr>
					<td><code>civgs-gamebrowser</code></td>
					<td>UDP 27901</td>
					<td>NAT越え(NATNEG)</td>
					<td><code>natneg1〜3.gamespy.com</code></td>
			</tr>
			<tr>
					<td><code>civgs-ircd</code></td>
					<td>TCP 6667</td>
					<td>在席確認・チャット(peerchat)</td>
					<td><code>peerchat.gamespy.com</code></td>
			</tr>
	</tbody>
</table>
<h2 id="通信シーケンス部屋参加nat越え">通信シーケンス(部屋参加〜NAT越え)</h2>
<p>ホストが部屋を作成してから、参加者が直接通信を始めるまでの流れは次の通りです。</p>
<figure>
<svg viewBox="0 0 680 470" role="img" aria-label="部屋参加からNAT越え(NATNEG)を経て、ホストと参加者が直接通信を始めるまでの通信シーケンス図。" style="max-width:100%;height:auto;">
  <defs>
    <marker id="arrow-seq" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
      <path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>
    </marker>
  </defs>
  <rect x="20" y="20" width="140" height="36" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <text x="90" y="43" text-anchor="middle" font-size="13" fill="currentColor">ホスト</text>
  <rect x="270" y="20" width="140" height="36" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <text x="340" y="35" text-anchor="middle" font-size="12" fill="currentColor">サーバー</text>
  <text x="340" y="49" text-anchor="middle" font-size="10" fill="currentColor" opacity="0.75">(civgs-gamebrowser)</text>
  <rect x="520" y="20" width="140" height="36" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/>
  <text x="590" y="43" text-anchor="middle" font-size="13" fill="currentColor">参加者</text>
  <line x1="90" y1="56" x2="90" y2="440" stroke="currentColor" stroke-width="1" stroke-dasharray="4,4" opacity="0.5"/>
  <line x1="340" y1="56" x2="340" y2="400" stroke="currentColor" stroke-width="1" stroke-dasharray="4,4" opacity="0.5"/>
  <line x1="590" y1="56" x2="590" y2="440" stroke="currentColor" stroke-width="1" stroke-dasharray="4,4" opacity="0.5"/>
  <line x1="90" y1="90" x2="340" y2="90" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="215" y="82" text-anchor="middle" font-size="11" fill="currentColor">部屋を作成(QR開始・UDP 27900)</text>
  <line x1="590" y1="130" x2="340" y2="130" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="465" y="122" text-anchor="middle" font-size="11" fill="currentColor">部屋一覧取得(TCP 28910)</text>
  <line x1="340" y1="170" x2="590" y2="170" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="465" y="162" text-anchor="middle" font-size="11" fill="currentColor">一覧を返す</text>
  <line x1="590" y1="210" x2="340" y2="210" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="465" y="202" text-anchor="middle" font-size="11" fill="currentColor">参加を選択→NATNEG開始</text>
  <line x1="90" y1="250" x2="340" y2="250" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <line x1="590" y1="250" x2="340" y2="250" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="340" y="242" text-anchor="middle" font-size="11" fill="currentColor">INIT(UDP 27901)</text>
  <line x1="340" y1="290" x2="90" y2="290" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <line x1="340" y1="290" x2="590" y2="290" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="340" y="282" text-anchor="middle" font-size="11" fill="currentColor">CONNECT ×2</text>
  <line x1="90" y1="330" x2="340" y2="330" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <line x1="590" y1="330" x2="340" y2="330" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="340" y="322" text-anchor="middle" font-size="11" fill="currentColor">CONNECT_ACK</text>
  <line x1="90" y1="370" x2="340" y2="370" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <line x1="590" y1="370" x2="340" y2="370" stroke="currentColor" stroke-width="1.3" marker-end="url(#arrow-seq)"/>
  <text x="340" y="362" text-anchor="middle" font-size="11" fill="currentColor">REPORT / REPORT_ACK</text>
  <line x1="90" y1="420" x2="590" y2="420" stroke="currentColor" stroke-width="2.5" marker-start="url(#arrow-seq)" marker-end="url(#arrow-seq)"/>
  <text x="340" y="410" text-anchor="middle" font-size="11" fill="currentColor">直接通信開始(UDP 2056・サーバーを介さない)</text>
</svg>
<figcaption>部屋参加からNAT越え(NATNEG)の4回のやり取りを経て、ホストと参加者が直接通信を始めるまでの流れ。NATNEG成立後はサーバーを経由しない。</figcaption>
</figure>
<ol>
<li>ホストが部屋を作成すると、<code>civgs-gamebrowser</code>へのハートビート(QR、UDP 27900)が始まる</li>
<li>参加者が部屋一覧を取得する(TCP 28910)</li>
<li>参加者が部屋への参加を選ぶと、NAT越え(NATNEG)処理が始まる</li>
<li>ホスト・参加者の双方から<code>civgs-gamebrowser</code>へ<code>INIT</code>を送る(UDP 27901)</li>
<li>サーバーは両者の通信先アドレスへ<code>CONNECT</code>を能動的に送信する(それぞれ2回ずつ)</li>
<li>両者がサーバーへ<code>CONNECT_ACK</code>を返す</li>
<li><code>REPORT</code>・<code>REPORT_ACK</code>のやり取りが完了する</li>
<li>ホストと参加者の間で直接通信が始まる(ゲームポート、UDP 2056。以降サーバーは経由しない)</li>
</ol>
<p>各プレイヤー側でのポート開放が不要なのは、このNAT越え処理のおかげです。</p>
]]></content:encoded></item><item><title>稼働状況・お知らせ</title><link>https://ebios-games.com/civ4/guide/status/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ebios-games.com/civ4/guide/status/</guid><description>Civ4 Internet lobbyの稼働状況とお知らせ</description><content:encoded><![CDATA[

<p>
  
    <strong style="color:#16a34a">&#9679; 稼働中</strong>
  
  <br>
  <small>最終確認: 2026年9月19日 22:20（5分ごとに自動更新）</small>
  
</p>

<table>
  <thead>
    <tr><th>サービス</th><th>状態</th><th>直近の自動再起動</th></tr>
  </thead>
  <tbody>
    
    
      
      
      <tr>
        <td>ログイン(civgs-login)</td>
        <td>
          
            <span style="color:#16a34a">&#9679; 稼働中</span>
          
        </td>
        <td>-</td>
      </tr>
      
    
      
      
      <tr>
        <td>ゲームブラウザ(civgs-gamebrowser)</td>
        <td>
          
            <span style="color:#16a34a">&#9679; 稼働中</span>
          
        </td>
        <td>-</td>
      </tr>
      
    
      
      
      <tr>
        <td>IRC(civgs-ircd)</td>
        <td>
          
            <span style="color:#16a34a">&#9679; 稼働中</span>
          
        </td>
        <td>-</td>
      </tr>
      
    
  </tbody>
</table>



<!-- TODO: 実際のお知らせは運用開始後に随時更新 -->
]]></content:encoded></item><item><title>ログイン時のpeerchat/IRC通信(TCP 6667)について</title><link>https://ebios-games.com/civ4/blog/peerchat-irc/</link><pubDate>Sat, 19 Sep 2026 12:00:00 +0900</pubDate><guid>https://ebios-games.com/civ4/blog/peerchat-irc/</guid><description>ロビーへのログイン時に必須のIRCハンドシェイク(TCP 6667)が何のためにあるのか、なぜフリーズの原因になり得るのか、部屋への参加処理とは無関係であることを解説</description><content:encoded><![CDATA[<h2 id="この通信は何のためにあるのか">この通信は何のためにあるのか</h2>
<p>Civ4のマルチプレイでロビーにログインする際、クライアントは裏側で複数のGameSpy系サーバーと順番に通信している。その中の1つが<code>peerchat.gamespy.com</code>(TCP 6667)で、これは目に見えるチャット機能ではなく、<strong>ログイン処理の一部として必須のハンドシェイク</strong>である。クライアントは接続直後に<code>CRYPT</code>という拡張コマンドを送り、サーバーからの暗号チャレンジ応答(<code>705</code>)を待つ。この一往復が成立しないと、クライアントはロビー画面にたどり着けない。</p>
<figure><svg viewBox="0 0 680 400" role="img" aria-labelledby="fig1-title fig1-desc" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font-family:sans-serif;"><title id="fig1-title">ログイン処理内でのIRCハンドシェイクの位置づけ</title><desc id="fig1-desc">Civ4クライアントはGameSpy Presence認証に続けてpeerchat/IRC(TCP 6667)へ接続しCRYPTコマンドを送る。705応答が返ればロビー画面へ進み、応答がなければ無応答のままフリーズする。</desc><defs><marker id="arrow-login" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs><rect x="250" y="15" width="180" height="45" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="340" y="43" font-size="13" text-anchor="middle" fill="currentColor">Civ4 クライアント</text><line x1="340" y1="60" x2="340" y2="93" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-login)"/><rect x="190" y="97" width="300" height="55" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="340" y="122" font-size="13" text-anchor="middle" fill="currentColor">GameSpy Presence認証</text><text x="340" y="140" font-size="11" text-anchor="middle" fill="currentColor">(TCP 29900・ログイン)</text><line x1="340" y1="152" x2="340" y2="185" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-login)"/><rect x="170" y="189" width="340" height="68" rx="6" fill="none" stroke="currentColor" stroke-width="1.5"/><text x="340" y="214" font-size="14" font-weight="600" text-anchor="middle" fill="currentColor">IRCハンドシェイク</text><text x="340" y="232" font-size="11" text-anchor="middle" fill="currentColor">(peerchat, TCP 6667)</text><text x="340" y="250" font-size="11" text-anchor="middle" fill="currentColor">CRYPTコマンド → 705応答を待つ</text><line x1="340" y1="257" x2="150" y2="298" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-login)"/><line x1="340" y1="257" x2="530" y2="298" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-login)"/><rect x="40" y="302" width="220" height="70" rx="6" fill="none" stroke="currentColor" stroke-width="2.5"/><text x="150" y="326" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor">705応答あり</text><text x="150" y="344" font-size="11" text-anchor="middle" fill="currentColor">→ ロビー画面へ</text><text x="150" y="362" font-size="11" text-anchor="middle" fill="currentColor">(civgs-ircdが正常稼働)</text><rect x="420" y="302" width="220" height="70" rx="6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-dasharray="6 4" opacity="0.6"/><text x="530" y="326" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor" opacity="0.75">705応答なし</text><text x="530" y="344" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.75">→ 無応答のままフリーズ</text><text x="530" y="362" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.75">(標準IRCサーバー等)</text></svg><figcaption>peerchat(TCP 6667)でのCRYPTハンドシェイクが成立しないと、クライアントはエラーも出さずに無応答のままフリーズする。</figcaption></figure>
<h2 id="なぜ普通のircサーバーでは動かないのか">なぜ普通のIRCサーバーでは動かないのか</h2>
<p>一般的なIRCサーバー実装(標準の<code>miniircd</code>本家など)は、GameSpy独自の<code>CRYPT</code>コマンドを理解しない。この場合に起きることは2通りある。</p>
<ul>
<li>そもそも接続できない場合: クライアントはログイン自体を取り消し、「サーバー接続不能: ゲーム検索サーバーと接続できませんでした」という分かりやすいエラーを表示する。</li>
<li>接続はできるが<code>CRYPT</code>に応答が返らない場合: <strong>エラーメッセージが一切出ないまま、クライアントが無応答でフリーズする。</strong></li>
</ul>
<p>後者が厄介なのは、原因がひと目で分からないことである。Civ4 Internet Lobbyでは、<code>CRYPT</code>/<code>705</code>応答と<code>civ4</code>/<code>civ4bts</code>/<code>civ4btsjp</code>用の暗号レイヤーを実装した<a href="https://github.com/Zulan/miniircd"><code>Zulan/miniircd</code></a>フォークを<code>civgs-ircd</code>として稼働させることで、この問題を解決している。</p>
<figure><svg viewBox="0 0 680 300" role="img" aria-labelledby="fig3-title fig3-desc" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font-family:sans-serif;"><title id="fig3-title">標準IRCサーバーとcivgs-ircdでのCRYPTハンドシェイクの違い</title><desc id="fig3-desc">標準のIRCサーバーはGameSpy独自のCRYPTコマンドに応答できず無応答のままフリーズするが、civgs-ircd(Zulanフォーク)はCRYPTコマンドに705応答を返しログイン処理が続行する。</desc><defs><marker id="arrow-crypt" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs><text x="180" y="15" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor">標準IRCサーバーの場合</text><text x="520" y="15" font-size="13" font-weight="600" text-anchor="middle" fill="currentColor">civgs-ircd(対応フォーク)の場合</text><text x="100" y="38" font-size="12" text-anchor="middle" fill="currentColor">Civ4 クライアント</text><text x="260" y="38" font-size="12" text-anchor="middle" fill="currentColor" opacity="0.7">標準IRCサーバー</text><line x1="100" y1="48" x2="100" y2="260" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" opacity="0.6"/><line x1="260" y1="48" x2="260" y2="260" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" opacity="0.6"/><line x1="100" y1="95" x2="260" y2="95" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-crypt)"/><text x="180" y="85" font-size="10" text-anchor="middle" fill="currentColor">CRYPT des 1 civ4bts</text><text x="260" y="120" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.6">CRYPTを理解できない</text><text x="180" y="158" font-size="20" text-anchor="middle" fill="currentColor" opacity="0.6">&#10005;</text><text x="180" y="180" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.6">応答なし(705が返らない)</text><text x="100" y="230" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">無応答のまま</text><text x="100" y="248" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">フリーズ</text><text x="440" y="38" font-size="12" text-anchor="middle" fill="currentColor">Civ4 クライアント</text><text x="600" y="38" font-size="12" text-anchor="middle" fill="currentColor">civgs-ircd</text><line x1="440" y1="48" x2="440" y2="260" stroke="currentColor" stroke-width="1.5"/><line x1="600" y1="48" x2="600" y2="260" stroke="currentColor" stroke-width="1.5"/><line x1="440" y1="95" x2="600" y2="95" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-crypt)"/><text x="520" y="85" font-size="10" text-anchor="middle" fill="currentColor">CRYPT des 1 civ4bts</text><line x1="600" y1="150" x2="440" y2="150" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-crypt)"/><text x="520" y="140" font-size="10" text-anchor="middle" fill="currentColor">705(暗号チャレンジ応答)</text><text x="440" y="230" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">ログイン処理を続行</text><text x="440" y="248" font-size="11" text-anchor="middle" fill="currentColor">→ ロビー画面へ</text></svg><figcaption>標準のIRCサーバーはGameSpy独自のCRYPTコマンドに応答できずフリーズの原因になるが、civgs-ircd(Zulanフォーク)はこれに対応しているため正常にログインできる。</figcaption></figure>
<h2 id="部屋に参加できない原因ではない">「部屋に参加できない」原因ではない</h2>
<p>もう一つ、誤解されやすい点がある。<strong>このTCP 6667通信は、部屋への参加処理そのものとは無関係</strong>である。実際のパケットキャプチャでは、参加時のUDP 2056ハンドシェイクが完了してから38秒も経ってから、ようやく6667の通信が発生していることが確認できている。6667は参加とは独立した、buddy/chat presenceのための定期的なバックグラウンド処理である。</p>
<figure><svg viewBox="0 0 680 220" role="img" aria-labelledby="fig2-title fig2-desc" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font-family:sans-serif;"><title id="fig2-title">UDP 2056の参加ハンドシェイクとTCP 6667の時間差</title><desc id="fig2-desc">実測では、部屋参加時のUDP 2056ハンドシェイク完了から約38秒後にTCP 6667のIRC通信が発生しており、両者は独立した処理であることを示している。</desc><defs><marker id="arrow-timeline" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs><line x1="60" y1="140" x2="620" y2="140" stroke="currentColor" stroke-width="1.5" marker-end="url(#arrow-timeline)"/><text x="600" y="128" font-size="11" text-anchor="middle" fill="currentColor" opacity="0.75">時間</text><line x1="150" y1="120" x2="150" y2="148" stroke="currentColor" stroke-width="1.5"/><text x="150" y="95" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">UDP 2056</text><text x="150" y="113" font-size="11" text-anchor="middle" fill="currentColor">参加ハンドシェイク完了</text><line x1="480" y1="120" x2="480" y2="148" stroke="currentColor" stroke-width="1.5"/><text x="480" y="95" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">TCP 6667</text><text x="480" y="113" font-size="11" text-anchor="middle" fill="currentColor">IRC通信開始</text><line x1="150" y1="165" x2="150" y2="171" stroke="currentColor" stroke-width="1.5"/><line x1="480" y1="165" x2="480" y2="171" stroke="currentColor" stroke-width="1.5"/><line x1="150" y1="165" x2="480" y2="165" stroke="currentColor" stroke-width="1.5"/><text x="315" y="185" font-size="12" font-weight="600" text-anchor="middle" fill="currentColor">約38秒後(実測)</text><text x="340" y="208" font-size="12" text-anchor="middle" fill="currentColor" font-style="italic" opacity="0.85">6667の通信は参加のトリガーではない</text></svg><figcaption>6667のIRC通信は参加のトリガーではなく、独立したバックグラウンド処理であることが実測で確認できている。</figcaption></figure>
<p>つまり、部屋に参加できない・NAT越えがうまくいかないといった症状の原因を探すときは、この6667通信は切り分けて考えてよい(NAT越えの仕組みについては<a href="/civ4/blog/system-overview/">システム全体像と通信シーケンス</a>を参照)。逆に、ロビー画面に<strong>そもそも入れない・ログイン中にフリーズする</strong>という症状であれば、この6667のハンドシェイクが疑わしい候補になる。</p>
<p>そのようなときは、<a href="/civ4/guide/status/">稼働状況・お知らせ</a>ページを確認してほしい。ログイン(civgs-login)・ゲームブラウザ(civgs-gamebrowser)と並んで「IRC(civgs-ircd)」の行があり、緑色の「● 稼働中」であれば、このハンドシェイクを処理するサーバー側の準備はできている。ここが赤色の「● 停止中」になっている場合は、サーバー側の問題(このページで解説したcivgs-ircdの停止)が原因である可能性が高い。「● 稼働中」なのにフリーズする場合は、別の原因を疑う必要がある。</p>
]]></content:encoded></item><item><title>Civ4掲示板</title><link>https://ebios-games.com/civ4/board/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ebios-games.com/civ4/board/</guid><description>Civ4 Internet lobbyについての質問・雑談・情報交換の掲示板</description><content:encoded>&lt;p>投稿にはGitHubアカウントでのログインが必要です。&lt;/p>
</content:encoded></item><item><title>コミュニティ</title><link>https://ebios-games.com/civ4/links/example-link/</link><pubDate>Sun, 13 Sep 2026 00:00:00 +0900</pubDate><guid>https://ebios-games.com/civ4/links/example-link/</guid><description>関連サイト</description><content:encoded><![CDATA[<p><a href="https://civ4multi.info/"><strong>civ4 multi WIKI</strong></a> — 主にCiv4 マルチプレイに関する情報を掲載しています。</p>
<p><a href="https://x.com/i/communities/1950579697840185669"><strong>X（Twitter）のコミュニティ</strong></a> — Civilization IV のX（Twitter）のコミュニティ</p>
]]></content:encoded></item><item><title>ゲーム掲示板</title><link>https://ebios-games.com/board/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ebios-games.com/board/</guid><description>EBIOS GAMESのゲームについての感想・質問・雑談等の掲示板</description><content:encoded><![CDATA[<p>深海のあっちむいてほい・Shrimp jumping・海底神殿の秘宝・深海リバーシ・海老推す🦐シューティングなど。投稿にはGitHubアカウントでのログインが必要です。</p>
<p>Civ4 Internet lobbyについての掲示板は<a href="/civ4/board/">こちら</a>に別途あります。</p>
]]></content:encoded></item></channel></rss>