summaryrefslogtreecommitdiff
path: root/src/plugins/db2sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/db2sql.c')
-rw-r--r--src/plugins/db2sql.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 1e27058c0..6d4a7789c 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -1,25 +1,25 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
-#include "../config/core.h"
+#include "config/core.h"
+
+#include "common/hercules.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/memmgr.h"
+#include "common/mmo.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "map/clif.h"
+#include "map/itemdb.h"
+#include "map/map.h"
+#include "map/pc.h"
+
+#include "common/HPMDataCheck.h"
#include <stdio.h>
#include <stdlib.h>
-#include "../common/HPMi.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../map/clif.h"
-#include "../map/itemdb.h"
-#include "../map/map.h"
-#include "../map/pc.h"
-
-#include "../common/HPMDataCheck.h"
-
HPExport struct hplugin_info pinfo = {
"DB2SQL", // Plugin name
SERVER_TYPE_MAP, // Which server types this plugin works with?
@@ -140,6 +140,9 @@ int db2sql(config_setting_t *entry, int n, const char *source) {
// bindonequip
StrBuf->Printf(&buf, "'%u',", it->flag.bindonequip?1:0);
+ // forceserial
+ StrBuf->Printf(&buf, "'%u',", it->flag.force_serial?1:0);
+
// buyingstore
StrBuf->Printf(&buf, "'%u',", it->flag.buyingstore?1:0);
@@ -269,6 +272,7 @@ void totable(void) {
" `refineable` tinyint(1) UNSIGNED DEFAULT NULL,\n"
" `view` smallint(3) UNSIGNED DEFAULT NULL,\n"
" `bindonequip` tinyint(1) UNSIGNED DEFAULT NULL,\n"
+ " `forceserial` tinyint(1) UNSIGNED DEFAULT NULL,\n"
" `buyingstore` tinyint(1) UNSIGNED DEFAULT NULL,\n"
" `delay` mediumint(9) UNSIGNED DEFAULT NULL,\n"
" `trade_flag` smallint(4) UNSIGNED DEFAULT NULL,\n"
@@ -286,11 +290,6 @@ void totable(void) {
"\n",tosql.db_name,tosql.db_name,tosql.db_name);
}
void do_db2sql(void) {
- if( map->db_use_sql_item_db ) {
- ShowInfo("db2sql: this should not be used with 'db_use_sql_item_db' enabled, skipping...\n");
- return;
- }
-
/* link */
itemdb_readdb_libconfig_sub = itemdb->readdb_libconfig_sub;
itemdb->readdb_libconfig_sub = db2sql;
@@ -301,7 +300,7 @@ void do_db2sql(void) {
return;
}
- tosql.db_name = map->item_db_db;
+ tosql.db_name = "item_db";
totable();
memset(&tosql.buf, 0, sizeof(tosql.buf) );
@@ -316,7 +315,7 @@ void do_db2sql(void) {
return;
}
- tosql.db_name = map->item_db_db;
+ tosql.db_name = "item_db";
totable();
itemdb->clear(false);
@@ -329,7 +328,7 @@ void do_db2sql(void) {
return;
}
- tosql.db_name = map->item_db2_db;
+ tosql.db_name = "item_db2";
totable();
itemdb->clear(false);
@@ -353,21 +352,14 @@ CMDLINEARG(db2sql)
map->minimal = torun = true;
return true;
}
-HPExport void server_preinit (void) {
- SQL = GET_SYMBOL("SQL");
- itemdb = GET_SYMBOL("itemdb");
- map = GET_SYMBOL("map");
- strlib = GET_SYMBOL("strlib");
- iMalloc = GET_SYMBOL("iMalloc");
- libconfig = GET_SYMBOL("libconfig");
- StrBuf = GET_SYMBOL("StrBuf");
+HPExport void server_preinit(void) {
addArg("--db2sql",false,db2sql,NULL);
}
-HPExport void plugin_init (void) {
+HPExport void plugin_init(void) {
addCPCommand("server:tools:db2sql",db2sql);
}
-HPExport void server_online (void) {
+HPExport void server_online(void) {
if( torun )
do_db2sql();
}