Skip to content

Commit

Permalink
[Commands] Consolidate #show commands into a singular #show command (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Kinglykrab authored Jul 8, 2023
1 parent d4962bb commit e55fb1c
Show file tree
Hide file tree
Showing 90 changed files with 2,766 additions and 2,590 deletions.
5 changes: 5 additions & 0 deletions common/servertalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,11 @@ struct ServerOOCMute_Struct {
bool is_muted;
};

struct ServerZoneStatus_Struct {
char name[64];
int16 admin;
};

#pragma pack()

#endif
3 changes: 2 additions & 1 deletion world/zoneserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,8 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
}
case ServerOP_ZoneStatus: {
if (pack->size >= 1) {
zoneserver_list.SendZoneStatus((char *)&pack->pBuffer[1], (uint8)pack->pBuffer[0], this);
auto z = (ServerZoneStatus_Struct*) pack->pBuffer;
zoneserver_list.SendZoneStatus(z->name, z->admin, this);
}

break;
Expand Down
18 changes: 8 additions & 10 deletions zone/client_packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6779,16 +6779,14 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)

void Client::Handle_OP_GMServers(const EQApplicationPacket *app)
{
if (!worldserver.Connected())
Message(Chat::Red, "Error: World server disconnected");
else {
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(GetName()) + 2);
memset(pack->pBuffer, (uint8)admin, 1);
strcpy((char *)&pack->pBuffer[1], GetName());
worldserver.SendPacket(pack);
safe_delete(pack);
}
return;
auto pack = new ServerPacket(ServerOP_ZoneStatus, sizeof(ServerZoneStatus_Struct));

auto z = (ServerZoneStatus_Struct *) pack->pBuffer;
z->admin = Admin();
strn0cpy(z->name, GetName(), sizeof(z->name));

worldserver.SendPacket(pack);
delete pack;
}

void Client::Handle_OP_GMSummon(const EQApplicationPacket *app)
Expand Down
145 changes: 53 additions & 92 deletions zone/command.cpp

Large diffs are not rendered by default.

49 changes: 2 additions & 47 deletions zone/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ std::string GetModifyNPCStatDescription(std::string stat);
void SendNPCEditSubCommands(Client *c);
void SendRuleSubCommands(Client *c);
void SendGuildSubCommands(Client *c);
void SendPeekInvSubCommands(Client *c);
void SendShowInventorySubCommands(Client *c);

// Commands
void command_acceptrules(Client *c, const Seperator *sep);
void command_advnpcspawn(Client *c, const Seperator *sep);
void command_aggro(Client *c, const Seperator *sep);
void command_aggrozone(Client *c, const Seperator *sep);
void command_ai(Client *c, const Seperator *sep);
void command_appearance(Client *c, const Seperator *sep);
Expand All @@ -52,12 +51,10 @@ void command_bugs(Client *c, const Seperator *sep);
void command_camerashake(Client *c, const Seperator *sep);
void command_castspell(Client *c, const Seperator *sep);
void command_chat(Client *c, const Seperator *sep);
void command_checklos(Client *c, const Seperator *sep);
void command_copycharacter(Client *c, const Seperator *sep);
void command_corpse(Client *c, const Seperator *sep);
void command_corpsefix(Client *c, const Seperator *sep);
void command_countitem(Client *c, const Seperator *sep);
void command_cvs(Client *c, const Seperator *sep);
void command_damage(Client *c, const Seperator *sep);
void command_databuckets(Client *c, const Seperator *sep);
void command_date(Client *c, const Seperator *sep);
Expand All @@ -70,14 +67,12 @@ void command_devtools(Client *c, const Seperator *sep);
void command_disablerecipe(Client *c, const Seperator *sep);
void command_disarmtrap(Client *c, const Seperator *sep);
void command_door(Client *c, const Seperator *sep);
void command_distance(Client *c, const Seperator *sep);
void command_doanim(Client *c, const Seperator *sep);
void command_dye(Client *c, const Seperator *sep);
void command_dz(Client *c, const Seperator *sep);
void command_dzkickplayers(Client *c, const Seperator *sep);
void command_editmassrespawn(Client *c, const Seperator *sep);
void command_emote(Client *c, const Seperator *sep);
void command_emoteview(Client *c, const Seperator *sep);
void command_emptyinventory(Client *c, const Seperator *sep);
void command_enablerecipe(Client *c, const Seperator *sep);
void command_endurance(Client *c, const Seperator *sep);
Expand All @@ -90,19 +85,13 @@ void command_find(Client *c, const Seperator *sep);
void command_fixmob(Client *c, const Seperator *sep);
void command_flag(Client *c, const Seperator *sep);
void command_flagedit(Client *c, const Seperator *sep);
void command_flags(Client *c, const Seperator *sep);
void command_flymode(Client *c, const Seperator *sep);
void command_fov(Client *c, const Seperator *sep);
void command_freeze(Client *c, const Seperator *sep);
void command_gassign(Client *c, const Seperator *sep);
void command_gearup(Client *c, const Seperator *sep);
void command_gender(Client *c, const Seperator *sep);
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep);
void command_getvariable(Client *c, const Seperator *sep);
void command_ginfo(Client *c, const Seperator *sep);
void command_giveitem(Client *c, const Seperator *sep);
void command_givemoney(Client *c, const Seperator *sep);
void command_globalview(Client *c, const Seperator *sep);
void command_gm(Client *c, const Seperator *sep);
void command_gmspeed(Client *c, const Seperator *sep);
void command_gmzone(Client *c, const Seperator *sep);
Expand All @@ -111,7 +100,6 @@ void command_goto(Client *c, const Seperator *sep);
void command_grid(Client *c, const Seperator *sep);
void command_guild(Client *c, const Seperator *sep);
void command_haste(Client *c, const Seperator *sep);
void command_hatelist(Client *c, const Seperator *sep);
void command_heal(Client *c, const Seperator *sep);
void command_help(Client *c, const Seperator *sep);
void command_heromodel(Client *c, const Seperator *sep);
Expand All @@ -125,14 +113,12 @@ void command_interrupt(Client *c, const Seperator *sep);
void command_invsnapshot(Client *c, const Seperator *sep);
void command_invul(Client *c, const Seperator *sep);
void command_ipban(Client *c, const Seperator *sep);
void command_iplookup(Client *c, const Seperator *sep);
void command_kick(Client *c, const Seperator *sep);
void command_killallnpcs(Client *c, const Seperator *sep);
void command_kill(Client *c, const Seperator *sep);
void command_lastname(Client *c, const Seperator *sep);
void command_level(Client *c, const Seperator *sep);
void command_list(Client *c, const Seperator *sep);
void command_listpetition(Client *c, const Seperator *sep);
void command_lootsim(Client *c, const Seperator *sep);
void command_load_shared_memory(Client *c, const Seperator *sep);
void command_loc(Client *c, const Seperator *sep);
Expand All @@ -150,8 +136,6 @@ void command_myskills(Client *c, const Seperator *sep);
void command_mysql(Client *c, const Seperator *sep);
void command_mystats(Client *c, const Seperator *sep);
void command_name(Client *c, const Seperator *sep);
void command_netstats(Client *c, const Seperator *sep);
void command_network(Client *c, const Seperator *sep);
void command_npccast(Client *c, const Seperator *sep);
void command_npcedit(Client *c, const Seperator *sep);
void command_npceditmass(Client *c, const Seperator *sep);
Expand All @@ -160,29 +144,23 @@ void command_npcloot(Client *c, const Seperator *sep);
void command_npcsay(Client *c, const Seperator *sep);
void command_npcshout(Client *c, const Seperator *sep);
void command_npcspawn(Client *c, const Seperator *sep);
void command_npcstats(Client *c, const Seperator *sep);
void command_npctypespawn(Client *c, const Seperator *sep);
void command_nudge(Client *c, const Seperator *sep);
void command_nukebuffs(Client *c, const Seperator *sep);
void command_nukeitem(Client *c, const Seperator *sep);
void command_object(Client *c, const Seperator *sep);
void command_oocmute(Client *c, const Seperator *sep);
void command_path(Client *c, const Seperator *sep);
void command_peekinv(Client *c, const Seperator *sep);
void command_peqzone(Client *c, const Seperator *sep);
void command_peqzone_flags(Client *c, const Seperator *sep);
void command_permaclass(Client *c, const Seperator *sep);
void command_permagender(Client *c, const Seperator *sep);
void command_permarace(Client *c, const Seperator *sep);
void command_petitems(Client *c, const Seperator *sep);
void command_petitioninfo(Client *c, const Seperator *sep);
void command_picklock(Client *c, const Seperator *sep);
void command_profanity(Client *c, const Seperator *sep);
void command_proximity(Client *c, const Seperator *sep);
void command_push(Client *c, const Seperator *sep);
void command_pvp(Client *c, const Seperator *sep);
void command_qglobal(Client *c, const Seperator *sep);
void command_questerrors(Client *c, const Seperator *sep);
void command_race(Client *c, const Seperator *sep);
void command_raidloot(Client* c, const Seperator* sep);
void command_randomfeatures(Client *c, const Seperator *sep);
Expand All @@ -203,7 +181,6 @@ void command_scribespell(Client *c, const Seperator *sep);
void command_scribespells(Client *c, const Seperator *sep);
void command_sendzonespawns(Client *c, const Seperator *sep);
void command_sensetrap(Client *c, const Seperator *sep);
void command_serverinfo(Client *c, const Seperator *sep);
void command_serverrules(Client *c, const Seperator *sep);
void command_set_adventure_points(Client *c, const Seperator *sep);
void command_setaapts(Client *c, const Seperator *sep);
Expand All @@ -225,19 +202,11 @@ void command_setskillall(Client *c, const Seperator *sep);
void command_setstartzone(Client *c, const Seperator *sep);
void command_setstat(Client *c, const Seperator *sep);
void command_setxp(Client *c, const Seperator *sep);
void command_showbuffs(Client *c, const Seperator *sep);
void command_shownpcgloballoot(Client *c, const Seperator *sep);
void command_showskills(Client *c, const Seperator *sep);
void command_showspells(Client *c, const Seperator *sep);
void command_showspellslist(Client *c, const Seperator *sep);
void command_showstats(Client *c, const Seperator *sep);
void command_showzonegloballoot(Client *c, const Seperator *sep);
void command_showzonepoints(Client *c, const Seperator *sep);
void command_show(Client *c, const Seperator *sep);
void command_shutdown(Client *c, const Seperator *sep);
void command_spawn(Client *c, const Seperator *sep);
void command_spawneditmass(Client *c, const Seperator *sep);
void command_spawnfix(Client *c, const Seperator *sep);
void command_spawnstatus(Client *c, const Seperator *sep);
void command_stun(Client *c, const Seperator *sep);
void command_summon(Client *c, const Seperator *sep);
void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
Expand All @@ -249,12 +218,10 @@ void command_tempname(Client *c, const Seperator *sep);
void command_petname(Client *c, const Seperator *sep);
void command_texture(Client *c, const Seperator *sep);
void command_time(Client *c, const Seperator *sep);
void command_timers(Client *c, const Seperator *sep);
void command_timezone(Client *c, const Seperator *sep);
void command_title(Client *c, const Seperator *sep);
void command_titlesuffix(Client *c, const Seperator *sep);
void command_traindisc(Client *c, const Seperator *sep);
void command_trapinfo(Client *c, const Seperator *sep);
void command_tune(Client *c, const Seperator *sep);
void command_undye(Client *c, const Seperator *sep);
void command_unfreeze(Client *c, const Seperator *sep);
Expand All @@ -265,22 +232,12 @@ void command_unscribespells(Client *c, const Seperator *sep);
void command_untraindisc(Client *c, const Seperator *sep);
void command_untraindiscs(Client *c, const Seperator *sep);
void command_updatechecksum(Client* c, const Seperator* sep);
void command_uptime(Client *c, const Seperator *sep);
void command_version(Client *c, const Seperator *sep);
void command_viewcurrencies(Client *c, const Seperator *sep);
void command_viewnpctype(Client *c, const Seperator *sep);
void command_viewpetition(Client *c, const Seperator *sep);
void command_viewrecipe(Client *c, const Seperator *sep);
void command_viewzoneloot(Client *c, const Seperator *sep);
void command_wc(Client *c, const Seperator *sep);
void command_weather(Client *c, const Seperator *sep);
void command_who(Client *c, const Seperator *sep);
void command_worldshutdown(Client *c, const Seperator *sep);
void command_wp(Client *c, const Seperator *sep);
void command_wpadd(Client *c, const Seperator *sep);
void command_wpinfo(Client *c, const Seperator *sep);
void command_worldwide(Client *c, const Seperator *sep);
void command_xtargets(Client *c, const Seperator *sep);
void command_zclip(Client *c, const Seperator *sep);
void command_zcolor(Client *c, const Seperator *sep);
void command_zheader(Client *c, const Seperator *sep);
Expand All @@ -289,12 +246,10 @@ void command_zone_instance(Client *c, const Seperator *sep);
void command_zonebootup(Client *c, const Seperator *sep);
void command_zonelock(Client *c, const Seperator *sep);
void command_zoneshutdown(Client *c, const Seperator *sep);
void command_zonestatus(Client *c, const Seperator *sep);
void command_zopp(Client *c, const Seperator *sep);
void command_zsafecoords(Client *c, const Seperator *sep);
void command_zsave(Client *c, const Seperator *sep);
void command_zsky(Client *c, const Seperator *sep);
void command_zstats(Client *c, const Seperator *sep);
void command_zunderworld(Client *c, const Seperator *sep);

#include "bot.h"
Expand Down
2 changes: 1 addition & 1 deletion zone/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ class EntityList
bool add_self_to_other_lists = false
);

void GetTrapInfo(Client* client);
void GetTrapInfo(Client* c);
bool IsTrapGroupSpawned(uint32 trap_id, uint8 group);
void UpdateAllTraps(bool respawn, bool repopnow = false);
void ClearTrapPointers();
Expand Down
28 changes: 0 additions & 28 deletions zone/gm_commands/aggro.cpp

This file was deleted.

23 changes: 0 additions & 23 deletions zone/gm_commands/checklos.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions zone/gm_commands/cvs.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions zone/gm_commands/distance.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions zone/gm_commands/flags.cpp

This file was deleted.

Loading

0 comments on commit e55fb1c

Please sign in to comment.