diff options
author | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
---|---|---|
committer | Happy <markaizer@gmail.com> | 2014-08-21 04:50:46 +0800 |
commit | f52e1007fe08c67003c0bc4c78231904dd3fd5cc (patch) | |
tree | 99907d827264e501774e58ab4630e41fa7103c02 /src/map/atcommand.h | |
parent | 2410110dece79b4598c12f1c953219f1d0d1904a (diff) | |
parent | 769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6 (diff) | |
download | hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.gz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.bz2 hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.tar.xz hercules-f52e1007fe08c67003c0bc4c78231904dd3fd5cc.zip |
Merge pull request #1 from HerculesWS/master
Update from original
Diffstat (limited to 'src/map/atcommand.h')
-rw-r--r-- | src/map/atcommand.h | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/map/atcommand.h b/src/map/atcommand.h index f09b1f2b8..356487bd1 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -2,9 +2,11 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _ATCOMMAND_H_ -#define _ATCOMMAND_H_ +#ifndef MAP_ATCOMMAND_H +#define MAP_ATCOMMAND_H +#include "pc_groups.h" +#include "../common/conf.h" #include "../common/db.h" /** @@ -12,13 +14,14 @@ **/ struct map_session_data; struct AtCommandInfo; +struct block_list; /** * Defines **/ #define ATCOMMAND_LENGTH 50 #define MAX_MSG 1500 - +#define msg_txt(idx) atcommand->msg(idx) /** * Enumerations **/ @@ -68,32 +71,54 @@ struct atcommand_interface { /* atcommand binding */ struct atcmd_binding_data** binding; int binding_count; - unsigned int *group_ids; /* other vars */ DBMap* db; //name -> AtCommandInfo DBMap* alias_db; //alias -> AtCommandInfo /* */ - void (*init) (void); + char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others) + /* */ + void (*init) (bool minimal); void (*final) (void); /* */ - bool (*parse) (const int fd, struct map_session_data* sd, const char* message, int type); + bool (*exec) (const int fd, struct map_session_data *sd, const char *message, bool player_invoked); bool (*create) (char *name, AtCommandFunc func); bool (*can_use) (struct map_session_data *sd, const char *command); bool (*can_use2) (struct map_session_data *sd, const char *command, AtCommandType type); - void (*load_groups) (void); + void (*load_groups) (GroupSettings **groups, config_setting_t **commands_, size_t sz); AtCommandInfo* (*exists) (const char* name); - int (*msg_read) (const char* cfgName); + bool (*msg_read) (const char *cfg_name, bool allow_override); void (*final_msg) (void); /* atcommand binding */ struct atcmd_binding_data* (*get_bind_byname) (const char* name); -} atcommand_s; + /* */ + AtCommandInfo* (*get_info_byname) (const char *name); // @help + const char* (*check_alias) (const char *aliasname); // @help + void (*get_suggestions) (struct map_session_data* sd, const char *name, bool is_atcmd_cmd); // @help + void (*config_read) (const char* config_filename); + /* command-specific subs */ + int (*stopattack) (struct block_list *bl,va_list ap); + int (*pvpoff_sub) (struct block_list *bl,va_list ap); + int (*pvpon_sub) (struct block_list *bl,va_list ap); + int (*atkillmonster_sub) (struct block_list *bl, va_list ap); + void (*raise_sub) (struct map_session_data* sd); + void (*get_jail_time) (int jailtime, int* year, int* month, int* day, int* hour, int* minute); + int (*cleanfloor_sub) (struct block_list *bl, va_list ap); + int (*mutearea_sub) (struct block_list *bl,va_list ap); + /* */ + void (*commands_sub) (struct map_session_data* sd, const int fd, AtCommandType type); + void (*cmd_db_clear) (void); + int (*cmd_db_clear_sub) (DBKey key, DBData *data, va_list args); + void (*doload) (void); + void (*base_commands) (void); + bool (*add) (char *name, AtCommandFunc func, bool replace); + const char* (*msg) (int msg_number); +}; struct atcommand_interface *atcommand; -const char* msg_txt(int msg_number); void atcommand_defaults(void); + /* stay here */ #define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info) -#define ACMD_A(x) atcommand_ ## x -#endif /* _ATCOMMAND_H_ */ +#endif /* MAP_ATCOMMAND_H */ |