summaryrefslogtreecommitdiffstats
path: root/source/cRoot.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 23:38:03 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 23:38:03 +0100
commit48d30d6ab4657e00c0c861d67285256daeff1142 (patch)
treeb9dc6b6e59f09224fe3e2b80c5c247b44331e469 /source/cRoot.cpp
parentAdded all current hooks to the new plugin structure. (diff)
downloadcuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.gz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.bz2
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.lz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.xz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.zst
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.zip
Diffstat (limited to '')
-rw-r--r--source/cRoot.cpp68
1 files changed, 67 insertions, 1 deletions
diff --git a/source/cRoot.cpp b/source/cRoot.cpp
index 73f5a6397..0ccee5f20 100644
--- a/source/cRoot.cpp
+++ b/source/cRoot.cpp
@@ -31,6 +31,10 @@ struct cRoot::sRootState
WorldMap WorldsByName;
};
+
+
+
+
cRoot::cRoot()
: m_Server( 0 )
, m_MonsterConfig( 0 )
@@ -48,12 +52,20 @@ cRoot::cRoot()
s_Root = this;
}
+
+
+
+
cRoot::~cRoot()
{
s_Root = 0;
delete m_pState;
}
+
+
+
+
void cRoot::InputThread(void* a_Params)
{
cRoot& self = *(cRoot*)a_Params;
@@ -66,6 +78,10 @@ void cRoot::InputThread(void* a_Params)
}
}
+
+
+
+
void cRoot::Start()
{
if( m_Log ) delete m_Log, m_Log = 0;
@@ -88,7 +104,6 @@ void cRoot::Start()
return;
}
-
cIniFile WebIniFile("webadmin.ini");
if( WebIniFile.ReadFile() )
{
@@ -108,6 +123,7 @@ void cRoot::Start()
m_MonsterConfig = new cMonsterConfig(2);
// This sets stuff in motion
+ m_Authenticator.Start();
m_Server->StartListenThread();
//cHeartBeat* HeartBeat = new cHeartBeat();
@@ -137,6 +153,10 @@ void cRoot::Start()
delete m_Log; m_Log = 0;
}
+
+
+
+
void cRoot::LoadWorlds()
{
cIniFile IniFile("settings.ini"); IniFile.ReadFile();
@@ -169,6 +189,10 @@ void cRoot::LoadWorlds()
}
}
+
+
+
+
void cRoot::UnloadWorlds()
{
for( WorldMap::iterator itr = m_pState->WorldsByName.begin(); itr != m_pState->WorldsByName.end(); ++itr )
@@ -178,16 +202,28 @@ void cRoot::UnloadWorlds()
m_pState->WorldsByName.clear();
}
+
+
+
+
cWorld* cRoot::GetWorld()
{
return GetDefaultWorld();
}
+
+
+
+
cWorld* cRoot::GetDefaultWorld()
{
return m_pState->pDefaultWorld;
}
+
+
+
+
cWorld* cRoot::GetWorld( const char* a_WorldName )
{
WorldMap::iterator itr = m_pState->WorldsByName.find( a_WorldName );
@@ -196,6 +232,10 @@ cWorld* cRoot::GetWorld( const char* a_WorldName )
return 0;
}
+
+
+
+
void cRoot::TickWorlds( float a_Dt )
{
for( WorldMap::iterator itr = m_pState->WorldsByName.begin(); itr != m_pState->WorldsByName.end(); ++itr )
@@ -204,6 +244,10 @@ void cRoot::TickWorlds( float a_Dt )
}
}
+
+
+
+
void cRoot::ServerCommand( const char* a_Cmd )
{
//LOG("Command: %s", a_Cmd );
@@ -217,3 +261,25 @@ void cRoot::ServerCommand( const char* a_Cmd )
m_bRestart = true;
}
}
+
+
+
+
+
+void cRoot::KickUser(const AString & iUserName, const AString & iReason)
+{
+ m_Server->KickUser(iUserName, iReason);
+}
+
+
+
+
+
+void cRoot::AuthenticateUser(const AString & iUserName)
+{
+ m_Server->AuthenticateUser(iUserName);
+}
+
+
+
+