mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 18:46:37 +00:00
[Commands] Consolidate #show commands into a singular #show command (#3478)
* [Cleanup] Consolidate #show commands into a singular #show command # Notes - All `#show` commands like `#showbuffs` are now subcommands of `#show`. - All aliases like `#showbuffs` still function. * Push up progress. * Final push. * Cleanup. * Update ip_lookup.cpp * emotes not emote * Cleanup * Update servertalk.h * Update show.cpp * Fix * Final push. * #aggro * #who
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_aggro(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #aggro [Distance] [-v] (-v is verbose Faction Information)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!c->GetTarget() ||
|
||||
(
|
||||
c->GetTarget() &&
|
||||
!c->GetTarget()->IsNPC()
|
||||
)
|
||||
) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
NPC* target = c->GetTarget()->CastToNPC();
|
||||
|
||||
float distance = Strings::ToFloat(sep->arg[1]);
|
||||
bool verbose = !strcasecmp("-v", sep->arg[2]);
|
||||
entity_list.DescribeAggro(c, target, distance, verbose);
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_checklos(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget()) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
|
||||
bool has_los = c->CheckLosFN(target);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You {}have line of sight to {}.",
|
||||
has_los ? "" : "do not ",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_cvs(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
|
||||
auto srcvss = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
|
||||
strn0cpy(srcvss->Name, c->GetName(), sizeof(srcvss->Name));
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_distance(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget()) {
|
||||
Mob *target = c->GetTarget();
|
||||
if (c != target) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} is {:.2f} units from you.",
|
||||
c->GetTargetDescription(target),
|
||||
Distance(
|
||||
c->GetPosition(),
|
||||
target->GetPosition()
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_flags(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
target->SendZoneFlagInfo(c);
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_fov(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget()) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
|
||||
std::string behind_message = (
|
||||
c->BehindMob(
|
||||
target,
|
||||
c->GetX(),
|
||||
c->GetY()
|
||||
) ?
|
||||
"behind" :
|
||||
"not behind"
|
||||
);
|
||||
|
||||
std::string gender_message = (
|
||||
target->GetGender() == MALE ?
|
||||
"he" :
|
||||
(
|
||||
target->GetGender() == FEMALE ?
|
||||
"she" :
|
||||
"it"
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You are {} {}, {} has a heading of {}.",
|
||||
behind_message,
|
||||
c->GetTargetDescription(target),
|
||||
gender_message,
|
||||
target->GetHeading()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../corpse.h"
|
||||
|
||||
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint32 corpse_count = database.GetCharacterBuriedCorpseCount(target->CharacterID());
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} buried corpse{}.",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
|
||||
c == target ? "have" : "has",
|
||||
(
|
||||
corpse_count ?
|
||||
std::to_string(corpse_count) :
|
||||
"no"
|
||||
),
|
||||
corpse_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_getvariable(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string variable = sep->argplus[1];
|
||||
if (variable.empty()) {
|
||||
c->Message(Chat::White, "Usage: #getvariable [Variable Name]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string message;
|
||||
std::string value;
|
||||
if (database.GetVariable(variable, value)) {
|
||||
message = fmt::format(
|
||||
"Variable {}: {}",
|
||||
variable,
|
||||
value
|
||||
);
|
||||
} else {
|
||||
message = fmt::format(
|
||||
"Variable '{}' does not exist.",
|
||||
variable
|
||||
);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
message.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../groups.h"
|
||||
|
||||
void command_ginfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
auto target_group = target->GetGroup();
|
||||
if (!target_group) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not in a group.",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
|
||||
c == target ? "are" : "is"
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string popup_title = fmt::format(
|
||||
"Group Info for {}",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCSelf)
|
||||
);
|
||||
std::string popup_text = "<table>";
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Group ID</td><td>{}</td><td>Members</td><td>{}</td>",
|
||||
target_group->GetID(),
|
||||
target_group->GroupCount()
|
||||
);
|
||||
popup_text += "<br><br>";
|
||||
popup_text += "<tr>";
|
||||
popup_text += "<td>Index</td>";
|
||||
popup_text += "<td>Name</td>";
|
||||
popup_text += "<td>In Zone</td>";
|
||||
popup_text += "<td>Assist</td>";
|
||||
popup_text += "<td>Puller</td>";
|
||||
popup_text += "<td>Tank</td>";
|
||||
popup_text += "</tr>";
|
||||
|
||||
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
|
||||
if (target_group->membername[group_member][0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool is_assist = target_group->MemberRoles[group_member] & RoleAssist;
|
||||
bool is_puller = target_group->MemberRoles[group_member] & RolePuller;
|
||||
bool is_tank = target_group->MemberRoles[group_member] & RoleTank;
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
|
||||
group_member,
|
||||
(
|
||||
strcmp(target_group->membername[group_member], c->GetCleanName()) ?
|
||||
target_group->membername[group_member] :
|
||||
fmt::format(
|
||||
"{} (You)",
|
||||
target_group->membername[group_member]
|
||||
)
|
||||
),
|
||||
target_group->members[group_member] ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_assist ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_puller ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_tank ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>"
|
||||
);
|
||||
}
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
c->SendPopupToClient(
|
||||
popup_title.c_str(),
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_globalview(Client *c, const Seperator *sep)
|
||||
{
|
||||
NPC *npcmob = nullptr;
|
||||
|
||||
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
|
||||
npcmob = c->GetTarget()->CastToNPC();
|
||||
QGlobalCache *npc_c = nullptr;
|
||||
QGlobalCache *char_c = nullptr;
|
||||
QGlobalCache *zone_c = nullptr;
|
||||
|
||||
if (npcmob) {
|
||||
npc_c = npcmob->GetQGlobals();
|
||||
}
|
||||
|
||||
char_c = c->GetQGlobals();
|
||||
zone_c = zone->GetQGlobals();
|
||||
|
||||
std::list<QGlobal> globalMap;
|
||||
uint32 ntype = 0;
|
||||
|
||||
if (npcmob) {
|
||||
ntype = npcmob->GetNPCTypeID();
|
||||
}
|
||||
|
||||
if (npc_c) {
|
||||
QGlobalCache::Combine(globalMap, npc_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (char_c) {
|
||||
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (zone_c) {
|
||||
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
auto iter = globalMap.begin();
|
||||
uint32 gcount = 0;
|
||||
|
||||
c->Message(Chat::White, "Name, Value");
|
||||
while (iter != globalMap.end()) {
|
||||
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
|
||||
++iter;
|
||||
++gcount;
|
||||
}
|
||||
c->Message(Chat::White, "%u globals loaded.", gcount);
|
||||
}
|
||||
else {
|
||||
QGlobalCache *char_c = nullptr;
|
||||
QGlobalCache *zone_c = nullptr;
|
||||
|
||||
char_c = c->GetQGlobals();
|
||||
zone_c = zone->GetQGlobals();
|
||||
|
||||
std::list<QGlobal> globalMap;
|
||||
uint32 ntype = 0;
|
||||
|
||||
if (char_c) {
|
||||
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (zone_c) {
|
||||
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
auto iter = globalMap.begin();
|
||||
uint32 gcount = 0;
|
||||
|
||||
c->Message(Chat::White, "Name, Value");
|
||||
while (iter != globalMap.end()) {
|
||||
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
|
||||
++iter;
|
||||
++gcount;
|
||||
}
|
||||
c->Message(Chat::White, "%u globals loaded.", gcount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_iplookup(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack =
|
||||
new ServerPacket(
|
||||
ServerOP_IPLookup,
|
||||
sizeof(ServerGenericWorldQuery_Struct) +
|
||||
strlen(sep->argplus[1]) + 1
|
||||
);
|
||||
ServerGenericWorldQuery_Struct *s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
|
||||
strcpy(s->from, c->GetName());
|
||||
s->admin = c->Admin();
|
||||
if (sep->argplus[1][0] != 0) {
|
||||
strcpy(s->query, sep->argplus[1]);
|
||||
}
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_listpetition(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string query = "SELECT petid, charname, accountname FROM petitions ORDER BY petid";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Petition list requested by [{}]", c->GetName());
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::Red, " ID : Character Name , Account Name");
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]);
|
||||
}
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_netstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
bool is_full = !strcasecmp(sep->arg[1], "full");
|
||||
bool is_reset = !strcasecmp(sep->arg[1], "reset");
|
||||
|
||||
if (is_reset) {
|
||||
auto connection = c->Connection();
|
||||
c->Message(Chat::White, "Resetting client stats (packet loss will not read correctly after reset).");
|
||||
connection->ResetStats();
|
||||
return;
|
||||
}
|
||||
|
||||
auto connection = c->Connection();
|
||||
auto opts = connection->GetManager()->GetOptions();
|
||||
auto eqs_stats = connection->GetStats();
|
||||
auto &stats = eqs_stats.DaybreakStats;
|
||||
auto now = EQ::Net::Clock::now();
|
||||
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
|
||||
now - stats.created
|
||||
).count();
|
||||
|
||||
std::string popup_text = "<table>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Sent Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.sent_bytes,
|
||||
stats.sent_bytes / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Received Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.recv_bytes,
|
||||
stats.recv_bytes / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Bytes Before Encode (Sent)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
|
||||
stats.bytes_before_encode,
|
||||
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) /
|
||||
static_cast<double>(stats.bytes_before_encode) * 100.0
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Bytes After Decode (Received)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
|
||||
stats.bytes_after_decode,
|
||||
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) /
|
||||
static_cast<double>(stats.bytes_after_decode) * 100.0
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format("<tr><td>Min Ping</td><td>{}</td></tr>", stats.min_ping);
|
||||
popup_text += fmt::format("<tr><td>Max Ping</td><td>{}</td></tr>", stats.max_ping);
|
||||
popup_text += fmt::format("<tr><td>Last Ping</td><td>{}</td></tr>", stats.last_ping);
|
||||
popup_text += fmt::format("<tr><td>Average Ping</td><td>{}</td></tr>", stats.avg_ping);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>(Realtime) Received Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.recv_packets,
|
||||
stats.recv_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>(Realtime) Sent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.sent_packets,
|
||||
stats.sent_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format("<tr><td>(Sync) Received Packets</td><td>{}</td></tr>", stats.sync_recv_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Sent Packets</td><td>{}</td></tr>", stats.sync_sent_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Remote Received Packets</td><td>{}</td></tr>", stats.sync_remote_recv_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Remote Sent Packets</td><td>{}</td></tr>", stats.sync_remote_sent_packets);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Packet Loss In</td><td>{:.2f}%%</td></tr>",
|
||||
(100.0 * (1.0 - static_cast<double>(stats.sync_recv_packets) / static_cast<double>(stats.sync_remote_sent_packets)))
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Packet Loss Out</td><td>{:.2f}%%</td></tr>",
|
||||
(100.0 * (1.0 - static_cast<double>(stats.sync_remote_recv_packets) / static_cast<double>(stats.sync_sent_packets)))
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_packets,
|
||||
stats.resent_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_fragments,
|
||||
stats.resent_fragments / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Non-Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_full,
|
||||
stats.resent_full / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Dropped Datarate Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.dropped_datarate_packets,
|
||||
stats.dropped_datarate_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Outgoing Link Saturation</td><td>{:.2f}%% ({:.2f}kb Per Second)</td></tr>",
|
||||
(100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate))),
|
||||
opts.daybreak_options.outgoing_data_rate
|
||||
);
|
||||
}
|
||||
|
||||
if (is_full) {
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += "<tr><td>Sent Packet Types</td></tr>";
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.SentCount[i];
|
||||
if (cnt > 0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
OpcodeNames[i],
|
||||
cnt,
|
||||
cnt / sec_since_stats_reset
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += "<tr><td>Received Packet Types</td></tr>";
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.RecvCount[i];
|
||||
if (cnt > 0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
OpcodeNames[i],
|
||||
cnt,
|
||||
cnt / sec_since_stats_reset
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Network Statistics",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_network(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!strcasecmp(sep->arg[1], "getopt")) {
|
||||
auto eqsi = c->Connection();
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[2], "all")) {
|
||||
c->Message(Chat::White, "max_packet_size: %llu", (uint64_t) opts.daybreak_options.max_packet_size);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"max_connection_count: %llu",
|
||||
(uint64_t) opts.daybreak_options.max_connection_count
|
||||
);
|
||||
c->Message(Chat::White, "keepalive_delay_ms: %llu", (uint64_t) opts.daybreak_options.keepalive_delay_ms);
|
||||
c->Message(Chat::White, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor);
|
||||
c->Message(Chat::White, "resend_delay_ms: %llu", (uint64_t) opts.daybreak_options.resend_delay_ms);
|
||||
c->Message(Chat::White, "resend_delay_min: %llu", (uint64_t) opts.daybreak_options.resend_delay_min);
|
||||
c->Message(Chat::White, "resend_delay_max: %llu", (uint64_t) opts.daybreak_options.resend_delay_max);
|
||||
c->Message(Chat::White, "connect_delay_ms: %llu", (uint64_t) opts.daybreak_options.connect_delay_ms);
|
||||
c->Message(Chat::White, "connect_stale_ms: %llu", (uint64_t) opts.daybreak_options.connect_stale_ms);
|
||||
c->Message(Chat::White, "stale_connection_ms: %llu", (uint64_t) opts.daybreak_options.stale_connection_ms);
|
||||
c->Message(Chat::White, "crc_length: %llu", (uint64_t) opts.daybreak_options.crc_length);
|
||||
c->Message(Chat::White, "hold_size: %llu", (uint64_t) opts.daybreak_options.hold_size);
|
||||
c->Message(Chat::White, "hold_length_ms: %llu", (uint64_t) opts.daybreak_options.hold_length_ms);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"simulated_in_packet_loss: %llu",
|
||||
(uint64_t) opts.daybreak_options.simulated_in_packet_loss
|
||||
);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"simulated_out_packet_loss: %llu",
|
||||
(uint64_t) opts.daybreak_options.simulated_out_packet_loss
|
||||
);
|
||||
c->Message(Chat::White, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz);
|
||||
c->Message(Chat::White, "resend_timeout: %llu", (uint64_t) opts.daybreak_options.resend_timeout);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"connection_close_time: %llu",
|
||||
(uint64_t) opts.daybreak_options.connection_close_time
|
||||
);
|
||||
c->Message(Chat::White, "encode_passes[0]: %llu", (uint64_t) opts.daybreak_options.encode_passes[0]);
|
||||
c->Message(Chat::White, "encode_passes[1]: %llu", (uint64_t) opts.daybreak_options.encode_passes[1]);
|
||||
c->Message(Chat::White, "port: %llu", (uint64_t) opts.daybreak_options.port);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown get option: %s", sep->arg[2]);
|
||||
c->Message(Chat::White, "Available options:");
|
||||
//Todo the rest of these when im less lazy.
|
||||
//c->Message(Chat::White, "max_packet_size");
|
||||
//c->Message(Chat::White, "max_connection_count");
|
||||
//c->Message(Chat::White, "keepalive_delay_ms");
|
||||
//c->Message(Chat::White, "resend_delay_factor");
|
||||
//c->Message(Chat::White, "resend_delay_ms");
|
||||
//c->Message(Chat::White, "resend_delay_min");
|
||||
//c->Message(Chat::White, "resend_delay_max");
|
||||
//c->Message(Chat::White, "connect_delay_ms");
|
||||
//c->Message(Chat::White, "connect_stale_ms");
|
||||
//c->Message(Chat::White, "stale_connection_ms");
|
||||
//c->Message(Chat::White, "crc_length");
|
||||
//c->Message(Chat::White, "hold_size");
|
||||
//c->Message(Chat::White, "hold_length_ms");
|
||||
//c->Message(Chat::White, "simulated_in_packet_loss");
|
||||
//c->Message(Chat::White, "simulated_out_packet_loss");
|
||||
//c->Message(Chat::White, "tic_rate_hertz");
|
||||
//c->Message(Chat::White, "resend_timeout");
|
||||
//c->Message(Chat::White, "connection_close_time");
|
||||
//c->Message(Chat::White, "encode_passes[0]");
|
||||
//c->Message(Chat::White, "encode_passes[1]");
|
||||
//c->Message(Chat::White, "port");
|
||||
c->Message(Chat::White, "all");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[1], "setopt")) {
|
||||
auto eqsi = c->Connection();
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[3], "")) {
|
||||
c->Message(Chat::White, "Missing value for set");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string value = sep->arg[3];
|
||||
if (!strcasecmp(sep->arg[2], "max_connection_count")) {
|
||||
opts.daybreak_options.max_connection_count = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "keepalive_delay_ms")) {
|
||||
opts.daybreak_options.keepalive_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_factor")) {
|
||||
opts.daybreak_options.resend_delay_factor = std::stod(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_ms")) {
|
||||
opts.daybreak_options.resend_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_min")) {
|
||||
opts.daybreak_options.resend_delay_min = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_max")) {
|
||||
opts.daybreak_options.resend_delay_max = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_delay_ms")) {
|
||||
opts.daybreak_options.connect_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_stale_ms")) {
|
||||
opts.daybreak_options.connect_stale_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "stale_connection_ms")) {
|
||||
opts.daybreak_options.stale_connection_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_size")) {
|
||||
opts.daybreak_options.hold_size = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_length_ms")) {
|
||||
opts.daybreak_options.hold_length_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_in_packet_loss")) {
|
||||
opts.daybreak_options.simulated_in_packet_loss = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_out_packet_loss")) {
|
||||
opts.daybreak_options.simulated_out_packet_loss = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_timeout")) {
|
||||
opts.daybreak_options.resend_timeout = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connection_close_time")) {
|
||||
opts.daybreak_options.connection_close_time = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown set option: %s", sep->arg[2]);
|
||||
c->Message(Chat::White, "Available options:");
|
||||
c->Message(Chat::White, "max_connection_count");
|
||||
c->Message(Chat::White, "keepalive_delay_ms");
|
||||
c->Message(Chat::White, "resend_delay_factor");
|
||||
c->Message(Chat::White, "resend_delay_ms");
|
||||
c->Message(Chat::White, "resend_delay_min");
|
||||
c->Message(Chat::White, "resend_delay_max");
|
||||
c->Message(Chat::White, "connect_delay_ms");
|
||||
c->Message(Chat::White, "connect_stale_ms");
|
||||
c->Message(Chat::White, "stale_connection_ms");
|
||||
c->Message(Chat::White, "hold_size");
|
||||
c->Message(Chat::White, "hold_length_ms");
|
||||
c->Message(Chat::White, "simulated_in_packet_loss");
|
||||
c->Message(Chat::White, "simulated_out_packet_loss");
|
||||
c->Message(Chat::White, "resend_timeout");
|
||||
c->Message(Chat::White, "connection_close_time");
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown command: %s", sep->arg[1]);
|
||||
c->Message(Chat::White, "Network commands avail:");
|
||||
c->Message(Chat::White, "getopt optname - Retrieve the current option value set.");
|
||||
c->Message(Chat::White, "setopt optname - Set the current option allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_npcstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
|
||||
NPC *target = c->GetTarget()->CastToNPC();
|
||||
|
||||
// Stats
|
||||
target->ShowStats(c);
|
||||
|
||||
// Loot Data
|
||||
target->QueryLoot(c);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_peqzone_flags(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
target->SendPEQZoneFlagInfo(c);
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_petitioninfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #petitioninfo (petition number) Type #listpetition for a list");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query = "SELECT petid, charname, accountname, zone, charclass, charrace, charlevel FROM petitions ORDER BY petid";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Petition information request from [{}], petition number:", c->GetName(), Strings::ToInt(sep->argplus[1]));
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
c->Message(Chat::Red, "There was an error in your request: ID not found! Please check the Id and try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
if (strcasecmp(row[0], sep->argplus[1]) == 0) {
|
||||
c->Message(
|
||||
Chat::Red,
|
||||
" ID : %s Character Name: %s Account Name: %s Zone: %s Character Class: %s Character Race: %s Character Level: %s",
|
||||
row[0],
|
||||
row[1],
|
||||
row[2],
|
||||
row[3],
|
||||
row[4],
|
||||
row[5],
|
||||
row[6]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_proximity(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || (c->GetTarget() && !c->GetTarget()->IsNPC())) {
|
||||
c->Message(Chat::White, "You must target an NPC");
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto &iter : entity_list.GetNPCList()) {
|
||||
auto npc = iter.second;
|
||||
std::string name = npc->GetName();
|
||||
|
||||
if (name.find("Proximity") != std::string::npos) {
|
||||
npc->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
NPC *npc = c->GetTarget()->CastToNPC();
|
||||
|
||||
std::vector<FindPerson_Point> points;
|
||||
|
||||
FindPerson_Point p{};
|
||||
|
||||
if (npc->IsProximitySet()) {
|
||||
glm::vec4 position;
|
||||
position.w = npc->GetHeading();
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
position.z = npc->GetZ();
|
||||
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMaxX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMaxX();
|
||||
position.y = npc->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
p.z = npc->GetZ();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMaxY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMaxX();
|
||||
p.y = npc->GetProximityMaxY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMaxX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
points.push_back(p);
|
||||
}
|
||||
|
||||
if (c->ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
||||
c->SendPathPacket(points);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../quest_parser_collection.h"
|
||||
|
||||
void command_questerrors(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::list<std::string> quest_errors;
|
||||
parse->GetErrors(quest_errors);
|
||||
|
||||
if (quest_errors.size()) {
|
||||
c->Message(Chat::White, "Quest errors currently are as follows:");
|
||||
|
||||
int error_index = 0;
|
||||
for (auto quest_error : quest_errors) {
|
||||
if (error_index >= RuleI(World, MaximumQuestErrors)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maximum of {} error{} shown.",
|
||||
RuleI(World, MaximumQuestErrors),
|
||||
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, quest_error.c_str());
|
||||
error_index++;
|
||||
}
|
||||
} else {
|
||||
c->Message(Chat::White, "There are no Quest errors currently.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../dialogue_window.h"
|
||||
#include "../../common/serverinfo.h"
|
||||
|
||||
void command_serverinfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto os = EQ::GetOS();
|
||||
auto cpus = EQ::GetCPUs();
|
||||
auto process_id = EQ::GetPID();
|
||||
auto rss = EQ::GetRSS() / 1048576.0;
|
||||
auto uptime = static_cast<uint32>(EQ::GetUptime());
|
||||
|
||||
std::string popup_table;
|
||||
auto popup_text = DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "Operating System Information")
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Machine") +
|
||||
DialogueWindow::TableCell(os.machine)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("System") +
|
||||
DialogueWindow::TableCell(os.sysname)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Release") +
|
||||
DialogueWindow::TableCell(os.release)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Uptime") +
|
||||
DialogueWindow::TableCell(Strings::SecondsToTime(uptime))
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Version") +
|
||||
DialogueWindow::TableCell(os.version)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text.append(DialogueWindow::Break());
|
||||
|
||||
popup_text.append(
|
||||
DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
)
|
||||
);
|
||||
|
||||
for (size_t cpu = 0; cpu < cpus.size(); ++cpu) {
|
||||
auto ¤t_cpu = cpus[cpu];
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"CPU {}",
|
||||
cpu
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f}GHz)",
|
||||
current_cpu.model,
|
||||
current_cpu.speed
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text.append(DialogueWindow::Break());
|
||||
|
||||
popup_text.append(
|
||||
DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
)
|
||||
);
|
||||
|
||||
popup_text.append("<table>");
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Process ID") +
|
||||
DialogueWindow::TableCell(std::to_string(process_id))
|
||||
)
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("RSS") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f} MB",
|
||||
rss
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Server Information",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
#include "../client.h"
|
||||
#include "show/aggro.cpp"
|
||||
#include "show/buffs.cpp"
|
||||
#include "show/buried_corpse_count.cpp"
|
||||
#include "show/client_version_summary.cpp"
|
||||
#include "show/currencies.cpp"
|
||||
#include "show/distance.cpp"
|
||||
#include "show/emotes.cpp"
|
||||
#include "show/field_of_view.cpp"
|
||||
#include "show/flags.cpp"
|
||||
#include "show/group_info.cpp"
|
||||
#include "show/hatelist.cpp"
|
||||
#include "show/inventory.cpp"
|
||||
#include "show/ip_lookup.cpp"
|
||||
#include "show/line_of_sight.cpp"
|
||||
#include "show/network.cpp"
|
||||
#include "show/network_stats.cpp"
|
||||
#include "show/npc_global_loot.cpp"
|
||||
#include "show/npc_stats.cpp"
|
||||
#include "show/npc_type.cpp"
|
||||
#include "show/peqzone_flags.cpp"
|
||||
#include "show/petition.cpp"
|
||||
#include "show/petition_info.cpp"
|
||||
#include "show/proximity.cpp"
|
||||
#include "show/quest_errors.cpp"
|
||||
#include "show/quest_globals.cpp"
|
||||
#include "show/recipe.cpp"
|
||||
#include "show/server_info.cpp"
|
||||
#include "show/skills.cpp"
|
||||
#include "show/spawn_status.cpp"
|
||||
#include "show/spells.cpp"
|
||||
#include "show/spells_list.cpp"
|
||||
#include "show/stats.cpp"
|
||||
#include "show/timers.cpp"
|
||||
#include "show/traps.cpp"
|
||||
#include "show/uptime.cpp"
|
||||
#include "show/variable.cpp"
|
||||
#include "show/version.cpp"
|
||||
#include "show/waypoints.cpp"
|
||||
#include "show/who.cpp"
|
||||
#include "show/xtargets.cpp"
|
||||
#include "show/zone_data.cpp"
|
||||
#include "show/zone_global_loot.cpp"
|
||||
#include "show/zone_loot.cpp"
|
||||
#include "show/zone_points.cpp"
|
||||
#include "show/zone_status.cpp"
|
||||
|
||||
void command_show(Client *c, const Seperator *sep)
|
||||
{
|
||||
struct Cmd {
|
||||
std::string cmd{}; // command
|
||||
std::string u{}; // usage
|
||||
void (*fn)(Client *c, const Seperator *sep) = nullptr; // function
|
||||
std::vector<std::string> a{}; // aliases
|
||||
};
|
||||
|
||||
std::vector<Cmd> commands = {
|
||||
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
||||
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
||||
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
||||
Cmd{.cmd = "client_version_summary", .u = "client_version_summary", .fn = ShowClientVersionSummary, .a = {"#cvs"}},
|
||||
Cmd{.cmd = "currencies", .u = "currencies", .fn = ShowCurrencies, .a = {"#viewcurrencies"}},
|
||||
Cmd{.cmd = "distance", .u = "distance", .fn = ShowDistance, .a = {"#distance"}},
|
||||
Cmd{.cmd = "emotes", .u = "emotes", .fn = ShowEmotes, .a = {"#emoteview"}},
|
||||
Cmd{.cmd = "field_of_view", .u = "field_of_view", .fn = ShowFieldOfView, .a = {"#fov"}},
|
||||
Cmd{.cmd = "flags", .u = "flags", .fn = ShowFlags, .a = {"#flags"}},
|
||||
Cmd{.cmd = "group_info", .u = "group_info", .fn = ShowGroupInfo, .a = {"#ginfo"}},
|
||||
Cmd{.cmd = "hatelist", .u = "hatelist", .fn = ShowHateList, .a = {"#hatelist"}},
|
||||
Cmd{.cmd = "inventory", .u = "inventory", .fn = ShowInventory, .a = {"#peekinv"}},
|
||||
Cmd{.cmd = "ip_lookup", .u = "ip_lookup", .fn = ShowIPLookup, .a = {"#iplookup"}},
|
||||
Cmd{.cmd = "line_of_sight", .u = "line_of_sight", .fn = ShowLineOfSight, .a = {"#checklos"}},
|
||||
Cmd{.cmd = "network", .u = "network", .fn = ShowNetwork, .a = {"#network"}},
|
||||
Cmd{.cmd = "network_stats", .u = "network_stats", .fn = ShowNetworkStats, .a = {"#netstats"}},
|
||||
Cmd{.cmd = "npc_global_loot", .u = "npc_global_loot", .fn = ShowNPCGlobalLoot, .a = {"#shownpcgloballoot"}},
|
||||
Cmd{.cmd = "npc_stats", .u = "npc_stats", .fn = ShowNPCStats, .a = {"#npcstats"}},
|
||||
Cmd{.cmd = "npc_type", .u = "npc_type [NPC ID]", .fn = ShowNPCType, .a = {"#viewnpctype"}},
|
||||
Cmd{.cmd = "peqzone_flags", .u = "peqzone_flags", .fn = ShowPEQZoneFlags, .a = {"#peqzone_flags"}},
|
||||
Cmd{.cmd = "petition", .u = "petition", .fn = ShowPetition, .a = {"#listpetition", "#viewpetition"}},
|
||||
Cmd{.cmd = "petition_info", .u = "petition_info", .fn = ShowPetitionInfo, .a = {"#petitioninfo"}},
|
||||
Cmd{.cmd = "proximity", .u = "proximity", .fn = ShowProximity, .a = {"#proximity"}},
|
||||
Cmd{.cmd = "quest_errors", .u = "quest_errors", .fn = ShowQuestErrors, .a = {"#questerrors"}},
|
||||
Cmd{.cmd = "quest_globals", .u = "quest_globals", .fn = ShowQuestGlobals, .a = {"#globalview"}},
|
||||
Cmd{.cmd = "recipe", .u = "recipe [Recipe ID]", .fn = ShowRecipe, .a = {"#viewrecipe"}},
|
||||
Cmd{.cmd = "server_info", .u = "server_info", .fn = ShowServerInfo, .a = {"#serverinfo"}},
|
||||
Cmd{.cmd = "skills", .u = "skills", .fn = ShowSkills, .a = {"#showskills"}},
|
||||
Cmd{.cmd = "spawn_status", .u = "spawn_status [all|disabled|enabled|Spawn ID]", .fn = ShowSpawnStatus, .a = {"#spawnstatus"}},
|
||||
Cmd{.cmd = "spells", .u = "spells [disciplines|spells]", .fn = ShowSpells, .a = {"#showspells"}},
|
||||
Cmd{.cmd = "spells_list", .u = "spells_list", .fn = ShowSpellsList, .a = {"#showspellslist"}},
|
||||
Cmd{.cmd = "stats", .u = "stats", .fn = ShowStats, .a = {"#showstats"}},
|
||||
Cmd{.cmd = "timers", .u = "timers", .fn = ShowTimers, .a = {"#timers"}},
|
||||
Cmd{.cmd = "traps", .u = "traps", .fn = ShowTraps, .a = {"#trapinfo"}},
|
||||
Cmd{.cmd = "uptime", .u = "uptime [Zone Server ID] (Zone Server ID is optional)", .fn = ShowUptime, .a = {"#uptime"}},
|
||||
Cmd{.cmd = "variable", .u = "variable [Variable Name]", .fn = ShowVariable, .a = {"#getvariable"}},
|
||||
Cmd{.cmd = "version", .u = "version", .fn = ShowVersion, .a = {"#version"}},
|
||||
Cmd{.cmd = "waypoints", .u = "waypoints", .fn = ShowWaypoints, .a = {"#wpinfo"}},
|
||||
Cmd{.cmd = "who", .u = "who [Search Criteria] (Search criteria is optional)", .fn = ShowWho, .a = {"#who"}},
|
||||
Cmd{.cmd = "xtargets", .u = "xtargets [Amount] (Amount is optional)", .fn = ShowXTargets, .a = {"#xtargets"}},
|
||||
Cmd{.cmd = "zone_data", .u = "zone_data", .fn = ShowZoneData, .a = {"#zstats"}},
|
||||
Cmd{.cmd = "zone_global_loot", .u = "zone_global_loot", .fn = ShowZoneGlobalLoot, .a = {"#showzonegloballoot"}},
|
||||
Cmd{.cmd = "zone_loot", .u = "zone_loot", .fn = ShowZoneLoot, .a = {"#viewzoneloot"}},
|
||||
Cmd{.cmd = "zone_points", .u = "zone_points", .fn = ShowZonePoints, .a = {"#showzonepoints"}},
|
||||
Cmd{.cmd = "zone_status", .u = "zone_status", .fn = ShowZoneStatus, .a = {"#zonestatus"}},
|
||||
};
|
||||
|
||||
// Check for arguments
|
||||
const auto arguments = sep->argnum;
|
||||
|
||||
// look for alias or command
|
||||
for (const auto &cmd: commands) {
|
||||
// Check for alias first
|
||||
for (const auto &alias: cmd.a) {
|
||||
if (!alias.empty() && Strings::EqualFold(alias, sep->arg[0])) {
|
||||
// build string from sep args
|
||||
std::vector<std::string> args = {};
|
||||
|
||||
// skip the first arg
|
||||
for (auto i = 1; i <= arguments; i++) {
|
||||
args.emplace_back(sep->arg[i]);
|
||||
}
|
||||
|
||||
// build the rewrite string
|
||||
const std::string& rewrite = fmt::format("#show {} {}", cmd.cmd, Strings::Join(args, " "));
|
||||
|
||||
// rewrite to #show <sub-command <args>
|
||||
c->SendGMCommand(rewrite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for command
|
||||
if (cmd.cmd == Strings::ToLower(sep->arg[1])) {
|
||||
cmd.fn(c, sep);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Command not found
|
||||
c->Message(Chat::White, "Command not found. Usage: #show [command]");
|
||||
for (const auto &cmd: commands) {
|
||||
c->Message(Chat::White, fmt::format("Usage: #show {}", cmd.u).c_str());
|
||||
}
|
||||
}
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowAggro(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Usage: #show aggro [Distance] [-v] (-v is verbose Faction Information)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
const float distance = Strings::ToFloat(sep->arg[2]);
|
||||
const bool is_verbose = Strings::EqualFold(sep->arg[3], "-v");
|
||||
|
||||
entity_list.DescribeAggro(c, t, distance, is_verbose);
|
||||
}
|
||||
Executable → Regular
+2
-3
@@ -1,6 +1,6 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_showbuffs(Client *c, const Seperator *sep)
|
||||
void ShowBuffs(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
@@ -9,4 +9,3 @@ void command_showbuffs(Client *c, const Seperator *sep)
|
||||
|
||||
t->ShowBuffs(c);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "../../client.h"
|
||||
#include "../../corpse.h"
|
||||
|
||||
void ShowBuriedCorpseCount(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const uint32 corpse_count = database.GetCharacterBuriedCorpseCount(t->CharacterID());
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} buried corpse{}.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "have" : "has",
|
||||
corpse_count,
|
||||
corpse_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "../../client.h"
|
||||
#include "../../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void ShowClientVersionSummary(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
|
||||
|
||||
auto s = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
|
||||
strn0cpy(s->Name, c->GetName(), sizeof(s->Name));
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowCurrencies(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const uint32 platinum = (
|
||||
t->GetMoney(3, 0) +
|
||||
t->GetMoney(3, 1) +
|
||||
t->GetMoney(3, 2) +
|
||||
t->GetMoney(3, 3)
|
||||
);
|
||||
|
||||
const uint32 gold = (
|
||||
t->GetMoney(2, 0) +
|
||||
t->GetMoney(2, 1) +
|
||||
t->GetMoney(2, 2)
|
||||
);
|
||||
|
||||
const uint32 silver = (
|
||||
t->GetMoney(1, 0) +
|
||||
t->GetMoney(1, 1) +
|
||||
t->GetMoney(1, 2)
|
||||
);
|
||||
|
||||
const uint32 copper = (
|
||||
t->GetMoney(0, 0) +
|
||||
t->GetMoney(0, 1) +
|
||||
t->GetMoney(0, 2)
|
||||
);
|
||||
|
||||
std::string currency_table;
|
||||
|
||||
bool has_currency = false;
|
||||
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Currency") +
|
||||
DialogueWindow::TableCell("Amount")
|
||||
);
|
||||
|
||||
if (
|
||||
platinum ||
|
||||
gold ||
|
||||
silver ||
|
||||
copper
|
||||
) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Money") +
|
||||
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
const uint32 ebon_crystals = t->GetEbonCrystals();
|
||||
if (ebon_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Ebon Crystals") +
|
||||
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
const uint32 radiant_crystals = t->GetRadiantCrystals();
|
||||
if (radiant_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Radiant Crystals") +
|
||||
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
for (const auto& a : zone->AlternateCurrencies) {
|
||||
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
||||
if (currency_value) {
|
||||
const auto* d = database.GetItem(a.item_id);
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(d->Name) +
|
||||
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
|
||||
const uint32 ldon_currency_value = t->GetLDoNPointsTheme(l.first);
|
||||
if (ldon_currency_value) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(l.second) +
|
||||
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32 pvp_points = t->GetPVPPoints();
|
||||
if (pvp_points) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("PVP Points") +
|
||||
DialogueWindow::TableCell(Strings::Commify(pvp_points))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
currency_table = DialogueWindow::Table(currency_table);
|
||||
|
||||
if (!has_currency) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not have any currencies.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does"
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Currency for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
currency_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowDistance(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || c->GetTarget() == c) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget();
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} is {:.2f} units from you.",
|
||||
c->GetTargetDescription(t),
|
||||
Distance(
|
||||
c->GetPosition(),
|
||||
t->GetPosition()
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+9
-24
@@ -1,29 +1,27 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_emoteview(Client *c, const Seperator *sep)
|
||||
void ShowEmotes(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to view their emotes.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
auto emote_count = 0;
|
||||
auto emote_id = target->GetEmoteID();
|
||||
|
||||
auto emote_number = 1;
|
||||
uint32 emote_count = 0;
|
||||
const uint32 emote_id = t->GetEmoteID();
|
||||
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
auto &e = iterator.GetData();
|
||||
const auto& e = iterator.GetData();
|
||||
if (emote_id == e->emoteid) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
emote_number,
|
||||
e->emoteid,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
@@ -35,35 +33,22 @@ void command_emoteview(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
emote_number,
|
||||
e->emoteid,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
emote_count++;
|
||||
emote_number++;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (!emote_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} has no emotes on Emote ID {}.",
|
||||
c->GetTargetDescription(target),
|
||||
emote_id
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} has {} emote{} on Emote ID {}.",
|
||||
c->GetTargetDescription(target),
|
||||
c->GetTargetDescription(t),
|
||||
emote_count,
|
||||
emote_count != 1 ? "s" : "",
|
||||
emote_id
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowFieldOfView(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || c->GetTarget() == c) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget();
|
||||
|
||||
const bool is_behind = c->BehindMob(t, c->GetX(), c->GetY());
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You are {}behind {}, they have a heading of {}.",
|
||||
is_behind ? "" : "not ",
|
||||
c->GetTargetDescription(t),
|
||||
t->GetHeading()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowFlags(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
t->SendZoneFlagInfo(c);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
#include "../../groups.h"
|
||||
|
||||
void ShowGroupInfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
auto g = t->GetGroup();
|
||||
if (!g) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not in a group.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "are" : "is"
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Group ID") +
|
||||
DialogueWindow::TableCell(Strings::Commify(g->GetID()))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Members") +
|
||||
DialogueWindow::TableCell(std::to_string(g->GroupCount()))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Index") +
|
||||
DialogueWindow::TableCell("Name") +
|
||||
DialogueWindow::TableCell("In Zone") +
|
||||
DialogueWindow::TableCell("Assist") +
|
||||
DialogueWindow::TableCell("Puller") +
|
||||
DialogueWindow::TableCell("Tank")
|
||||
);
|
||||
|
||||
const std::string yes = DialogueWindow::ColorMessage("forest_green", "Y");
|
||||
const std::string no = DialogueWindow::ColorMessage("red1", "N");
|
||||
|
||||
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
|
||||
if (g->membername[group_member][0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool is_assist = g->MemberRoles[group_member] & RoleAssist;
|
||||
const bool is_puller = g->MemberRoles[group_member] & RolePuller;
|
||||
const bool is_tank = g->MemberRoles[group_member] & RoleTank;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}{}{}{}{}",
|
||||
group_member,
|
||||
(
|
||||
strcmp(g->membername[group_member], c->GetCleanName()) ?
|
||||
g->membername[group_member] :
|
||||
fmt::format(
|
||||
"{} (You)",
|
||||
g->membername[group_member]
|
||||
)
|
||||
),
|
||||
g->members[group_member] ? yes : no,
|
||||
is_assist ? yes : no,
|
||||
is_puller ? yes : no,
|
||||
is_tank ? yes : no
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Group Info for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+4
-4
@@ -1,13 +1,13 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_hatelist(Client *c, const Seperator *sep)
|
||||
void ShowHateList(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
const auto t = c->GetTarget();
|
||||
|
||||
target->PrintHateListToClient(c);
|
||||
t->PrintHateListToClient(c);
|
||||
}
|
||||
Executable → Regular
+34
-34
@@ -1,11 +1,11 @@
|
||||
#include "../client.h"
|
||||
#include "../object.h"
|
||||
#include "../../client.h"
|
||||
#include "../../object.h"
|
||||
|
||||
void command_peekinv(Client *c, const Seperator *sep)
|
||||
void ShowInventory(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
SendPeekInvSubCommands(c);
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2) {
|
||||
SendShowInventorySubCommands(c);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,19 +50,19 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
|
||||
int scope_mask = peekNone;
|
||||
|
||||
const bool is_all = !strcasecmp(sep->arg[1], "all");
|
||||
const bool is_all_bank = !strcasecmp(sep->arg[1], "allbank");
|
||||
const bool is_bank = !strcasecmp(sep->arg[1], "bank");
|
||||
const bool is_cursor = !strcasecmp(sep->arg[1], "cursor");
|
||||
const bool is_cursor_limbo = !strcasecmp(sep->arg[1], "curlimbo");
|
||||
const bool is_equipment = !strcasecmp(sep->arg[1], "equip");
|
||||
const bool is_general = !strcasecmp(sep->arg[1], "gen");
|
||||
const bool is_limbo = !strcasecmp(sep->arg[1], "limbo");
|
||||
const bool is_possessions = !strcasecmp(sep->arg[1], "poss");
|
||||
const bool is_shared_bank = !strcasecmp(sep->arg[1], "shbank");
|
||||
const bool is_trade = !strcasecmp(sep->arg[1], "trade");
|
||||
const bool is_tribute = !strcasecmp(sep->arg[1], "trib");
|
||||
const bool is_world = !strcasecmp(sep->arg[1], "world");
|
||||
const bool is_all = !strcasecmp(sep->arg[2], "all");
|
||||
const bool is_all_bank = !strcasecmp(sep->arg[2], "allbank");
|
||||
const bool is_bank = !strcasecmp(sep->arg[2], "bank");
|
||||
const bool is_cursor = !strcasecmp(sep->arg[2], "cursor");
|
||||
const bool is_cursor_limbo = !strcasecmp(sep->arg[2], "curlimbo");
|
||||
const bool is_equipment = !strcasecmp(sep->arg[2], "equip");
|
||||
const bool is_general = !strcasecmp(sep->arg[2], "gen");
|
||||
const bool is_limbo = !strcasecmp(sep->arg[2], "limbo");
|
||||
const bool is_possessions = !strcasecmp(sep->arg[2], "poss");
|
||||
const bool is_shared_bank = !strcasecmp(sep->arg[2], "shbank");
|
||||
const bool is_trade = !strcasecmp(sep->arg[2], "trade");
|
||||
const bool is_tribute = !strcasecmp(sep->arg[2], "trib");
|
||||
const bool is_world = !strcasecmp(sep->arg[2], "world");
|
||||
|
||||
if (is_all) {
|
||||
scope_mask = (peekOutOfScope - 1);
|
||||
@@ -91,7 +91,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
} else if (is_world) {
|
||||
scope_mask |= peekWorld;
|
||||
} else {
|
||||
SendPeekInvSubCommands(c);
|
||||
SendShowInventorySubCommands(c);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -433,18 +433,18 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
void SendPeekInvSubCommands(Client* c) {
|
||||
c->Message(Chat::White, "Usage: #peekinv equip - Shows items in Equipment slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv gen - Shows items in General slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv cursor - Shows items in Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv poss - Shows items in Equipment, General, and Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv limbo - Shows items in Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv curlim - Shows items in Cursor and Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv trib - Shows items in Tribute slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv bank - Shows items in Bank slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv shbank - Shows items in Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv allbank - Shows items in Bank and Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv trade - Shows items in Trade slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv world - Shows items in World slots");
|
||||
c->Message(Chat::White, "Usage: #peekinv all - Shows items in all slots");
|
||||
void SendShowInventorySubCommands(Client* c) {
|
||||
c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
|
||||
c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "../../client.h"
|
||||
#include "../../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void ShowIPLookup(Client *c, const Seperator *sep)
|
||||
{
|
||||
const uint32 ip_length = strlen(sep->argplus[2]);
|
||||
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_IPLookup,
|
||||
sizeof(ServerGenericWorldQuery_Struct) + ip_length + 1
|
||||
);
|
||||
|
||||
auto s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
|
||||
strn0cpy(s->from, c->GetName(), sizeof(s->from));
|
||||
s->admin = c->Admin();
|
||||
|
||||
if (ip_length) {
|
||||
strcpy(s->query, sep->argplus[2]);
|
||||
}
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowLineOfSight(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || c->GetTarget() == c) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget();
|
||||
|
||||
const bool has_los = c->CheckLosFN(t);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You {}have line of sight to {}.",
|
||||
has_los ? "" : "do not ",
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowNetwork(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto eqsi = c->Connection();
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Option") +
|
||||
DialogueWindow::TableCell("Value")
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Max Packet Size") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_packet_size))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Max Connection Count") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_connection_count))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Keep Alive Delay") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.keepalive_delay_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resend Delay Factor") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
opts.daybreak_options.resend_delay_factor
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resend Delay") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resend Delay Minimum") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_min))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resend Delay Maximum") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_max))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Connect Delay") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_delay_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Connect Stale") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_stale_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Stale Connection") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.stale_connection_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("CRC Length") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.crc_length))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Hold Size") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.hold_size))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Hold Length") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.hold_length_ms))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Simulated In Packet Loss") +
|
||||
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_in_packet_loss))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Simulated Out Packet Loss") +
|
||||
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_out_packet_loss))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Tic Rate (Hz)") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
opts.daybreak_options.tic_rate_hertz
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resend Timeout") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_timeout))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Connection Close Time") +
|
||||
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connection_close_time))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Encode Passes (1)") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[0]))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Encode Passes (2)") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[1]))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Port") +
|
||||
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.port))
|
||||
);
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Network Information",
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowNetworkStats(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto connection = c->Connection();
|
||||
const auto opts = connection->GetManager()->GetOptions();
|
||||
const auto eqs_stats = connection->GetStats();
|
||||
|
||||
const auto& stats = eqs_stats.DaybreakStats;
|
||||
|
||||
const auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
|
||||
EQ::Net::Clock::now() - stats.created
|
||||
).count();
|
||||
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sent Bytes") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.sent_bytes),
|
||||
stats.sent_bytes / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Received Bytes") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.recv_bytes),
|
||||
stats.recv_bytes / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sent Bytes Before Encode") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.bytes_before_encode)) +
|
||||
DialogueWindow::TableCell("Compression Rate") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%%",
|
||||
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) /
|
||||
static_cast<double>(stats.bytes_before_encode) * 100.0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sent Bytes After Encode") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.bytes_after_decode)) +
|
||||
DialogueWindow::TableCell("Compression Rate") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%%",
|
||||
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) /
|
||||
static_cast<double>(stats.bytes_after_decode) * 100.0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Minimum Ping") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.min_ping))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Maximum Ping") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.max_ping))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Last Ping") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.last_ping))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Average Ping") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.avg_ping))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Real Time Received Packets") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.recv_packets),
|
||||
stats.recv_packets / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Real Time Sent Packets") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.sent_packets),
|
||||
stats.sent_packets / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sync Received Packets") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.sync_recv_packets))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sync Sent Packets") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.sync_sent_packets))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sync Remote Received Packets") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.sync_remote_recv_packets))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sync Remote Sent Packets") +
|
||||
DialogueWindow::TableCell(Strings::Commify(stats.sync_remote_sent_packets))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Packet Loss In") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%%",
|
||||
(
|
||||
100.0 *
|
||||
(
|
||||
1.0 -
|
||||
static_cast<double>(stats.sync_recv_packets) /
|
||||
static_cast<double>(stats.sync_remote_sent_packets)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Packet Loss Out") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%%",
|
||||
(
|
||||
100.0 *
|
||||
(
|
||||
1.0 -
|
||||
static_cast<double>(stats.sync_remote_recv_packets) /
|
||||
static_cast<double>(stats.sync_sent_packets)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resent Packets") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.resent_packets),
|
||||
stats.resent_packets / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resent Fragments") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.resent_fragments),
|
||||
stats.resent_fragments / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Resent Non-Fragments") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.resent_full),
|
||||
stats.resent_full / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Dropped Datarate Packets") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(stats.dropped_datarate_packets),
|
||||
stats.dropped_datarate_packets / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Outgoing Link Saturation") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%% ({:.2f}kb Per Second)",
|
||||
(
|
||||
100.0 *
|
||||
(
|
||||
1.0 -
|
||||
(
|
||||
(
|
||||
opts.daybreak_options.outgoing_data_rate -
|
||||
stats.datarate_remaining
|
||||
) /
|
||||
opts.daybreak_options.outgoing_data_rate
|
||||
)
|
||||
)
|
||||
),
|
||||
opts.daybreak_options.outgoing_data_rate
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_table += DialogueWindow::Break(2);
|
||||
|
||||
std::string sent_rows;
|
||||
|
||||
for (int i = 0; i < _maxEmuOpcode; ++i) {
|
||||
const int count = eqs_stats.SentCount[i];
|
||||
if (count) {
|
||||
sent_rows += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(OpcodeNames[i]) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(count),
|
||||
count / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
std::string recv_rows;
|
||||
|
||||
for (int i = 0; i < _maxEmuOpcode; ++i) {
|
||||
const int count = eqs_stats.RecvCount[i];
|
||||
if (count) {
|
||||
recv_rows += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(OpcodeNames[i]) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f} Per Second)",
|
||||
Strings::Commify(count),
|
||||
count / sec_since_stats_reset
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_table += DialogueWindow::TableRow(DialogueWindow::TableCell("Sent Packet Types"));
|
||||
|
||||
popup_table += sent_rows;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(DialogueWindow::TableCell("Received Packet Types"));
|
||||
|
||||
popup_table += recv_rows;
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Network Statistics",
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+2
-3
@@ -1,6 +1,6 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_shownpcgloballoot(Client *c, const Seperator *sep)
|
||||
void ShowNPCGlobalLoot(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
@@ -11,4 +11,3 @@ void command_shownpcgloballoot(Client *c, const Seperator *sep)
|
||||
|
||||
zone->ShowNPCGlobalLoot(c, t);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowNPCStats(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
// Stats
|
||||
t->ShowStats(c);
|
||||
|
||||
// Loot Data
|
||||
t->QueryLoot(c);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowNPCType(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Usage: #show npc_type [NPC ID]");
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 npc_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const auto d = content_db.LoadNPCTypesData(npc_id);
|
||||
|
||||
if (!d) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"NPC ID {} was not found.",
|
||||
npc_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
auto npc = new NPC(
|
||||
d,
|
||||
nullptr,
|
||||
c->GetPosition(),
|
||||
GravityBehavior::Water
|
||||
);
|
||||
|
||||
npc->ShowStats(c);
|
||||
|
||||
safe_delete(npc);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowPEQZoneFlags(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
t->SendPEQZoneFlagInfo(c);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/repositories/petitions_repository.h"
|
||||
|
||||
void ShowPetition(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(2)) {
|
||||
const auto& l = PetitionsRepository::All(database);
|
||||
|
||||
uint32 found_count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition {} | Name: {} Text: {}",
|
||||
e.petid,
|
||||
e.charname,
|
||||
e.petitiontext
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(Chat::White, "50 Petitions found, max reached.");
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Petition{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 petition_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
const auto& l = PetitionsRepository::GetWhere(database, fmt::format("petition_id = {}", petition_id));
|
||||
if (l.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition ID {} was not found.",
|
||||
petition_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition {} | Name: {} Text: {}",
|
||||
l[0].petid,
|
||||
l[0].charname,
|
||||
l[0].petitiontext
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/repositories/petitions_repository.h"
|
||||
|
||||
void ShowPetitionInfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(2)) {
|
||||
const auto& l = PetitionsRepository::All(database);
|
||||
|
||||
uint32 found_count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition {} | Name: {} Text: {} Account: {} Zone: {} Class: {} Race: {} Level: {}",
|
||||
e.petid,
|
||||
e.charname,
|
||||
e.petitiontext,
|
||||
e.accountname,
|
||||
e.zone,
|
||||
GetClassIDName(static_cast<uint8>(e.charclass)),
|
||||
GetRaceIDName(static_cast<uint16>(e.charrace)),
|
||||
e.charlevel
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(Chat::White, "50 Petitions found, max reached.");
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Petition{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 petition_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
const auto& l = PetitionsRepository::GetWhere(database, fmt::format("petition_id = {}", petition_id));
|
||||
if (l.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition ID {} was not found.",
|
||||
petition_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Petition {} | Name: {} Text: {} Account: {} Zone: {} Class: {} Race: {} Level: {}",
|
||||
l[0].petid,
|
||||
l[0].charname,
|
||||
l[0].petitiontext,
|
||||
l[0].accountname,
|
||||
l[0].zone,
|
||||
GetClassIDName(static_cast<uint8>(l[0].charclass)),
|
||||
GetRaceIDName(static_cast<uint16>(l[0].charrace)),
|
||||
l[0].charlevel
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowProximity(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& n : entity_list.GetNPCList()) {
|
||||
if (
|
||||
n.second &&
|
||||
Strings::Contains(n.second->GetName(), "Proximity")
|
||||
) {
|
||||
n.second->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
std::vector<FindPerson_Point> v;
|
||||
|
||||
FindPerson_Point p {};
|
||||
|
||||
if (t->IsProximitySet()) {
|
||||
glm::vec4 position;
|
||||
position.w = t->GetHeading();
|
||||
position.x = t->GetProximityMinX();
|
||||
position.y = t->GetProximityMinY();
|
||||
position.z = t->GetZ();
|
||||
|
||||
position.x = t->GetProximityMinX();
|
||||
position.y = t->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = t->GetProximityMinX();
|
||||
position.y = t->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = t->GetProximityMaxX();
|
||||
position.y = t->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = t->GetProximityMaxX();
|
||||
position.y = t->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
p.x = t->GetProximityMinX();
|
||||
p.y = t->GetProximityMinY();
|
||||
p.z = t->GetZ();
|
||||
v.push_back(p);
|
||||
|
||||
p.x = t->GetProximityMinX();
|
||||
p.y = t->GetProximityMaxY();
|
||||
v.push_back(p);
|
||||
|
||||
p.x = t->GetProximityMaxX();
|
||||
p.y = t->GetProximityMaxY();
|
||||
v.push_back(p);
|
||||
|
||||
p.x = t->GetProximityMaxX();
|
||||
p.y = t->GetProximityMinY();
|
||||
v.push_back(p);
|
||||
|
||||
p.x = t->GetProximityMinX();
|
||||
p.y = t->GetProximityMinY();
|
||||
v.push_back(p);
|
||||
}
|
||||
|
||||
if (c->ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
||||
c->SendPathPacket(v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "../../client.h"
|
||||
#include "../../quest_parser_collection.h"
|
||||
|
||||
void ShowQuestErrors(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::list<std::string> l;
|
||||
parse->GetErrors(l);
|
||||
|
||||
if (!l.size()) {
|
||||
c->Message(Chat::White, "There are no Quest errors currently.");
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "Quest errors currently are as follows:");
|
||||
|
||||
uint32 error_count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
if (error_count >= RuleI(World, MaximumQuestErrors)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maximum of {} error{} shown.",
|
||||
RuleI(World, MaximumQuestErrors),
|
||||
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, e.c_str());
|
||||
|
||||
error_count++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowQuestGlobals(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
t = c->GetTarget();
|
||||
}
|
||||
|
||||
QGlobalCache* char_cache = c->GetQGlobals();
|
||||
QGlobalCache* npc_cache = t->IsNPC() ? t->CastToNPC()->GetQGlobals() : nullptr;
|
||||
QGlobalCache* zone_cache = zone->GetQGlobals();
|
||||
|
||||
std::list<QGlobal> global_map;
|
||||
|
||||
uint32 character_id = c->CharacterID();
|
||||
uint32 npc_id = t->IsNPC() ? t->CastToNPC()->GetNPCTypeID() : 0;
|
||||
uint32 zone_id = zone->GetZoneID();
|
||||
|
||||
if (npc_cache) {
|
||||
QGlobalCache::Combine(
|
||||
global_map,
|
||||
npc_cache->GetBucket(),
|
||||
npc_id,
|
||||
character_id,
|
||||
zone_id
|
||||
);
|
||||
}
|
||||
|
||||
if (char_cache) {
|
||||
QGlobalCache::Combine(
|
||||
global_map,
|
||||
char_cache->GetBucket(),
|
||||
npc_id,
|
||||
character_id,
|
||||
zone_id
|
||||
);
|
||||
}
|
||||
|
||||
if (zone_cache) {
|
||||
QGlobalCache::Combine(
|
||||
global_map,
|
||||
zone_cache->GetBucket(),
|
||||
npc_id,
|
||||
character_id,
|
||||
zone_id
|
||||
);
|
||||
}
|
||||
|
||||
uint32 global_count = 0;
|
||||
uint32 global_number = 1;
|
||||
|
||||
for (const auto& g : global_map) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Quest Global {} | Name: {} Value: {}",
|
||||
global_number,
|
||||
g.name,
|
||||
g.value
|
||||
).c_str()
|
||||
);
|
||||
|
||||
global_count++;
|
||||
global_number++;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Quest Global{} found.",
|
||||
global_count,
|
||||
global_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+31
-17
@@ -1,32 +1,33 @@
|
||||
#include "../client.h"
|
||||
#include "../command.h"
|
||||
#include "../../client.h"
|
||||
#include "../../command.h"
|
||||
#include "../../common/repositories/tradeskill_recipe_repository.h"
|
||||
#include "../../common/repositories/tradeskill_recipe_entries_repository.h"
|
||||
|
||||
void command_viewrecipe(Client *c, const Seperator *sep)
|
||||
void ShowRecipe(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Command Syntax: #viewrecipe [Recipe ID]");
|
||||
if (!sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Command Syntax: #show recipe [Recipe ID]");
|
||||
return;
|
||||
}
|
||||
|
||||
auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
auto re = TradeskillRecipeEntriesRepository::GetWhere(
|
||||
const uint16 recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||
|
||||
const auto& re = TradeskillRecipeEntriesRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("recipe_id = {} ORDER BY id ASC", recipe_id)
|
||||
);
|
||||
auto r = TradeskillRecipeRepository::GetWhere(
|
||||
|
||||
const auto& r = TradeskillRecipeRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("id = {}", recipe_id)
|
||||
);
|
||||
|
||||
if (re.empty() || r.empty() || !re[0].id || !r[0].id) {
|
||||
if (re.empty() || r.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe ID {} has no entries or could not be found.",
|
||||
Strings::Commify(std::to_string(recipe_id))
|
||||
Strings::Commify(recipe_id)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
@@ -36,13 +37,13 @@ void command_viewrecipe(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe {} | {}",
|
||||
Strings::Commify(std::to_string(recipe_id)),
|
||||
Strings::Commify(recipe_id),
|
||||
r[0].name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
auto entry_number = 1;
|
||||
bool can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
|
||||
uint32 entry_number = 1;
|
||||
const bool can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
|
||||
|
||||
for (const auto& e : re) {
|
||||
c->Message(
|
||||
@@ -51,8 +52,22 @@ void command_viewrecipe(Client *c, const Seperator *sep)
|
||||
"Entry {}{} | {}{}",
|
||||
entry_number,
|
||||
e.iscontainer > 0 ? " (Container)" : "",
|
||||
e.item_id > 1000 ? database.CreateItemLink(e.item_id) : EQ::constants::GetObjectTypeName(e.item_id),
|
||||
can_summon_items && e.item_id > 1000 ? fmt::format(" | {}", Saylink::Silent(fmt::format("#si {}", e.item_id), "Summon")) : ""
|
||||
(
|
||||
e.item_id > 1000 ?
|
||||
database.CreateItemLink(e.item_id) :
|
||||
EQ::constants::GetObjectTypeName(e.item_id)
|
||||
),
|
||||
(
|
||||
can_summon_items && e.item_id > 1000 ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format("#si {}", e.item_id),
|
||||
"Summon"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
@@ -117,4 +132,3 @@ void command_viewrecipe(Client *c, const Seperator *sep)
|
||||
entry_number++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
#include "../../common/serverinfo.h"
|
||||
|
||||
void ShowServerInfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto os = EQ::GetOS();
|
||||
auto cpus = EQ::GetCPUs();
|
||||
const uint32 process_id = EQ::GetPID();
|
||||
const double rss = EQ::GetRSS() / 1048576.0;
|
||||
const uint32 uptime = static_cast<uint32>(EQ::GetUptime());
|
||||
|
||||
std::string popup_table;
|
||||
|
||||
std::string popup_text;
|
||||
|
||||
popup_text += DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "Operating System Information")
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Machine") +
|
||||
DialogueWindow::TableCell(os.machine)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("System") +
|
||||
DialogueWindow::TableCell(os.sysname)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Release") +
|
||||
DialogueWindow::TableCell(os.release)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Uptime") +
|
||||
DialogueWindow::TableCell(Strings::SecondsToTime(uptime))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Version") +
|
||||
DialogueWindow::TableCell(os.version)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::Table(popup_table);
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text += DialogueWindow::Break();
|
||||
|
||||
popup_text += DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
);
|
||||
|
||||
for (size_t cpu = 0; cpu < cpus.size(); ++cpu) {
|
||||
auto ¤t_cpu = cpus[cpu];
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"CPU {}",
|
||||
cpu
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f}GHz)",
|
||||
current_cpu.model,
|
||||
current_cpu.speed
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text += DialogueWindow::Table(popup_table);
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text += DialogueWindow::Break();
|
||||
|
||||
popup_text += DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Process ID") +
|
||||
DialogueWindow::TableCell(Strings::Commify(process_id))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("RSS") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f} MB",
|
||||
rss
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text += DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Server Information",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowSkills(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("ID") +
|
||||
DialogueWindow::TableCell("Name") +
|
||||
DialogueWindow::TableCell("Current") +
|
||||
DialogueWindow::TableCell("Max") +
|
||||
DialogueWindow::TableCell("Raw")
|
||||
);
|
||||
|
||||
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
|
||||
if (t->CanHaveSkill(s.first) && t->MaxSkill(s.first)) {
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(std::to_string(s.first)) +
|
||||
DialogueWindow::TableCell(s.second) +
|
||||
DialogueWindow::TableCell(std::to_string(t->GetSkill(s.first))) +
|
||||
DialogueWindow::TableCell(std::to_string(t->MaxSkill(s.first))) +
|
||||
DialogueWindow::TableCell(std::to_string(t->GetRawSkill(s.first)))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Skills for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowSpawnStatus(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2) {
|
||||
c->Message(Chat::White, "Usage: #show spawn_status all - Show all spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status disabled - Show all disabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status enabled - Show all enabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status [Spawn ID] - Show spawn status by ID for your current zone");
|
||||
return;
|
||||
}
|
||||
|
||||
const bool is_all = !strcasecmp(sep->arg[2], "all");
|
||||
const bool is_disabled = !strcasecmp(sep->arg[2], "disabled");
|
||||
const bool is_enabled = !strcasecmp(sep->arg[2], "enabled");
|
||||
const bool is_search = sep->IsNumber(2);
|
||||
|
||||
if (
|
||||
!is_all &&
|
||||
!is_disabled &&
|
||||
!is_enabled &&
|
||||
!is_search
|
||||
) {
|
||||
c->Message(Chat::White, "Usage: #show spawn_status all - Show all spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status disabled - Show all disabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status enabled - Show all enabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #show spawn_status [Spawn ID] - Show spawn status by ID for your current zone");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string filter_type;
|
||||
if (is_disabled) {
|
||||
filter_type = "Disabled";
|
||||
} else if (is_enabled) {
|
||||
filter_type = "Enabled";
|
||||
}
|
||||
|
||||
const uint32 spawn_id = (
|
||||
is_search ?
|
||||
Strings::ToUnsignedInt(sep->arg[2]) :
|
||||
0
|
||||
);
|
||||
|
||||
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
|
||||
uint32 filtered_count = 0;
|
||||
uint32 spawn_count = 0;
|
||||
uint32 spawn_number = 1;
|
||||
|
||||
while (iterator.MoreElements()) {
|
||||
const auto& e = iterator.GetData();
|
||||
|
||||
const uint32 time_remaining = e->GetTimer().GetRemainingTime();
|
||||
|
||||
if (
|
||||
is_all ||
|
||||
(
|
||||
is_disabled &&
|
||||
time_remaining == UINT32_MAX
|
||||
) ||
|
||||
(
|
||||
is_enabled &&
|
||||
time_remaining != UINT32_MAX
|
||||
) ||
|
||||
(
|
||||
is_search &&
|
||||
e->GetID() == spawn_id
|
||||
)
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spawn {} | ID: {} Coordinates: {:.2f}, {:.2f}, {:.2f}, {:.2f}",
|
||||
spawn_number,
|
||||
e->GetID(),
|
||||
e->GetX(),
|
||||
e->GetY(),
|
||||
e->GetZ(),
|
||||
e->GetHeading()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (time_remaining != UINT32_MAX) {
|
||||
const uint32 seconds_remaining = (time_remaining / 1000);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spawn {} | Respawn: {}",
|
||||
spawn_number,
|
||||
Strings::SecondsToTime(seconds_remaining)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
filtered_count++;
|
||||
spawn_number++;
|
||||
}
|
||||
|
||||
spawn_count++;
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (!spawn_count) {
|
||||
c->Message(Chat::White, "No spawns were found.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
(is_disabled || is_enabled) &&
|
||||
!filtered_count
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No {} spawns were found.",
|
||||
filter_type
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_all) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Spawn{} found.",
|
||||
spawn_count,
|
||||
spawn_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} of {} spawn{} found.",
|
||||
filtered_count,
|
||||
spawn_count,
|
||||
spawn_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowSpells(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const auto is_disciplines = !strcasecmp(sep->arg[2], "disciplines");
|
||||
const auto is_spells = !strcasecmp(sep->arg[2], "spells");
|
||||
if (
|
||||
!is_disciplines &&
|
||||
!is_spells
|
||||
) {
|
||||
c->Message(Chat::White, "Usages: #show spells disciplines - Show your or your target's learned disciplines");
|
||||
c->Message(Chat::White, "Usages: #show spells spells - Show your or your target's memorized spells");
|
||||
return;
|
||||
}
|
||||
|
||||
ShowSpellType show_spell_type;
|
||||
|
||||
if (is_disciplines) {
|
||||
show_spell_type = ShowSpellType::Disciplines;
|
||||
} else if (is_spells) {
|
||||
show_spell_type = ShowSpellType::Spells;
|
||||
}
|
||||
|
||||
t->ShowSpells(c, show_spell_type);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowSpellsList(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
t->AISpellsList(c);
|
||||
}
|
||||
Executable → Regular
+2
-3
@@ -1,6 +1,6 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_showstats(Client *c, const Seperator *sep)
|
||||
void ShowStats(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
@@ -9,4 +9,3 @@ void command_showstats(Client *c, const Seperator *sep)
|
||||
|
||||
t->ShowStats(c);
|
||||
}
|
||||
|
||||
Executable → Regular
+14
-10
@@ -1,7 +1,7 @@
|
||||
#include "../client.h"
|
||||
#include "../dialogue_window.h"
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void command_timers(Client *c, const Seperator *sep)
|
||||
void ShowTimers(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
@@ -23,26 +23,30 @@ void command_timers(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
auto m = DialogueWindow::TableRow(
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Timer ID") +
|
||||
DialogueWindow::TableCell("Remaining Time")
|
||||
);
|
||||
|
||||
for (const auto& e : l) {
|
||||
auto r = e.second->GetRemainingTime();
|
||||
if (r) {
|
||||
m += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(std::to_string(e.first)) +
|
||||
DialogueWindow::TableCell(Strings::SecondsToTime(r))
|
||||
const uint32 remaining_time = e.second->GetRemainingTime();
|
||||
if (remaining_time) {
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(Strings::Commify(e.first)) +
|
||||
DialogueWindow::TableCell(Strings::SecondsToTime(remaining_time))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Recast Timers for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
DialogueWindow::Table(m).c_str()
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowTraps(Client *c, const Seperator *sep)
|
||||
{
|
||||
entity_list.GetTrapInfo(c);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "../../client.h"
|
||||
#include "../../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void ShowUptime(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
|
||||
|
||||
auto s = (ServerUptime_Struct *) pack->pBuffer;
|
||||
strn0cpy(s->adminname, c->GetName(), sizeof(s->adminname));
|
||||
|
||||
if (sep->IsNumber(2) && Strings::ToUnsignedInt(sep->arg[2]) > 0) {
|
||||
s->zoneserverid = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
}
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowVariable(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2) {
|
||||
c->Message(Chat::White, "Usage: #show variable [Variable Name]");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string& variable = sep->argplus[2];
|
||||
|
||||
std::string value;
|
||||
if (!database.GetVariable(variable, value)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Variable '{}' was not found.",
|
||||
variable
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Variable {} | {}",
|
||||
variable,
|
||||
value
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowVersion(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Version") +
|
||||
DialogueWindow::TableCell(CURRENT_VERSION)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Compiled") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} {}",
|
||||
COMPILE_DATE,
|
||||
COMPILE_TIME
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Last Modified") +
|
||||
DialogueWindow::TableCell(LAST_MODIFIED)
|
||||
);
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Server Version",
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+7
-7
@@ -1,25 +1,25 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_wpinfo(Client *c, const Seperator *sep)
|
||||
void ShowWaypoints(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
if (!target->GetGrid()) {
|
||||
if (!t->GetGrid()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} is not a part of any grid.",
|
||||
c->GetTargetDescription(target)
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
target->DisplayWaypointInfo(c);
|
||||
t->DisplayWaypointInfo(c);
|
||||
}
|
||||
|
||||
Executable
+235
@@ -0,0 +1,235 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowWho(Client *c, const Seperator *sep)
|
||||
{
|
||||
const std::string& query = SQL(
|
||||
SELECT
|
||||
character_data.name,
|
||||
character_data.zone_id,
|
||||
character_data.zone_instance,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT guilds.name FROM guilds WHERE id = (
|
||||
(
|
||||
SELECT guild_id FROM guild_members WHERE char_id = character_data.id
|
||||
)
|
||||
)
|
||||
),
|
||||
""
|
||||
) AS guild_name,
|
||||
character_data.level,
|
||||
character_data.race,
|
||||
character_data.class,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account.status FROM account WHERE account.id = character_data.account_id LIMIT 1
|
||||
),
|
||||
0
|
||||
) AS account_status,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account.name FROM account WHERE account.id = character_data.account_id LIMIT 1
|
||||
),
|
||||
0
|
||||
) AS account_name,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account_ip.ip FROM account_ip WHERE account_ip.accid = character_data.account_id ORDER BY account_ip.lastused DESC LIMIT 1
|
||||
),
|
||||
""
|
||||
) AS account_ip
|
||||
FROM
|
||||
character_data
|
||||
WHERE
|
||||
last_login > (UNIX_TIMESTAMP() - 600)
|
||||
ORDER BY
|
||||
character_data.name;
|
||||
);
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_filtered = false;
|
||||
|
||||
std::string search_criteria;
|
||||
|
||||
if (sep->arg[2]) {
|
||||
search_criteria = Strings::ToLower(sep->arg[2]);
|
||||
}
|
||||
|
||||
uint32 found_count = 0;
|
||||
|
||||
c->Message(Chat::Who, "Players in EverQuest:");
|
||||
c->Message(Chat::Who, "------------------------------");
|
||||
|
||||
for (auto row : results) {
|
||||
const std::string& player_name = row[0];
|
||||
const uint32 zone_id = Strings::ToUnsignedInt(row[1]);
|
||||
const std::string& zone_short_name = ZoneName(zone_id);
|
||||
const std::string& zone_long_name = ZoneLongName(zone_id);
|
||||
const uint8 zone_instance = Strings::ToUnsignedInt(row[2]);
|
||||
const std::string& guild_name = row[3];
|
||||
const uint8 player_level = Strings::ToUnsignedInt(row[4]);
|
||||
const uint16 player_race = Strings::ToUnsignedInt(row[5]);
|
||||
const uint8 player_class = Strings::ToUnsignedInt(row[6]);
|
||||
const uint8 account_status = Strings::ToUnsignedInt(row[7]);
|
||||
const std::string& account_name = row[8];
|
||||
const std::string& account_ip = row[9];
|
||||
const std::string& base_class_name = GetClassIDName(player_class);
|
||||
const std::string& displayed_race_name = GetRaceIDName(player_race);
|
||||
|
||||
if (!search_criteria.empty()) {
|
||||
is_filtered = true;
|
||||
|
||||
const bool found = (
|
||||
Strings::Contains(Strings::ToLower(player_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(zone_short_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(displayed_race_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(base_class_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(guild_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(account_name), search_criteria) ||
|
||||
Strings::Contains(Strings::ToLower(account_ip), search_criteria)
|
||||
);
|
||||
|
||||
if (!found) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
std::string displayed_guild_name;
|
||||
if (!guild_name.empty()) {
|
||||
displayed_guild_name = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who \"{}\"",
|
||||
guild_name
|
||||
),
|
||||
fmt::format(
|
||||
"<{}>",
|
||||
guild_name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const std::string& goto_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#goto {}",
|
||||
player_name
|
||||
),
|
||||
"Goto"
|
||||
);
|
||||
|
||||
const std::string& summon_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summon {}",
|
||||
player_name
|
||||
),
|
||||
"Summon"
|
||||
);
|
||||
|
||||
const std::string& display_class_name = GetClassIDName(player_class, player_level);
|
||||
|
||||
const std::string& class_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
base_class_name
|
||||
),
|
||||
display_class_name
|
||||
);
|
||||
|
||||
const std::string& race_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
displayed_race_name
|
||||
),
|
||||
displayed_race_name
|
||||
);
|
||||
|
||||
const std::string& zone_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
zone_short_name
|
||||
),
|
||||
zone_long_name
|
||||
);
|
||||
|
||||
const std::string& account_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
account_name
|
||||
),
|
||||
account_name
|
||||
);
|
||||
|
||||
const std::string& account_ip_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
account_ip
|
||||
),
|
||||
account_ip
|
||||
);
|
||||
|
||||
const std::string& status_level = (
|
||||
account_status ?
|
||||
fmt::format(
|
||||
"* {} * ",
|
||||
EQ::constants::GetAccountStatusName(account_status)
|
||||
) :
|
||||
""
|
||||
);
|
||||
|
||||
const std::string& version_string = (
|
||||
zone_instance ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
zone_instance
|
||||
) :
|
||||
""
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::Who,
|
||||
fmt::format(
|
||||
"{}[{} {} ({})] {} ({}) ({}) ({}) {} ZONE: {}{} ({} | {})",
|
||||
status_level,
|
||||
player_level,
|
||||
class_saylink,
|
||||
base_class_name,
|
||||
player_name,
|
||||
race_saylink,
|
||||
account_saylink,
|
||||
account_ip_saylink,
|
||||
displayed_guild_name,
|
||||
zone_saylink,
|
||||
version_string,
|
||||
goto_saylink,
|
||||
summon_saylink
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
const std::string& filter_string = is_filtered ? " that match those filters" : "";
|
||||
|
||||
const std::string& message = (
|
||||
found_count ?
|
||||
fmt::format(
|
||||
"There {} {} player{} in EverQuest{}.",
|
||||
found_count != 1 ? "are" : "is",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
filter_string
|
||||
) :
|
||||
fmt::format(
|
||||
"There are no players in EverQuest{}.",
|
||||
filter_string
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::Who,
|
||||
message.c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+5
-5
@@ -1,20 +1,20 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
#include "../../common/data_verification.h"
|
||||
|
||||
void command_xtargets(Client *c, const Seperator *sep)
|
||||
void ShowXTargets(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
t->ShowXTargets(c);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto new_max = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
const auto new_max = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||
|
||||
if (!EQ::ValueWithin(new_max, 5, XTARGET_HARDCAP)) {
|
||||
c->Message(
|
||||
@@ -0,0 +1,276 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowZoneData(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string popup_table;
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Type") +
|
||||
DialogueWindow::TableCell(std::to_string(zone->newzone_data.ztype))
|
||||
);
|
||||
|
||||
for (uint8 fog_index = 0; fog_index < 4; fog_index++) {
|
||||
const uint8 fog_number = (fog_index + 1);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Fog {} Colors",
|
||||
fog_number
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} {} {}",
|
||||
DialogueWindow::ColorMessage(
|
||||
"red1",
|
||||
std::to_string(zone->newzone_data.fog_red[fog_index])
|
||||
),
|
||||
DialogueWindow::ColorMessage(
|
||||
"forest_green",
|
||||
std::to_string(zone->newzone_data.fog_green[fog_index])
|
||||
),
|
||||
DialogueWindow::ColorMessage(
|
||||
"royal_blue",
|
||||
std::to_string(zone->newzone_data.fog_blue[fog_index])
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Fog {} Clipping",
|
||||
fog_number
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} to {}",
|
||||
zone->newzone_data.fog_minclip[fog_index],
|
||||
zone->newzone_data.fog_maxclip[fog_index]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Fog Density") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
zone->newzone_data.fog_density
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Gravity") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
zone->newzone_data.gravity
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Time Type") +
|
||||
DialogueWindow::TableCell(std::to_string(zone->newzone_data.time_type))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Time Type") +
|
||||
DialogueWindow::TableCell(std::to_string(zone->newzone_data.time_type))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Experience Multiplier") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}%%",
|
||||
(zone->newzone_data.zone_exp_multiplier * 100)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Safe Coordinates") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}, {:.2f}, {:.2f}",
|
||||
zone->newzone_data.safe_x,
|
||||
zone->newzone_data.safe_y,
|
||||
zone->newzone_data.safe_z
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Max Z") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
zone->newzone_data.max_z
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Underworld Z") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f}",
|
||||
zone->newzone_data.underworld
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Clipping Distance") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} to {}",
|
||||
zone->newzone_data.minclip,
|
||||
zone->newzone_data.maxclip
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Weather Data
|
||||
for (uint8 weather_index = 0; weather_index < 4; weather_index++) {
|
||||
const uint8 weather_number = (weather_index + 1);
|
||||
|
||||
if (
|
||||
zone->newzone_data.rain_chance[weather_index] ||
|
||||
zone->newzone_data.rain_duration[weather_index]
|
||||
) {
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Rain {}",
|
||||
weather_number
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Chance: {}",
|
||||
zone->newzone_data.rain_chance[weather_index]
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Duration: {}",
|
||||
zone->newzone_data.rain_duration[weather_index]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
zone->newzone_data.snow_chance[weather_index] ||
|
||||
zone->newzone_data.snow_duration[weather_index]
|
||||
) {
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Snow {}",
|
||||
weather_number
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Chance: {}",
|
||||
zone->newzone_data.snow_chance[weather_index]
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"Duration: {}",
|
||||
zone->newzone_data.snow_duration[weather_index]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Sky") +
|
||||
DialogueWindow::TableCell(std::to_string(zone->newzone_data.sky))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Suspend Buffs") +
|
||||
DialogueWindow::TableCell(
|
||||
zone->newzone_data.suspend_buffs ?
|
||||
DialogueWindow::ColorMessage("forest_green", "Y") :
|
||||
DialogueWindow::ColorMessage("red1", "N")
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Health Regen") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
Strings::Commify(zone->newzone_data.fast_regen_hp),
|
||||
Strings::SecondsToTime(zone->newzone_data.fast_regen_hp)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Mana Regen") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
Strings::Commify(zone->newzone_data.fast_regen_mana),
|
||||
Strings::SecondsToTime(zone->newzone_data.fast_regen_mana)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Endurance Regen") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
Strings::Commify(zone->newzone_data.fast_regen_endurance),
|
||||
Strings::SecondsToTime(zone->newzone_data.fast_regen_endurance)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Maximum Aggro Distance") +
|
||||
DialogueWindow::TableCell(Strings::Commify(zone->newzone_data.npc_aggro_max_dist))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Underworld Teleport Index") +
|
||||
DialogueWindow::TableCell(Strings::Commify(zone->newzone_data.underworld_teleport_index))
|
||||
);
|
||||
|
||||
popup_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Lava Damage") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} to {}",
|
||||
Strings::Commify(zone->newzone_data.min_lava_damage),
|
||||
Strings::Commify(zone->newzone_data.lava_damage)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_table = DialogueWindow::Table(popup_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Zone Data for {}",
|
||||
zone->GetZoneDescription()
|
||||
).c_str(),
|
||||
popup_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowZoneGlobalLoot(Client *c, const Seperator *sep)
|
||||
{
|
||||
zone->ShowZoneGlobalLoot(c);
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowZoneLoot(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!sep->IsNumber(2)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Usage: #show zone_loot [Item ID]"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 search_item_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
std::vector<std::pair<NPC *, ItemList>> v;
|
||||
|
||||
uint32 loot_count = 0;
|
||||
uint32 loot_number = 1;
|
||||
|
||||
for (auto npc_entity: entity_list.GetNPCList()) {
|
||||
auto il = npc_entity.second->GetItemList();
|
||||
v.emplace_back(std::make_pair(npc_entity.second, il));
|
||||
}
|
||||
|
||||
for (const auto &e: v) {
|
||||
NPC *n = e.first;
|
||||
const auto &l = e.second;
|
||||
|
||||
std::string npc_link;
|
||||
if (n) {
|
||||
const uint32 instance_id = zone->GetInstanceID();
|
||||
const uint32 zone_id = zone->GetZoneID();
|
||||
|
||||
const std::string &command_link = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#{} {} {} {} {}",
|
||||
(instance_id != 0 ? "zoneinstance" : "zone"),
|
||||
(instance_id != 0 ? instance_id : zone_id),
|
||||
n->GetX(),
|
||||
n->GetY(),
|
||||
n->GetZ()
|
||||
),
|
||||
"Goto"
|
||||
);
|
||||
|
||||
npc_link = fmt::format(
|
||||
"NPC: {} (ID {}) [{}]",
|
||||
n->GetCleanName(),
|
||||
n->GetID(),
|
||||
command_link
|
||||
);
|
||||
}
|
||||
|
||||
for (const auto &i: l) {
|
||||
if (!search_item_id || i->item_id == search_item_id) {
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkLootItem);
|
||||
linker.SetLootData(i);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}. {} ({}) {}",
|
||||
loot_number,
|
||||
linker.GenerateLink(),
|
||||
Strings::Commify(i->item_id),
|
||||
npc_link
|
||||
).c_str()
|
||||
);
|
||||
|
||||
loot_number++;
|
||||
loot_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (search_item_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} ({}) is dropping in {} place{}.",
|
||||
database.CreateItemLink(search_item_id),
|
||||
Strings::Commify(search_item_id),
|
||||
loot_count,
|
||||
loot_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Item {} {} dropping.",
|
||||
loot_count,
|
||||
loot_count != 1 ? "s" : "",
|
||||
loot_count != 1 ? "are" : "is"
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
Executable → Regular
+56
-51
@@ -1,24 +1,24 @@
|
||||
#include "../client.h"
|
||||
#include "../../client.h"
|
||||
|
||||
void command_showzonepoints(Client *c, const Seperator *sep)
|
||||
void ShowZonePoints(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto &mob_list = entity_list.GetMobList();
|
||||
for (auto itr : mob_list) {
|
||||
Mob *mob = itr.second;
|
||||
for (const auto& m : entity_list.GetMobList()) {
|
||||
Mob* mob = m.second;
|
||||
if (mob->IsNPC() && mob->GetRace() == RACE_NODE_2254) {
|
||||
mob->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
int found_zone_points = 0;
|
||||
uint32 found_count = 0;
|
||||
|
||||
c->Message(Chat::White, "Listing zone points...");
|
||||
|
||||
c->SendChatLineBreak();
|
||||
|
||||
for (auto &p : zone->virtual_zone_point_list) {
|
||||
std::string zone_long_name = ZoneLongName(p.target_zone_id);
|
||||
const std::string& zone_long_name = ZoneLongName(p.target_zone_id);
|
||||
|
||||
std::string saylink = fmt::format(
|
||||
const std::string& saylink = fmt::format(
|
||||
"#goto {:.0f} {:.0f} {:.0f}",
|
||||
p.x,
|
||||
p.y,
|
||||
@@ -45,83 +45,92 @@ void command_showzonepoints(Client *c, const Seperator *sep)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
std::string node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
|
||||
const std::string& node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
|
||||
|
||||
float half_width = ((float) p.width / 2);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x + half_width,
|
||||
(float) p.y + half_width,
|
||||
p.x + half_width,
|
||||
p.y + half_width,
|
||||
p.z,
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x + half_width,
|
||||
(float) p.y - half_width,
|
||||
p.x + half_width,
|
||||
p.y - half_width,
|
||||
p.z,
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x - half_width,
|
||||
(float) p.y - half_width,
|
||||
p.x - half_width,
|
||||
p.y - half_width,
|
||||
p.z,
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x - half_width,
|
||||
(float) p.y + half_width,
|
||||
p.x - half_width,
|
||||
p.y + half_width,
|
||||
p.z,
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x + half_width,
|
||||
(float) p.y + half_width,
|
||||
(float) p.z + (float) p.height,
|
||||
p.x + half_width,
|
||||
p.y + half_width,
|
||||
p.z + static_cast<float>(p.height),
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x + half_width,
|
||||
(float) p.y - half_width,
|
||||
(float) p.z + (float) p.height,
|
||||
p.x + half_width,
|
||||
p.y - half_width,
|
||||
p.z + static_cast<float>(p.height),
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x - half_width,
|
||||
(float) p.y - half_width,
|
||||
(float) p.z + (float) p.height,
|
||||
p.x - half_width,
|
||||
p.y - half_width,
|
||||
p.z + static_cast<float>(p.height),
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
(float) p.x - half_width,
|
||||
(float) p.y + half_width,
|
||||
(float) p.z + (float) p.height,
|
||||
p.x - half_width,
|
||||
p.y + half_width,
|
||||
p.z + static_cast<float>(p.height),
|
||||
p.heading
|
||||
));
|
||||
)
|
||||
);
|
||||
|
||||
found_zone_points++;
|
||||
found_count++;
|
||||
}
|
||||
|
||||
LinkedListIterator<ZonePoint *> iterator(zone->zone_point_list);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
ZonePoint *p = iterator.GetData();
|
||||
std::string zone_long_name = ZoneLongName(p->target_zone_id);
|
||||
std::string node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
|
||||
const auto &p = iterator.GetData();
|
||||
|
||||
const std::string& zone_long_name = ZoneLongName(p->target_zone_id);
|
||||
const std::string& node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
|
||||
|
||||
NPC::SpawnZonePointNodeNPC(
|
||||
node_name, glm::vec4(
|
||||
@@ -132,9 +141,7 @@ void command_showzonepoints(Client *c, const Seperator *sep)
|
||||
)
|
||||
);
|
||||
|
||||
// {:.0f}
|
||||
|
||||
std::string saylink = fmt::format(
|
||||
const std::string& saylink = fmt::format(
|
||||
"#goto {:.0f} {:.0f} {:.0f}",
|
||||
p->x,
|
||||
p->y,
|
||||
@@ -145,13 +152,13 @@ void command_showzonepoints(Client *c, const Seperator *sep)
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Client Side Zone Point [{}] x [{}] y [{}] z [{}] h [{}] number [{}] | To [{}] ({}) x [{}] y [{}] z [{}] h [{}]",
|
||||
Saylink::Silent(saylink, "Goto").c_str(),
|
||||
Saylink::Silent(saylink, "Goto"),
|
||||
p->x,
|
||||
p->y,
|
||||
p->z,
|
||||
p->heading,
|
||||
p->number,
|
||||
zone_long_name.c_str(),
|
||||
zone_long_name,
|
||||
p->target_zone_id,
|
||||
p->target_x,
|
||||
p->target_y,
|
||||
@@ -162,14 +169,12 @@ void command_showzonepoints(Client *c, const Seperator *sep)
|
||||
|
||||
iterator.Advance();
|
||||
|
||||
found_zone_points++;
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_zone_points == 0) {
|
||||
c->Message(Chat::White, "There were no zone points found...");
|
||||
if (!found_count) {
|
||||
c->Message(Chat::White, "There were no zone points found.");
|
||||
}
|
||||
|
||||
c->SendChatLineBreak();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "../../client.h"
|
||||
#include "../../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void ShowZoneStatus(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_ZoneStatus, sizeof(ServerZoneStatus_Struct));
|
||||
|
||||
auto z = (ServerZoneStatus_Struct *) pack->pBuffer;
|
||||
z->admin = c->Admin();
|
||||
strn0cpy(z->name, c->GetName(), sizeof(z->name));
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
delete pack;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_showskills(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint32 start_skill_id = 0;
|
||||
if (sep->IsNumber(1)) {
|
||||
start_skill_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
}
|
||||
|
||||
bool show_all = !strcasecmp(sep->arg[2], "all");
|
||||
|
||||
uint32 max_skill_id = (start_skill_id + 49);
|
||||
|
||||
std::string popup_text = "<table>";
|
||||
|
||||
popup_text += "<tr><td>ID</td><td>Name</td><td>Current</td><td>Max</td><td>Raw</td></tr>";
|
||||
|
||||
for (
|
||||
EQ::skills::SkillType skill_id = (EQ::skills::SkillType) start_skill_id;
|
||||
skill_id <= (EQ::skills::SkillType) max_skill_id;
|
||||
skill_id = (EQ::skills::SkillType) (skill_id + 1)
|
||||
) {
|
||||
if ((EQ::skills::SkillType) skill_id >= EQ::skills::SkillCount) {
|
||||
max_skill_id = (EQ::skills::SkillCount - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (show_all || (target->CanHaveSkill(skill_id) && target->MaxSkill(skill_id))) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
|
||||
skill_id,
|
||||
EQ::skills::GetSkillName(skill_id),
|
||||
target->GetSkill(skill_id),
|
||||
target->MaxSkill(skill_id),
|
||||
target->GetRawSkill(skill_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
std::string popup_title = fmt::format(
|
||||
"Skills for {} [{} to {}]",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
|
||||
start_skill_id,
|
||||
max_skill_id
|
||||
);
|
||||
|
||||
c->SendPopupToClient(
|
||||
popup_title.c_str(),
|
||||
popup_text.c_str()
|
||||
);
|
||||
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Viewing skill levels from {} ({}) to {} ({}) for {}.",
|
||||
EQ::skills::GetSkillName((EQ::skills::SkillType) start_skill_id),
|
||||
start_skill_id,
|
||||
EQ::skills::GetSkillName((EQ::skills::SkillType) max_skill_id),
|
||||
max_skill_id,
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
int next_skill_id = (max_skill_id + 1);
|
||||
if ((EQ::skills::SkillType) next_skill_id < EQ::skills::SkillCount) {
|
||||
auto next_list_string = fmt::format(
|
||||
"#showskills {}",
|
||||
next_skill_id
|
||||
);
|
||||
|
||||
auto next_list_link = Saylink::Silent(next_list_string, next_list_string);
|
||||
|
||||
auto next_list_all_string = fmt::format(
|
||||
"#showskills {} all",
|
||||
next_skill_id
|
||||
);
|
||||
|
||||
auto next_list_all_link = Saylink::Silent(next_list_all_string, next_list_all_string);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"To view the next 50 skill levels, you can use {} or {} to show skills the player cannot normally have.",
|
||||
next_list_link,
|
||||
next_list_all_link
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_showspells(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
|
||||
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
|
||||
return;
|
||||
}
|
||||
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const auto is_disciplines = !strcasecmp(sep->arg[1], "disciplines");
|
||||
const auto is_spells = !strcasecmp(sep->arg[1], "spells");
|
||||
if (
|
||||
!is_disciplines &&
|
||||
!is_spells
|
||||
) {
|
||||
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
|
||||
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
|
||||
}
|
||||
|
||||
ShowSpellType show_spell_type;
|
||||
|
||||
if (is_disciplines) {
|
||||
show_spell_type = ShowSpellType::Disciplines;
|
||||
} else if (is_spells) {
|
||||
show_spell_type = ShowSpellType::Spells;
|
||||
}
|
||||
|
||||
t->ShowSpells(c, show_spell_type);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_showspellslist(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *target = c->GetTarget();
|
||||
if (!target || !target->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
target->CastToNPC()->AISpellsList(c);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_showzonegloballoot(Client *c, const Seperator *sep)
|
||||
{
|
||||
zone->ShowZoneGlobalLoot(c);
|
||||
}
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_spawnstatus(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #spawnstatus all - Show all spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus disabled - Show all disabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus enabled - Show all enabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus [Spawn ID] - Show spawn status by ID for your current zone");
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_all = !strcasecmp(sep->arg[1], "all");
|
||||
bool is_disabled = !strcasecmp(sep->arg[1], "disabled");
|
||||
bool is_enabled = !strcasecmp(sep->arg[1], "enabled");
|
||||
bool is_search = sep->IsNumber(1);
|
||||
|
||||
if (
|
||||
!is_all &&
|
||||
!is_disabled &&
|
||||
!is_enabled &&
|
||||
!is_search
|
||||
) {
|
||||
c->Message(Chat::White, "Usage: #spawnstatus all - Show all spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus disabled - Show all disabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus enabled - Show all enabled spawn statuses for your current zone");
|
||||
c->Message(Chat::White, "Usage: #spawnstatus [Spawn ID] - Show spawn status by ID for your current zone");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string filter_type;
|
||||
if (is_disabled) {
|
||||
filter_type = "Disabled";
|
||||
} else if (is_enabled) {
|
||||
filter_type = "Enabled";
|
||||
}
|
||||
|
||||
uint32 spawn_id = 0;
|
||||
if (is_search) {
|
||||
spawn_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
}
|
||||
|
||||
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
|
||||
uint32 filtered_count = 0;
|
||||
uint32 spawn_count = 0;
|
||||
uint32 spawn_number = 1;
|
||||
while (iterator.MoreElements()) {
|
||||
auto e = iterator.GetData();
|
||||
auto time_remaining = e->GetTimer().GetRemainingTime();
|
||||
if (
|
||||
is_all ||
|
||||
(
|
||||
is_disabled &&
|
||||
time_remaining == 0xFFFFFFFF
|
||||
) ||
|
||||
(
|
||||
is_enabled &&
|
||||
time_remaining != 0xFFFFFFFF
|
||||
) ||
|
||||
(
|
||||
is_search &&
|
||||
e->GetID() == spawn_id
|
||||
)
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spawn {} | ID: {} Coordinates: {:.2f}, {:.2f}, {:.2f}, {:.2f}",
|
||||
spawn_number,
|
||||
e->GetID(),
|
||||
e->GetX(),
|
||||
e->GetY(),
|
||||
e->GetZ(),
|
||||
e->GetHeading()
|
||||
).c_str()
|
||||
);
|
||||
if (time_remaining != 0xFFFFFFFF) {
|
||||
auto seconds_remaining = (time_remaining / 1000);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spawn {} | Respawn: {} ({} Second{})",
|
||||
spawn_number,
|
||||
Strings::SecondsToTime(seconds_remaining),
|
||||
seconds_remaining,
|
||||
seconds_remaining != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
filtered_count++;
|
||||
spawn_number++;
|
||||
}
|
||||
spawn_count++;
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (!spawn_count) {
|
||||
c->Message(Chat::White, "No spawns were found in this zone.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_all && !is_search && !filtered_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No {} spawns were found in this zone.",
|
||||
filter_type
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_all) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} spawn{} listed.",
|
||||
spawn_count,
|
||||
spawn_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} of {} spawn{} listed.",
|
||||
filtered_count,
|
||||
spawn_count,
|
||||
spawn_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_trapinfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
entity_list.GetTrapInfo(c);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_uptime(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!worldserver.Connected()) {
|
||||
c->Message(Chat::White, "Error: World server disconnected");
|
||||
}
|
||||
else {
|
||||
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
|
||||
ServerUptime_Struct *sus = (ServerUptime_Struct *) pack->pBuffer;
|
||||
strcpy(sus->adminname, c->GetName());
|
||||
if (sep->IsNumber(1) && Strings::ToInt(sep->arg[1]) > 0) {
|
||||
sus->zoneserverid = Strings::ToInt(sep->arg[1]);
|
||||
}
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_version(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string popup_text = "<table>";
|
||||
|
||||
popup_text += fmt::format("<tr><td>Version</td><td>{}</td></tr>", CURRENT_VERSION);
|
||||
popup_text += fmt::format("<tr><td>Compiled</td><td>{} {}</td></tr>", COMPILE_DATE, COMPILE_TIME);
|
||||
popup_text += fmt::format("<tr><td>Last Modified</td><td>{}</td></tr>", LAST_MODIFIED);
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Server Version Information",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_viewcurrencies(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const auto platinum = (
|
||||
t->GetMoney(3, 0) +
|
||||
t->GetMoney(3, 1) +
|
||||
t->GetMoney(3, 2) +
|
||||
t->GetMoney(3, 3)
|
||||
);
|
||||
|
||||
const auto gold = (
|
||||
t->GetMoney(2, 0) +
|
||||
t->GetMoney(2, 1) +
|
||||
t->GetMoney(2, 2)
|
||||
);
|
||||
|
||||
const auto silver = (
|
||||
t->GetMoney(1, 0) +
|
||||
t->GetMoney(1, 1) +
|
||||
t->GetMoney(1, 2)
|
||||
);
|
||||
|
||||
const auto copper = (
|
||||
t->GetMoney(0, 0) +
|
||||
t->GetMoney(0, 1) +
|
||||
t->GetMoney(0, 2)
|
||||
);
|
||||
|
||||
std::string currency_table;
|
||||
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell("Currency"),
|
||||
DialogueWindow::TableCell("Amount")
|
||||
)
|
||||
);
|
||||
|
||||
if (
|
||||
platinum ||
|
||||
gold ||
|
||||
silver ||
|
||||
copper
|
||||
) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell("Money"),
|
||||
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const auto ebon_crystals = t->GetEbonCrystals();
|
||||
if (ebon_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell("Ebon Crystals"),
|
||||
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const auto radiant_crystals = t->GetRadiantCrystals();
|
||||
if (radiant_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell("Radiant Crystals"),
|
||||
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
for (const auto& a : zone->AlternateCurrencies) {
|
||||
const auto currency_value = t->GetAlternateCurrencyValue(a.id);
|
||||
if (currency_value) {
|
||||
const auto* d = database.GetItem(a.item_id);
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell(d->Name),
|
||||
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
|
||||
const auto ldon_currency_value = t->GetLDoNPointsTheme(l.first);
|
||||
if (ldon_currency_value) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell(l.second),
|
||||
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
auto pvp_points = t->GetPVPPoints();
|
||||
if (pvp_points) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
fmt::format(
|
||||
"{}{}",
|
||||
DialogueWindow::TableCell("PVP Points"),
|
||||
DialogueWindow::TableCell(Strings::Commify(pvp_points))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
currency_table = DialogueWindow::Table(currency_table);
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Currency for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
currency_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_viewnpctype(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(1)) {
|
||||
uint32 npc_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
const NPCType *npc_type_data = content_db.LoadNPCTypesData(npc_id);
|
||||
if (npc_type_data) {
|
||||
auto npc = new NPC(
|
||||
npc_type_data,
|
||||
nullptr,
|
||||
c->GetPosition(),
|
||||
GravityBehavior::Water
|
||||
);
|
||||
npc->ShowStats(c);
|
||||
safe_delete(npc);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"NPC ID {} was not found.",
|
||||
npc_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Usage: #viewnpctype [NPC ID]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_viewpetition(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #viewpetition (petition number) Type #listpetition for a list");
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::Red, " ID : Character Name , Petition Text");
|
||||
|
||||
std::string query = "SELECT petid, charname, petitiontext FROM petitions ORDER BY petid";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("View petition request from [{}], petition number: [{}]", c->GetName(), Strings::ToInt(sep->argplus[1]));
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
c->Message(Chat::Red, "There was an error in your request: ID not found! Please check the Id and try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
if (strcasecmp(row[0], sep->argplus[1]) == 0) {
|
||||
c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_viewzoneloot(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::map<uint32, ItemList> zone_loot_list;
|
||||
auto npc_list = entity_list.GetNPCList();
|
||||
uint32 loot_amount = 0, loot_id = 1, search_item_id = 0;
|
||||
if (sep->argnum == 1 && sep->IsNumber(1)) {
|
||||
search_item_id = Strings::ToInt(sep->arg[1]);
|
||||
}
|
||||
else if (sep->argnum == 1 && !sep->IsNumber(1)) {
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
"Usage: #viewzoneloot [item id]"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto npc_entity : npc_list) {
|
||||
auto current_npc_item_list = npc_entity.second->GetItemList();
|
||||
zone_loot_list.insert({npc_entity.second->GetID(), current_npc_item_list});
|
||||
}
|
||||
|
||||
for (auto loot_item : zone_loot_list) {
|
||||
uint32 current_entity_id = loot_item.first;
|
||||
auto current_item_list = loot_item.second;
|
||||
auto current_npc = entity_list.GetNPCByID(current_entity_id);
|
||||
std::string npc_link;
|
||||
if (current_npc) {
|
||||
std::string npc_name = current_npc->GetCleanName();
|
||||
uint32 instance_id = zone->GetInstanceID();
|
||||
uint32 zone_id = zone->GetZoneID();
|
||||
std::string command_link = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#{} {} {} {} {}",
|
||||
(instance_id != 0 ? "zoneinstance" : "zone"),
|
||||
(instance_id != 0 ? instance_id : zone_id),
|
||||
current_npc->GetX(),
|
||||
current_npc->GetY(),
|
||||
current_npc->GetZ()
|
||||
),
|
||||
"Goto"
|
||||
);
|
||||
npc_link = fmt::format(
|
||||
" NPC: {} (ID {}) [{}]",
|
||||
npc_name,
|
||||
current_entity_id,
|
||||
command_link
|
||||
);
|
||||
}
|
||||
|
||||
for (auto current_item : current_item_list) {
|
||||
if (search_item_id == 0 || current_item->item_id == search_item_id) {
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkLootItem);
|
||||
linker.SetLootData(current_item);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}. {} ({}){}",
|
||||
loot_id,
|
||||
linker.GenerateLink(),
|
||||
current_item->item_id,
|
||||
npc_link
|
||||
).c_str()
|
||||
);
|
||||
loot_id++;
|
||||
loot_amount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (search_item_id != 0) {
|
||||
std::string drop_string = (
|
||||
loot_amount > 0 ?
|
||||
fmt::format(
|
||||
"dropping in {} {}",
|
||||
loot_amount,
|
||||
(loot_amount > 1 ? "places" : "place")
|
||||
) :
|
||||
"not dropping"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} ({}) is {}.",
|
||||
database.CreateItemLink(search_item_id),
|
||||
search_item_id,
|
||||
drop_string
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
std::string drop_string = (
|
||||
loot_amount > 0 ?
|
||||
fmt::format(
|
||||
"{} {} dropping",
|
||||
(loot_amount > 1 ? "items" : "item"),
|
||||
(loot_amount > 1 ? "are" : "is")
|
||||
) :
|
||||
"items are dropping"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {}.",
|
||||
loot_amount,
|
||||
drop_string
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,233 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_who(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string query = SQL(
|
||||
SELECT
|
||||
character_data.account_id,
|
||||
character_data.name,
|
||||
character_data.zone_id,
|
||||
character_data.zone_instance,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT guilds.name FROM guilds WHERE id = (
|
||||
(
|
||||
SELECT guild_id FROM guild_members WHERE char_id = character_data.id
|
||||
)
|
||||
)
|
||||
),
|
||||
""
|
||||
) AS guild_name,
|
||||
character_data.level,
|
||||
character_data.race,
|
||||
character_data.class,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account.status FROM account WHERE account.id = character_data.account_id LIMIT 1
|
||||
),
|
||||
0
|
||||
) AS account_status,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account.name FROM account WHERE account.id = character_data.account_id LIMIT 1
|
||||
),
|
||||
0
|
||||
) AS account_name,
|
||||
COALESCE(
|
||||
(
|
||||
SELECT account_ip.ip FROM account_ip WHERE account_ip.accid = character_data.account_id ORDER BY account_ip.lastused DESC LIMIT 1
|
||||
),
|
||||
""
|
||||
) AS account_ip
|
||||
FROM
|
||||
character_data
|
||||
WHERE
|
||||
last_login > (UNIX_TIMESTAMP() - 600)
|
||||
ORDER BY
|
||||
character_data.name;
|
||||
);
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string search_string;
|
||||
|
||||
if (sep->arg[1]) {
|
||||
search_string = Strings::ToLower(sep->arg[1]);
|
||||
}
|
||||
|
||||
int found_count = 0;
|
||||
|
||||
c->Message(Chat::Who, "Players in EverQuest:");
|
||||
c->Message(Chat::Who, "------------------------------");
|
||||
|
||||
for (auto row : results) {
|
||||
auto account_id = Strings::ToUnsignedInt(row[0]);
|
||||
std::string player_name = row[1];
|
||||
auto zone_id = Strings::ToUnsignedInt(row[2]);
|
||||
std::string zone_short_name = ZoneName(zone_id);
|
||||
std::string zone_long_name = ZoneLongName(zone_id);
|
||||
auto zone_instance = Strings::ToUnsignedInt(row[3]);
|
||||
std::string guild_name = row[4];
|
||||
auto player_level = Strings::ToUnsignedInt(row[5]);
|
||||
auto player_race = Strings::ToUnsignedInt(row[6]);
|
||||
auto player_class = Strings::ToUnsignedInt(row[7]);
|
||||
auto account_status = Strings::ToUnsignedInt(row[8]);
|
||||
std::string account_name = row[9];
|
||||
std::string account_ip = row[10];
|
||||
std::string base_class_name = GetClassIDName(static_cast<uint8>(player_class));
|
||||
std::string displayed_race_name = GetRaceIDName(static_cast<uint16>(player_race));
|
||||
|
||||
if (search_string.length()) {
|
||||
bool found_search_term = (
|
||||
Strings::ToLower(player_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(zone_short_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(displayed_race_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(base_class_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(guild_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(account_name).find(search_string) != std::string::npos ||
|
||||
Strings::ToLower(account_ip).find(search_string) != std::string::npos
|
||||
);
|
||||
|
||||
if (!found_search_term) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
std::string displayed_guild_name;
|
||||
if (guild_name.length()) {
|
||||
displayed_guild_name = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who \"{}\"",
|
||||
guild_name
|
||||
),
|
||||
fmt::format(
|
||||
"<{}>",
|
||||
guild_name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
auto goto_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#goto {}",
|
||||
player_name
|
||||
),
|
||||
"Goto"
|
||||
);
|
||||
|
||||
auto summon_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summon {}",
|
||||
player_name
|
||||
),
|
||||
"Summon"
|
||||
);
|
||||
|
||||
std::string display_class_name = GetClassIDName(
|
||||
static_cast<uint8>(player_class),
|
||||
static_cast<uint8>(player_level)
|
||||
);
|
||||
|
||||
auto class_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
base_class_name
|
||||
),
|
||||
display_class_name
|
||||
);
|
||||
|
||||
auto race_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who %s",
|
||||
displayed_race_name
|
||||
),
|
||||
displayed_race_name
|
||||
);
|
||||
|
||||
auto zone_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
zone_short_name
|
||||
),
|
||||
zone_long_name
|
||||
);
|
||||
|
||||
auto account_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
account_name
|
||||
),
|
||||
account_name
|
||||
);
|
||||
|
||||
auto account_ip_saylink = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#who {}",
|
||||
account_ip
|
||||
),
|
||||
account_ip
|
||||
);
|
||||
|
||||
auto status_level = (
|
||||
account_status ?
|
||||
fmt::format(
|
||||
"* {} * ",
|
||||
EQ::constants::GetAccountStatusName(account_status)
|
||||
) :
|
||||
""
|
||||
);
|
||||
|
||||
auto version_string = (
|
||||
zone_instance ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
zone_instance
|
||||
) :
|
||||
""
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::Who,
|
||||
fmt::format(
|
||||
"{}[{} {} ({})] {} ({}) ({}) ({}) {} ZONE: {}{} ({} | {})",
|
||||
status_level,
|
||||
player_level,
|
||||
class_saylink,
|
||||
base_class_name,
|
||||
player_name,
|
||||
race_saylink,
|
||||
account_saylink,
|
||||
account_ip_saylink,
|
||||
displayed_guild_name,
|
||||
zone_saylink,
|
||||
version_string,
|
||||
goto_saylink,
|
||||
summon_saylink
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
std::string count_string = found_count == 1 ? "is" : "are";
|
||||
|
||||
std::string message = (
|
||||
found_count ?
|
||||
fmt::format(
|
||||
"There {} {} player{} in EverQuest.",
|
||||
count_string,
|
||||
found_count,
|
||||
found_count > 1 ? "s" : ""
|
||||
) :
|
||||
"There are no players in EverQuest that match those filters."
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::Who,
|
||||
message.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_zonestatus(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!worldserver.Connected()) {
|
||||
c->Message(Chat::White, "Error: World server disconnected");
|
||||
}
|
||||
else {
|
||||
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(c->GetName()) + 2);
|
||||
memset(pack->pBuffer, (uint8) c->Admin(), 1);
|
||||
strcpy((char *) &pack->pBuffer[1], c->GetName());
|
||||
worldserver.SendPacket(pack);
|
||||
delete pack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_zstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
// Zone
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Zone | {}",
|
||||
zone->GetZoneDescription()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Type
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Type: {}",
|
||||
zone->newzone_data.ztype
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Fog Data
|
||||
for (int fog_index = 0; fog_index < 4; fog_index++) {
|
||||
int fog_number = (fog_index + 1);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Fog {} Colors | Red: {} Blue: {} Green: {} ",
|
||||
fog_number,
|
||||
zone->newzone_data.fog_red[fog_index],
|
||||
zone->newzone_data.fog_green[fog_index],
|
||||
zone->newzone_data.fog_blue[fog_index]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Fog {} Clipping Distance | Min: {} Max: {}",
|
||||
fog_number,
|
||||
zone->newzone_data.fog_minclip[fog_index],
|
||||
zone->newzone_data.fog_maxclip[fog_index]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
// Fog Density
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Fog Density: {}",
|
||||
zone->newzone_data.fog_density
|
||||
).c_str()
|
||||
);
|
||||
|
||||
|
||||
// Gravity
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Gravity: {}",
|
||||
zone->newzone_data.gravity
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Time Type
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Time Type: {}",
|
||||
zone->newzone_data.time_type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Experience Multiplier
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Experience Multiplier: {}",
|
||||
zone->newzone_data.zone_exp_multiplier
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Safe Coordinates
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Safe Coordinates: {}, {}, {}",
|
||||
zone->newzone_data.safe_x,
|
||||
zone->newzone_data.safe_y,
|
||||
zone->newzone_data.safe_z
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Max Z
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Max Z: {}",
|
||||
zone->newzone_data.max_z
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Underworld Z
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Underworld Z: {}",
|
||||
zone->newzone_data.underworld
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Clipping Distance
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Clipping Distance | Min: {} Max: {}",
|
||||
zone->newzone_data.minclip,
|
||||
zone->newzone_data.maxclip
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Weather Data
|
||||
for (int weather_index = 0; weather_index < 4; weather_index++) {
|
||||
int weather_number = (weather_index + 1);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Rain {} | Chance: {} Duration: {} ",
|
||||
weather_number,
|
||||
zone->newzone_data.rain_chance[weather_index],
|
||||
zone->newzone_data.rain_duration[weather_index]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Snow {} | Chance: {} Duration: {}",
|
||||
weather_number,
|
||||
zone->newzone_data.snow_chance[weather_index],
|
||||
zone->newzone_data.snow_duration[weather_index]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
// Sky Type
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Sky Type: {}",
|
||||
zone->newzone_data.sky
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Suspend Buffs
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Suspend Buffs: {}",
|
||||
zone->newzone_data.suspend_buffs
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Regeneration Data
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Regen | Health: {} Mana: {} Endurance: {}",
|
||||
zone->newzone_data.fast_regen_hp,
|
||||
zone->newzone_data.fast_regen_mana,
|
||||
zone->newzone_data.fast_regen_endurance
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// NPC Max Aggro Distance
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"NPC Max Aggro Distance: {}",
|
||||
zone->newzone_data.npc_aggro_max_dist
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Underworld Teleport Index
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Underworld Teleport Index: {}",
|
||||
zone->newzone_data.underworld_teleport_index
|
||||
).c_str()
|
||||
);
|
||||
|
||||
// Lava Damage
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Lava Damage | Min: {} Max: {}",
|
||||
zone->newzone_data.min_lava_damage,
|
||||
zone->newzone_data.lava_damage
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user