mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10983] Config option for disable progress bar show at server startup.
Make happy nervouse ppl by some secs startup speedup.
This commit is contained in:
parent
b89e531fee
commit
ea930108da
5 changed files with 41 additions and 15 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "Common.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Config/Config.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "Log.h"
|
||||
#include "Master.h"
|
||||
#include "SystemConfig.h"
|
||||
|
|
@ -174,6 +175,9 @@ extern int main(int argc, char **argv)
|
|||
|
||||
DETAIL_LOG("Using ACE: %s", ACE_VERSION);
|
||||
|
||||
///- Set progress bars show mode
|
||||
barGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true));
|
||||
|
||||
///- and run the 'Master'
|
||||
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?
|
||||
return sMaster.Run();
|
||||
|
|
|
|||
|
|
@ -699,6 +699,11 @@ LogColors = ""
|
|||
# Default: 1 (true)
|
||||
# 0 (false)
|
||||
#
|
||||
# ShowProgressBars
|
||||
# Control show progress bars for load steps at server startup
|
||||
# Default: 1 (true)
|
||||
# 0 (false)
|
||||
#
|
||||
# WaitAtStartupError
|
||||
# After startup error report wait <Enter> or some time before continue (and possible close console window)
|
||||
# -1 (wait until <Enter> press)
|
||||
|
|
@ -772,6 +777,7 @@ PetUnsummonAtMount = 1
|
|||
ClientCacheVersion = 0
|
||||
Event.Announce = 0
|
||||
BeepAtStart = 1
|
||||
ShowProgressBars = 1
|
||||
WaitAtStartupError = 0
|
||||
Motd = "Welcome to the Massive Network Game Object Server."
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include "ProgressBar.h"
|
||||
|
||||
bool barGoLink::m_showOutput = true;
|
||||
|
||||
char const* const barGoLink::empty = " ";
|
||||
#ifdef _WIN32
|
||||
char const* const barGoLink::full = "\x3D";
|
||||
|
|
@ -29,6 +31,9 @@ char const* const barGoLink::full = "*";
|
|||
|
||||
barGoLink::~barGoLink()
|
||||
{
|
||||
if (!m_showOutput)
|
||||
return;
|
||||
|
||||
printf( "\n" );
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
@ -39,6 +44,10 @@ barGoLink::barGoLink( int row_count )
|
|||
rec_pos = 0;
|
||||
indic_len = 50;
|
||||
num_rec = row_count;
|
||||
|
||||
if (!m_showOutput)
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
printf( "\x3D" );
|
||||
#else
|
||||
|
|
@ -53,8 +62,11 @@ barGoLink::barGoLink( int row_count )
|
|||
fflush(stdout);
|
||||
}
|
||||
|
||||
void barGoLink::step( void )
|
||||
void barGoLink::step()
|
||||
{
|
||||
if (!m_showOutput)
|
||||
return;
|
||||
|
||||
int i, n;
|
||||
|
||||
if ( num_rec == 0 ) return;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,16 @@
|
|||
|
||||
class MANGOS_DLL_SPEC barGoLink
|
||||
{
|
||||
public: // constructors
|
||||
barGoLink(int row_count);
|
||||
~barGoLink();
|
||||
|
||||
public: // modifiers
|
||||
void step( void );
|
||||
|
||||
static void SetOutputState(bool on) { m_showOutput = on; }
|
||||
private:
|
||||
static bool m_showOutput; // not recommended change with existed active bar
|
||||
static char const * const empty;
|
||||
static char const * const full;
|
||||
|
||||
|
|
@ -29,11 +39,5 @@ class MANGOS_DLL_SPEC barGoLink
|
|||
int rec_pos;
|
||||
int num_rec;
|
||||
int indic_len;
|
||||
|
||||
public:
|
||||
|
||||
void step( void );
|
||||
barGoLink( int );
|
||||
~barGoLink();
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10982"
|
||||
#define REVISION_NR "10983"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue