From 48d30d6ab4657e00c0c861d67285256daeff1142 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 1 Feb 2012 22:38:03 +0000 Subject: Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients; Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cRoot.h | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'source/cRoot.h') diff --git a/source/cRoot.h b/source/cRoot.h index 86b6ac28a..3179d72b0 100644 --- a/source/cRoot.h +++ b/source/cRoot.h @@ -1,5 +1,15 @@ + #pragma once + + + +#include "cAuthenticator.h" + + + + + class cThread; class cMonsterConfig; class cMCLogger; @@ -10,6 +20,7 @@ class cWebAdmin; class cPluginManager; class cServer; class cWorld; + class cRoot //tolua_export { //tolua_export public: @@ -31,24 +42,31 @@ public: cFurnaceRecipe* GetFurnaceRecipe() { return m_FurnaceRecipe; } //tolua_export cWebAdmin* GetWebAdmin() { return m_WebAdmin; } //tolua_export cPluginManager* GetPluginManager() { return m_PluginManager; } //tolua_export + cAuthenticator & GetAuthenticator() {return m_Authenticator; } - void ServerCommand( const char* a_Cmd ); //tolua_export + void ServerCommand(const char* a_Cmd ); //tolua_export + + void KickUser(const AString & iUserName, const AString & iReason); // Kicks the user, no matter in what world they are. Used from cAuthenticator + void AuthenticateUser(const AString & iUserName); // Called by cAuthenticator to auth the specified user void TickWorlds( float a_Dt ); + private: + void LoadWorlds(); void UnloadWorlds(); - cServer* m_Server; - cMonsterConfig *m_MonsterConfig; + cServer * m_Server; + cMonsterConfig * m_MonsterConfig; - cGroupManager* m_GroupManager; - cRecipeChecker* m_RecipeChecker; - cFurnaceRecipe* m_FurnaceRecipe; - cWebAdmin* m_WebAdmin; - cPluginManager* m_PluginManager; + cGroupManager * m_GroupManager; + cRecipeChecker * m_RecipeChecker; + cFurnaceRecipe * m_FurnaceRecipe; + cWebAdmin * m_WebAdmin; + cPluginManager * m_PluginManager; + cAuthenticator m_Authenticator; - cMCLogger* m_Log; + cMCLogger * m_Log; bool m_bStop; bool m_bRestart; @@ -60,4 +78,8 @@ private: static void InputThread(void* a_Params); static cRoot* s_Root; -}; //tolua_export \ No newline at end of file +}; //tolua_export + + + + -- cgit v1.2.3