Speed up loading of npcs and maps (#7597)

This commit is contained in:
Vincent Stumpf
2023-02-12 11:01:14 -08:00
committed by GitHub
parent bc7b9cdd2e
commit eff6131087
4 changed files with 23 additions and 5 deletions

View File

@@ -5281,10 +5281,13 @@ static int mob_read_sqldb(void)
uint32 total_columns = Sql_NumColumns(mmysql_handle);
uint64 total_rows = Sql_NumRows(mmysql_handle), rows = 0, count = 0;
ShowStatus("Loading '" CL_WHITE "%" PRIdPTR CL_RESET "' entries in '" CL_WHITE "%s" CL_RESET "'\n", total_rows, mob_db_name[fi]);
// process rows one by one
while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) ) {
ShowStatus("Loading [%" PRIu64 "/%" PRIu64 "] rows from '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\r", ++rows, total_rows, mob_db_name[fi]);
#ifdef DEBUG
ShowStatus("Loading [%" PRIu64 "/%" PRIu64 "] entries in '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\r", ++rows, total_rows, mob_db_name[fi]);
#endif
std::vector<std::string> data = {};
for (uint32 i = 0; i < total_columns; i++) {