mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Commmands] Cleanup #questerrors Command. (#2116)
- Cleanup messages and logic.
This commit is contained in:
parent
6e15fae6a0
commit
7d89c05a48
@ -3,21 +3,24 @@
|
|||||||
|
|
||||||
void command_questerrors(Client *c, const Seperator *sep)
|
void command_questerrors(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
std::list<std::string> err;
|
std::list<std::string> quest_errors;
|
||||||
parse->GetErrors(err);
|
parse->GetErrors(quest_errors);
|
||||||
c->Message(Chat::White, "Current Quest Errors:");
|
|
||||||
|
|
||||||
auto iter = err.begin();
|
if (quest_errors.size()) {
|
||||||
int i = 0;
|
c->Message(Chat::White, "Quest errors currently are as follows:");
|
||||||
while (iter != err.end()) {
|
|
||||||
if (i >= 30) {
|
int error_index = 0;
|
||||||
c->Message(Chat::White, "Maximum of 30 Errors shown...");
|
for (auto quest_error : quest_errors) {
|
||||||
break;
|
if (error_index >= 30) {
|
||||||
|
c->Message(Chat::White, "Maximum of 30 errors shown.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(Chat::White, quest_error.c_str());
|
||||||
|
error_index++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
c->Message(Chat::White, iter->c_str());
|
c->Message(Chat::White, "There are no Quest errors currently.");
|
||||||
++i;
|
|
||||||
++iter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,8 +81,8 @@ public:
|
|||||||
virtual void RemoveEncounter(const std::string &name) { }
|
virtual void RemoveEncounter(const std::string &name) { }
|
||||||
|
|
||||||
//TODO: Set maximum quest errors instead of hard coding it
|
//TODO: Set maximum quest errors instead of hard coding it
|
||||||
virtual void GetErrors(std::list<std::string> &err) {
|
virtual void GetErrors(std::list<std::string> &quest_errors) {
|
||||||
err.insert(err.end(), errors_.begin(), errors_.end());
|
quest_errors.insert(quest_errors.end(), errors_.begin(), errors_.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void AddError(std::string error) {
|
virtual void AddError(std::string error) {
|
||||||
|
|||||||
@ -991,11 +991,11 @@ QuestInterface *QuestParserCollection::GetQIByEncounterQuest(std::string encount
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestParserCollection::GetErrors(std::list<std::string> &err) {
|
void QuestParserCollection::GetErrors(std::list<std::string> &quest_errors) {
|
||||||
err.clear();
|
quest_errors.clear();
|
||||||
auto iter = _load_precedence.begin();
|
auto iter = _load_precedence.begin();
|
||||||
while(iter != _load_precedence.end()) {
|
while (iter != _load_precedence.end()) {
|
||||||
(*iter)->GetErrors(err);
|
(*iter)->GetErrors(quest_errors);
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ public:
|
|||||||
int EventEncounter(QuestEventID evt, std::string encounter_name, std::string data, uint32 extra_data,
|
int EventEncounter(QuestEventID evt, std::string encounter_name, std::string data, uint32 extra_data,
|
||||||
std::vector<EQ::Any> *extra_pointers = nullptr);
|
std::vector<EQ::Any> *extra_pointers = nullptr);
|
||||||
|
|
||||||
void GetErrors(std::list<std::string> &err);
|
void GetErrors(std::list<std::string> &quest_errors);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Internally used memory reference for all Perl Event Export Settings
|
Internally used memory reference for all Perl Event Export Settings
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user