summaryrefslogtreecommitdiff
path: root/src/map/HPMmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/HPMmap.c')
-rw-r--r--src/map/HPMmap.c58
1 files changed, 34 insertions, 24 deletions
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index 84544976a..6eff37df8 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -38,6 +38,7 @@
#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"
@@ -47,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"
@@ -54,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"
@@ -71,13 +74,13 @@
#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/script.h"
#include "map/searchstore.h"
#include "map/skill.h"
@@ -102,8 +105,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)
@@ -113,33 +116,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++) {
@@ -159,7 +165,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++) {
@@ -170,7 +177,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);
@@ -180,14 +188,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);
/**