feat: Steam and Minecraft game server checks
ci / build (pull_request) Successful in 5m10s
ci / image (pull_request) Successful in 6m44s
ci / test (pull_request) Canceled after 7m6s
ci / lint (pull_request) Canceled after 7m5s

Steam servers are asked for A2S_INFO like the server browser does,
answering the challenge newer servers send. Minecraft Java Edition gets
the server list ping, Bedrock Edition a RakNet unconnected ping. A
minimum of free slots can be required. The protocols are implemented
directly; tested against protocol-accurate test servers and once by
hand against public Java and Bedrock servers.

Closes #96

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 16:56:40 +01:00
1 parent 365152d164
commit f14b760069
11 files changed
+1682 -1101

No files matched your search

+23
View File
@@ -494,6 +494,7 @@ type MonitorForm struct {
DB DBForm
Broker BrokerForm
Proto ProtocolForm
Game GameForm
// Types are the check types to offer.
Types []string
}
@@ -515,6 +516,12 @@ type ProtocolForm struct {
Version, OID, Condition, Value string
}
// GameForm holds the settings of game server checks.
type GameForm struct {
Edition string
MinFreeSlots int
}
// DBForm holds the settings of database checks. The password is never
// filled in; PasswordSet tells the form one is stored.
type DBForm struct {
@@ -669,6 +676,22 @@ templ MonitorEditor(p Page, me Me, f MonitorForm) {
@valueField(i18n.T(ctx, "monitors.snmp_value"), "config.value", f.Proto.Value, "", false)
</div>
}
@typeFields("steam", f.Type) {
<p class="mb-4 text-xs text-muted">{ i18n.T(ctx, "monitors.steam_hint") }</p>
@numberField(i18n.T(ctx, "monitors.game_min_free_slots"), "config.min_free_slots", f.Game.MinFreeSlots, 0, 10000, i18n.T(ctx, "monitors.game_min_free_slots_hint"))
}
@typeFields("minecraft", f.Type) {
<p class="mb-4 text-xs text-muted">{ i18n.T(ctx, "monitors.minecraft_hint") }</p>
<label class="mb-4 block">
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ i18n.T(ctx, "monitors.minecraft_edition") }</span>
<select name="config.edition" class="w-full border border-rule bg-transparent px-2 py-1.5 text-sm">
for _, e := range []string{"java", "bedrock"} {
<option value={ e } selected?={ e == f.Game.Edition }>{ i18n.T(ctx, "monitors.minecraft_"+e) }</option>
}
</select>
</label>
@numberField(i18n.T(ctx, "monitors.game_min_free_slots"), "config.min_free_slots", f.Game.MinFreeSlots, 0, 10000, i18n.T(ctx, "monitors.game_min_free_slots_hint"))
}
@typeFields("alertmanager", f.Type) {
<p class="mb-4 text-xs text-muted">
{ i18n.T(ctx, "monitors.alertmanager_hint") }
File diff suppressed because it is too large. Load diff