diff --git a/zone/command.cpp b/zone/command.cpp index 66641d69f..ba4a6f746 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -315,7 +315,7 @@ int command_init(void) command_add("scribespells", "[max level] [min level] - Scribe all spells for you or your player target that are usable by them, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_scribespells) || command_add("sendzonespawns", "- Refresh spawn list for all clients in zone", AccountStatus::GMLeadAdmin, command_sendzonespawns) || command_add("sensetrap", "Analog for ldon sense trap for the newer clients since we still don't have it working.", AccountStatus::Player, command_sensetrap) || - command_add("serverinfo", "- Get OS info about server host", AccountStatus::GMMgmt, command_serverinfo) || + command_add("serverinfo", "- Get CPU, Operating System, and Process Information about the server", AccountStatus::GMMgmt, command_serverinfo) || command_add("serverrules", "- Read this server's rules", AccountStatus::Player, command_serverrules) || command_add("setaapts", "[AA|Group|Raid] [AA Amount] - Set your or your player target's Available AA Points by Type", AccountStatus::GMAdmin, command_setaapts) || command_add("setaaxp", "[AA|Group|Raid] [AA Experience] - Set your or your player target's AA Experience by Type", AccountStatus::GMAdmin, command_setaaxp) || diff --git a/zone/gm_commands/serverinfo.cpp b/zone/gm_commands/serverinfo.cpp index e51da7266..7ca20e26b 100755 --- a/zone/gm_commands/serverinfo.cpp +++ b/zone/gm_commands/serverinfo.cpp @@ -3,31 +3,96 @@ void command_serverinfo(Client *c, const Seperator *sep) { - auto os = EQ::GetOS(); - auto cpus = EQ::GetCPUs(); - auto pid = EQ::GetPID(); - auto rss = EQ::GetRSS(); - auto uptime = EQ::GetUptime(); + auto os = EQ::GetOS(); + auto cpus = EQ::GetCPUs(); + auto process_id = EQ::GetPID(); + auto rss = EQ::GetRSS() / 1048576.0; + auto uptime = static_cast(EQ::GetUptime()); - c->Message(Chat::White, "Operating System Information"); - c->Message(Chat::White, "=================================================="); - c->Message(Chat::White, "System: %s", os.sysname.c_str()); - c->Message(Chat::White, "Release: %s", os.release.c_str()); - c->Message(Chat::White, "Version: %s", os.version.c_str()); - c->Message(Chat::White, "Machine: %s", os.machine.c_str()); - c->Message(Chat::White, "Uptime: %.2f seconds", uptime); - c->Message(Chat::White, "=================================================="); - c->Message(Chat::White, "CPU Information"); - c->Message(Chat::White, "=================================================="); - for (size_t i = 0; i < cpus.size(); ++i) { - auto &cp = cpus[i]; - c->Message(Chat::White, "CPU #%i: %s, Speed: %.2fGhz", i, cp.model.c_str(), cp.speed); + std::string popup_text; + + popup_text.append("Operating System Information"); + + popup_text.append(""); + + popup_text.append( + fmt::format( + "", + os.sysname + ).c_str() + ); + + popup_text.append( + fmt::format( + "", + os.release + ) + ); + + popup_text.append( + fmt::format( + "", + os.version + ) + ); + + popup_text.append( + fmt::format( + "", + os.machine + ) + ); + + popup_text.append( + fmt::format( + "", + ConvertSecondsToTime(uptime) + ) + ); + + popup_text.append("
System{}
Release{}
Version{}
Machine{}
Uptime{}
"); + + popup_text.append("CPU Information"); + + popup_text.append(""); + + for (size_t cpu = 0; cpu < cpus.size(); ++cpu) { + auto ¤t_cpu = cpus[cpu]; + popup_text.append( + fmt::format( + "", + cpu, + current_cpu.model, + current_cpu.speed + ) + ); } - c->Message(Chat::White, "=================================================="); - c->Message(Chat::White, "Process Information"); - c->Message(Chat::White, "=================================================="); - c->Message(Chat::White, "PID: %u", pid); - c->Message(Chat::White, "RSS: %.2f MB", rss / 1048576.0); - c->Message(Chat::White, "=================================================="); + + popup_text.append("
CPU {}{} ({:.2f}GHz)
"); + + popup_text.append("Process Information"); + + popup_text.append(""); + + popup_text.append( + fmt::format( + "", + process_id + ) + ); + + popup_text.append( + fmt::format( + "", + rss + ) + ); + + popup_text.append("
Process ID{}
RSS{:.2f} MB
"); + + c->SendPopupToClient( + "Server Information", + popup_text.c_str() + ); }