<?xml version="1.0"?>
<!-- ============================================================ V3.0
     serverconfig.xml rendered by panel for 7 Days to Die V3.0 "Dead Hot Summer".

     RECONCILED 2026-06-15 against the REAL shipped 3.0 serverconfig.xml from the
     experimental dedicated-server install (app 294420 -beta latest_experimental,
     buildid 23705258). The kept/removed split below is the authoritative one
     from that file — NOT a guess.

     V3.0 removes 30 gameplay properties from serverconfig.xml and replaces them
     with ONE encoded `SandboxCode` property carrying all 150 in-game Sandbox
     Options. The panel generates SandboxCode from per-option settings via
     pkg/sandbox (or accepts a pasted/preset code). The 30 removed properties:
       GameDifficulty, BlockDamagePlayer, BlockDamageAI, BlockDamageAIBM,
       XPMultiplier, DayNightLength, DayLightLength, BiomeProgression, StormFreq,
       DeathPenalty, DropOnDeath, DropOnQuit, JarRefund, EnemySpawnMode,
       EnemyDifficulty, ZombieFeralSense, ZombieMove, ZombieMoveNight,
       ZombieFeralMove, ZombieBMMove, AISmellMode, BloodMoonFrequency,
       BloodMoonRange, BloodMoonWarning, BloodMoonEnemyCount, LootAbundance,
       LootRespawnDays, AirDropFrequency, AirDropMarker, QuestProgressionDailyLimit
     (all now live inside SandboxCode).

     Selection: an instance renders THIS template instead of serverconfig.xml.tmpl
     when its normalized Steam branch is the 3.0 branch (latest_experimental;
     add v3.x when TFP cuts a frozen branch). Wired via module.yaml
     config_files[].template_by_branch + ConfigFile.TemplateForBranch /
     module.RenderForBranch. 2.6 and earlier keep serverconfig.xml.tmpl untouched.

     Manage values via the panel config UI, which populates `.Values.*`.
     See panel/memory/7dtd-v3-version-and-sandboxcode-plan.md.
     ============================================================ -->
<ServerSettings>
  <!-- ===== Server representation ===== -->
  <property name="ServerName" value="{{ or .Values.server_name "Refuge 7DTD" }}" />
  <property name="ServerDescription" value="{{ .Values.server_description }}" />
  <property name="ServerWebsiteURL" value="{{ .Values.server_website }}" />
  <property name="ServerPassword" value="{{ .Values.server_password }}" />
  <property name="ServerLoginConfirmationText" value="{{ .Values.login_confirmation_text }}" />
  <property name="Region" value="{{ or .Values.region "NorthAmericaWest" }}" />
  <property name="Language" value="{{ or .Values.language "English" }}" />

  <!-- ===== Networking ===== -->
  <property name="ServerPort" value="{{ or .Values.server_port "26900" }}" />
  <property name="ServerVisibility" value="{{ or .Values.server_visibility "2" }}" />
  <property name="ServerDisabledNetworkProtocols" value="{{ or .Values.disabled_network_protocols "SteamNetworking" }}" />
  <property name="ServerMaxWorldTransferSpeedKiBs" value="{{ or .Values.max_world_transfer_speed "512" }}" />

  <!-- ===== Slots ===== -->
  <property name="ServerMaxPlayerCount" value="{{ or .Values.max_players "8" }}" />
  <property name="ServerReservedSlots" value="{{ or .Values.reserved_slots "0" }}" />
  <property name="ServerReservedSlotsPermission" value="{{ or .Values.reserved_slots_permission "100" }}" />
  <property name="ServerAdminSlots" value="{{ or .Values.admin_slots "0" }}" />
  <property name="ServerAdminSlotsPermission" value="{{ or .Values.admin_slots_permission "0" }}" />

  <!-- ===== Admin interfaces ===== -->
  <property name="WebDashboardEnabled" value="{{ or .Values.webdash_enabled "true" }}" />
  <property name="WebDashboardPort" value="{{ or .Values.WEBDASH_PORT .Values.webdash_port "8080" }}" />
  <property name="WebDashboardUrl" value="{{ .Values.webdash_url }}" />
  <property name="EnableMapRendering" value="{{ or .Values.enable_map_rendering "true" }}" />
  <property name="TelnetEnabled" value="{{ or .Values.telnet_enabled "true" }}" />
  <property name="TelnetPort" value="{{ or .Values.telnet_port "8081" }}" />
  <property name="TelnetPassword" value="{{ .Values.telnet_password }}" />
  <property name="TelnetFailedLoginLimit" value="{{ or .Values.telnet_failed_login_limit "10" }}" />
  <property name="TelnetFailedLoginsBlocktime" value="{{ or .Values.telnet_failed_login_blocktime "10" }}" />
  <property name="TerminalWindowEnabled" value="{{ or .Values.terminal_window_enabled "true" }}" />

  <!-- ===== Folder/file locations ===== -->
  <property name="AdminFileName" value="serveradmin.xml" />

  <!-- ===== Other technical settings ===== -->
  <property name="ServerAllowCrossplay" value="{{ or .Values.allow_crossplay "false" }}" />
  <property name="EACEnabled" value="{{ or .Values.eac "true" }}" />
  <property name="IgnoreEOSSanctions" value="{{ or .Values.ignore_eos_sanctions "false" }}" />
  <property name="HideCommandExecutionLog" value="{{ or .Values.hide_command_log "0" }}" />
  <property name="MaxUncoveredMapChunksPerPlayer" value="{{ or .Values.max_uncovered_chunks "131072" }}" />
  <property name="PersistentPlayerProfiles" value="{{ or .Values.persistent_player_profiles "false" }}" />
  <property name="MaxChunkAge" value="{{ or .Values.max_chunk_age "-1" }}" />
  <property name="SaveDataLimit" value="{{ or .Values.save_data_limit "-1" }}" />

  <!-- ===== World generation ===== -->
  <property name="GameWorld" value="{{ or .Values.world_name "RWG" }}" />
  <property name="WorldGenSeed" value="{{ or .Values.world_seed "panel-default" }}" />
  <property name="WorldGenSize" value="{{ or .Values.world_size "8192" }}" />
  <property name="GameName" value="{{ or .Values.game_name "Refuge" }}" />
  <property name="GameMode" value="{{ or .Values.game_mode "GameModeSurvival" }}" />

  <!-- ===== Difficulty (KEPT in 3.0 — these survived the SandboxCode move) ===== -->
  <property name="PlayerSafeZoneLevel" value="{{ or .Values.player_safe_zone_level "5" }}" />
  <property name="PlayerSafeZoneHours" value="{{ or .Values.player_safe_zone_hours "5" }}" />

  <!-- ===== Game rules (KEPT) ===== -->
  <property name="BuildCreate" value="{{ or .Values.build_create "false" }}" />
  <property name="BedrollDeadZoneSize" value="{{ or .Values.bedroll_dead_zone_size "15" }}" />
  <property name="BedrollExpiryTime" value="{{ or .Values.bedroll_expiry_time "45" }}" />
  <property name="AllowSpawnNearFriend" value="{{ or .Values.allow_spawn_near_friend "2" }}" />
  <property name="CameraRestrictionMode" value="{{ or .Values.camera_restriction_mode "0" }}" />

  <!-- ===== Performance (KEPT) ===== -->
  <property name="MaxSpawnedZombies" value="{{ or .Values.max_spawned_zombies "64" }}" />
  <property name="MaxSpawnedAnimals" value="{{ or .Values.max_spawned_animals "50" }}" />
  <property name="ServerMaxAllowedViewDistance" value="{{ or .Values.max_view_distance "12" }}" />
  <property name="MaxQueuedMeshLayers" value="{{ or .Values.max_queued_mesh_layers "1000" }}" />

  <!-- ===== Multiplayer (KEPT) ===== -->
  <property name="PartySharedKillRange" value="{{ or .Values.party_shared_kill_range "100" }}" />
  <property name="PlayerKillingMode" value="{{ or .Values.pk_mode "3" }}" />

  <!-- ===== Land claim options (KEPT) ===== -->
  <property name="LandClaimCount" value="{{ or .Values.land_claim_count "5" }}" />
  <property name="LandClaimSize" value="{{ or .Values.land_claim_size "41" }}" />
  <property name="LandClaimDeadZone" value="{{ or .Values.land_claim_dead_zone "30" }}" />
  <property name="LandClaimExpiryTime" value="{{ or .Values.land_claim_expiry_time "7" }}" />
  <property name="LandClaimDecayMode" value="{{ or .Values.land_claim_decay_mode "0" }}" />
  <property name="LandClaimOnlineDurabilityModifier" value="{{ or .Values.land_claim_online_durability_modifier "4" }}" />
  <property name="LandClaimOfflineDurabilityModifier" value="{{ or .Values.land_claim_offline_durability_modifier "4" }}" />
  <property name="LandClaimOfflineDelay" value="{{ or .Values.land_claim_offline_delay "0" }}" />

  <!-- ===== Dynamic mesh (KEPT) ===== -->
  <property name="DynamicMeshEnabled" value="{{ or .Values.dynamic_mesh_enabled "true" }}" />
  <property name="DynamicMeshLandClaimOnly" value="{{ or .Values.dynamic_mesh_land_claim_only "true" }}" />
  <property name="DynamicMeshLandClaimBuffer" value="{{ or .Values.dynamic_mesh_land_claim_buffer "3" }}" />
  <property name="DynamicMeshMaxItemCache" value="{{ or .Values.dynamic_mesh_max_item_cache "3" }}" />

  <!-- ===== Twitch (KEPT) ===== -->
  <property name="TwitchServerPermission" value="{{ or .Values.twitch_server_permission "90" }}" />
  <property name="TwitchBloodMoonAllowed" value="{{ or .Values.twitch_blood_moon_allowed "false" }}" />

  <!-- ===== NEW in V3.0: the 150 sandbox options as one encoded string =====
       Empty value = the game's built-in default sandbox. The panel writes
       either a per-option-generated code (pkg/sandbox) or a pasted/preset code.
       Default below = the game's Adventurer difficulty code. -->
  <property name="SandboxCode" value="{{ or .Values.sandbox_code "AAAJABJACJADJARFBNC" }}" />
</ServerSettings>
