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 "Common.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "Config/Config.h"
|
#include "Config/Config.h"
|
||||||
|
#include "ProgressBar.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Master.h"
|
#include "Master.h"
|
||||||
#include "SystemConfig.h"
|
#include "SystemConfig.h"
|
||||||
|
|
@ -174,6 +175,9 @@ extern int main(int argc, char **argv)
|
||||||
|
|
||||||
DETAIL_LOG("Using ACE: %s", ACE_VERSION);
|
DETAIL_LOG("Using ACE: %s", ACE_VERSION);
|
||||||
|
|
||||||
|
///- Set progress bars show mode
|
||||||
|
barGoLink::SetOutputState(sConfig.GetBoolDefault("ShowProgressBars", true));
|
||||||
|
|
||||||
///- and run the 'Master'
|
///- and run the 'Master'
|
||||||
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?
|
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?
|
||||||
return sMaster.Run();
|
return sMaster.Run();
|
||||||
|
|
|
||||||
|
|
@ -699,6 +699,11 @@ LogColors = ""
|
||||||
# Default: 1 (true)
|
# Default: 1 (true)
|
||||||
# 0 (false)
|
# 0 (false)
|
||||||
#
|
#
|
||||||
|
# ShowProgressBars
|
||||||
|
# Control show progress bars for load steps at server startup
|
||||||
|
# Default: 1 (true)
|
||||||
|
# 0 (false)
|
||||||
|
#
|
||||||
# WaitAtStartupError
|
# WaitAtStartupError
|
||||||
# After startup error report wait <Enter> or some time before continue (and possible close console window)
|
# After startup error report wait <Enter> or some time before continue (and possible close console window)
|
||||||
# -1 (wait until <Enter> press)
|
# -1 (wait until <Enter> press)
|
||||||
|
|
@ -772,6 +777,7 @@ PetUnsummonAtMount = 1
|
||||||
ClientCacheVersion = 0
|
ClientCacheVersion = 0
|
||||||
Event.Announce = 0
|
Event.Announce = 0
|
||||||
BeepAtStart = 1
|
BeepAtStart = 1
|
||||||
|
ShowProgressBars = 1
|
||||||
WaitAtStartupError = 0
|
WaitAtStartupError = 0
|
||||||
Motd = "Welcome to the Massive Network Game Object Server."
|
Motd = "Welcome to the Massive Network Game Object Server."
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
|
|
||||||
|
bool barGoLink::m_showOutput = true;
|
||||||
|
|
||||||
char const* const barGoLink::empty = " ";
|
char const* const barGoLink::empty = " ";
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char const* const barGoLink::full = "\x3D";
|
char const* const barGoLink::full = "\x3D";
|
||||||
|
|
@ -29,16 +31,23 @@ char const* const barGoLink::full = "*";
|
||||||
|
|
||||||
barGoLink::~barGoLink()
|
barGoLink::~barGoLink()
|
||||||
{
|
{
|
||||||
|
if (!m_showOutput)
|
||||||
|
return;
|
||||||
|
|
||||||
printf( "\n" );
|
printf( "\n" );
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
barGoLink::barGoLink( int row_count )
|
barGoLink::barGoLink(int row_count)
|
||||||
{
|
{
|
||||||
rec_no = 0;
|
rec_no = 0;
|
||||||
rec_pos = 0;
|
rec_pos = 0;
|
||||||
indic_len = 50;
|
indic_len = 50;
|
||||||
num_rec = row_count;
|
num_rec = row_count;
|
||||||
|
|
||||||
|
if (!m_showOutput)
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
printf( "\x3D" );
|
printf( "\x3D" );
|
||||||
#else
|
#else
|
||||||
|
|
@ -53,8 +62,11 @@ barGoLink::barGoLink( int row_count )
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void barGoLink::step( void )
|
void barGoLink::step()
|
||||||
{
|
{
|
||||||
|
if (!m_showOutput)
|
||||||
|
return;
|
||||||
|
|
||||||
int i, n;
|
int i, n;
|
||||||
|
|
||||||
if ( num_rec == 0 ) return;
|
if ( num_rec == 0 ) return;
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,22 @@
|
||||||
|
|
||||||
class MANGOS_DLL_SPEC barGoLink
|
class MANGOS_DLL_SPEC barGoLink
|
||||||
{
|
{
|
||||||
static char const * const empty;
|
public: // constructors
|
||||||
static char const * const full;
|
barGoLink(int row_count);
|
||||||
|
|
||||||
int rec_no;
|
|
||||||
int rec_pos;
|
|
||||||
int num_rec;
|
|
||||||
int indic_len;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
void step( void );
|
|
||||||
barGoLink( int );
|
|
||||||
~barGoLink();
|
~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;
|
||||||
|
|
||||||
|
int rec_no;
|
||||||
|
int rec_pos;
|
||||||
|
int num_rec;
|
||||||
|
int indic_len;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10982"
|
#define REVISION_NR "10983"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue