From ebea2b7efc1775de66e0c6b6ee66da6f9ad04422 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 11 Jul 2014 13:13:10 +0200 Subject: Player data filenames are based on UUID. --- src/Server.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 3d76c8ccf..5227799e8 100644 --- a/src/Server.h +++ b/src/Server.h @@ -112,8 +112,18 @@ public: // tolua_export cRsaPrivateKey & GetPrivateKey(void) { return m_PrivateKey; } const AString & GetPublicKeyDER(void) const { return m_PublicKeyDER; } + /** Returns true if authentication has been turned on in server settings. */ bool ShouldAuthenticate(void) const { return m_ShouldAuthenticate; } + /** Returns true if offline UUIDs should be used to load data for players whose normal UUIDs cannot be found. + Loaded from the settings.ini [PlayerData].LoadOfflinePlayerData setting. */ + bool ShouldLoadOfflinePlayerData(void) const { return m_ShouldLoadOfflinePlayerData; } + + /** Returns true if old-style playernames should be used to load data for players whose regular datafiles cannot be found. + This allows a seamless transition from name-based to UUID-based player storage. + Loaded from the settings.ini [PlayerData].LoadNamedPlayerData setting. */ + bool ShouldLoadNamedPlayerData(void) const { return m_ShouldLoadNamedPlayerData; } + private: friend class cRoot; // so cRoot can create and destroy cServer @@ -204,6 +214,16 @@ private: This setting is the same as the "online-mode" setting in Vanilla. */ bool m_ShouldAuthenticate; + /** True if offline UUIDs should be used to load data for players whose normal UUIDs cannot be found. + This allows transitions from an offline (no-auth) server to an online one. + Loaded from the settings.ini [PlayerData].LoadOfflinePlayerData setting. */ + bool m_ShouldLoadOfflinePlayerData; + + /** True if old-style playernames should be used to load data for players whose regular datafiles cannot be found. + This allows a seamless transition from name-based to UUID-based player storage. + Loaded from the settings.ini [PlayerData].LoadNamedPlayerData setting. */ + bool m_ShouldLoadNamedPlayerData; + cServer(void); -- cgit v1.2.3 From 4e24f711abd3d6a93f01ee7c297eb67c8aedbd37 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 14 Jul 2014 19:49:31 +0100 Subject: Player properties are now retrieved --- src/Server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 5227799e8..672dc26c0 100644 --- a/src/Server.h +++ b/src/Server.h @@ -37,7 +37,7 @@ class cPlayer; class cClientHandle; class cIniFile; -class cCommandOutputCallback ; +class cCommandOutputCallback; typedef std::list cClientHandleList; @@ -83,7 +83,7 @@ public: // tolua_export void Shutdown(void); void KickUser(int a_ClientID, const AString & a_Reason); - void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator to auth the specified user + void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const AString & a_Properties); // Called by cAuthenticator to auth the specified user const AString & GetServerID(void) const { return m_ServerID; } // tolua_export -- cgit v1.2.3 From 1f6854792cdd6792b27c4f9f3d7d857df9dd64bf Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 00:03:47 +0100 Subject: Store properties as Json::Value --- src/Server.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 672dc26c0..cf5fa524f 100644 --- a/src/Server.h +++ b/src/Server.h @@ -41,6 +41,11 @@ class cCommandOutputCallback; typedef std::list cClientHandleList; +namespace Json +{ + class Value; +} + @@ -83,7 +88,9 @@ public: // tolua_export void Shutdown(void); void KickUser(int a_ClientID, const AString & a_Reason); - void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const AString & a_Properties); // Called by cAuthenticator to auth the specified user + + /** Authenticates the specified user, called by cAuthenticator */ + void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties); const AString & GetServerID(void) const { return m_ServerID; } // tolua_export -- cgit v1.2.3 From 993fd14ddfc881cf5be951df77da0338124d68cc Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 16:33:09 +0200 Subject: Fixed basic whitespace problems. Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines. --- src/Server.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index cf5fa524f..a6b7297e8 100644 --- a/src/Server.h +++ b/src/Server.h @@ -50,10 +50,10 @@ namespace Json -class cServer // tolua_export +class cServer // tolua_export : public cListenThread::cCallback -{ // tolua_export -public: // tolua_export +{ // tolua_export +public: // tolua_export virtual ~cServer() {} bool InitServer(cIniFile & a_SettingsIni); @@ -149,7 +149,7 @@ private: virtual void Execute(void); - public: + public: cNotifyWriteThread(void); ~cNotifyWriteThread(); -- cgit v1.2.3 From 7fff12bfacbb4bef1c02cea0ec10fdc9a6fb64e4 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 19:13:23 +0200 Subject: Fixed spaces around single-line comments. There should be at least two spaces in front and one space after //-style comments. --- src/Server.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index a6b7297e8..b03359f03 100644 --- a/src/Server.h +++ b/src/Server.h @@ -133,7 +133,7 @@ public: // tolua_export private: - friend class cRoot; // so cRoot can create and destroy cServer + friend class cRoot; // so cRoot can create and destroy cServer /** When NotifyClientWrite() is called, it is queued for this thread to process (to avoid deadlocks between cSocketThreads, cClientHandle and cChunkMap) */ class cNotifyWriteThread : @@ -194,7 +194,7 @@ private: int m_ClientViewDistance; // The default view distance for clients; settable in Settings.ini - bool m_bIsConnected; // true - connected false - not connected + bool m_bIsConnected; // true - connected false - not connected bool m_bRestarting; @@ -244,7 +244,7 @@ private: // cListenThread::cCallback overrides: virtual void OnConnectionAccepted(cSocket & a_Socket) override; -}; // tolua_export +}; // tolua_export -- cgit v1.2.3