見出し画像

[Dynmap]外部 Web サーバーの基本

https://github.com/webbukkit/dynmap/wiki/External-Webserver-Basics
の機械翻訳

このページでは、

  • 使用しているスタンドアロン Web サーバーの経験が十分にある。

  • スタンドアロン Web サーバーと CraftBukkit が同じマシンで実行されています。

  • Web サーバーは PHP をサポートしています。(Web から Minecraft へのチャットにのみ必要)

  • Linux を使用している場合は、ターミナルとchmod.

ステップ 1: plugins/dynmap/configuration.txt で内部更新メカニズムを無効にする

内部更新メカニズムを無効にし、json-file 更新メカニズムを有効にします。standalone/dynmap_world.jsonこれにより、 で指定された間隔で web-path 内のファイルに書き込みますwriteinterval。以下を変更します: (42 行目から 75 行目まで)

  - class: org.dynmap.InternalClientUpdateComponent
    sendhealth: true
    sendposition: true
    allowwebchat: true
    webchat-interval: 5
    hidewebchatip: false
    trustclientname: false
    includehiddenplayers: false
    # (optional) if true, color codes in player display names are used
    use-name-colors: false
    # (optional) if true, player login IDs will be used for web chat when their IPs match
    use-player-login-ip: true
    # (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored
    require-player-login-ip: false
    # (optional) block player login IDs that are banned from chatting
    block-banned-player-chat: true
    # Require login for web-to-server chat (requires login-enabled: true)
    webchat-requires-login: false
    # If set to true, users must have dynmap.webchat permission in order to chat
    webchat-permissions: false
    # Limit length of single chat messages
    chatlengthlimit: 256
  #  # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)
  #  hideifshadow: 4
  #  # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)
  #  hideifundercover: 14
  #  # (Optional) if true, players that are crouching/sneaking will be hidden 
    hideifsneaking: false
    # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
    protected-player-info: false
    # If true, hide players with invisibility potion effects active
    hide-if-invisiblity-potion: true
    # If true, player names are not shown on map, chat, list
    hidenames: false
  #- class: org.dynmap.JsonFileClientUpdateComponent
  #  writeinterval: 1
  #  sendhealth: true
  #  sendposition: true
  #  allowwebchat: true
  #  webchat-interval: 5
  #  hidewebchatip: false
  #  includehiddenplayers: false
  #  use-name-colors: false
  #  use-player-login-ip: false
  #  require-player-login-ip: false
  #  block-banned-player-chat: true
  #  hideifshadow: 0
  #  hideifundercover: 0
  #  hideifsneaking: false
  #  # Require login for web-to-server chat (requires login-enabled: true)
  #  webchat-requires-login: false
  #  # If set to true, users must have dynmap.webchat permission in order to chat
  #  webchat-permissions: false
  #  # Limit length of single chat messages
  #  chatlengthlimit: 256
  #  hide-if-invisiblity-potion: true
  #  hidenames: false

を:

  #- class: org.dynmap.InternalClientUpdateComponent
   # sendhealth: true
   # sendposition: true
   # allowwebchat: true
   # webchat-interval: 5
   # hidewebchatip: false
   # trustclientname: false
   # includehiddenplayers: false
   # # (optional) if true, color codes in player display names are used
   # use-name-colors: false
   # # (optional) if true, player login IDs will be used for web chat when their IPs match
   # use-player-login-ip: true
   # # (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored
   # require-player-login-ip: false
   # # (optional) block player login IDs that are banned from chatting
   # block-banned-player-chat: true
   # # Require login for web-to-server chat (requires login-enabled: true)
   # webchat-requires-login: false
   # # If set to true, users must have dynmap.webchat permission in order to chat
   # webchat-permissions: false
   # # Limit length of single chat messages
   # chatlengthlimit: 256
   # # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)
   # hideifshadow: 4
   # # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)
   # hideifundercover: 14
   # # (Optional) if true, players that are crouching/sneaking will be hidden 
   # hideifsneaking: false
   # # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
   # protected-player-info: false
   # # If true, hide players with invisibility potion effects active
   # hide-if-invisiblity-potion: true
   # # If true, player names are not shown on map, chat, list
   # hidenames: false
  - class: org.dynmap.JsonFileClientUpdateComponent
    writeinterval: 1
    sendhealth: true
    sendposition: true
    allowwebchat: true
    webchat-interval: 5
    hidewebchatip: false
    includehiddenplayers: false
    use-name-colors: false
    use-player-login-ip: false
    require-player-login-ip: false
    block-banned-player-chat: true
    hideifshadow: 0
    hideifundercover: 0
    hideifsneaking: false
  #  # Require login for web-to-server chat (requires login-enabled: true)
    webchat-requires-login: false
  #  # If set to true, users must have dynmap.webchat permission in order to chat
    webchat-permissions: false
  #  # Limit length of single chat messages
    chatlengthlimit: 256
    hide-if-invisiblity-potion: true
    hidenames: false

コメントのコメントを外さないでください。設定行の前に 2 つの # が付きます。これらの行はオプションを説明するためのものであり、コメントを外すと設定が壊れます。

ステップ 2: 内部 Web サーバーを無効にする

内部 Web サーバーを無効にするには、次の行 (340) を変更します。

# Disables Webserver portion of Dynmap (Advanced users only)
disable-webserver: false

に:

# Disables Webserver portion of Dynmap (Advanced users only)
disable-webserver: true

ステップ 3: ファイルを Web サーバーにコピーしてパスを変更する

plugins/dynmap/webファイルをWeb サーバーのディレクトリにコピーします。とWeb ファイルを配置したパスの両方tilespathを指すように、configuration.txt を変更します。webpath*nix ベースのシステムの場合:

# The path where the tile-files are placed.
tilespath: /path/to/web/server/dynmap/web/tiles

# The path where the web-files are located.
webpath: /path/to/web/server/dynmap/web

または Windows の場合

# The path where the tile-files are placed.
tilespath: c:\\path\\to\\web\\server\\dynmap\\web\\tiles

# The path where the web-files are located.
webpath: c:\\path\\to\\web\\server\\dynmap\\web

ステップ 4: 構成の変更を適用します。

Minecraft サーバーを再起動します。Minecraft サーバーに参加し、いくつかのブロックを (ランダムに) 配置して、dynmap をトリガーし、マップのタイルを生成します。dynmap fullrender worldnameサーバーコンソールに入力して、世界全体を名前でレンダリングすることもできますworldname。

ブラウザを更新します。これでhttp://mywebserver/dynmap/にオンライン プレーヤーが表示され、最新の状態に保たれます。

トラブルシューティング

マップ上にタイルが表示されない場合は、タイル ディレクトリをチェックして、タイルが実際に生成されているかどうかを確認してください。タイルがない場合、選択した web-path ディレクトリにタイルを書き込む権限が Minecraft にない可能性があります。tilespathもう 1 つの可能性は、正しく入力されていないことです。

プレーヤーが表示されない場合、またはプレーヤーが動いているのが表示されない場合は、http://mywebserver/standalone/dynmap_world.json ( worldはワールドの名前) に移動します。いくつかのコードが表示され、数秒ごとに更新を押すと、そのコードが変更されます (サーバータイムが更新されるはずです)。このファイルが存在しない場合、またはファイルが変更されていない場合はwebpath、構成に間違った情報を入力した可能性があります。

Linux では、web-to-mc-chat が機能しない場合、'standalone' フォルダーを 77x に chmod する必要があります。次のいずれかを選択し、選択したものが機能しない場合は次のものを試してください。

$ chmod -R 770 standalone

770 シンボリック | rwxrwx--- ユーザー | グループの読み取り、書き込み、実行 | その他の読み取り、書き込み、および実行 | 無許可

774 シンボリック | rwxrwxr -- ユーザー | グループの読み取り、書き込み、実行 | その他の読み取り、書き込み、および実行 | 読んだ

775 シンボリック | rwxrwxr -- ユーザー | グループの読み取り、書き込み、実行 | その他の読み取り、書き込み、および実行 | 読み書き

777 シンボリック | rwxrwxr -- ユーザー | グループの読み取り、書き込み、実行 | その他の読み取り、書き込み、および実行 | 読み取り、書き込み、実行

通常、「$ chmod -R 770 standalone」はうまくいくはずです。他のものは、自分が何をしているのかわかっている場合にのみ使用してください。

これはsendmessage.php、jsonfile を作成できるようにするためです。これは、minecraft サーバーではなく Web サーバーがファイルを作成するために必要です。

Web-to-mc-chat が IIS で機能しない場合は、PHP をインストールする必要がある可能性があります。

最後までお読みいただき、ありがとうございます。 今後もたくさんの方に読んでいただけるよう精進します。 活動継続にあたりサポートをいただけると、 私のモチベーション維持やクオリティ向上に繋がります。 頂いたサポートはクリエイターとしての活動費にさせて頂きます。 ぜひお願い致します。