summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-08 17:31:28 -0300
committershennetsind <ind@henn.et>2013-06-08 17:31:28 -0300
commit4c31ec091c3dcef916c90b6416976ea701671e90 (patch)
tree421552306c5f014103c6f8efc261e947bbb448c5 /src/map
parent60eb0c9e0527e80b7793e48d2cea47e3204b777c (diff)
downloadhercules-4c31ec091c3dcef916c90b6416976ea701671e90.tar.gz
hercules-4c31ec091c3dcef916c90b6416976ea701671e90.tar.bz2
hercules-4c31ec091c3dcef916c90b6416976ea701671e90.tar.xz
hercules-4c31ec091c3dcef916c90b6416976ea701671e90.zip
Follow up d73783f22b2bb881aab74524d153d89a5932a199
Adjusting db.c interface name to adhere with the rest (pretty much we try to make it as short as we can, and being there were no conflicts we saw no reason to maintain the 'i') Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c8
-rw-r--r--src/map/battleground.c2
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/guild.c28
-rw-r--r--src/map/itemdb.c8
-rw-r--r--src/map/map.c14
-rw-r--r--src/map/npc.c14
-rw-r--r--src/map/party.c2
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/storage.c4
11 files changed, 45 insertions, 45 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 32191032c..36c4b987d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5340,12 +5340,12 @@ ACMD(skillid) {
iter = db_iterator(skilldb_name2id);
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
- idx = skill->get_index(iDB->data2i(data));
+ idx = skill->get_index(DB->data2i(data));
if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) {
- sprintf(atcmd_output, msg_txt(1164), iDB->data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
+ sprintf(atcmd_output, msg_txt(1164), DB->data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
clif->message(fd, atcmd_output);
} else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) {
- snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), iDB->data2i(data), skill_db[idx].desc, key.str);
+ snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), DB->data2i(data), skill_db[idx].desc, key.str);
}
}
@@ -9156,7 +9156,7 @@ ACMD(channel) {
iter = db_iterator(channel->banned);
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
- struct hChSysBanEntry * entry = iDB->data2ptr(data);
+ struct hChSysBanEntry * entry = DB->data2ptr(data);
if( !isA )
sprintf(atcmd_output, msg_txt(1444), entry->name);// - %s %s
diff --git a/src/map/battleground.c b/src/map/battleground.c
index f91d7ae69..64bc25269 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -220,7 +220,7 @@ int bg_send_message(struct map_session_data *sd, const char *mes, int len)
*/
int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
{
- struct battleground_data *bg = iDB->data2ptr(data);
+ struct battleground_data *bg = DB->data2ptr(data);
struct map_session_data *sd;
int i;
nullpo_ret(bg);
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 9f3a07680..6e076e6d8 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -479,7 +479,7 @@ int chrif_connectack(int fd) {
* @see DBApply
*/
static int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
- struct auth_node *node = iDB->data2ptr(data);
+ struct auth_node *node = DB->data2ptr(data);
switch (node->state) {
case ST_LOGIN:
@@ -687,7 +687,7 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
* @see DBApply
*/
int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
- struct auth_node *node = iDB->data2ptr(data);
+ struct auth_node *node = DB->data2ptr(data);
const char* states[] = { "Login", "Logout", "Map change" };
if(DIFF_TICK(iTimer->gettick(),node->node_created)>60000) {
@@ -1595,7 +1595,7 @@ void chrif_send_report(char* buf, int len) {
* @see DBApply
*/
int auth_db_final(DBKey key, DBData *data, va_list ap) {
- struct auth_node *node = iDB->data2ptr(data);
+ struct auth_node *node = DB->data2ptr(data);
if (node->char_dat)
aFree(node->char_dat);
diff --git a/src/map/guild.c b/src/map/guild.c
index fc7779982..b28c14db7 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -297,7 +297,7 @@ int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
struct guild_expcache *c;
struct guild *g;
- c = iDB->data2ptr(data);
+ c = DB->data2ptr(data);
if (
(g = guild->search(c->guild_id)) == NULL ||
@@ -332,7 +332,7 @@ int guild_payexp_timer(int tid, unsigned int tick, int id, intptr_t data)
*/
int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
{
- struct guild *g = iDB->data2ptr(data);
+ struct guild *g = DB->data2ptr(data);
int i;
nullpo_ret(g);
@@ -440,8 +440,8 @@ int guild_npc_request_info(int guild_id,const char *event)
ev=(struct eventlist *)aCalloc(sizeof(struct eventlist),1);
memcpy(ev->name,event,strlen(event));
//The one in the db (if present) becomes the next event from this.
- if (guild_infoevent_db->put(guild_infoevent_db, iDB->i2key(guild_id), iDB->ptr2data(ev), &prev))
- ev->next = iDB->data2ptr(&prev);
+ if (guild_infoevent_db->put(guild_infoevent_db, DB->i2key(guild_id), DB->ptr2data(ev), &prev))
+ ev->next = DB->data2ptr(&prev);
}
return guild->request_info(guild_id);
@@ -618,8 +618,8 @@ int guild_recv_info(struct guild *sg) {
}
//Occurrence of an event
- if (guild_infoevent_db->remove(guild_infoevent_db, iDB->i2key(sg->guild_id), &data)) {
- struct eventlist *ev = iDB->data2ptr(&data), *ev2;
+ if (guild_infoevent_db->remove(guild_infoevent_db, DB->i2key(sg->guild_id), &data)) {
+ struct eventlist *ev = DB->data2ptr(&data), *ev2;
while(ev) {
npc_event_do(ev->name);
ev2=ev->next;
@@ -1247,7 +1247,7 @@ static DBData create_expcache(DBKey key, va_list args)
c->account_id = sd->status.account_id;
c->char_id = sd->status.char_id;
c->exp = 0;
- return iDB->ptr2data(c);
+ return DB->ptr2data(c);
}
/*====================================================
@@ -1273,7 +1273,7 @@ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp) {
exp = exp * per / 100;
//Otherwise tax everything.
- c = iDB->data2ptr(guild_expcache_db->ensure(guild_expcache_db, iDB->i2key(sd->status.char_id), create_expcache, sd));
+ c = DB->data2ptr(guild_expcache_db->ensure(guild_expcache_db, DB->i2key(sd->status.char_id), create_expcache, sd));
if (c->exp > UINT64_MAX - exp)
c->exp = UINT64_MAX;
@@ -1296,7 +1296,7 @@ int guild_getexp(struct map_session_data *sd,int exp)
if (sd->status.guild_id == 0 || sd->guild == NULL)
return 0;
- c = iDB->data2ptr(guild_expcache_db->ensure(guild_expcache_db, iDB->i2key(sd->status.char_id), create_expcache, sd));
+ c = DB->data2ptr(guild_expcache_db->ensure(guild_expcache_db, DB->i2key(sd->status.char_id), create_expcache, sd));
if (c->exp > UINT64_MAX - exp)
c->exp = UINT64_MAX;
else
@@ -1696,7 +1696,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
*/
int guild_broken_sub(DBKey key, DBData *data, va_list ap)
{
- struct guild *g = iDB->data2ptr(data);
+ struct guild *g = DB->data2ptr(data);
int guild_id=va_arg(ap,int);
int i,j;
struct map_session_data *sd=NULL;
@@ -1721,7 +1721,7 @@ int guild_broken_sub(DBKey key, DBData *data, va_list ap)
*/
int castle_guild_broken_sub(DBKey key, DBData *data, va_list ap)
{
- struct guild_castle *gc = iDB->data2ptr(data);
+ struct guild_castle *gc = DB->data2ptr(data);
int guild_id = va_arg(ap, int);
nullpo_ret(gc);
@@ -2149,7 +2149,7 @@ void guild_flag_remove(struct npc_data *nd) {
*/
static int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
struct eventlist *next = NULL;
- struct eventlist *current = iDB->data2ptr(data);
+ struct eventlist *current = DB->data2ptr(data);
while (current != NULL) {
next = current->next;
aFree(current);
@@ -2162,7 +2162,7 @@ static int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
* @see DBApply
*/
static int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
- ers_free(expcache_ers, iDB->data2ptr(data));
+ ers_free(expcache_ers, DB->data2ptr(data));
return 0;
}
@@ -2170,7 +2170,7 @@ static int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
* @see DBApply
*/
static int guild_castle_db_final(DBKey key, DBData *data, va_list ap) {
- struct guild_castle* gc = iDB->data2ptr(data);
+ struct guild_castle* gc = DB->data2ptr(data);
if( gc->temp_guardians )
aFree(gc->temp_guardians);
aFree(gc);
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 00f4198a8..4b6275047 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -30,7 +30,7 @@ struct item_data dummy_item; //This is the default dummy item used for non-exist
*/
static int itemdb_searchname_sub(DBKey key, DBData *data, va_list ap)
{
- struct item_data *item = iDB->data2ptr(data), **dst, **dst2;
+ struct item_data *item = DB->data2ptr(data), **dst, **dst2;
char *str;
str=va_arg(ap,char *);
dst=va_arg(ap,struct item_data **);
@@ -83,7 +83,7 @@ struct item_data* itemdb_searchname(const char *str)
*/
static int itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap)
{
- struct item_data *item = iDB->data2ptr(&data);
+ struct item_data *item = DB->data2ptr(&data);
char *str;
str=va_arg(ap,char *);
if (item == &dummy_item)
@@ -127,7 +127,7 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str)
size -= count;
db_count = itemdb_other->getall(itemdb_other, (DBData**)&db_data, size, itemdb_searchname_array_sub, str);
for (i = 0; i < db_count; i++)
- data[count++] = iDB->data2ptr(db_data[i]);
+ data[count++] = DB->data2ptr(db_data[i]);
count += db_count;
}
return count;
@@ -1376,7 +1376,7 @@ static void destroy_item_data(struct item_data* self, int free_self)
*/
static int itemdb_final_sub(DBKey key, DBData *data, va_list ap)
{
- struct item_data *id = iDB->data2ptr(data);
+ struct item_data *id = DB->data2ptr(data);
if( id != &dummy_item )
destroy_item_data(id, 1);
diff --git a/src/map/map.c b/src/map/map.c
index bb1ea4fb4..44b328d05 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1490,7 +1490,7 @@ static DBData create_charid2nick(DBKey key, va_list args)
{
struct charid2nick *p;
CREATE(p, struct charid2nick, 1);
- return iDB->ptr2data(p);
+ return DB->ptr2data(p);
}
/// Adds(or replaces) the nick of charid to nick_db and fullfils pending requests.
@@ -1526,7 +1526,7 @@ void map_delnickdb(int charid, const char* name)
struct map_session_data* sd;
DBData data;
- if (!nick_db->remove(nick_db, iDB->i2key(charid), &data) || (p = iDB->data2ptr(&data)) == NULL)
+ if (!nick_db->remove(nick_db, DB->i2key(charid), &data) || (p = DB->data2ptr(&data)) == NULL)
return;
while( p->requests ) {
@@ -2751,7 +2751,7 @@ static DBData create_map_data_other_server(DBKey key, va_list args)
mdos=(struct map_data_other_server *)aCalloc(1,sizeof(struct map_data_other_server));
mdos->index = mapindex;
memcpy(mdos->name, mapindex_id2name(mapindex), MAP_NAME_LENGTH);
- return iDB->ptr2data(mdos);
+ return DB->ptr2data(mdos);
}
/*==========================================
@@ -2781,7 +2781,7 @@ int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
*/
int map_eraseallipport_sub(DBKey key, DBData *data, va_list va)
{
- struct map_data_other_server *mdos = iDB->data2ptr(data);
+ struct map_data_other_server *mdos = DB->data2ptr(data);
if(mdos->cell == NULL) {
db_remove(map_db,key);
aFree(mdos);
@@ -4961,7 +4961,7 @@ void read_map_zone_db(void) {
* @see DBApply
*/
int map_db_final(DBKey key, DBData *data, va_list ap) {
- struct map_data_other_server *mdos = iDB->data2ptr(data);
+ struct map_data_other_server *mdos = DB->data2ptr(data);
if(mdos && iMalloc->verify_ptr(mdos) && mdos->cell == NULL)
aFree(mdos);
@@ -4974,7 +4974,7 @@ int map_db_final(DBKey key, DBData *data, va_list ap) {
*/
int nick_db_final(DBKey key, DBData *data, va_list args)
{
- struct charid2nick* p = iDB->data2ptr(data);
+ struct charid2nick* p = DB->data2ptr(data);
struct charid_request* req;
if( p == NULL )
@@ -5021,7 +5021,7 @@ int cleanup_sub(struct block_list *bl, va_list ap) {
*/
static int cleanup_db_sub(DBKey key, DBData *data, va_list va)
{
- return iMap->cleanup_sub(iDB->data2ptr(data), va);
+ return iMap->cleanup_sub(DB->data2ptr(data), va);
}
/*==========================================
diff --git a/src/map/npc.c b/src/map/npc.c
index e842a6c05..5e03191e7 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -350,7 +350,7 @@ int npc_event_doall_sub(DBKey key, DBData *data, va_list ap)
const char* name;
int rid;
- nullpo_ret(ev = iDB->data2ptr(data));
+ nullpo_ret(ev = DB->data2ptr(data));
nullpo_ret(c = va_arg(ap, int *));
nullpo_ret(name = va_arg(ap, const char *));
rid = va_arg(ap, int);
@@ -378,7 +378,7 @@ static int npc_event_do_sub(DBKey key, DBData *data, va_list ap)
int* c;
const char* name;
- nullpo_ret(ev = iDB->data2ptr(data));
+ nullpo_ret(ev = DB->data2ptr(data));
nullpo_ret(c = va_arg(ap, int *));
nullpo_ret(name = va_arg(ap, const char *));
@@ -1773,7 +1773,7 @@ int npc_remove_map(struct npc_data* nd) {
*/
static int npc_unload_ev(DBKey key, DBData *data, va_list ap)
{
- struct event_data* ev = iDB->data2ptr(data);
+ struct event_data* ev = DB->data2ptr(data);
char* npcname = va_arg(ap, char *);
if(strcmp(ev->nd->exname,npcname)==0){
@@ -2289,7 +2289,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
int npc_convertlabel_db(DBKey key, DBData *data, va_list ap)
{
const char* lname = (const char*)key.str;
- int lpos = iDB->data2i(data);
+ int lpos = DB->data2i(data);
struct npc_label_list** label_list;
int* label_list_num;
const char* filepath;
@@ -2933,9 +2933,9 @@ static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, co
return end;
func_db = script_get_userfunc_db();
- if (func_db->put(func_db, iDB->str2key(w3), iDB->ptr2data(script), &old_data))
+ if (func_db->put(func_db, DB->str2key(w3), DB->ptr2data(script), &old_data))
{
- struct script_code *oldscript = (struct script_code*)iDB->data2ptr(&old_data);
+ struct script_code *oldscript = (struct script_code*)DB->data2ptr(&old_data);
ShowInfo("npc_parse_function: Overwriting user function [%s] (%s:%d)\n", w3, filepath, strline(buffer,start-buffer));
script_free_vars(oldscript->script_vars);
aFree(oldscript->script_buf);
@@ -3729,7 +3729,7 @@ void npc_read_event_script(void)
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) )
{
const char* p = key.str;
- struct event_data* ed = iDB->data2ptr(data);
+ struct event_data* ed = DB->data2ptr(data);
unsigned char count = script_event[i].event_count;
if( count >= ARRAYLENGTH(script_event[i].event) )
diff --git a/src/map/party.c b/src/map/party.c
index 5f8164557..91d6188a9 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -102,7 +102,7 @@ static TBL_PC* party_sd_check(int party_id, int account_id, int char_id)
int party_db_final(DBKey key, DBData *data, va_list ap) {
struct party_data *p;
- if( ( p = iDB->data2ptr(data) ) && p->instance )
+ if( ( p = DB->data2ptr(data) ) && p->instance )
aFree(p->instance);
return 0;
diff --git a/src/map/script.c b/src/map/script.c
index 752f4445d..612bf52f5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3659,7 +3659,7 @@ int script_config_read(char *cfgName)
*/
static int db_script_free_code_sub(DBKey key, DBData *data, va_list ap)
{
- struct script_code *code = iDB->data2ptr(data);
+ struct script_code *code = DB->data2ptr(data);
if (code)
script_free_code(code);
return 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index 2ada270e8..8f13591b6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -15373,7 +15373,7 @@ int skill_unit_timer_sub_onplace (struct block_list* bl, va_list ap) {
* @see DBApply
*/
int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
- struct skill_unit* unit = iDB->data2ptr(data);
+ struct skill_unit* unit = DB->data2ptr(data);
struct skill_unit_group* group = unit->group;
unsigned int tick = va_arg(ap,unsigned int);
bool dissonance;
diff --git a/src/map/storage.c b/src/map/storage.c
index 17b7c82ae..ea30f6c0f 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -73,7 +73,7 @@ void do_final_storage(void) // by [MC Cameri]
*/
static int storage_reconnect_sub(DBKey key, DBData *data, va_list ap)
{
- struct guild_storage *stor = iDB->data2ptr(data);
+ struct guild_storage *stor = DB->data2ptr(data);
if (stor->dirty && stor->storage_status == 0) //Save closed storages.
storage_guild_storagesave(0, stor->guild_id,0);
@@ -352,7 +352,7 @@ static DBData create_guildstorage(DBKey key, va_list args)
struct guild_storage *gs = NULL;
gs = (struct guild_storage *) aCalloc(sizeof(struct guild_storage), 1);
gs->guild_id=key.i;
- return iDB->ptr2data(gs);
+ return DB->ptr2data(gs);
}
struct guild_storage *guild2storage(int guild_id)