Made debug ShowStatus calls easier to disable (#7618)

Co-authored-by: Aleos <aleos89@users.noreply.github.com>
This commit is contained in:
Jittapan Pluemsumran 2023-02-21 11:34:52 +07:00 committed by GitHub
parent 08d3467faa
commit 1985662045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 5 deletions

View File

@ -164,7 +164,7 @@ void YamlDatabase::parse( const ryml::Tree& tree ){
for( const ryml::NodeRef &node : bodyNode ){
count += this->parseBodyNode( node );
#ifdef DEBUG
#ifdef DETAILED_LOADING_OUTPUT
ShowStatus( "Loading [%" PRIdPTR "/%" PRIdPTR "] entries from '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\r", ++childNodesProgressed, childNodesCount, fileName );
#endif
}

View File

@ -100,6 +100,14 @@
/// Uncomment for use with Nemo patch ExtendOldCashShopPreview
//#define ENABLE_OLD_CASHSHOP_PREVIEW_PATCH
#if defined(_DEBUG) || defined(DEBUG)
#define DETAILED_LOADING_OUTPUT
#endif
/// Uncomment to forcibly disable the detailed loading output.
/// This will noticeably decrease the boot time of the map server by not having to print so many status messages.
//#undef DETAILED_LOADING_OUTPUT
/**
* No settings past this point
**/

View File

@ -4168,7 +4168,7 @@ static int itemdb_read_sqldb(void) {
// process rows one by one
while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) ) {
#ifdef DEBUG
#ifdef DETAILED_LOADING_OUTPUT
ShowStatus( "Loading [%" PRIu64 "/%" PRIu64 "] entries in '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\r", ++rows, total_rows, item_db_name[fi] );
#endif
std::vector<std::string> data = {};

View File

@ -3786,7 +3786,7 @@ int map_readallmaps (void)
struct map_data *mapdata = &map[i];
char map_cache_decode_buffer[MAX_MAP_SIZE];
#ifdef DEBUG
#ifdef DETAILED_LOADING_OUTPUT
// show progress
ShowStatus("Loading maps [%i/%i]: %s" CL_CLL "\r", i, map_num, mapdata->name);
#endif

View File

@ -5285,7 +5285,7 @@ static int mob_read_sqldb(void)
// process rows one by one
while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) ) {
#ifdef DEBUG
#ifdef DETAILED_LOADING_OUTPUT
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 = {};

View File

@ -3611,7 +3611,7 @@ void npc_delsrcfile(const char* name)
void npc_loadsrcfiles() {
ShowStatus("Loading NPCs...\n");
for (const auto& file : npc_src_files) {
#ifdef DEBUG
#ifdef DETAILED_LOADING_OUTPUT
ShowStatus("Loading NPC file: %s" CL_CLL "\r", file.c_str());
#endif
npc_parsesrcfile(file.c_str());