Barotrauma

Barotrauma

View Stats:
 This topic has been pinned, so it's probably important
Dynamoon  [developer] 20 May, 2020 @ 7:46am
How to host a server? // Как создать сервер?
The easiest way to host a Barotrauma server is to click the "Host server" button in the main menu. If you run into any problems when trying to host a server or want to use one of the more advanced server hosting options, please read the instructions below.

The easy option: hosting directly from the game

  • Open the "Host server" menu from the main menu.
  • Enter a name for your server and adjust the settings in the menu as you see fit (password, number of players, karma settings...)
  • Click "Start".
  • If you receive a prompt from Windows Firewall with your antivirus or a similar software asking whether to allow the application to connect to the internet, make sure you allow it to do so.

Advanced option: dedicated server

The dedicated server is a command line application, meaning that it has no graphical interface. It's more lightweight than the client application, meaning that it takes less of your computer’s resources to run. It may be the preferred option if you want to leave the server running in the background without playing on it yourself.

  • Launch a file called "DedicatedServer" inside the game folder.
  • If you wish to modify the settings for your server, you can edit a file called "serversettings.xml" inside the game folder. If the file is not present, it can be created by launching the DedicatedServer executable.
  • If you receive a prompt from Windows Firewall, your antivirus or a similar software asking whether to allow the application to connect to the internet, make sure you allow it to do so.
  • If the computer you wish to run the server on has a private IP, you may need to forward ports on your router (either manually or using UPnP port forwarding) to allow players to connect to your server. See the "forwarding ports" section for more instructions.

Advanced option: hosting using SteamCMD

This is a more complex way to host servers, mainly intended for people who want to run a dedicated server 24/7 on a remote machine. Unlike the previous options, it does not require logging in to Steam.

  • Install SteamCMD following these instructions.
  • Log in to SteamCMD using the command "login anonymous".
  • Install the Barotrauma dedicated server using "app_update 1026340 validate".
  • Make sure you've configured the server settings, port forwarding, firewall settings and such as instructed in the "dedicated server" section above.
  • Launch the server using "app_run 1026340".

Forwarding ports
If the computer you wish to run the server on has a private IP[en.wikipedia.org], you may need to forward ports in your router to allow players to connect to your server.

Some routers support a feature called UPnP (universal plug and play) that can be used to automatically take care of port forwarding. You can enable it by selecting the "Attempt UPnP port forwarding" checkbox in the "Host server" menu, or when using the dedicated server, setting "enableupnp" to "true" in the "serversettings.xml" file.

Once you've enabled UPnP, you can check if others can connect to your server either by asking some else to join it, or by using some remote tool (see the "Resources" section below).

If others are unable to join your server after UPnP has been enabled, you may need to forward ports manually. We’re working on an alternative solution to remove the need for port forwarding, but for now this is how you can do it:

On many router models you can access the settings by navigating to http://192.168.1.1/ using your web browser, finding the port forwarding settings (sometimes called “application sharing”) and forwarding one of the ports using the following settings:

Game port (used to communicate with clients)
Service/Application: barotrauma
External Port: The port you have selected for your server (27015 by default)
Internal Port: The port you have selected for your server (27015 by default)
Protocol: UDP

Query port (used to communicate with Steam)
Service/Application: barotrauma
External Port: The port you have selected for your server (27016 by default)
Internal Port: The port you have selected for your server (27016 by default)
Protocol: UDP

If you are playing the old, non-Steam legacy version, you only need to forward the game port (14242 by default).

Resources
Remote Port Testing URLs
http://www.yougetsignal.com/tools/open-ports/
http://www.canyouseeme.org/
http://www.t1shopper.com/tools/port-scan/

Help with Forwarding Ports
http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
http://portforward.com/english/routers/port_forwarding/
http://en.wikipedia.org/wiki/Port_forwarding

===============================================================

Чтобы создать сервер игры Barotrauma, щелкните по кнопке «Создать сервер» в главном меню. Если появятся проблемы при создании сервера или вы захотите опробовать более сложный вариант создания сервера, прочитайте инструкции ниже.

Простой способ: создание сервера в игре

  • Выберите «Создать сервер» в главном меню.
  • Введите название своего сервера и настройте его параметры (пароль, число игроков, настройки кармы...)
  • Щелкните по кнопке «Запуск».
  • Если вы получите от Windows Firewall, антивирусной программы или другой подобной программы запрос на разрешение подключиться к интернету для данного приложения, дайте такое разрешение.

Сложный способ: выделенный сервер

Выделенный сервер – это приложение командной строки, без графического интерфейса. Для его работы требуется меньше ресурсов вашего компьютера, чем для клиентского приложения. Этот вариант подходит, если вы хотите, чтобы сервер мог работать в фоновом режиме, когда вы сами не участвуете в игре.

  • Запустите файл DedicatedServer, который находится в папке с игрой.
  • Если вы хотите изменить настройки своего сервера, откройте файл serversettings.xml в папке с игрой. Если там нет такого файла, он будет создан после запуска исполняемого файла DedicatedServer.
  • Если вы получите от Windows Firewall, антивирусной программы или другой подобной программы запрос на разрешение подключиться к интернету для данного приложения, дайте такое разрешение.
  • Если у компьютера, на котором вы хотите запустить выделенный сервер, частный IP-адрес, вам может понадобиться настроить переадресацию портов на маршрутизаторе (вручную или с помощью переадресации портов UPnP), чтобы разрешить игрокам подключаться к вашему серверу. Инструкции по переадресации портов находятся в соответствующем разделе.

Сложный способ: создание сервера с помощью SteamCMD

Это более сложный способ создания сервера, который подходит в тех случаях, когда вам нужен выделенный сервер, работающий круглосуточно и непрерывно на удаленной машине. В отличие от предыдущих вариантов, для этого не требуется выполнять вход в Steam.

  • Установите SteamCMD, следуя этим инструкциям.
  • Войдите в SteamCMD, используя команду login anonymous.
  • Установите выделенный сервер для игры Barotrauma, используя файл «app_update 1026340 validate».
  • Настройте параметры сервера, переадресацию портов и настройки брандмауэра, как описано в разделе о выделенном сервере выше.
  • Запустите сервер, используя файл «app_run 1026340».

Переадресация портов
Если у компьютера, на котором вы хотите запустить выделенный сервер, частный IP-адрес[en.wikipedia.org], вам может понадобиться настроить переадресацию портов на маршрутизаторе, чтобы разрешить игрокам подключаться к вашему серверу.

Некоторые маршрутизаторы поддерживают функцию автоматической переадресации портов UPnP (universal plug and play). Чтобы включить ее, выберите вариант «Переадресация портов UPnP» в меню «Создать сервер» или, при использовании выделенного сервера, укажите для параметра enableupnp значение true в файле serversettings.xml.

Включив UPnP, проверьте, могут ли игроки подключиться к вашему серверу: либо предложите кому-то это сделать, либо примените специальный инструмент (см. раздел «Ресурсы» ниже).

Если после включения UPnP игроки не могут подключиться к вашему серверу, нужно настроить переадресацию портов вручную. Мы работаем над альтернативным решением, которое позволит обойтись без переадресации портов, но пока сделайте следующее:

На многих моделях маршрутизаторов можно открыть меню настройки, введя адрес http://192.168.1.1/ в веб-браузере, найти меню настройки переадресации портов (меню может называться application sharing) и установить переадресацию портов, как указано ниже:

Игровой порт (используется для связи с клиентами)
Сервис/приложение: barotrauma
Внешний порт: порт, назначенный вами для вашего сервера (по умолчанию 27015)
Внутренний порт: порт, назначенный вами для вашего сервера (по умолчанию 27015)
Протокол: UDP

Порт запросов (используется для связи со Steam)
Сервис/приложение: barotrauma
Внешний порт: порт, назначенный вами для вашего сервера (по умолчанию 27016)
Внутренний порт: порт, назначенный вами для вашего сервера (по умолчанию 27016)
Протокол: UDP

Если вы используете устаревшую версию игры без Steam, нужно настроить только переадресацию игрового порта (по умолчанию 14242).

Ресурсы
Адреса дистанционного тестирования портов
http://www.yougetsignal.com/tools/open-ports/
http://www.canyouseeme.org/
http://www.t1shopper.com/tools/port-scan/

Полезные советы по переадресации портов
http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
http://portforward.com/english/routers/port_forwarding/
http://en.wikipedia.org/wiki/Port_forwarding
Last edited by Dynamoon; 20 May, 2020 @ 7:46am