2014年3月27日木曜日

GP Bikes サーバーの立てかた

'14.7.15 国名表示と複数カテゴリーを指定する方法を追加
     .batファイルを作ってサーバーを起動する方法を追加



GP Bikesはインターネットを経由して一緒に走ったり、レースをすることが出来ます。


GP Bikesはゲームとサーバーを同時に起動することができます


 まずは公式フォーラムのサーバーに関するページを読んでみて下さい。





  ※ 試される方は各自の責任においてやってくださいませ

  ※ サーバーを立てるためにはルーターやファイアウォールのポートを開く必要があります
  ※ GP Bikesの使用ポートは10500から10510です


1台のPCでゲームのクライアント(参加者)とサーバーを同時に起動できるようにします


1. ゲームとは別にサーバー用のGP Bikesをインストールする

 自分が遊ぶゲームとは別に、サーバー専用にするGP BikeをPC内の別の場所にインストールして下さい

  ※ インストールに使用するのはゲームと同じ”gpbikes-beta5b.exe”です

  ※ 1台のPCに2つのGP Bikesがインストールされることになります

  ※ サーバー用にするGP Bikesはデモ版のままでかまいません



2. サーバー用GP Bikesの設定


2.a .bat ファイルを作ってサーバーを起動する方法

 1. \GP Bikesフォルダに新しいテキストファイルを作り、名前と拡張子を変える

   名前は server などわかりやすい任意の物に、拡張子は.batにしてください
   たとえば server.bat など


 2. server.bat を右クリック→編集をえらんで開き、以下の文を書き込んで保存して閉じる

core.exe  -dedicated 10508 -set params dedicated.ini


  ※ クライアントとサーバーが同じポートを使うと上手くいかないので、1台のPCで両方をかねる場合はサーバーのポート番号を10510以外にして下さい



2.b ショートカットを作って起動する方法

 インストールして出来た”core.exe”のショートカットを作ります

 出来た”core.exe - ショートカット”を右クリックしてプロパティを選択
 ショートカットタブのリンク先に
” -dedicated 10508 -set params dedicated.ini”
 と書き足して下さい

  -dedicatedの前には半角スペースを入れて下さい

 Dドライブ直下にサーバー用GP Bikesをインストールした場合はリンク先のボックス内はこうなります

"D:\GP Bikes\core.exe" -dedicated 10508 -set params dedicated.ini
 

  ※ クライアントとサーバーが同じポートを使うと上手くいかないので、1台のPCで両方をかねる場合はサーバーのポート番号を10510以外にして下さい


  ※ .batを作るか、ショートカットを作るかのどちらかひとつでかまいません





 3. ”gpbikes”フォルダに”dedicated.ini”を作る


  ※ ”dedicated.ini”を作る場所は”gpbikes.ico”のあるフォルダです
    ”core.exe”と並んでいてはいけません


 ”gpbikes”フォルダの中で右クリックして”新規作成”→”テキストドキュメント”を選択して”新しいテキスト ドキュメント.txt”を作ります

 ”新しいテキスト ドキュメント.txt”をメモ帳で開きます

 ↓ここから↓
[connection]
name =
maxclient =
password =
admin_password =
location =
bandwidth = ; 0 -> low, 1 -> medium, 2 -> high
max_ping =
whitelist = ; the filename of the whitelist
blacklist = ; the filename of the blacklist
polls_disable = ; if set to 1, polls are disabled
MOTD = ; message of the day

[export]
results =  ; html or xml, If set it will automatically export results at the end of the race
directory = ; the directory where results will be saved ( must exist )
units =  ; 0 -> metric units, 1 -> US units, 2 -> UK units

[replay]
save = ; 0 or 1, If set to 1 it will automatically save the full replay at the end of the race
directory = ; the directory where replays will be saved ( must exist )

[event]
track = ; track ID ( for ex. Victoria )
track_layout = ; track layout ( for ex. Short ). Empty -> Default;
category = ; bike category allowed. Empty -> Open; GP125; GP125 Cup; GP500; GP1000

[rating]
class = ; A -> 2000+, B -> 1600-1999; C -> 1200-1599; D -> 800-1199

[weather]
realistic = ; 0 or 1, if set to 1, following params are ignored
conditions = ; 0 -> sunny, 1 -> cloudy, 2 -> rainy
temperature = ; air temperature, celsius
wind_direction = ; 0 -> north, 1 -> north-east, 2 -> east, ..., 7 -> north-west
wind_speed = ; meters/second
track_conditions = ; 0 -> dry, 1 -> wet

[hardcore]
force_cockpit = ; 0 or 1
no_aids = ; 0 or 1
limited_tyre_sets = ; 0 or 1

[race]
quick_race = ; 0 or 1. If set to 1, practice, warmup, sighting lap and warmup lap are skipped
practice_length = ; minutes
qualify_length = ; minutes
warmup_length = ; minutes
sighting_lap = ; 0 or 1
race_length = ; % of full length
restart_delay = ; server restart time in seconds
pause = ; 0 or 1. If set to 1, the event is paused and saved at the end of "pause_session"
pause_session = ; practice, qualify, warmup or race
pause_directory = ; the directory where data is saved. The default is "resume"
resume = ; the file to load to resume an event

[live]
enable = ; 1 to enable live timing
port = ; the UDP port
password =
↑ここまで↑

 以上をコピーして貼り付けで下さい

 いちど保存して”新しいテキスト ドキュメント.txt”を”dedicated.ini”にファイル名も拡張子もリネームして下さい


 各設定項目にかんしてはリンク先の英語ドキュメントを参照して下さい
 以下は実験によりわかった事です


[connection]
name =     ←サーバーの名前
maxclient =   ←参加者の人数
password =   ←サーバーに入るためのパスワード
         空欄ならパスワードでブロックされません
admin_password = ←よくわかりません
location = Japan ←国名を指定できます
          ランチャーのサーバーをクリックすると表示される情報一覧に国名が表示されるようになります
bandwidth = ; 0 -> low, 1 -> medium, 2 -> high
        ↑使用しているネット回線の速さ 2 を推奨します
max_ping =   ←PINGの高い人の接続を拒否できます
whitelist = ; the filename of the whitelist
blacklist = ; the filename of the blacklist
polls_disable = ; if set to 1, polls are disabled
MOTD = ; message of the day   ←サーバーに入ってきた人に自動チャットメッセージが送れます

[export]
results =  ; html or xml, If set it will automatically export results at the end of the race
     ↑リザルトをhtmlかxmlで出力できます
directory = ; the directory where results will be saved ( must exist )
     ↑リザルトの出力先をフルパスで指定できます
units =  ; 0 -> metric units, 1 -> US units, 2 -> UK units

[replay]
save = ; 0 or 1, If set to 1 it will automatically save the full replay at the end of the race
     ↑1ならリプレイを保存、0なら保存しない
directory = ; the directory where replays will be saved ( must exist )
     ↑リプレイの保存先をフルパスで指定できます

[event]
track = ; track ID ( for ex. Victoria )
     ↑使用するサーキットを指定できます
      名前はサーキットのフォルダに使われている名前を書きます
track_layout = ; track layout ( for ex. Short ). Empty -> Default;
category = ; bike category allowed. Empty -> Open; GP125; GP125 Cup; GP500; GP1000
            ↑サーバー内で使用できるバイクカテゴリーを指定できます
       OPEN ですべてのバイクが使えるようになります
       GP1000/GP500 このように "/" で区切ると複数のカテゴリーが使用可能になります

[rating]
class = ; A -> 2000+, B -> 1600-1999; C -> 1200-1599; D -> 800-1199

[weather]
realistic = ; 0 or 1, if set to 1, following params are ignored
      ↑ 0 にすると以下で設定する項目が
       1にするとサーキット所在地の現在の天候が適用されます
conditions = ; 0 -> sunny, 1 -> cloudy, 2 -> rainy ← 0 で晴天
temperature = ; air temperature, celsius ← 気温
wind_direction = ; 0 -> north, 1 -> north-east, 2 -> east, ..., 7 -> north-west  ← 風向き 0 で北からの風
wind_speed = ; meters/second
track_conditions = ; 0 -> dry, 1 -> wet ← 風速

[hardcore]
force_cockpit = ; 0 or 1
       ↑1にするとコクピット視点しか使えなくなります
no_aids = ; 0 or 1  ← 1 でアシスト使用不可
limited_tyre_sets = ; 0 or 1

[race]
quick_race = ; 0 or 1. If set to 1, practice, warmup, sighting lap and warmup lap are skipped
      ↑ 0 にすると以下で設定する項目が
       1にすると予選と決勝のみのレースになります
practice_length = ; minutes ←練習を何分間行うか
qualify_length = ; minutes  ←予選を何分間行うか
warmup_length = ; minutes  ←ウォームアップを何分間行うか
sighting_lap = ; 0 or 1   ←サイティングラップを行うか
race_length = ; % of full length
       レースの長さを数字で設定します
        50なら半分の周回数になります

restart_delay = ; server restart time in seconds
pause = ; 0 or 1. If set to 1, the event is paused and saved at the end of "pause_session"
pause_session = ; practice, qualify, warmup or race
pause_directory = ; the directory where data is saved. The default is "resume"
resume = ; the file to load to resume an event

[live]
enable = ; 1 to enable live timing
port = ; the UDP port
password =


 各設定の書き方は

  name = test_japan
  password = 819

  results = html

 といった感じです”=”の右に半角スペースが必要なのかは検証していません


[event]
track = SPA V1
track_layout = ;
track2= NC - Suzuka
track2_layout=
category =

 このようにサーキットを追加すると、自動でレースが終わるごとに次のサーキットへ行くようになります
 最後のサーキットでのレースが終わったら最初のサーキットに戻ります

// track = NC - Mugello
// track_layout = ;
// track = Tsukuba
// track_layout = ;

 このようにトラックの前に "// " と入れるとサーバーにトラックが読み込まれなくなります
 頻繁に使うトラックを dedicated.ini ファイルにあらかじめ書き込んでおき、使いたい時だけ "// " を書いたり消したりすれば便利です


 4. サーバーの起動


 4.a .batファイルを作った場合

  server.bat をダブルクリックすればサーバーが起動します



 4.b ショートカットを作った場合

  サーバー用に作った”core.exe - ショートカット”をダブルクリックすればサーバーが立ち上がります





 サーバーが立っているか確認するには公式の

   GP Bikes | Stats

 を開いて、自分で立てたサーバーが表示されていれば成功です


 サーバーに参加者が接続してくると名前とIDが表示されます

 下のボックスに文字を打てば参加者にはチャットで表示されます
 参加者からのチャットは現状では見えないようです


 5. サーバーの終了

  サーバーは右下の”Quit”をクリックすると終了します



 MODを使用するときの注意点

 バイクMODはサーバーとクライアント両方に同じものが入っている必要があります

 ゲーム上からサーバーは見えますが、同じものが入っていないままサーバーに入ろうとすると”mismatch”と表示されて参加できません

 たとえばサーバーに"WSS","GSV-R"が入っていたらクライアント側にも"WSS","GSV-R"が入っている必要があります

 サーバーがバイクカテゴリーを指定している場合は、サーバーに入っているそのカテゴリーのバイクがクライアントに入っている必要があります

 たとえば、サーバーがGP500を指定していて、"NSR"."YZR"が入っていたらクライアント側にも"NSR"."YZR"が入っている必要があります


 クライアント側にサーバーに入っているバイク以外のバイクMODが入っていても問題ありません


   サーバーが指定している、入っているバイクMODが
     クライアント側にも入っている必要がある




 サーバーに入っているコースMODがクライアントに入っていない場合はゲーム上からサーバーが見えず参加できません





  以上です





 おさらい

 ・ ルーターやファイアウォールのポート10500-10510を開ける

  サーバー用のGP Bikesをインストールする

  .batファイルを作るか
   サーバー用のGP Bikesのショートカットを作って設定

  gpbikesフォルダに”dedicated.ini”を作る

  サーバー用のGP Bikes ”core.exe - ショートカット”をダブルクリックして起動させる


  サーバーの名前に決まったルールは無いようですが
   使用しているバイクMODをサーバー名に書いておけば参加者が準備しやすいと思います




  分かりにくいところがあれが気軽に質問して下さい

  間違っている所があれば教えてください



 それではいい旅を