Core/WorldServer: Some minor text and code style clean up.
This commit is contained in:
@@ -37,9 +37,9 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "ServiceWin32.h"
|
#include "ServiceWin32.h"
|
||||||
char serviceName[] = "TrinityCore";
|
char serviceName[] = "worldserver";
|
||||||
char serviceLongName[] = "Trinity core service";
|
char serviceLongName[] = "TrinityCore world service";
|
||||||
char serviceDescription[] = "Massive Network Game Object Server";
|
char serviceDescription[] = "TrinityCore World of Warcraft emulator world service";
|
||||||
/*
|
/*
|
||||||
* -1 - not in service mode
|
* -1 - not in service mode
|
||||||
* 0 - stopped
|
* 0 - stopped
|
||||||
@@ -74,12 +74,12 @@ extern int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
///- Command line parsing to get the configuration file name
|
///- Command line parsing to get the configuration file name
|
||||||
char const* cfg_file = _TRINITY_CORE_CONFIG;
|
char const* cfg_file = _TRINITY_CORE_CONFIG;
|
||||||
int c=1;
|
int c = 1;
|
||||||
while( c < argc )
|
while( c < argc )
|
||||||
{
|
{
|
||||||
if( strcmp(argv[c],"-c") == 0)
|
if (strcmp(argv[c], "-c") == 0)
|
||||||
{
|
{
|
||||||
if( ++c >= argc )
|
if (++c >= argc)
|
||||||
{
|
{
|
||||||
sLog->outError("Runtime-Error: -c option requires an input argument");
|
sLog->outError("Runtime-Error: -c option requires an input argument");
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@@ -93,34 +93,34 @@ extern int main(int argc, char **argv)
|
|||||||
////////////
|
////////////
|
||||||
//Services//
|
//Services//
|
||||||
////////////
|
////////////
|
||||||
if( strcmp(argv[c],"-s") == 0)
|
if (strcmp(argv[c], "-s") == 0)
|
||||||
{
|
{
|
||||||
if( ++c >= argc )
|
if (++c >= argc)
|
||||||
{
|
{
|
||||||
sLog->outError("Runtime-Error: -s option requires an input argument");
|
sLog->outError("Runtime-Error: -s option requires an input argument");
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if( strcmp(argv[c],"install") == 0)
|
if (strcmp(argv[c], "install") == 0)
|
||||||
{
|
{
|
||||||
if (WinServiceInstall())
|
if (WinServiceInstall())
|
||||||
sLog->outString("Installing service");
|
sLog->outString("Installing service");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if( strcmp(argv[c],"uninstall") == 0)
|
else if (strcmp(argv[c], "uninstall") == 0)
|
||||||
{
|
{
|
||||||
if(WinServiceUninstall())
|
if (WinServiceUninstall())
|
||||||
sLog->outString("Uninstalling service");
|
sLog->outString("Uninstalling service");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sLog->outError("Runtime-Error: unsupported option %s",argv[c]);
|
sLog->outError("Runtime-Error: unsupported option %s", argv[c]);
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( strcmp(argv[c],"--service") == 0)
|
if (strcmp(argv[c], "--service") == 0)
|
||||||
{
|
{
|
||||||
WinServiceRun();
|
WinServiceRun();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
extern int m_ServiceStatus;
|
extern int m_ServiceStatus;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Handle cored's termination signals
|
/// Handle worldservers's termination signals
|
||||||
class CoredSignalHandler : public Trinity::SignalHandler
|
class WorldServerSignalHandler : public Trinity::SignalHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void HandleSignal(int SigNum)
|
virtual void HandleSignal(int SigNum)
|
||||||
@@ -123,7 +123,7 @@ int Master::Run()
|
|||||||
BigNumber seed1;
|
BigNumber seed1;
|
||||||
seed1.SetRand(16 * 8);
|
seed1.SetRand(16 * 8);
|
||||||
|
|
||||||
sLog->outString("%s (core-daemon)", _FULLVERSION);
|
sLog->outString("%s (worldserver-daemon)", _FULLVERSION);
|
||||||
sLog->outString("<Ctrl-C> to stop.\n");
|
sLog->outString("<Ctrl-C> to stop.\n");
|
||||||
|
|
||||||
sLog->outString(" ______ __");
|
sLog->outString(" ______ __");
|
||||||
@@ -143,7 +143,7 @@ int Master::Run()
|
|||||||
sLog->outString("\n");
|
sLog->outString("\n");
|
||||||
#endif //USE_SFMT_FOR_RNG
|
#endif //USE_SFMT_FOR_RNG
|
||||||
|
|
||||||
/// worldd PID file creation
|
/// worldserver PID file creation
|
||||||
std::string pidfile = sConfig->GetStringDefault("PidFile", "");
|
std::string pidfile = sConfig->GetStringDefault("PidFile", "");
|
||||||
if (!pidfile.empty())
|
if (!pidfile.empty())
|
||||||
{
|
{
|
||||||
@@ -168,12 +168,12 @@ int Master::Run()
|
|||||||
sWorld->SetInitialWorldSettings();
|
sWorld->SetInitialWorldSettings();
|
||||||
|
|
||||||
// Initialise the signal handlers
|
// Initialise the signal handlers
|
||||||
CoredSignalHandler SignalINT, SignalTERM;
|
WorldServerSignalHandler SignalINT, SignalTERM;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
CoredSignalHandler SignalBREAK;
|
WorldServerSignalHandler SignalBREAK;
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
// Register core's signal handlers
|
// Register worldserver's signal handlers
|
||||||
ACE_Sig_Handler Handler;
|
ACE_Sig_Handler Handler;
|
||||||
Handler.register_handler(SIGINT, &SignalINT);
|
Handler.register_handler(SIGINT, &SignalINT);
|
||||||
Handler.register_handler(SIGTERM, &SignalTERM);
|
Handler.register_handler(SIGTERM, &SignalTERM);
|
||||||
@@ -216,11 +216,11 @@ int Master::Run()
|
|||||||
|
|
||||||
if (!curAff)
|
if (!curAff)
|
||||||
{
|
{
|
||||||
sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x", Aff, appAff);
|
sLog->outError("Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SetProcessAffinityMask(hProcess,curAff))
|
if (SetProcessAffinityMask(hProcess, curAff))
|
||||||
sLog->outString("Using processors (bitmask, hex): %x", curAff);
|
sLog->outString("Using processors (bitmask, hex): %x", curAff);
|
||||||
else
|
else
|
||||||
sLog->outError("Can't set used processors (hex): %x", curAff);
|
sLog->outError("Can't set used processors (hex): %x", curAff);
|
||||||
@@ -235,9 +235,9 @@ int Master::Run()
|
|||||||
if (Prio)
|
if (Prio)
|
||||||
{
|
{
|
||||||
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
|
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
|
||||||
sLog->outString("TrinityCore process priority class set to HIGH");
|
sLog->outString("worldserver process priority class set to HIGH");
|
||||||
else
|
else
|
||||||
sLog->outError("Can't set Trinityd process priority class.");
|
sLog->outError("Can't set worldserver process priority class.");
|
||||||
sLog->outString("");
|
sLog->outString("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user