summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-08 14:08:32 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-08 14:08:32 +0000
commitb5be01c5baca2d51da4ec9a138e3bb57eea7cbb4 (patch)
treeb7f079f5317d736e49fdf8b12f6d3f18b2a98daf /src/map/chrif.c
parentad2a3a12e2d603e8ef2011d1121271b7ed2f05eb (diff)
downloadhercules-b5be01c5baca2d51da4ec9a138e3bb57eea7cbb4.tar.gz
hercules-b5be01c5baca2d51da4ec9a138e3bb57eea7cbb4.tar.bz2
hercules-b5be01c5baca2d51da4ec9a138e3bb57eea7cbb4.tar.xz
hercules-b5be01c5baca2d51da4ec9a138e3bb57eea7cbb4.zip
* Changed EXIT_SUCCESS back to 0 in console.c to avoid an unnecessary include.
* Fixed gm_account_db not being deallocated in login-converter.c. * Refactoring names and documentation in db.h/db.c: - changed 'struct dbt' to 'struct DBMap' and 'DB' to 'DBMap*' - changed 'struct db' to 'struct DBMap_impl' and 'DB_impl' to 'DBMap_impl*' - changed COUNT to DB_COUNTSTAT and made it's existence not depend on DB_ENABLE_STATS - removed some @see links and corrected small typos in the documentation git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11698 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 0ea1e06a9..6369a6745 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -25,7 +25,7 @@
#include <sys/types.h>
#include <time.h>
-struct dbt *auth_db;
+DBMap* auth_db; // int id -> struct auth_node*
static const int packet_len_table[0x3d] = { // U - used, F - free
60, 3,-1,27,10,-1, 6,-1, // 2af8-2aff: U->2af8, U->2af9, U->2afa, U->2afb, U->2afc, U->2afd, U->2afe, U->2aff
@@ -430,7 +430,7 @@ void chrif_authreq(struct map_session_data *sd)
auth_data->account_id = sd->bl.id;
auth_data->login_id1 = sd->login_id1;
auth_data->node_created = gettick();
- uidb_put(auth_db, sd->bl.id, auth_data);
+ idb_put(auth_db, sd->bl.id, auth_data);
}
return;
}
@@ -451,7 +451,7 @@ void chrif_authok(int fd)
return;
}
- if ((auth_data =uidb_get(auth_db, RFIFOL(fd, 4))) != NULL)
+ if ((auth_data =idb_get(auth_db, RFIFOL(fd, 4))) != NULL)
{ //Is the character already awaiting authorization?
if (auth_data->sd)
{
@@ -472,7 +472,7 @@ void chrif_authok(int fd)
//Delete the data of this node...
if (auth_data->char_dat)
aFree (auth_data->char_dat);
- uidb_remove(auth_db, RFIFOL(fd, 4));
+ idb_remove(auth_db, RFIFOL(fd, 4));
return;
}
// Awaiting for client to connect.
@@ -485,7 +485,7 @@ void chrif_authok(int fd)
auth_data->login_id2=RFIFOL(fd, 16);
memcpy(auth_data->char_dat,RFIFOP(fd, 20),sizeof(struct mmo_charstatus));
auth_data->node_created=gettick();
- uidb_put(auth_db, RFIFOL(fd, 4), auth_data);
+ idb_put(auth_db, RFIFOL(fd, 4), auth_data);
}
int auth_db_cleanup_sub(DBKey key,void *data,va_list ap)
@@ -1445,7 +1445,7 @@ int do_init_chrif(void)
#endif
add_timer_interval(gettick() + 1000, auth_db_cleanup, 0, 0, 30 * 1000);
- auth_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ auth_db = idb_alloc(DB_OPT_RELEASE_DATA);
return 0;
}