diff options
Diffstat (limited to 'src/map/HPMmap.c')
-rw-r--r-- | src/map/HPMmap.c | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index 289375323..42c7b3c5f 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2020 Hercules Dev Team * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,10 +31,15 @@ #include "common/db.h" #include "common/des.h" #include "common/ers.h" +#include "common/grfio.h" +#include "common/md5calc.h" #include "common/memmgr.h" +#include "common/mutex.h" #include "common/mapindex.h" #include "common/mmo.h" #include "common/nullpo.h" +#include "common/packets.h" +#include "common/random.h" #include "common/showmsg.h" #include "common/socket.h" #include "common/spinlock.h" @@ -43,6 +48,7 @@ #include "common/sysinfo.h" #include "common/timer.h" #include "common/utils.h" +#include "map/achievement.h" #include "map/atcommand.h" #include "map/battle.h" #include "map/battleground.h" @@ -50,6 +56,7 @@ #include "map/channel.h" #include "map/chat.h" #include "map/chrif.h" +#include "map/clan.h" #include "map/clif.h" #include "map/date.h" #include "map/duel.h" @@ -67,18 +74,21 @@ #include "map/mercenary.h" #include "map/mob.h" #include "map/npc.h" -#include "map/packets_struct.h" #include "map/party.h" #include "map/path.h" #include "map/pc.h" #include "map/pc_groups.h" #include "map/pet.h" #include "map/quest.h" +#include "map/rodex.h" +#include "map/refine.h" +#include "map/refine.p.h" #include "map/script.h" #include "map/searchstore.h" #include "map/skill.h" #include "map/status.h" #include "map/storage.h" +#include "map/stylist.h" #include "map/trade.h" #include "map/unit.h" #include "map/vending.h" @@ -98,8 +108,8 @@ struct HPM_atcommand_list { AtCommandFunc func; }; -struct HPM_atcommand_list *atcommand_list = NULL; -unsigned int atcommand_list_items = 0; +static struct HPM_atcommand_list *atcommand_list = NULL; +static unsigned int atcommand_list_items = 0; /** * HPM plugin data store validator sub-handler (map-server) @@ -109,33 +119,36 @@ unsigned int atcommand_list_items = 0; bool HPM_map_data_store_validate(enum HPluginDataTypes type, struct hplugin_data_store **storeptr, bool initialize) { switch (type) { - case HPDT_MSD: - case HPDT_NPCD: - case HPDT_MAP: - case HPDT_PARTY: - case HPDT_GUILD: - case HPDT_INSTANCE: - case HPDT_MOBDB: - case HPDT_MOBDATA: - case HPDT_ITEMDATA: - case HPDT_BGDATA: - case HPDT_AUTOTRADE_VEND: - // Initialized by the caller. - return true; - default: - break; + case HPDT_MSD: + case HPDT_NPCD: + case HPDT_MAP: + case HPDT_PARTY: + case HPDT_GUILD: + case HPDT_INSTANCE: + case HPDT_MOBDB: + case HPDT_MOBDATA: + case HPDT_ITEMDATA: + case HPDT_BGDATA: + case HPDT_AUTOTRADE_VEND: + case HPDT_CLAN: + // Initialized by the caller. + return true; + default: + break; } return false; } -void HPM_map_plugin_load_sub(struct hplugin *plugin) { +void HPM_map_plugin_load_sub(struct hplugin *plugin) +{ plugin->hpi->sql_handle = map->mysql_handle; plugin->hpi->addCommand = atcommand->create; plugin->hpi->addScript = script->addScript; plugin->hpi->addPCGPermission = HPM_map_add_group_permission; } -bool HPM_map_add_atcommand(char *name, AtCommandFunc func) { +bool HPM_map_add_atcommand(char *name, AtCommandFunc func) +{ unsigned int i = 0; for(i = 0; i < atcommand_list_items; i++) { @@ -155,7 +168,8 @@ bool HPM_map_add_atcommand(char *name, AtCommandFunc func) { return true; } -void HPM_map_atcommands(void) { +void HPM_map_atcommands(void) +{ unsigned int i; for(i = 0; i < atcommand_list_items; i++) { @@ -166,7 +180,8 @@ void HPM_map_atcommands(void) { /** * Adds a new group permission to the HPM-provided list **/ -void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask) { +void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask) +{ unsigned char index = pcg->HPMpermissions_count; RECREATE(pcg->HPMpermissions, struct pc_groups_new_permission, ++pcg->HPMpermissions_count); @@ -176,14 +191,16 @@ void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned in pcg->HPMpermissions[index].mask = mask; } -void HPM_map_do_init(void) { +void HPM_map_do_init(void) +{ HPM->load_sub = HPM_map_plugin_load_sub; HPM->data_store_validate_sub = HPM_map_data_store_validate; HPM->datacheck_init(HPMDataCheck, HPMDataCheckLen, HPMDataCheckVer); HPM_shared_symbols(SERVER_TYPE_MAP); } -void HPM_map_do_final(void) { +void HPM_map_do_final(void) +{ if (atcommand_list) aFree(atcommand_list); /** |