summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c9
-rw-r--r--src/char_sql/int_guild.c4
-rw-r--r--src/char_sql/int_party.c4
-rw-r--r--src/char_sql/inter.c4
4 files changed, 11 insertions, 10 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 5c6040cf2..89f31e2c1 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -64,7 +64,7 @@ char friend_db[256] = "friends";
char hotkey_db[256] = "hotkey";
#ifndef TXT_SQL_CONVERT
-static struct dbt *char_db_;
+static DBMap* char_db_; // int char_id -> struct mmo_charstatus*
char db_path[1024] = "db";
@@ -192,7 +192,8 @@ struct online_char_data {
short server; // -2: unknown server, -1: not connected, 0+: id of server
};
-struct dbt* online_char_db; //Holds all online characters.
+// Holds all online characters.
+DBMap* online_char_db; // int account_id -> struct online_char_data*
static void* create_online_char_data(DBKey key, va_list args)
{
@@ -1066,7 +1067,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
int mmo_char_sql_init(void)
{
ShowInfo("Begin Initializing.......\n");
- char_db_= db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA, sizeof(int));
+ char_db_= idb_alloc(DB_OPT_RELEASE_DATA);
if(char_per_account == 0){
ShowStatus("Chars per Account: 'Unlimited'.......\n");
@@ -3771,7 +3772,7 @@ int do_init(int argc, char **argv)
ShowInfo("Finished reading the inter-server configuration.\n");
ShowInfo("Initializing char server.\n");
- online_char_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ online_char_db = idb_alloc(DB_OPT_RELEASE_DATA);
mmo_char_sql_init();
char_read_fame_list(); //Read fame lists.
if(char_gm_read)
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index d315a1833..8502c1be6 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -32,7 +32,7 @@ static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9
#ifndef TXT_SQL_CONVERT
//Guild cache
-static struct dbt *guild_db_;
+static DBMap* guild_db_; // int guild_id -> struct guild*
struct guild_castle castles[MAX_GUILDCASTLE];
@@ -797,7 +797,7 @@ int inter_guild_CharOffline(int char_id, int guild_id) {
int inter_guild_sql_init(void)
{
//Initialize the guild cache
- guild_db_= db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ guild_db_= idb_alloc(DB_OPT_RELEASE_DATA);
//Read exp file
inter_guild_ReadEXP();
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c
index f5afb1777..cff17c5b5 100644
--- a/src/char_sql/int_party.c
+++ b/src/char_sql/int_party.c
@@ -27,7 +27,7 @@ struct party_data {
};
static struct party_data *party_pt;
-static struct dbt *party_db_;
+static DBMap* party_db_; // int party_id -> struct party_data*
int mapif_party_broken(int party_id,int flag);
int party_check_empty(struct party_data *p);
@@ -269,7 +269,7 @@ struct party_data *inter_party_fromsql(int party_id)
int inter_party_sql_init(void)
{
//memory alloc
- party_db_ = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ party_db_ = idb_alloc(DB_OPT_RELEASE_DATA);
party_pt = (struct party_data*)aCalloc(sizeof(struct party_data), 1);
if (!party_pt) {
ShowFatalError("inter_party_sql_init: Out of Memory!\n");
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index bb15ad50b..e595324b6 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -79,7 +79,7 @@ struct WisData {
unsigned long tick;
unsigned char src[24], dst[24], msg[512];
};
-static struct dbt * wis_db = NULL;
+static DBMap* wis_db = NULL; // int wis_id -> struct WisData*
static int wis_dellist[WISDELLIST_MAX], wis_delnum;
int inter_sql_test (void);
@@ -390,7 +390,7 @@ int inter_init_sql(const char *file)
}
#ifndef TXT_SQL_CONVERT
- wis_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ wis_db = idb_alloc(DB_OPT_RELEASE_DATA);
inter_guild_sql_init();
inter_storage_sql_init();
inter_party_sql_init();