diff options
author | shennetsind <ind@henn.et> | 2013-10-02 14:31:46 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-10-02 14:31:46 -0300 |
commit | 2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6 (patch) | |
tree | 9f8d7692f8d1e23837ca7b7ca6b5c3ba874eedc3 /src/map/itemdb.c | |
parent | 7c711d608a454abea0037d79b3e805d8d7cfca55 (diff) | |
download | hercules-2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6.tar.gz hercules-2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6.tar.bz2 hercules-2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6.tar.xz hercules-2f2afbd3b63a75695f8f96e3bcb4db9fff5a7dc6.zip |
HPM: Map.c Completed
Fully Interfaced.
Moved missing vars and declarations of interest into the interface, removed duplicate mentions of map within calls to shorten wherever it made sense to.
Ladies and Gentleman its my pleasure to announce that with this commit we've revised all of map-server, we've learned a hell lot from this, improved many things on the go and have a number of features to be released thanks to this. *cough* hpm hooking *cough*.
Signed-off-by: shennetsind <ind@henn.et>
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; } |