summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c5
-rw-r--r--src/char/int_guild.c8
-rw-r--r--src/char/int_homun.c4
-rw-r--r--src/char/int_party.c4
-rw-r--r--src/char/int_pet.c4
-rw-r--r--src/char/int_status.c5
-rw-r--r--src/char/int_storage.c8
-rw-r--r--src/char/inter.c8
8 files changed, 24 insertions, 22 deletions
diff --git a/src/char/char.c b/src/char/char.c
index fb991ec71..0e7d5782d 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -169,7 +169,8 @@ struct online_char_data {
short server;
};
-struct dbt *online_char_db; //Holds all online characters.
+// Holds all online characters.
+static DBMap* online_char_db; // int account_id -> struct online_char_data*
time_t update_online; // to update online files when we receiving information from a server (not less than 8 seconds)
@@ -4227,7 +4228,7 @@ int do_init(int argc, char **argv)
char_log("The char-server starting...\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_init();
char_read_fame_list(); //Read fame lists.
#ifdef ENABLE_SC_SAVING
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 563ad360e..685ef1d00 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -22,8 +22,8 @@ char guild_txt[1024] = "save/guild.txt";
char castle_txt[1024] = "save/castle.txt";
#ifndef TXT_SQL_CONVERT
-static struct dbt *guild_db;
-static struct dbt *castle_db;
+static DBMap* guild_db; // int guild_id -> struct guild*
+static DBMap* castle_db; // int castle_id -> struct guild_castle*
static int guild_newid = 10000;
@@ -376,8 +376,8 @@ int inter_guild_init() {
inter_guild_readdb();
- guild_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
- castle_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ guild_db = idb_alloc(DB_OPT_RELEASE_DATA);
+ castle_db = idb_alloc(DB_OPT_RELEASE_DATA);
if ((fp = fopen(guild_txt,"r")) == NULL)
return 1;
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 62b5a78a1..545f0d08c 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -17,7 +17,7 @@
char homun_txt[1024]="save/homun.txt";
-static struct dbt *homun_db;
+static DBMap* homun_db; // int hom_id -> struct s_homunculus*
static int homun_newid = 100;
int inter_homun_tostr(char *str,struct s_homunculus *p)
@@ -118,7 +118,7 @@ int inter_homun_init()
FILE *fp;
int c=0;
- homun_db= db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ homun_db= idb_alloc(DB_OPT_RELEASE_DATA);
if( (fp=fopen(homun_txt,"r"))==NULL )
return 1;
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 4e6366807..7e71adb64 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -25,7 +25,7 @@ struct party_data {
unsigned char size; //Total size of party.
};
-static struct dbt *party_db;
+static DBMap* party_db; // int party_id -> struct party_data*
static int party_newid = 100;
int mapif_party_broken(int party_id, int flag);
@@ -178,7 +178,7 @@ int inter_party_init() {
int c = 0;
int i, j;
- party_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ party_db = idb_alloc(DB_OPT_RELEASE_DATA);
if ((fp = fopen(party_txt, "r")) == NULL)
return 1;
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 8d0f53472..2f06e2df5 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -18,7 +18,7 @@
char pet_txt[1024]="save/pet.txt";
#ifndef TXT_SQL_CONVERT
-static struct dbt *pet_db;
+static DBMap* pet_db; // int pet_id -> struct s_pet*
static int pet_newid = 100;
int inter_pet_tostr(char *str,struct s_pet *p)
@@ -88,7 +88,7 @@ int inter_pet_init()
FILE *fp;
int c=0;
- pet_db= db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ pet_db= idb_alloc(DB_OPT_RELEASE_DATA);
if( (fp=fopen(pet_txt,"r"))==NULL )
return 1;
diff --git a/src/char/int_status.c b/src/char/int_status.c
index cc25b1485..29886d45c 100644
--- a/src/char/int_status.c
+++ b/src/char/int_status.c
@@ -10,7 +10,8 @@
#include <stdio.h>
-static struct dbt * scdata_db = NULL; //Contains all the status change data in-memory. [Skotlex]
+// Contains all the status change data in-memory. [Skotlex]
+static DBMap* scdata_db = NULL; // int char_id -> struct scdata*
char scdata_txt[1024]="save/scdata.txt"; //By [Skotlex]
#ifdef ENABLE_SC_SAVING
@@ -156,7 +157,7 @@ void inter_status_save()
*------------------------------------------*/
void status_init()
{
- scdata_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
+ scdata_db = idb_alloc(DB_OPT_BASE);
status_load_scdata(scdata_txt);
}
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index daee13134..cba4a28a9 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -24,8 +24,8 @@ char storage_txt[1024]="save/storage.txt";
char guild_storage_txt[1024]="save/g_storage.txt";
#ifndef TXT_SQL_CONVERT
-static struct dbt *storage_db;
-static struct dbt *guild_storage_db;
+static DBMap* storage_db; // int account_id -> struct storage*
+static DBMap* guild_storage_db; // int guild_id -> struct guild_storage*
// 倉庫データを文字列に変換
int storage_tostr(char *str,struct storage *p)
@@ -198,7 +198,7 @@ int inter_storage_init()
struct guild_storage *gs;
FILE *fp;
- storage_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ storage_db = idb_alloc(DB_OPT_RELEASE_DATA);
fp=fopen(storage_txt,"r");
if(fp==NULL){
@@ -227,7 +227,7 @@ int inter_storage_init()
fclose(fp);
c = 0;
- guild_storage_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ guild_storage_db = idb_alloc(DB_OPT_RELEASE_DATA);
fp=fopen(guild_storage_txt,"r");
if(fp==NULL){
diff --git a/src/char/inter.c b/src/char/inter.c
index 9856c13b2..85b4793f7 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -30,7 +30,7 @@ char accreg_txt[1024] = "save/accreg.txt";
char inter_log_filename[1024] = "log/inter.log";
char main_chat_nick[16] = "Main";
-static struct dbt *accreg_db = NULL;
+static DBMap* accreg_db = NULL; // int account_id -> struct accreg*
unsigned int party_share_level = 10;
@@ -66,7 +66,7 @@ struct WisData {
unsigned long tick;
unsigned char src[24], dst[24], msg[1024];
};
-static struct dbt * wis_db = NULL;
+static DBMap* wis_db = NULL; // int wis_id -> struct WisData*
static int wis_dellist[WISDELLIST_MAX], wis_delnum;
@@ -109,7 +109,7 @@ int inter_accreg_init(void) {
int c = 0;
struct accreg *reg;
- accreg_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
+ accreg_db = idb_alloc(DB_OPT_RELEASE_DATA);
if( (fp = fopen(accreg_txt, "r")) == NULL)
return 1;
@@ -259,7 +259,7 @@ int inter_init_txt(const char *file) {
inter_config_read(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_party_init();
inter_guild_init();