summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/map.c33
-rw-r--r--src/map/map.h7
-rw-r--r--src/map/script.c8
3 files changed, 4 insertions, 44 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 429c1b85a..3f2db8662 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -128,13 +128,6 @@ MYSQL charsql_handle;
MYSQL_RES* charsql_res;
MYSQL_ROW charsql_row;
-#ifdef MAPREGSQL
-// [zBuffer] SQL Mapreg
-MYSQL mapregsql_handle;
-MYSQL_RES* mapregsql_res ;
-MYSQL_ROW mapregsql_row;
-#endif
-
#endif /* not TXT_ONLY */
int lowest_gm_level = 1;
@@ -3539,26 +3532,6 @@ int map_sql_init(void){
ShowStatus ("connect success! (Login Server Connection)\n");
}
-#ifdef MAPREGSQL
- // [zBuffer] SQL Mapreg connection start
- ShowInfo("Connect Mapreg DB Server....\n");
- mysql_init(&mapregsql_handle);
- if(!mysql_real_connect(&mapregsql_handle, map_server_ip, map_server_id, map_server_pw,
- map_server_db ,map_server_port, (char *)NULL, 0)) {
- //pointer check
- ShowSQL("DB error - %s\n",mysql_error(&mapregsql_handle));
- exit(1);
- } else {
- ShowStatus ("Connect success! (Mapreg DB Connection)\n");
- if( strlen(default_codepage) > 0 ) {
- sprintf( tmp_sql, "SET NAMES %s", default_codepage );
- if (mysql_query(&mapregsql_handle, tmp_sql)) {
- ShowSQL("DB error - %s\n",mysql_error(&mapregsql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
- }
- }
- }
-#endif
if(mail_server_enable) { // mail system [Valaris]
mysql_init(&mail_handle);
ShowInfo("Connecting to the Mail DB Server....\n");
@@ -3596,12 +3569,6 @@ int map_sql_close(void){
mysql_close(&lmysql_handle);
ShowStatus("Close Login DB Connection....\n");
-#ifdef MAPREGSQL
- // [zBuffer] SQL Mapreg connection stop
- mysql_close(&mapregsql_handle);
- ShowStatus("Close Mapreg DB Connection....\n");
-#endif
-
if (log_config.sql_logs)
//Updating this if each time there's a log_config addition is too much of a hassle. [Skotlex]
/*&& (log_config.branch || log_config.drop || log_config.mvpdrop ||
diff --git a/src/map/map.h b/src/map/map.h
index a7a10c168..9c227a2c9 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1386,13 +1386,6 @@ extern int read_gm_interval;
extern char char_db[32];
-#ifdef MAPREGSQL
-// [zBuffer] SQL Mapreg
-extern MYSQL mapregsql_handle;
-extern MYSQL_RES* mapregsql_res ;
-extern MYSQL_ROW mapregsql_row;
-#endif
-
extern char mail_db[32];
#endif /* not TXT_ONLY */
diff --git a/src/map/script.c b/src/map/script.c
index 0fa99a72e..d32a6492b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10582,8 +10582,8 @@ static int script_save_mapreg_intsub(DBKey key,void *data,va_list ap)
char *name=str_buf+str_data[num].str;
if ( name[1] != '@') {
sprintf(tmp_sql,"UPDATE `%s` SET `%s`='%d' WHERE `%s`='%s' AND `%s`='%d'",mapregsql_db,mapregsql_db_value,(int)data,mapregsql_db_varname,name,mapregsql_db_index,i);
- if(mysql_query(&mapregsql_handle, tmp_sql) ) {
- ShowSQL("DB error - %s\n",mysql_error(&mapregsql_handle));
+ if(mysql_query(&mmyregsql_handle, tmp_sql) ) {
+ ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
}
@@ -10609,8 +10609,8 @@ static int script_save_mapreg_strsub(DBKey key,void *data,va_list ap)
char *name=str_buf+str_data[num].str;
if ( name[1] != '@') {
sprintf(tmp_sql,"UPDATE `%s` SET `%s`='%s' WHERE `%s`='%s' AND `%s`='%d'",mapregsql_db,mapregsql_db_value,jstrescapecpy(tmp_str2,(char *)data),mapregsql_db_varname,name,mapregsql_db_index,i);
- if(mysql_query(&mapregsql_handle, tmp_sql) ) {
- ShowSQL("DB error - %s\n",mysql_error(&mapregsql_handle));
+ if(mysql_query(&mmysql_handle, tmp_sql) ) {
+ ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
}