Skip to content

Commit

Permalink
Allow customization of Agones healthcheck and reservation periods wit…
Browse files Browse the repository at this point in the history
…h environment variables
  • Loading branch information
FluxCapacitor2 committed Dec 4, 2023
1 parent d870ab8 commit f78e308
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ This uses the `Dockerfile` in the current directory to build an image with the v

Environment variables:
* `PUFFIN_VELOCITY_SECRET` - Your Velocity proxy forwarding secret (optional). If not specified, Mojang authentication will be enabled.
* `BLUEDRAGON_AGONES_HEALTHCHECK_INTERVAL_MS` - The amount of time in between Agones healthcheck pings, in milliseconds.
* `BLUEDRAGON_AGONES_RESERVATION_TIME_MS` - The amount of time in between Agones server reservations, in milliseconds.
* `BLUEDRAGON_AGONES_DISABLED` - Disables Agones integration if set to any value.
* `BLUEDRAGON_ENV_TYPE` - Set to "DEV" to enable development mode.
* `BLUEDRAGON_QUEUE_TYPE` - Set to "IPC" to use Puffin or "TEST" for the `TestQueue`. If not present, a default value is inferred.
* `BLUEDRAGON_MONGO_HOSTNAME` - The hostname used to connect to MongoDB.
* `BLUEDRAGON_PUFFIN_HOSTNAME` - The hostname used to connect to Puffin.
* `BLUEDRAGON_LUCKPERMS_HOSTNAME` - The hostname used to connect to LuckPerms.
* `HOSTNAME` - Used to determine the server name. Provided by default in Docker or Kubernetes environments.
* `SERVER_INSTANCE_MIN_INACTIVE_TIME` - The amount of time that an instance must be inactive before it is cleaned up.
* `SERVER_INSTANCE_CLEANUP_PERIOD` - The amount of time in between instance cleanup tasks.

## Implementation
To learn how to integrate other server software with BlueDragon's systems, see the [Integration Guide](./INTEGRATION.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ object AgonesIntegration : Bootstrap(EnvType.PRODUCTION) {
lateinit var stub: SDKGrpcKt.SDKCoroutineStub

// The amount of milliseconds in between health check pings
private const val HEALTH_CHECK_INTERVAL = 10_000L
private val HEALTH_CHECK_INTERVAL = System.getenv("BLUEDRAGON_AGONES_HEALTHCHECK_INTERVAL_MS")?.toLongOrNull() ?: 10_000L

// When players are online, keep the server reserved for twice the healthcheck interval.
private const val RESERVATION_TIME = HEALTH_CHECK_INTERVAL * 2L
private val RESERVATION_TIME =
System.getenv("BLUEDRAGON_AGONES_RESERVATION_TIME_MS")?.toLongOrNull() ?: (HEALTH_CHECK_INTERVAL * 2L)

override fun hook(eventNode: EventNode<Event>) {

Expand Down

0 comments on commit f78e308

Please sign in to comment.