logger gets initialized now
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40286
This commit is contained in:
parent
8ec61eecbf
commit
f30dfedeeb
@ -3,6 +3,17 @@
|
|||||||
|
|
||||||
CLogger g_Logger;
|
CLogger g_Logger;
|
||||||
|
|
||||||
|
void CLogger::OnSourceModStartup(bool late)
|
||||||
|
{
|
||||||
|
//:TODO: read these options from a file, dont hardcode them
|
||||||
|
InitLogger(LoggingMode_PerMap, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLogger::OnSourceModAllShutdown()
|
||||||
|
{
|
||||||
|
CloseLogger();
|
||||||
|
}
|
||||||
|
|
||||||
void CLogger::_NewMapFile()
|
void CLogger::_NewMapFile()
|
||||||
{
|
{
|
||||||
if (!m_Active)
|
if (!m_Active)
|
||||||
|
@ -23,10 +23,13 @@ enum LoggingMode
|
|||||||
LoggingMode_HL2
|
LoggingMode_HL2
|
||||||
};
|
};
|
||||||
|
|
||||||
class CLogger
|
class CLogger : public SMGlobalClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CLogger() : m_ErrMapStart(false), m_Active(false), m_DelayedStart(false), m_DailyPrintHdr(false) {}
|
CLogger() : m_ErrMapStart(false), m_Active(false), m_DelayedStart(false), m_DailyPrintHdr(false) {}
|
||||||
|
public: //SMGlobalClass
|
||||||
|
void OnSourceModStartup(bool late);
|
||||||
|
void OnSourceModAllShutdown();
|
||||||
public:
|
public:
|
||||||
void InitLogger(LoggingMode mode, bool startlogging);
|
void InitLogger(LoggingMode mode, bool startlogging);
|
||||||
void CloseLogger();
|
void CloseLogger();
|
||||||
|
@ -42,6 +42,13 @@ public:
|
|||||||
virtual void OnSourceModShutdown()
|
virtual void OnSourceModShutdown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called after SourceMod is completely shutted down
|
||||||
|
*/
|
||||||
|
virtual void OnSourceModAllShutdown()
|
||||||
|
{
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
SMGlobalClass *m_pGlobalClassNext;
|
SMGlobalClass *m_pGlobalClassNext;
|
||||||
static SMGlobalClass *head;
|
static SMGlobalClass *head;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <sh_string.h>
|
#include <sh_string.h>
|
||||||
#include "PluginSys.h"
|
#include "PluginSys.h"
|
||||||
#include "ShareSys.h"
|
#include "ShareSys.h"
|
||||||
|
#include "CLogger.h"
|
||||||
|
|
||||||
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
|
SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool);
|
||||||
|
|
||||||
@ -157,6 +158,8 @@ bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, ch
|
|||||||
m_IsMapLoading = true;
|
m_IsMapLoading = true;
|
||||||
m_IsLateLoadInMap = false;
|
m_IsLateLoadInMap = false;
|
||||||
|
|
||||||
|
g_Logger.MapChange(pMapName);
|
||||||
|
|
||||||
DoGlobalPluginLoads();
|
DoGlobalPluginLoads();
|
||||||
|
|
||||||
m_IsMapLoading = false;
|
m_IsMapLoading = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user