diff --git a/common/ruletypes.h b/common/ruletypes.h index 042c9bec40..a1672d5a89 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -329,6 +329,7 @@ RULE_BOOL(World, UseItemLinksForKeyRing, false, "Uses item links for Key Ring Li RULE_BOOL(World, UseOldShadowKnightClassExport, true, "Disable to have Shadowknight show as Shadow Knight (live-like)") RULE_STRING(World, IPExemptionZones, "", "Comma-delimited list of zones to exclude from IP-limit checks. Empty string to disable.") RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to have this be used instead of variables table 'motd' value") +RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C") RULE_CATEGORY_END() RULE_CATEGORY(Zone) diff --git a/zone/client.cpp b/zone/client.cpp index db3b76300d..1bc2760e22 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3786,14 +3786,12 @@ void Client::GetRaidAAs(RaidLeadershipAA_Struct *into) const { void Client::EnteringMessages(Client* client) { - std::string rules; - if (database.GetVariable("Rules", rules)) { - uint8 flag = database.GetAgreementFlag(client->AccountID()); + std::string rules = RuleS(World, Rules); + + if (!rules.empty() || database.GetVariable("Rules", rules)) { + const uint8 flag = database.GetAgreementFlag(client->AccountID()); if (!flag) { - auto rules_link = Saylink::Silent( - "#serverrules", - "rules" - ); + const std::string& rules_link = Saylink::Silent("#serverrules", "rules"); client->Message( Chat::White, @@ -3810,9 +3808,9 @@ void Client::EnteringMessages(Client* client) void Client::SendRules() { - std::string rules; + std::string rules = RuleS(World, Rules); - if (!database.GetVariable("Rules", rules)) { + if (rules.empty() && !database.GetVariable("Rules", rules)) { return; }