mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Commands] Cleanup #serverrules Command. (#2139)
- Cleanup messages and logic. - Change separator from new line to pipe separator, as new line was non-functional.
This commit is contained in:
parent
e5acc7c322
commit
e2bfa44df0
@ -3897,31 +3897,50 @@ void Client::GetRaidAAs(RaidLeadershipAA_Struct *into) const {
|
|||||||
|
|
||||||
void Client::EnteringMessages(Client* client)
|
void Client::EnteringMessages(Client* client)
|
||||||
{
|
{
|
||||||
//server rules
|
|
||||||
std::string rules;
|
std::string rules;
|
||||||
if(database.GetVariable("Rules", rules))
|
if (database.GetVariable("Rules", rules)) {
|
||||||
{
|
|
||||||
uint8 flag = database.GetAgreementFlag(client->AccountID());
|
uint8 flag = database.GetAgreementFlag(client->AccountID());
|
||||||
if(!flag)
|
if (!flag) {
|
||||||
{
|
auto rules_link = EQ::SayLinkEngine::GenerateQuestSaylink(
|
||||||
client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)");
|
"#serverrules",
|
||||||
client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)");
|
false,
|
||||||
client->Message(Chat::Red,"You must agree to the Rules, before you can move. (type #serverrules to view the rules)");
|
"rules"
|
||||||
|
);
|
||||||
|
|
||||||
|
client->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"You must agree to the {} before you can move.",
|
||||||
|
rules_link
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
client->SendAppearancePacket(AT_Anim, ANIM_FREEZE);
|
client->SendAppearancePacket(AT_Anim, ANIM_FREEZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SendRules(Client* client)
|
void Client::SendRules()
|
||||||
{
|
{
|
||||||
std::string rules;
|
std::string rules;
|
||||||
|
|
||||||
if (!database.GetVariable("Rules", rules))
|
if (!database.GetVariable("Rules", rules)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto lines = SplitString(rules, '\n');
|
auto lines = split_string(rules, "|");
|
||||||
for (auto&& e : lines)
|
auto line_number = 1;
|
||||||
client->Message(Chat::White, "%s", e.c_str());
|
for (auto&& line : lines) {
|
||||||
|
Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"{}. {}",
|
||||||
|
line_number,
|
||||||
|
line
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
line_number++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetEndurance(int32 newEnd)
|
void Client::SetEndurance(int32 newEnd)
|
||||||
|
|||||||
@ -1035,7 +1035,7 @@ public:
|
|||||||
void RemoveTitle(int titleset);
|
void RemoveTitle(int titleset);
|
||||||
|
|
||||||
void EnteringMessages(Client* client);
|
void EnteringMessages(Client* client);
|
||||||
void SendRules(Client* client);
|
void SendRules();
|
||||||
|
|
||||||
const bool GetGMSpeed() const { return (gmspeed > 0); }
|
const bool GetGMSpeed() const { return (gmspeed > 0); }
|
||||||
bool CanUseReport;
|
bool CanUseReport;
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
void command_serverrules(Client *c, const Seperator *sep)
|
void command_serverrules(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
c->SendRules(c);
|
c->SendRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user