diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/HPM.h | 6 | ||||
-rw-r--r-- | src/common/HPMDataCheck.h | 13 | ||||
-rw-r--r-- | src/common/console.c | 5 | ||||
-rw-r--r-- | src/common/core.c | 11 | ||||
-rw-r--r-- | src/common/mmo.h | 14 |
5 files changed, 29 insertions, 20 deletions
diff --git a/src/common/HPM.h b/src/common/HPM.h index e55397022..efa5d8370 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -42,11 +42,7 @@ #define DLL HINSTANCE #else // ! WIN32 #include <dlfcn.h> - #ifdef RTLD_DEEPBIND // Certain linux distributions require this, but it's not available everywhere - #define plugin_open(x) dlopen((x),RTLD_NOW|RTLD_DEEPBIND) - #else // ! RTLD_DEEPBIND - #define plugin_open(x) dlopen((x),RTLD_NOW) - #endif // RTLD_DEEPBIND + #define plugin_open(x) dlopen((x), RTLD_NOW) #define plugin_import(x,y,z) (z)dlsym((x),(y)) #define plugin_close(x) dlclose(x) #define plugin_geterror(buf) ((void)buf, dlerror()) diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index e82f9fed3..c004c534e 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -52,6 +52,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #define CHAR_GEOIP_H #endif // CHAR_GEOIP_H #ifdef CHAR_INTER_H + { "WisData", sizeof(struct WisData), SERVER_TYPE_CHAR }, { "inter_interface", sizeof(struct inter_interface), SERVER_TYPE_CHAR }, #else #define CHAR_INTER_H @@ -214,6 +215,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "guild_storage", sizeof(struct guild_storage), SERVER_TYPE_ALL }, { "hotkey", sizeof(struct hotkey), SERVER_TYPE_ALL }, { "item", sizeof(struct item), SERVER_TYPE_ALL }, + { "item_option", sizeof(struct item_option), SERVER_TYPE_ALL }, { "mail_data", sizeof(struct mail_data), SERVER_TYPE_ALL }, { "mail_message", sizeof(struct mail_message), SERVER_TYPE_ALL }, { "mmo_charstatus", sizeof(struct mmo_charstatus), SERVER_TYPE_ALL }, @@ -432,6 +434,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "hCSData", sizeof(struct hCSData), SERVER_TYPE_MAP }, { "merge_item", sizeof(struct merge_item), SERVER_TYPE_MAP }, { "s_packet_db", sizeof(struct s_packet_db), SERVER_TYPE_MAP }, + { "stylist_data_entry", sizeof(struct stylist_data_entry), SERVER_TYPE_MAP }, #else #define MAP_CLIF_H #endif // MAP_CLIF_H @@ -492,12 +495,12 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "item_combo", sizeof(struct item_combo), SERVER_TYPE_MAP }, { "item_data", sizeof(struct item_data), SERVER_TYPE_MAP }, { "item_group", sizeof(struct item_group), SERVER_TYPE_MAP }, - { "item_option", sizeof(struct item_option), SERVER_TYPE_MAP }, { "item_package", sizeof(struct item_package), SERVER_TYPE_MAP }, { "item_package_must_entry", sizeof(struct item_package_must_entry), SERVER_TYPE_MAP }, { "item_package_rand_entry", sizeof(struct item_package_rand_entry), SERVER_TYPE_MAP }, { "item_package_rand_group", sizeof(struct item_package_rand_group), SERVER_TYPE_MAP }, { "itemdb_interface", sizeof(struct itemdb_interface), SERVER_TYPE_MAP }, + { "itemdb_option", sizeof(struct itemdb_option), SERVER_TYPE_MAP }, { "itemlist", sizeof(struct itemlist), SERVER_TYPE_MAP }, { "itemlist_entry", sizeof(struct itemlist_entry), SERVER_TYPE_MAP }, #else @@ -587,6 +590,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_CZ_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_CZ_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP }, { "PACKET_CZ_CHECKNAME", sizeof(struct PACKET_CZ_CHECKNAME), SERVER_TYPE_MAP }, { "PACKET_CZ_OPEN_UI", sizeof(struct PACKET_CZ_OPEN_UI), SERVER_TYPE_MAP }, + { "PACKET_CZ_PET_EVOLUTION", sizeof(struct PACKET_CZ_PET_EVOLUTION), SERVER_TYPE_MAP }, { "PACKET_CZ_PRIVATE_AIRSHIP_REQUEST", sizeof(struct PACKET_CZ_PRIVATE_AIRSHIP_REQUEST), SERVER_TYPE_MAP }, { "PACKET_CZ_REQ_DELETE_MAIL", sizeof(struct PACKET_CZ_REQ_DELETE_MAIL), SERVER_TYPE_MAP }, { "PACKET_CZ_REQ_ITEM_FROM_MAIL", sizeof(struct PACKET_CZ_REQ_ITEM_FROM_MAIL), SERVER_TYPE_MAP }, @@ -596,6 +600,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_CZ_REQ_READ_MAIL", sizeof(struct PACKET_CZ_REQ_READ_MAIL), SERVER_TYPE_MAP }, { "PACKET_CZ_REQ_REFRESH_MAIL_LIST", sizeof(struct PACKET_CZ_REQ_REFRESH_MAIL_LIST), SERVER_TYPE_MAP }, { "PACKET_CZ_REQ_REMOVE_ITEM_MAIL", sizeof(struct PACKET_CZ_REQ_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP }, + { "PACKET_CZ_REQ_STYLE_CHANGE", sizeof(struct PACKET_CZ_REQ_STYLE_CHANGE), SERVER_TYPE_MAP }, { "PACKET_CZ_REQ_ZENY_FROM_MAIL", sizeof(struct PACKET_CZ_REQ_ZENY_FROM_MAIL), SERVER_TYPE_MAP }, { "PACKET_CZ_SEND_MAIL", sizeof(struct PACKET_CZ_SEND_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_CLAN_LEAVE", sizeof(struct PACKET_ZC_ACK_CLAN_LEAVE), SERVER_TYPE_MAP }, @@ -613,18 +618,22 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_GROUP_LIST_SUB", sizeof(struct PACKET_ZC_GROUP_LIST_SUB), SERVER_TYPE_MAP }, { "PACKET_ZC_MAIL_LIST", sizeof(struct PACKET_ZC_MAIL_LIST), SERVER_TYPE_MAP }, { "PACKET_ZC_MSG_COLOR", sizeof(struct PACKET_ZC_MSG_COLOR), SERVER_TYPE_MAP }, + { "PACKET_ZC_NOTIFY_CHAT", sizeof(struct PACKET_ZC_NOTIFY_CHAT), SERVER_TYPE_MAP }, { "PACKET_ZC_NOTIFY_CLAN_CHAT", sizeof(struct PACKET_ZC_NOTIFY_CLAN_CHAT), SERVER_TYPE_MAP }, { "PACKET_ZC_NOTIFY_CLAN_CONNECTINFO", sizeof(struct PACKET_ZC_NOTIFY_CLAN_CONNECTINFO), SERVER_TYPE_MAP }, + { "PACKET_ZC_NOTIFY_PLAYERCHAT", sizeof(struct PACKET_ZC_NOTIFY_PLAYERCHAT), SERVER_TYPE_MAP }, { "PACKET_ZC_NOTIFY_UNREADMAIL", sizeof(struct PACKET_ZC_NOTIFY_UNREADMAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_OPEN_UI", sizeof(struct PACKET_ZC_OPEN_UI), SERVER_TYPE_MAP }, { "PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE", sizeof(struct PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE), SERVER_TYPE_MAP }, { "PACKET_ZC_READ_MAIL", sizeof(struct PACKET_ZC_READ_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, + { "PACKET_ZC_STYLE_CHANGE_RES", sizeof(struct PACKET_ZC_STYLE_CHANGE_RES), SERVER_TYPE_MAP }, { "PACKET_ZC_UI_ACTION", sizeof(struct PACKET_ZC_UI_ACTION), SERVER_TYPE_MAP }, { "PACKET_ZC_WRITE_MAIL_RESULT", sizeof(struct PACKET_ZC_WRITE_MAIL_RESULT), SERVER_TYPE_MAP }, { "ZC_PROGRESS_ACTOR", sizeof(struct ZC_PROGRESS_ACTOR), SERVER_TYPE_MAP }, { "mail_item", sizeof(struct mail_item), SERVER_TYPE_MAP }, { "maillistinfo", sizeof(struct maillistinfo), SERVER_TYPE_MAP }, + { "packet_ZC_REFUSE_LOGIN", sizeof(struct packet_ZC_REFUSE_LOGIN), SERVER_TYPE_MAP }, { "packet_additem", sizeof(struct packet_additem), SERVER_TYPE_MAP }, { "packet_authok", sizeof(struct packet_authok), SERVER_TYPE_MAP }, { "packet_banking_check", sizeof(struct packet_banking_check), SERVER_TYPE_MAP }, @@ -693,6 +702,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_viewequip_ack", sizeof(struct packet_viewequip_ack), SERVER_TYPE_MAP }, { "packet_whisper_message", sizeof(struct packet_whisper_message), SERVER_TYPE_MAP }, { "packet_wis_end", sizeof(struct packet_wis_end), SERVER_TYPE_MAP }, + { "pet_evolution_items", sizeof(struct pet_evolution_items), SERVER_TYPE_MAP }, #else #define MAP_PACKETS_STRUCT_H #endif // MAP_PACKETS_STRUCT_H @@ -743,6 +753,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #ifdef MAP_PET_H { "pet_bonus", sizeof(struct pet_bonus), SERVER_TYPE_MAP }, { "pet_data", sizeof(struct pet_data), SERVER_TYPE_MAP }, + { "pet_evolve_data", sizeof(struct pet_evolve_data), SERVER_TYPE_MAP }, { "pet_interface", sizeof(struct pet_interface), SERVER_TYPE_MAP }, { "pet_loot", sizeof(struct pet_loot), SERVER_TYPE_MAP }, { "pet_recovery", sizeof(struct pet_recovery), SERVER_TYPE_MAP }, diff --git a/src/common/console.c b/src/common/console.c index 0b0a900f6..e7edd7e1e 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -133,7 +133,10 @@ int console_parse_key_pressed(void) **/ CPCMD_C(exit, server) { - core->runflag = 0; + if (core->shutdown_callback != NULL) + core->shutdown_callback(); + else + core->runflag = CORE_ST_STOP; } /** diff --git a/src/common/core.c b/src/common/core.c index 1bd332eec..406bb7629 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -80,9 +80,6 @@ // And don't complain to us if the XYZ plugin you installed wiped your hard disk, or worse. // Note: This feature is deprecated, and should not be used. -/// Called when a terminate signal is received. -void (*shutdown_callback)(void) = NULL; - struct core_interface core_s; struct core_interface *core = &core_s; @@ -128,8 +125,8 @@ static BOOL WINAPI console_handler(DWORD c_event) case CTRL_CLOSE_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: - if( shutdown_callback != NULL ) - shutdown_callback(); + if (core->shutdown_callback != NULL) + core->shutdown_callback(); else core->runflag = CORE_ST_STOP;// auto-shutdown break; @@ -158,8 +155,8 @@ static void sig_proc(int sn) case SIGTERM: if (++is_called > 3) exit(EXIT_SUCCESS); - if( shutdown_callback != NULL ) - shutdown_callback(); + if (core->shutdown_callback != NULL) + core->shutdown_callback(); else core->runflag = CORE_ST_STOP;// auto-shutdown break; diff --git a/src/common/mmo.h b/src/common/mmo.h index 74d48dd47..4a79245a1 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -363,6 +363,12 @@ enum attribute_flag { ATTR_BROKEN = 1, }; +struct item_option { + int16 index; + int16 value; + uint8 param; +}; + struct item { int id; short nameid; @@ -376,12 +382,7 @@ struct item { char favorite; unsigned char bound; uint64 unique_id; - - struct { - int16 index; - int16 value; - uint8 param; - } option[MAX_ITEM_OPTIONS]; + struct item_option option[MAX_ITEM_OPTIONS]; }; //Equip position constants @@ -544,6 +545,7 @@ struct s_pet { char name[NAME_LENGTH]; char rename_flag; char incubate; + int autofeed; }; struct s_homunculus { //[orn] |