// HQ administration belongs to AI; Core sees only ERR_AdminProvider. class ERR_HQAdminProvider : ERR_AdminProvider { protected ERR_HQ m_HQ; void ERR_HQAdminProvider(ERR_HQ hq) { m_HQ = hq; } override string Id() { return "hq"; } override void Capabilities(array values) { values.Insert("supports=hq"); } override string Setting(string section, string option) { if (section != "hq") return ""; if (option == "interval") return "reportIntervalSeconds"; if (option == "squads") return "supportSquadLimit"; if (option == "radius") return "responseRadiusMetres"; return ""; } override int JournalSequence() { if (!m_HQ || !m_HQ.Journal()) return -1; return m_HQ.Journal().Sequence(); } override bool ReadJournal(int after, array lines, out int cursor, int limit = 8) { if (!m_HQ || !m_HQ.Journal()) return false; m_HQ.Journal().Read(after, lines, cursor, limit); return true; } override bool Execute(ERR_GameMode mode, string arguments, array replies) { if (arguments != "status" && arguments != "hq show" && arguments != "hq log") return false; if (!m_HQ) { replies.Insert("HQ unavailable."); return true; } if (arguments == "hq show" || arguments == "status") replies.Insert(m_HQ.Status()); else { int cursor; ReadJournal(Math.Max(0, JournalSequence() - 8), replies, cursor); if (replies.IsEmpty()) replies.Insert("HQ journal is empty."); } return true; } override bool Help(string topic, array replies) { if (topic != "hq") return false; replies.Insert("/esc hq show | hq log show|next|set on|off"); replies.Insert("/esc hq interval|squads|radius show|set N"); replies.Insert("HQ assigns available physical squads through delivered reports. These commands do not create replacement forces."); return true; } }