Skip to content

Commit df93d51

Browse files
feat: Improve Ban File Sync error handling and update configuration instructions
1 parent 13c3794 commit df93d51

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

src/XtremeIdiots.Portal.Web/Views/BanFileMonitors/Index.cshtml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@
5454
GameServerLiveStatusDto? live,
5555
BanFileMonitorGameTypeCard? card)
5656
{
57-
if (m.GameServer is null || !m.GameServer.BanFileSyncEnabled)
57+
if (m.GameServer is null)
58+
return ("bg-secondary", "Unknown", "Game server data unavailable.");
59+
60+
// Ban file sync is a sub-feature of the agent. If sync is on but the agent is off,
61+
// the watcher cannot run — surface this as a config error rather than the misleading
62+
// "Stale" badge it would otherwise produce.
63+
if (m.GameServer.BanFileSyncEnabled && !m.GameServer.AgentEnabled)
64+
return ("bg-warning text-dark", "Misconfigured",
65+
"Ban file sync requires the agent to be enabled. Toggle Agent Enabled on the game server's edit page, or disable Ban File Sync.");
66+
67+
if (!m.GameServer.BanFileSyncEnabled)
5868
return ("bg-secondary", "Disabled", "Ban file sync is disabled for this server.");
5969

6070
if (m.LastCheckUtc is null)
@@ -96,10 +106,11 @@
96106
<div class="alert alert-primary" role="alert">
97107
<i class="fa-solid fa-fw fa-circle-info" aria-hidden="true"></i>
98108
Ban file monitors are now <strong>read-only status snapshots</strong> written by the server agent.
99-
To enable / disable monitoring for a server, toggle <strong>Ban File Sync</strong> on
109+
To enable / disable monitoring for a server, toggle <strong>Agent Enabled</strong> + <strong>Ban File Sync</strong> on
100110
<a asp-controller="GameServers" asp-action="Index">the game server's edit page</a>.
101-
The FTP path is resolved automatically from the server's <strong>Ban File Root Path</strong>
102-
plus per-game-type rules and the currently-running mod.
111+
Ban file sync is a sub-feature of the agent and requires Agent Enabled. The FTP path is resolved
112+
automatically from the server's <strong>Ban File Root Path</strong> plus per-game-type rules and
113+
the currently-running mod.
103114
</div>
104115

105116
@if (Model.GameTypeCards.Count > 0)

src/XtremeIdiots.Portal.Web/Views/GameServers/ConfigurationSections/_BanFileSyncConfiguration.cshtml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
Ban File Sync Configuration
77
</div>
88
<div class="ibox-content">
9+
<div class="alert alert-info small mb-3" role="alert">
10+
<i class="fa-solid fa-fw fa-circle-info" aria-hidden="true"></i>
11+
Ban file sync runs as part of the agent's check loop and requires
12+
<strong>Agent Enabled</strong>. Disabling the agent automatically disables ban file sync.
13+
</div>
14+
915
<div class="mb-3">
1016
<label asp-for="GameServer.BanFileRootPath" class="form-label"></label>
1117
<input asp-for="GameServer.BanFileRootPath" class="form-control" type="text" maxlength="255" placeholder="/" />
@@ -27,3 +33,4 @@
2733
</div>
2834
</div>
2935

36+

0 commit comments

Comments
 (0)