mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
[Logs] #logs list Improvements (#2302)
This commit is contained in:
parent
6cbfecd5a1
commit
71966c85ca
@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
extern WorldServer worldserver;
|
extern WorldServer worldserver;
|
||||||
|
|
||||||
|
inline void print_legend(Client *c) {
|
||||||
|
c->Message(Chat::White, "[Legend] [G = GM Say] [F = File] [C = Console] [D = Discord]");
|
||||||
|
}
|
||||||
|
|
||||||
void command_logs(Client *c, const Seperator *sep)
|
void command_logs(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
int arguments = sep->argnum;
|
int arguments = sep->argnum;
|
||||||
@ -58,15 +62,8 @@ void command_logs(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
uint32 max_category_id = (start_category_id + 49);
|
uint32 max_category_id = (start_category_id + 49);
|
||||||
|
|
||||||
std::string popup_text = "<table>";
|
print_legend(c);
|
||||||
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
popup_text += "<tr>";
|
|
||||||
popup_text += "<td>ID</td>";
|
|
||||||
popup_text += "<td>Name</td>";
|
|
||||||
popup_text += "<td>Console</td>";
|
|
||||||
popup_text += "<td>File</td>";
|
|
||||||
popup_text += "<td>GM Say</td>";
|
|
||||||
popup_text += "</tr>";
|
|
||||||
|
|
||||||
for (int index = start_category_id; index <= max_category_id; index++) {
|
for (int index = start_category_id; index <= max_category_id; index++) {
|
||||||
if (index >= Logs::LogCategory::MaxCategoryID) {
|
if (index >= Logs::LogCategory::MaxCategoryID) {
|
||||||
@ -74,29 +71,100 @@ void command_logs(Client *c, const Seperator *sep)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
popup_text += fmt::format(
|
std::vector<std::string> gmsay;
|
||||||
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
|
for (int i = 0; i <= 3; i++) {
|
||||||
index,
|
if (i == 2) {
|
||||||
Logs::LogCategoryName[index],
|
continue;
|
||||||
LogSys.log_settings[index].log_to_console,
|
}
|
||||||
LogSys.log_settings[index].log_to_file,
|
if (LogSys.log_settings[index].log_to_gmsay == i) {
|
||||||
LogSys.log_settings[index].log_to_gmsay
|
gmsay.emplace_back(std::to_string(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
gmsay.emplace_back(
|
||||||
|
EQ::SayLinkEngine::GenerateQuestSaylink(
|
||||||
|
fmt::format("#logs set gmsay {} {}", index, i), false, std::to_string(i)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
popup_text += "</table>";
|
std::vector<std::string> file;
|
||||||
|
for (int i = 0; i <= 3; i++) {
|
||||||
|
if (i == 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (LogSys.log_settings[index].log_to_file == i) {
|
||||||
|
file.emplace_back(std::to_string(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::string popup_title = fmt::format(
|
file.emplace_back(
|
||||||
"Log Settings [{} to {}]",
|
EQ::SayLinkEngine::GenerateQuestSaylink(
|
||||||
start_category_id,
|
fmt::format("#logs set file {} {}", index, i), false, std::to_string(i)
|
||||||
max_category_id
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> console;
|
||||||
|
for (int i = 0; i <= 3; i++) {
|
||||||
|
if (i == 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (LogSys.log_settings[index].log_to_console == i) {
|
||||||
|
console.emplace_back(std::to_string(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.emplace_back(
|
||||||
|
EQ::SayLinkEngine::GenerateQuestSaylink(
|
||||||
|
fmt::format("#logs set console {} {}", index, i), false, std::to_string(i)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> discord;
|
||||||
|
for (int i = 0; i <= 3; i++) {
|
||||||
|
if (i == 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (LogSys.log_settings[index].log_to_discord == i) {
|
||||||
|
discord.emplace_back(std::to_string(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
discord.emplace_back(
|
||||||
|
EQ::SayLinkEngine::GenerateQuestSaylink(
|
||||||
|
fmt::format("#logs set discord {} {}", index, i), false, std::to_string(i)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string gmsay_string = JoinString(gmsay, "-");
|
||||||
|
std::string console_string = JoinString(console, "-");
|
||||||
|
std::string file_string = JoinString(file, "-");
|
||||||
|
std::string discord_string = JoinString(discord, "-");
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
0,
|
||||||
|
fmt::format(
|
||||||
|
"G [{}] C [{}] F [{}] D [{}] [{}] [{}] ",
|
||||||
|
rtrim(gmsay_string, "-"),
|
||||||
|
rtrim(console_string, "-"),
|
||||||
|
rtrim(file_string, "-"),
|
||||||
|
rtrim(discord_string, "-"),
|
||||||
|
index,
|
||||||
|
Logs::LogCategoryName[index]
|
||||||
|
).c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
c->SendPopupToClient(
|
if (index % 10 == 0) {
|
||||||
popup_title.c_str(),
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
popup_text.c_str()
|
print_legend(c);
|
||||||
);
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@ -107,6 +175,7 @@ void command_logs(Client *c, const Seperator *sep)
|
|||||||
max_category_id
|
max_category_id
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
|
c->Message(Chat::White, "------------------------------------------------");
|
||||||
|
|
||||||
int next_category_id = (max_category_id + 1);
|
int next_category_id = (max_category_id + 1);
|
||||||
if (next_category_id < Logs::LogCategory::MaxCategoryID) {
|
if (next_category_id < Logs::LogCategory::MaxCategoryID) {
|
||||||
@ -166,7 +235,7 @@ void command_logs(Client *c, const Seperator *sep)
|
|||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} ({}) is now set to Debug Level {} for {}.",
|
"{} ({}) is now set to Debug Level {} for {}. This is temporary and only in memory for the current zone.",
|
||||||
Logs::LogCategoryName[category_id],
|
Logs::LogCategoryName[category_id],
|
||||||
category_id,
|
category_id,
|
||||||
setting,
|
setting,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user