diff options
author | shenhuyong <shenhuyong@hotmail.com> | 2013-10-03 14:26:16 +0800 |
---|---|---|
committer | shenhuyong <shenhuyong@hotmail.com> | 2013-10-03 14:26:16 +0800 |
commit | d153854f32c4fd9265010e6936db49e23137db08 (patch) | |
tree | 7b389a5693d5003e88880ce7bfb9d5500551ebb4 /src/map/itemdb.c | |
parent | ea84a19426cd401615421ee3f3d2eff2d741beb7 (diff) | |
parent | 2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6 (diff) | |
download | hercules-d153854f32c4fd9265010e6936db49e23137db08.tar.gz hercules-d153854f32c4fd9265010e6936db49e23137db08.tar.bz2 hercules-d153854f32c4fd9265010e6936db49e23137db08.tar.xz hercules-d153854f32c4fd9265010e6936db49e23137db08.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index f7ee8a884..fe2c43fcc 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1838,18 +1838,18 @@ int itemdb_read_sqldb(void) { uint32 count = 0; // retrieve all rows from the item database - if( SQL_ERROR == SQL->Query(mmysql_handle, "SELECT * FROM `%s`", item_db_name[fi]) ) { - Sql_ShowDebug(mmysql_handle); + if( SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT * FROM `%s`", item_db_name[fi]) ) { + Sql_ShowDebug(map->mysql_handle); continue; } // process rows one by one - while( SQL_SUCCESS == SQL->NextRow(mmysql_handle) ) {// wrap the result into a TXT-compatible format + while( SQL_SUCCESS == SQL->NextRow(map->mysql_handle) ) {// wrap the result into a TXT-compatible format char* str[ITEMDB_SQL_COLUMNS]; char* dummy = ""; int i; for( i = 0; i < ITEMDB_SQL_COLUMNS; ++i ) { - SQL->GetData(mmysql_handle, i, &str[i], NULL); + SQL->GetData(map->mysql_handle, i, &str[i], NULL); if( str[i] == NULL ) str[i] = dummy; // get rid of NULL columns } @@ -1860,7 +1860,7 @@ int itemdb_read_sqldb(void) { } // free the query result - SQL->FreeResult(mmysql_handle); + SQL->FreeResult(map->mysql_handle); ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, item_db_name[fi]); } @@ -1895,18 +1895,18 @@ uint64 itemdb_unique_id(int8 flag, int64 value) { } int itemdb_uid_load() { char * uid; - if (SQL_ERROR == SQL->Query(mmysql_handle, "SELECT `value` FROM `%s` WHERE `varname`='unique_id'",map->interreg_db)) - Sql_ShowDebug(mmysql_handle); + if (SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `value` FROM `%s` WHERE `varname`='unique_id'",map->interreg_db)) + Sql_ShowDebug(map->mysql_handle); - if( SQL_SUCCESS != SQL->NextRow(mmysql_handle) ) { + if( SQL_SUCCESS != SQL->NextRow(map->mysql_handle) ) { ShowError("itemdb_uid_load: Unable to fetch unique_id data\n"); - SQL->FreeResult(mmysql_handle); + SQL->FreeResult(map->mysql_handle); return -1; } - SQL->GetData(mmysql_handle, 0, &uid, NULL); + SQL->GetData(map->mysql_handle, 0, &uid, NULL); itemdb->unique_id(1, (uint64)strtoull(uid, NULL, 10)); - SQL->FreeResult(mmysql_handle); + SQL->FreeResult(map->mysql_handle); return 0; } |