<game_config>
  <game_key>arkse_linux64</game_key>
  <installer>steamcmd</installer>
  <game_name>ARK:SE</game_name>
  <server_exec_name>ShooterGameServer</server_exec_name>
  <cli_template>%MAP%%IP%%PORT%%QUERY_PORT%%PLAYERS%%RCON%%RCON_PORT%%CONTROL_PASSWORD%%PDS%%PDI%%PDD%%PUS%%PUI%%PUD%%ASDN%%POP%%POPI%%PTA%?listen %AMM% %FACF% %NTFF% -server -log</cli_template>
  <cli_params>
    <cli_param id="MAP" cli_string="" />
    <cli_param id="IP" cli_string="?Multihome=" />
    <cli_param id="PORT" cli_string="?Port=" />
    <cli_param id="PLAYERS" cli_string="?MaxPlayers=" />
    <cli_param id="CONTROL_PASSWORD" cli_string="?ServerAdminPassword=" />
  </cli_params>
  <reserve_ports>
    <port type="add" id="QUERY_PORT" cli_string="?QueryPort=">1</port>
    <port type="add" id="RCON_PORT" cli_string="?RconPort=">2</port>
  </reserve_ports>
  <map_list>maplist.txt</map_list>
  <exe_location>ShooterGame/Binaries/Linux</exe_location>
  <max_user_amount>127</max_user_amount>
  <mods>
    <mod key="default">
      <name>None</name>
      <installer_name>376030</installer_name>
      <installer_login>anonymous</installer_login>
    </mod>
  </mods>
  <replace_texts>
    <text key="home_name">
      <default>SessionName=.*</default>
      <var>SessionName=</var>
      <filepath>ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini</filepath>
    </text>
  </replace_texts>
  <server_params>
    <param key="?RCONEnabled=" type="select" id="RCON">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable remote control.</desc>
    </param>
    <param key="-automanagedmods" type="checkbox_key_value" id="AMM">
      <desc>Enable automatic MOD downloading, installing and updating.</desc>
    </param>
    <param key="-servergamelog" type="checkbox_key_value">
      <desc>Enable server admin logs.</desc>
    </param>
    <param key="-gameplaylogging" type="checkbox_key_value">
      <desc>Log file will contain a timestamped kills and winners log listing Steam ID, Steam name, character name, etc.</desc>
    </param>
    <param key="?PreventOfflinePvP=" type="select" id="POP">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Use this to enable the offline raiding prevention option.</desc>
    </param>
    <param key="?PreventOfflinePvPInterval=" type="text" id="POPI">
      <default>900</default>
      <options>ns</options>
      <desc>Time in seconds to wait before a tribe/players dinos/structures become invulnerable/inactive after they log off. If tribe, requires ALL tribe members logged off!</desc>
    </param>
    <param key="?PreventTribeAlliances=" type="select" id="PTA">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable tribe alliances.</desc>
    </param>
    <param key="-ForceAllowCaveFlyers" type="checkbox_key_value" id="FACF">
      <desc>Force flyer dinos to be allowed into caves (Flyers able to go into caves by default on custom maps).</desc>
    </param>
    <param key="?AltSaveDirectoryName=" type="text" id="ASDN">
      <options>ns</options>
      <desc>Name of the save folder.</desc>
    </param>
    <param key="-NoTransferFromFiltering" type="checkbox_key_value" id="NTFF">
      <desc>Cross-ARK Data Transfer protection against other servers that use different Cluster IDs. If you set this, players from unknown servers will not able to transfer datas to your Cluster.</desc>
    </param>
    <param key="?PreventDownloadSurvivors=" type="select" id="PDS">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable downloading characters from Cluster to this server.</desc>
    </param>
    <param key="?PreventDownloadItems=" type="select" id="PDI">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable downloading items from Cluster to this server.</desc>
    </param>
    <param key="?PreventDownloadDinos=" type="select" id="PDD">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable downloading tamed dinos from Cluster to this server.</desc>
    </param>
    <param key="?PreventUploadSurvivors=" type="select" id="PUS">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable uploading characters from this server to Cluster.</desc>
    </param>
    <param key="?PreventUploadItems=" type="select" id="PUI">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable uploading items from this server to Cluster.</desc>
    </param>
    <param key="?PreventUploadDinos=" type="select" id="PUD">
      <option value="True">True</option>
      <option value="False">False</option>
      <options>ns</options>
      <desc>Enable or disable uploading tamed dinos from this server to Cluster.</desc>
    </param>
  </server_params>
  <custom_fields>
    <field key="RCON_Port" type="text">
      <default>RCONPort=.*</default>
      <default_value>27020</default_value>
      <var>RCONPort=</var>
      <filepath>ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini</filepath>
      <options>sq</options>
      <access>admin</access>
      <desc>Port of remote control.</desc>
    </field>
  </custom_fields>
  <post_install>
    maplist="maplist.txt"
    if [ -s "$maplist" ]
      then
        echo "File $maplist found. OK!"
      else
        echo "File $maplist not found."
        echo "Generating new maplist file in $maplist!"
        touch $maplist
        echo Aberration_P> $maplist
        echo Extinction>> $maplist
        echo Ragnarok>> $maplist
        echo ScorchedEarth_P>> $maplist
        echo TheCenter>> $maplist
        echo TheIsland>> $maplist
        echo Valguero_P>> $maplist
    fi
    if [ -f "Engine/Binaries/ThirdParty/SteamCMD/Linux/linux32/steamcmd" ]
      then
        echo "SteamCMD found. OK!"
      else
        echo "SteamCMD not found."
        echo "Installing SteamCMD!"
        mkdir -p Engine/Binaries/ThirdParty/SteamCMD/Linux
        cd Engine/Binaries/ThirdParty/SteamCMD/Linux
        wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
        tar -xf steamcmd_linux.tar.gz
    fi
  </post_install>
<lock_files>
ShooterGame/Binaries/Linux/ShooterGameServer
</lock_files>

  <configuration_files>
    <file description="Server Configurations">ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini</file>
    <file description="Advanced Modifications">ShooterGame/Saved/Config/LinuxServer/Game.ini</file>
  </configuration_files>
</game_config>
