diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/HPMchar.h | 4 | ||||
-rw-r--r-- | src/char/char.h | 2 | ||||
-rw-r--r-- | src/char/geoip.h | 2 | ||||
-rw-r--r-- | src/char/int_auction.c | 2 | ||||
-rw-r--r-- | src/char/int_auction.h | 2 | ||||
-rw-r--r-- | src/char/int_elemental.h | 2 | ||||
-rw-r--r-- | src/char/int_guild.c | 6 | ||||
-rw-r--r-- | src/char/int_guild.h | 2 | ||||
-rw-r--r-- | src/char/int_homun.h | 2 | ||||
-rw-r--r-- | src/char/int_mail.c | 14 | ||||
-rw-r--r-- | src/char/int_mail.h | 2 | ||||
-rw-r--r-- | src/char/int_mercenary.h | 2 | ||||
-rw-r--r-- | src/char/int_party.h | 2 | ||||
-rw-r--r-- | src/char/int_pet.h | 2 | ||||
-rw-r--r-- | src/char/int_quest.c | 6 | ||||
-rw-r--r-- | src/char/int_quest.h | 2 | ||||
-rw-r--r-- | src/char/int_storage.c | 4 | ||||
-rw-r--r-- | src/char/int_storage.h | 2 | ||||
-rw-r--r-- | src/char/inter.h | 2 | ||||
-rw-r--r-- | src/char/loginif.h | 2 | ||||
-rw-r--r-- | src/char/mapif.h | 2 | ||||
-rw-r--r-- | src/char/pincode.h | 2 |
22 files changed, 50 insertions, 18 deletions
diff --git a/src/char/HPMchar.h b/src/char/HPMchar.h index 9d367725c..aa266f1de 100644 --- a/src/char/HPMchar.h +++ b/src/char/HPMchar.h @@ -4,6 +4,10 @@ #ifndef CHAR_HPMCHAR_H #define CHAR_HPMCHAR_H +#ifndef HERCULES_CORE +#error You should never include HPMchar.h from a plugin. +#endif + #include "../common/cbasetypes.h" #include "../common/HPM.h" diff --git a/src/char/char.h b/src/char/char.h index a6707a7f9..4b68dc43c 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -63,6 +63,7 @@ enum { TABLE_GUILD_STORAGE, }; +#ifdef HERCULES_CORE extern int char_name_option; extern char char_name_letters[]; extern bool char_gm_read; @@ -112,6 +113,7 @@ extern int log_inter; void char_load_defaults(); void char_defaults(); +#endif // HERCULES_CORE struct char_auth_node { int account_id; diff --git a/src/char/geoip.h b/src/char/geoip.h index 8cad2f73b..a7ab6b9a4 100644 --- a/src/char/geoip.h +++ b/src/char/geoip.h @@ -27,6 +27,8 @@ struct geoip_interface { struct geoip_interface *geoip; +#ifdef HERCULES_CORE void geoip_defaults(void); +#endif // HERCULES_CORE #endif /* CHAR_GEOIP_H */ diff --git a/src/char/int_auction.c b/src/char/int_auction.c index e28240ca6..5d42e6398 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -188,7 +188,7 @@ void inter_auctions_fromsql(void) StrBuf->Printf(&buf, ",`card%d`", i); StrBuf->Printf(&buf, " FROM `%s` ORDER BY `auction_id` DESC", auction_db); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); diff --git a/src/char/int_auction.h b/src/char/int_auction.h index ad8ac7b67..c27ecd6c3 100644 --- a/src/char/int_auction.h +++ b/src/char/int_auction.h @@ -6,7 +6,9 @@ #include "../common/mmo.h" +#ifdef HERCULES_CORE void inter_auction_defaults(void); +#endif // HERCULES_CORE /** * inter_auction_interface interface diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index 611d97550..7aa379ebb 100644 --- a/src/char/int_elemental.h +++ b/src/char/int_elemental.h @@ -6,7 +6,9 @@ #include "../common/cbasetypes.h" +#ifdef HERCULES_CORE void inter_elemental_defaults(void); +#endif // HERCULES_CORE /** * inter_elemental_interface interface diff --git a/src/char/int_guild.c b/src/char/int_guild.c index a5623f83d..7af01f883 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -215,7 +215,7 @@ int inter_guild_tosql(struct guild *g,int flag) StrBuf->Printf(&buf, "`guild_lv`=%d, `skill_point`=%d, `exp`=%"PRIu64", `next_exp`=%u, `max_member`=%d", g->guild_lv, g->skill_point, g->exp, g->next_exp, g->max_member); } StrBuf->Printf(&buf, " WHERE `guild_id`=%d", g->guild_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, "%s", StrBuf->Value(&buf)) ) + if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) ) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); } @@ -531,7 +531,7 @@ int inter_guild_castle_tosql(struct guild_castle *gc) for (i = 0; i < MAX_GUARDIANS; ++i) StrBuf->Printf(&buf, ", `visibleG%d`='%d'", i, gc->guardian[i].visible); - if (SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf))) + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); else if(save_log) ShowInfo("Saved guild castle (%d)\n", gc->castle_id); @@ -557,7 +557,7 @@ struct guild_castle* inter_guild_castle_fromsql(int castle_id) for (i = 0; i < MAX_GUARDIANS; ++i) StrBuf->Printf(&buf, ", `visibleG%d`", i); StrBuf->Printf(&buf, " FROM `%s` WHERE `castle_id`='%d'", guild_castle_db, castle_id); - if (SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf))) { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) { Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); return NULL; diff --git a/src/char/int_guild.h b/src/char/int_guild.h index 960150f4f..e7d089943 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -22,7 +22,9 @@ enum { GS_REMOVE = 0x8000, }; +#ifdef HERCULES_CORE void inter_guild_defaults(void); +#endif // HERCULES_CORE /** * inter_guild interface diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 5bfa355d4..0212da150 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -8,7 +8,9 @@ struct s_homunculus; +#ifdef HERCULES_CORE void inter_homunculus_defaults(void); +#endif // HERCULES_CORE /** * inter_homunculus interface diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 2c0a85f33..0e5043e14 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -45,7 +45,7 @@ static int inter_mail_fromsql(int char_id, struct mail_data* md) StrBuf->Printf(&buf, " FROM `%s` WHERE `dest_id`='%d' AND `status` < 3 ORDER BY `id` LIMIT %d", mail_db, char_id, MAIL_MAX_INBOX + 1); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); @@ -160,16 +160,13 @@ static bool inter_mail_loadmessage(int mail_id, struct mail_message* msg) StrBuf->Printf(&buf, ",`card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `id` = '%d'", mail_db, mail_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) - || SQL_SUCCESS != SQL->NextRow(inter->sql_handle) ) - { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) + || SQL_SUCCESS != SQL->NextRow(inter->sql_handle)) { Sql_ShowDebug(inter->sql_handle); SQL->FreeResult(inter->sql_handle); StrBuf->Destroy(&buf); return false; - } - else - { + } else { char* data; SQL->GetData(inter->sql_handle, 0, &data, NULL); msg->id = atoi(data); @@ -253,8 +250,7 @@ static bool inter_mail_DeleteAttach(int mail_id) StrBuf->Printf(&buf, ", `card%d` = '0'", i); StrBuf->Printf(&buf, " WHERE `id` = '%d'", mail_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) - { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) { Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 5ce7bafa2..02f640ae2 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -10,7 +10,9 @@ struct item; struct mail_data; struct mail_message; +#ifdef HERCULES_CORE void inter_mail_defaults(void); +#endif // HERCULES_CORE /** * inter_mail interface diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h index b22ea61b2..049429e1d 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -8,7 +8,9 @@ struct mmo_charstatus; +#ifdef HERCULES_CORE void inter_mercenary_defaults(void); +#endif // HERCULES_CORE /** * inter_mercenary interface diff --git a/src/char/int_party.h b/src/char/int_party.h index 0c70a5300..61d828bc0 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -23,7 +23,9 @@ struct party_data { unsigned char size; //Total size of party. }; +#ifdef HERCULES_CORE void inter_party_defaults(void); +#endif // HERCULES_CORE /** * inter_party interface diff --git a/src/char/int_pet.h b/src/char/int_pet.h index 873613307..69e440781 100644 --- a/src/char/int_pet.h +++ b/src/char/int_pet.h @@ -6,7 +6,9 @@ struct s_pet; +#ifdef HERCULES_CORE void inter_pet_defaults(void); +#endif // HERCULES_CORE /** * inter_pet interface diff --git a/src/char/int_quest.c b/src/char/int_quest.c index b993cbc14..dd3d4e1bf 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -60,7 +60,7 @@ struct quest *mapif_quests_fromsql(int char_id, int *count) memset(&tmp_quest, 0, sizeof(struct quest)); - if (SQL_ERROR == SQL->StmtPrepare(stmt, StrBuf->Value(&buf)) + if (SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf)) || SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &char_id, 0) || SQL_ERROR == SQL->StmtExecute(stmt) || SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL) @@ -142,7 +142,7 @@ bool mapif_quest_add(int char_id, struct quest qd) StrBuf->Printf(&buf, ", '%d'", qd.count[i]); } StrBuf->AppendStr(&buf, ")"); - if (SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf))) { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) { Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); return false; @@ -171,7 +171,7 @@ bool mapif_quest_update(int char_id, struct quest qd) } StrBuf->Printf(&buf, " WHERE `quest_id` = '%d' AND `char_id` = '%d'", qd.quest_id, char_id); - if (SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf))) { + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) { Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); return false; diff --git a/src/char/int_quest.h b/src/char/int_quest.h index 265a3f97a..2cb359d40 100644 --- a/src/char/int_quest.h +++ b/src/char/int_quest.h @@ -4,7 +4,9 @@ #ifndef CHAR_QUEST_H #define CHAR_QUEST_H +#ifdef HERCULES_CORE void inter_quest_defaults(void); +#endif // HERCULES_CORE /** * inter_quest interface diff --git a/src/char/int_storage.c b/src/char/int_storage.c index d64e11b89..f2dd4d47a 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -51,7 +51,7 @@ int inter_storage_fromsql(int account_id, struct storage_data* p) StrBuf->Printf(&buf, ",`card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `account_id`='%d' ORDER BY `nameid`", storage_db, account_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) + if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); @@ -109,7 +109,7 @@ int inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage* p) StrBuf->Printf(&buf, ",`card%d`", j); StrBuf->Printf(&buf, " FROM `%s` WHERE `guild_id`='%d' ORDER BY `nameid`", guild_storage_db, guild_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, StrBuf->Value(&buf)) ) + if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) Sql_ShowDebug(inter->sql_handle); StrBuf->Destroy(&buf); diff --git a/src/char/int_storage.h b/src/char/int_storage.h index 6c380f29b..11a16de83 100644 --- a/src/char/int_storage.h +++ b/src/char/int_storage.h @@ -7,7 +7,9 @@ struct storage_data; struct guild_storage; +#ifdef HERCULES_CORE void inter_storage_defaults(void); +#endif // HERCULES_CORE /** * inter_storage interface diff --git a/src/char/inter.h b/src/char/inter.h index c4bb43c1d..7f5b5fc22 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -13,9 +13,11 @@ struct accreg; #define inter_cfgName "conf/inter-server.conf" +#ifdef HERCULES_CORE extern unsigned int party_share_level; void inter_defaults(void); +#endif // HERCULES_CORE /** * inter interface diff --git a/src/char/loginif.h b/src/char/loginif.h index 27eb62a1a..634bd4b8b 100644 --- a/src/char/loginif.h +++ b/src/char/loginif.h @@ -28,6 +28,8 @@ struct loginif_interface { struct loginif_interface *loginif; +#ifdef HERCULES_CORE void loginif_defaults(void); +#endif // HERCULES_CORE #endif /* CHAR_LOGINIF_H */ diff --git a/src/char/mapif.h b/src/char/mapif.h index f9c06256d..528522d1e 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -193,6 +193,8 @@ struct mapif_interface { struct mapif_interface *mapif; +#ifdef HERCULES_CORE void mapif_defaults(void); +#endif // HERCULES_CORE #endif /* CHAR_MAPIF_H */ diff --git a/src/char/pincode.h b/src/char/pincode.h index f4265716a..178d7e427 100644 --- a/src/char/pincode.h +++ b/src/char/pincode.h @@ -42,6 +42,8 @@ struct pincode_interface { struct pincode_interface *pincode; +#ifdef HERCULES_CORE void pincode_defaults(void); +#endif // HERCULES_CORE #endif /* CHAR_PINCODE_H */ |