[Commands] Cleanup #findaliases and #help Commands. (#2204)

- Cleanup messages and logic.
- Add saylinks to messages for ease of use when searching for commands as most have help messages when using them incorrectly or require no arguments and can be used immediately from the say link.
This commit is contained in:
Kinglykrab
2022-05-27 15:28:36 -04:00
committed by GitHub
parent 275995a374
commit d7f38361f2
3 changed files with 334 additions and 252 deletions
+13 -13
View File
@@ -5,29 +5,30 @@ class Client;
class Seperator;
#include "../common/types.h"
#include <string>
#define COMMAND_CHAR '#'
typedef void (*CmdFuncPtr)(Client *, const Seperator *);
typedef struct {
int access;
const char *desc; // description of command
CmdFuncPtr function; // null means perl function
} CommandRecord;
uint8 admin;
std::string description;
CmdFuncPtr function; // null means perl function
} CommandRecord;
extern int (*command_dispatch)(Client *, char const *);
extern int commandcount; // number of commands loaded
extern int (*command_dispatch)(Client *,std::string);
extern int command_count; // Commands Loaded Count
// the command system:
// Command Utilities
int command_init(void);
void command_deinit(void);
int command_add(std::string command_name, const char *desc, int access, CmdFuncPtr function);
int command_notavail(Client *c, const char *message);
int command_realdispatch(Client *c, char const *message);
void command_logcommand(Client *c, const char *message);
int command_add(std::string command_name, std::string description, uint8 admin, CmdFuncPtr function);
int command_notavail(Client *c, std::string message);
int command_realdispatch(Client *c, std::string message);
void command_logcommand(Client *c, std::string message);
//commands
// 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);
@@ -107,7 +108,6 @@ void command_gmzone(Client *c, const Seperator *sep);
void command_goto(Client *c, const Seperator *sep);
void command_grid(Client *c, const Seperator *sep);
void command_guild(Client *c, const Seperator *sep);
bool helper_guild_edit(Client *c, uint32 dbid, uint32 eqid, uint8 rank, const char *what, const char *value);
void command_guildapprove(Client *c, const Seperator *sep);
void command_guildcreate(Client *c, const Seperator *sep);
void command_guildlist(Client *c, const Seperator *sep);