38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
// Companion-specific commands extend Core's authenticated transport.
|
|
modded class ERR_AdminService
|
|
{
|
|
protected override string Setting(string section, string option)
|
|
{
|
|
if (section == "hq")
|
|
{
|
|
if (option == "interval") return "reportIntervalSeconds";
|
|
if (option == "squads") return "supportSquadLimit";
|
|
if (option == "radius") return "responseRadiusMetres";
|
|
}
|
|
if (section == "intel")
|
|
{
|
|
if (option == "carrying") return "aiIntelChancePercent";
|
|
if (option == "reveal") return "intelRevealChancePercent";
|
|
}
|
|
return super.Setting(section, option);
|
|
}
|
|
protected override bool Extension(ERR_GameMode mode, string arguments, array<string> replies)
|
|
{
|
|
if (arguments != "status" && arguments != "hq show" && arguments != "hq log") return super.Extension(mode, arguments, replies);
|
|
ERR_HQ hq = ERR_HQ.Cast(mode.Command());
|
|
if (!hq) { replies.Insert("HQ unavailable"); return true; }
|
|
if (arguments == "hq show" || arguments == "status") replies.Insert(hq.Status());
|
|
else
|
|
{
|
|
int cursor;
|
|
hq.Journal().Read(Math.Max(0, hq.Journal().Sequence() - 8), replies, cursor);
|
|
if (replies.IsEmpty()) replies.Insert("HQ journal is empty.");
|
|
}
|
|
return true;
|
|
}
|
|
protected override string Help()
|
|
{
|
|
return super.Help() + " | hq show|log | hq interval|squads|radius show|set N | intel carrying|reveal show|set N";
|
|
}
|
|
}
|