mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-18 11:48:21 +00:00
[GM Commands] Split GM Commands Into Separate Files (#1766)
* Split GM commands into their own files * Code cleanup
This commit is contained in:
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user