# The socket bind address for all net.psforever.services except admin. 127.0.0.1 is the
# default for local testing, for public servers use 0.0.0.0 instead.
bind = 127.0.0.1

# The public host name or IP address. Used to forward clients from the login
# server to the world server. The default value will only allow local connections.
public = 127.0.0.1

# Login server configuration
login {
  # UDP listening port
  port = 51000

  # Account usernames that don't exist yet will be automatically created in the
  # database. Useful for test servers and development testing.
  create-missing-accounts = yes
}

# World server configuration
world {
  # UDP listening port
  port = 51001

  # The name of the server as displayed in the server browser.
  server-name = PSForever

  # How the server is displayed in the server browser.
  # One of: released beta development
  server-type = released
}

# Admin API configuration
admin {
  # TCP listening port
  port = 51002

  # The socket bind address
  bind = 127.0.0.1
}

# Database configuration
# Full reference: https://github.com/jasync-sql/jasync-sql/wiki/Configuring-and-Managing-Connections
# https://github.com/getquill/quill/blob/master/quill-jasync/src/main/scala/io/getquill/context/jasync/JAsyncContextConfig.scala
database {
  # The hostname of the PostgreSQL server.
  host = localhost

  # The TCP port to connect to the database with.
  port = 5432

  # The username to connect to the SQL server with.
  username = psforever

  # The password to connect to the SQL server with.
  password = psforever

  # The database name to use on the SQL server.
  database = psforever

  # The SSL configuration of the database connection.
  # One of: disable prefer require verify-full
  sslmode = prefer

  # The maximum number of active connections.
  maxActiveConnections = 5
}

# Enable non-standard game properties
game {
  # Allow instant action to AMS
  instant-action-ams = no

  # Battle experience rate
  bep-rate = 1.0

  # Command experience rate
  cep-rate = 1.0

  # Modify the amount of mending per autorepair tick for facility amenities
  amenity-autorepair-rate = 1.0

  # Modify the amount of NTU drain per autorepair tick for facility amenities
  amenity-autorepair-drain-rate = 0.5

  new-avatar {
    # Starting battle rank
    br = 1

    # Starting command rank
    cr = 0
  }
}

anti-cheat {
  # The distance (squared) threshold that triggers if the reported hit location
  # of a shot does not match the object being hit's location on the server
  # One of 1-1000000 (sqrt 10000 = ~100 ingame units)
  hit-position-discrepancy-threshold = 10000
}

network {
  middleware {
    # How often between executions of the outbound bundling process
    packet-bundling-delay = 25 milliseconds

    # Pause inbound packet transmission towards the network if the sequence number is out of order
    # Packets are put aside until the sequence is restored, or this timeout passes
    in-reorder-timeout = 50 milliseconds

    # Wait on inbound packets if that packet is a SlottedMetaPacket and the next subslot number is greater than expected
    # Does not stop the transmission of packets to the server
    # but dictates how long between requests to the network (client) for missing packets with anticipated subslot numbers
    in-subslot-missing-delay = 50 milliseconds

    # How many attempts at resolving missing packets with anticipated subslot numbers
    in-subslot-missing-attempts = 10
  }

  session {
    # The maximum amount of time since the last inbound packet from a UDP session
    # before it is dropped.
    inbound-grace-time = 1 minute

    # The maximum amount of time since the last outbound packet for a UDP session
    # before it is dropped. Can be used as a watchdog for hung server sessions.
    outbound-grace-time = 1 minute
  }
}

development {
  # List of GM commands available to everyone
  # Values are ChatMessageType members, for example: [CMT_ADDBATTLEEXPERIENCE, CMT_CAPTUREBASE]
  unprivileged-gm-commands = []

  net-sim {
    # Enable artificial packet unreliability. Used for development testing.
    # Active equally on upstream and downstream packets.
    enable = no

    # The percentage of outgoing and incoming packets that are dropped.
    loss = 0.02

    # The time a packet is buffered before being delivered to simulate delay.
    # The artificial delay is in addition to any real network latency.
    delay = 150 milliseconds

    # The percentage chance that a packet will be ordered randomly in the delay
    # buffer. If the delay is too small then packets won't be reordered.
    reorder-chance = 0.005

    # If a packet is reordered, the maximum time in the future or the past where
    # it will randomly appear.
    reorder-time = 150 milliseconds
  }
}

kamon {
  # Enables reporting of metrics to Kamon.io
  enable = no

  environment.service = "PSForever"
  apm.api-key = ""
}

sentry {
  # Enables submission of warnings and errors to Sentry
  enable = no

  # Sentry DSN (Data Source Name)
  dsn = ""
}

include "akka.conf"
include "dispatchers.conf"
