From 4dd858f8997488e2252f5a04df9df1654a70d67f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 29 Jul 2014 17:45:55 +0200 Subject: Added a cMojangAPI class for PlayerName -> UUID lookups, with cache. The cache is persisted into a SQLite DB file on server shutdown. --- src/Protocol/MojangAPI.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/Protocol/MojangAPI.h (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h new file mode 100644 index 000000000..789fdf818 --- /dev/null +++ b/src/Protocol/MojangAPI.h @@ -0,0 +1,102 @@ + +// MojangAPI.h + +// Declares the cMojangAPI class representing the various API points provided by Mojang's webservices, and a cache for their results + + + + + +#pragma once + +#include + + + + + +class cMojangAPI +{ +public: + cMojangAPI(void); + ~cMojangAPI(); + + /** Initializes the API; reads the settings from the specified ini file. + Loads cached results from disk. */ + void Start(cIniFile & a_SettingsIni); + + /** Connects to the specified server using SSL, sends the given request and receives the response. + Checks Mojang certificates using the hard-coded Starfield root CA certificate. + Returns true if all was successful, false on failure. */ + static bool SecureRequest(const AString & a_ServerName, const AString & a_Request, AString & a_Response); + + /** Converts the given UUID to its short form (32 bytes, no dashes). + Logs a warning and returns empty string if not a UUID. */ + static AString MakeUUIDShort(const AString & a_UUID); + + /** Converts the given UUID to its dashed form (36 bytes, 4 dashes). + Logs a warning and returns empty string if not a UUID. */ + static AString MakeUUIDDashed(const AString & a_UUID); + + /** Converts the player names into UUIDs. + a_PlayerName[idx] will be converted to UUID and returned as idx-th value + The UUID will be empty on error. + Blocking operation, do not use in world-tick thread! */ + AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName); + + /** Called by the Authenticator to add a PlayerName -> UUID mapping that it has received from + authenticating a user. This adds the cache item and "refreshes" it if existing, adjusting its datetime + stamp to now. */ + void AddPlayerNameToUUIDMapping(const AString & a_PlayerName, const AString & a_UUID); + +protected: + struct sUUIDRecord + { + AString m_PlayerName; // Case-correct playername + AString m_UUID; + Int64 m_DateTime; // UNIXtime of the UUID lookup + + sUUIDRecord(void) : + m_UUID(), + m_DateTime(time(NULL)) + { + } + + sUUIDRecord(const AString & a_PlayerName, const AString & a_UUID, Int64 a_DateTime) : + m_PlayerName(a_PlayerName), + m_UUID(a_UUID), + m_DateTime(a_DateTime) + { + } + }; + typedef std::map cNameToUUIDMap; // maps Lowercased PlayerName to sUUIDRecord + + /** The server to connect to when converting player names to UUIDs. For example "api.mojang.com". */ + AString m_NameToUUIDServer; + + /** The URL to use for converting player names to UUIDs, without server part. + For example "/profiles/page/1". */ + AString m_NameToUUIDAddress; + + /** Cache for the Name-to-UUID lookups. The map key is expected lowercased. Protected by m_CSNameToUUID. */ + cNameToUUIDMap m_NameToUUID; + + /** Protects m_NameToUUID against simultaneous multi-threaded access. */ + cCriticalSection m_CSNameToUUID; + + + /** Loads the caches from a disk storage. */ + void LoadCachesFromDisk(void); + + /** Saves the caches to a disk storage. */ + void SaveCachesToDisk(void); + + /** Makes sure all specified names are in the cache. Downloads any missing ones from Mojang API servers. + Names that are not valid are not added into the cache. + ASSUMEs that a_PlayerNames contains lowercased player names. */ + void CacheNamesToUUIDs(const AStringVector & a_PlayerNames); +} ; + + + + -- cgit v1.2.3 From 6476bd0e2ee7e128e3eaa56159f169f0a53736ff Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 30 Jul 2014 13:44:03 +0200 Subject: Exported cMojangAPI to Lua. --- src/Protocol/MojangAPI.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index 789fdf818..cc2902a19 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -15,9 +15,12 @@ +// tolua_begin class cMojangAPI { public: + // tolua_end + cMojangAPI(void); ~cMojangAPI(); @@ -30,6 +33,8 @@ public: Returns true if all was successful, false on failure. */ static bool SecureRequest(const AString & a_ServerName, const AString & a_Request, AString & a_Response); + // tolua_begin + /** Converts the given UUID to its short form (32 bytes, no dashes). Logs a warning and returns empty string if not a UUID. */ static AString MakeUUIDShort(const AString & a_UUID); @@ -38,16 +43,22 @@ public: Logs a warning and returns empty string if not a UUID. */ static AString MakeUUIDDashed(const AString & a_UUID); + // tolua_end + /** Converts the player names into UUIDs. a_PlayerName[idx] will be converted to UUID and returned as idx-th value The UUID will be empty on error. Blocking operation, do not use in world-tick thread! */ AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName); + // tolua_begin + /** Called by the Authenticator to add a PlayerName -> UUID mapping that it has received from authenticating a user. This adds the cache item and "refreshes" it if existing, adjusting its datetime stamp to now. */ void AddPlayerNameToUUIDMapping(const AString & a_PlayerName, const AString & a_UUID); + + // tolua_end protected: struct sUUIDRecord @@ -95,7 +106,7 @@ protected: Names that are not valid are not added into the cache. ASSUMEs that a_PlayerNames contains lowercased player names. */ void CacheNamesToUUIDs(const AStringVector & a_PlayerNames); -} ; +} ; // tolua_export -- cgit v1.2.3 From 85d64d291a6d11df6689190268c1f4c6b1c02cdd Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 30 Jul 2014 14:09:30 +0200 Subject: MojangAPI: Clarified the UUID conversion code. --- src/Protocol/MojangAPI.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index cc2902a19..c99f940ad 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -36,11 +36,13 @@ public: // tolua_begin /** Converts the given UUID to its short form (32 bytes, no dashes). - Logs a warning and returns empty string if not a UUID. */ + Logs a warning and returns empty string if not a UUID. + Note: only checks the string's length, not the actual content. */ static AString MakeUUIDShort(const AString & a_UUID); /** Converts the given UUID to its dashed form (36 bytes, 4 dashes). - Logs a warning and returns empty string if not a UUID. */ + Logs a warning and returns empty string if not a UUID. + Note: only checks the string's length, not the actual content. */ static AString MakeUUIDDashed(const AString & a_UUID); // tolua_end -- cgit v1.2.3 From 8b519bf6e20a987c9544ef11f0df6467831cc069 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 31 Jul 2014 10:02:50 +0200 Subject: MojangAPI: Added a UseCachedOnly param to GetUUIDsFromPlayerNames(). --- src/Protocol/MojangAPI.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index c99f940ad..ac8995bb5 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -50,8 +50,10 @@ public: /** Converts the player names into UUIDs. a_PlayerName[idx] will be converted to UUID and returned as idx-th value The UUID will be empty on error. - Blocking operation, do not use in world-tick thread! */ - AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName); + If a_UseOnlyCached is true, only the cached values are returned. + If a_UseOnlyCached is false, the names not found in the cache are looked up online, which is a blocking + operation, do not use this in world-tick thread! */ + AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName, bool a_UseOnlyCached = false); // tolua_begin -- cgit v1.2.3 From 003f18bd0f7593bddf5c6af89e3f6fc13632300d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 3 Aug 2014 12:12:28 +0200 Subject: Added cMojangAPI:GetUUIDFromPlayerName(). This is a simpler way to ask for a single name -> uuid conversion. --- src/Protocol/MojangAPI.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index ac8995bb5..7f3ef4e39 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -45,6 +45,13 @@ public: Note: only checks the string's length, not the actual content. */ static AString MakeUUIDDashed(const AString & a_UUID); + /** Converts a player name into a UUID. + The UUID will be empty on error. + If a_UseOnlyCached is true, the function only consults the cached values. + If a_UseOnlyCached is false and the name is not found in the cache, it is looked up online, which is a blocking + operation, do not use this in world-tick thread! */ + AString GetUUIDFromPlayerName(const AString & a_PlayerName, bool a_UseOnlyCached = false); + // tolua_end /** Converts the player names into UUIDs. -- cgit v1.2.3 From 21f52676f3848d58ff1e4eb511c691d4a4ed824b Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 3 Aug 2014 21:32:20 +0200 Subject: cMojangAPI: Added UUID-to-Name lookup. Also fixed the bindings, now all functions are static-like. --- src/Protocol/MojangAPI.h | 97 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 16 deletions(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index 7f3ef4e39..08e799c73 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -11,6 +11,11 @@ #include +namespace Json +{ + class Value; +} + @@ -45,14 +50,24 @@ public: Note: only checks the string's length, not the actual content. */ static AString MakeUUIDDashed(const AString & a_UUID); + // tolua_end + /** Converts a player name into a UUID. The UUID will be empty on error. If a_UseOnlyCached is true, the function only consults the cached values. If a_UseOnlyCached is false and the name is not found in the cache, it is looked up online, which is a blocking - operation, do not use this in world-tick thread! */ + operation, do not use this in world-tick thread! + If you have multiple names to resolve, use the GetUUIDsFromPlayerNames() function, it uses a single request for multiple names. */ AString GetUUIDFromPlayerName(const AString & a_PlayerName, bool a_UseOnlyCached = false); - // tolua_end + /** Converts a UUID into a playername. + The returned playername will be empty on error. + Both short and dashed UUID formats are accepted. + Uses both m_UUIDToName and m_UUIDToProfile to search for the value. Uses m_UUIDToProfile for cache. + If a_UseOnlyCached is true, the function only consults the cached values. + If a_UseOnlyCached is false and the name is not found in the cache, it is looked up online, which is a blocking + operation, do not use this in world-tick thread! */ + AString GetPlayerNameFromUUID(const AString & a_UUID, bool a_UseOnlyCached = false); /** Converts the player names into UUIDs. a_PlayerName[idx] will be converted to UUID and returned as idx-th value @@ -62,36 +77,61 @@ public: operation, do not use this in world-tick thread! */ AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName, bool a_UseOnlyCached = false); - // tolua_begin - /** Called by the Authenticator to add a PlayerName -> UUID mapping that it has received from authenticating a user. This adds the cache item and "refreshes" it if existing, adjusting its datetime stamp to now. */ void AddPlayerNameToUUIDMapping(const AString & a_PlayerName, const AString & a_UUID); - // tolua_end - + /** Called by the Authenticator to add a profile that it has received from authenticating a user. Adds + the profile to the respective mapping caches and updtes their datetime stamp to now. */ + void AddPlayerProfile(const AString & a_PlayerName, const AString & a_UUID, const Json::Value & a_Properties); + protected: - struct sUUIDRecord + /** Holds data for a single player profile. */ + struct sProfile { - AString m_PlayerName; // Case-correct playername - AString m_UUID; - Int64 m_DateTime; // UNIXtime of the UUID lookup + AString m_PlayerName; // Case-correct playername + AString m_UUID; // Short lowercased UUID + AString m_Textures; // The Textures field of the profile properties + AString m_TexturesSignature; // The signature of the Textures field of the profile properties + Int64 m_DateTime; // UNIXtime of the profile lookup - sUUIDRecord(void) : + /** Default constructor for the container's sake. */ + sProfile(void) : + m_PlayerName(), m_UUID(), + m_Textures(), + m_TexturesSignature(), m_DateTime(time(NULL)) { } - sUUIDRecord(const AString & a_PlayerName, const AString & a_UUID, Int64 a_DateTime) : + /** Constructor for the storage creation. */ + sProfile( + const AString & a_PlayerName, + const AString & a_UUID, + const AString & a_Textures, + const AString & a_TexturesSignature, + Int64 a_DateTime + ) : m_PlayerName(a_PlayerName), m_UUID(a_UUID), + m_Textures(a_Textures), + m_TexturesSignature(a_TexturesSignature), m_DateTime(a_DateTime) { } + + /** Constructor that parses the values from the Json profile. */ + sProfile( + const AString & a_PlayerName, + const AString & a_UUID, + const Json::Value & a_Properties, + Int64 a_DateTime + ); }; - typedef std::map cNameToUUIDMap; // maps Lowercased PlayerName to sUUIDRecord + typedef std::map cProfileMap; + /** The server to connect to when converting player names to UUIDs. For example "api.mojang.com". */ AString m_NameToUUIDServer; @@ -100,12 +140,32 @@ protected: For example "/profiles/page/1". */ AString m_NameToUUIDAddress; - /** Cache for the Name-to-UUID lookups. The map key is expected lowercased. Protected by m_CSNameToUUID. */ - cNameToUUIDMap m_NameToUUID; + /** The server to connect to when converting UUID to profile. For example "sessionserver.mojang.com". */ + AString m_UUIDToProfileServer; + + /** The URL to use for converting UUID to profile, without the server part. + Will replace %UUID% with the actual UUID. For example "session/minecraft/profile/%UUID%?unsigned=false". */ + AString m_UUIDToProfileAddress; + + /** Cache for the Name-to-UUID lookups. The map key is lowercased PlayerName. Protected by m_CSNameToUUID. */ + cProfileMap m_NameToUUID; /** Protects m_NameToUUID against simultaneous multi-threaded access. */ cCriticalSection m_CSNameToUUID; + /** Cache for the Name-to-UUID lookups. The map key is lowercased short UUID. Protected by m_CSUUIDToName. */ + cProfileMap m_UUIDToName; + + /** Protects m_UUIDToName against simultaneous multi-threaded access. */ + cCriticalSection m_CSUUIDToName; + + /** Cache for the UUID-to-profile lookups. The map key is lowercased short UUID. + Protected by m_CSUUIDToProfile. */ + cProfileMap m_UUIDToProfile; + + /** Protects m_UUIDToProfile against simultaneous multi-threaded access. */ + cCriticalSection m_CSUUIDToProfile; + /** Loads the caches from a disk storage. */ void LoadCachesFromDisk(void); @@ -113,10 +173,15 @@ protected: /** Saves the caches to a disk storage. */ void SaveCachesToDisk(void); - /** Makes sure all specified names are in the cache. Downloads any missing ones from Mojang API servers. + /** Makes sure all specified names are in the m_PlayerNameToUUID cache. Downloads any missing ones from Mojang API servers. Names that are not valid are not added into the cache. ASSUMEs that a_PlayerNames contains lowercased player names. */ void CacheNamesToUUIDs(const AStringVector & a_PlayerNames); + + /** Makes sure the specified UUID is in the m_UUIDToProfile cache. If missing, downloads it from Mojang API servers. + UUIDs that are not valid will not be added into the cache. + ASSUMEs that a_UUID is a lowercased short UUID. */ + void CacheUUIDToProfile(const AString & a_UUID); } ; // tolua_export -- cgit v1.2.3 From 1fa210c7f91030ac18fd880fcf131e8104c0b889 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 4 Aug 2014 11:16:19 +0200 Subject: Refactored case-conversion functions. StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place. --- src/Protocol/MojangAPI.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index 08e799c73..6ed37625e 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -40,12 +40,12 @@ public: // tolua_begin - /** Converts the given UUID to its short form (32 bytes, no dashes). + /** Normalizes the given UUID to its short form (32 bytes, no dashes, lowercase). Logs a warning and returns empty string if not a UUID. Note: only checks the string's length, not the actual content. */ static AString MakeUUIDShort(const AString & a_UUID); - /** Converts the given UUID to its dashed form (36 bytes, 4 dashes). + /** Normalizes the given UUID to its dashed form (36 bytes, 4 dashes, lowercase). Logs a warning and returns empty string if not a UUID. Note: only checks the string's length, not the actual content. */ static AString MakeUUIDDashed(const AString & a_UUID); -- cgit v1.2.3 From 936604ca95d8e639a6783f9931093b689ce103d9 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 21 Aug 2014 15:19:30 +0200 Subject: cMojangAPI: Fixed MakeUUID___() bindings. ToLua would generate a shadow return value for the input strings. --- src/Protocol/MojangAPI.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index 6ed37625e..e96c0d589 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -38,8 +38,6 @@ public: Returns true if all was successful, false on failure. */ static bool SecureRequest(const AString & a_ServerName, const AString & a_Request, AString & a_Response); - // tolua_begin - /** Normalizes the given UUID to its short form (32 bytes, no dashes, lowercase). Logs a warning and returns empty string if not a UUID. Note: only checks the string's length, not the actual content. */ @@ -50,8 +48,6 @@ public: Note: only checks the string's length, not the actual content. */ static AString MakeUUIDDashed(const AString & a_UUID); - // tolua_end - /** Converts a player name into a UUID. The UUID will be empty on error. If a_UseOnlyCached is true, the function only consults the cached values. -- cgit v1.2.3 From 0c04bf962ed025789c1979c6d4fb122735b1a46b Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 21 Aug 2014 20:47:52 +0200 Subject: cMojangAPI updates cRankManager's playernames. --- src/Protocol/MojangAPI.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index e96c0d589..252d32543 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -11,6 +11,13 @@ #include + + + + +// fwd: ../RankManager.h" +class cRankManager; + namespace Json { class Value; @@ -81,7 +88,10 @@ public: /** Called by the Authenticator to add a profile that it has received from authenticating a user. Adds the profile to the respective mapping caches and updtes their datetime stamp to now. */ void AddPlayerProfile(const AString & a_PlayerName, const AString & a_UUID, const Json::Value & a_Properties); - + + /** Sets the m_RankMgr that is used for name-uuid notifications. Accepts NULL to remove the binding. */ + void SetRankManager(cRankManager * a_RankManager) { m_RankMgr = a_RankManager; } + protected: /** Holds data for a single player profile. */ struct sProfile @@ -161,6 +171,12 @@ protected: /** Protects m_UUIDToProfile against simultaneous multi-threaded access. */ cCriticalSection m_CSUUIDToProfile; + + /** The rank manager that is notified of the name-uuid pairings. May be NULL. Protected by m_CSRankMgr. */ + cRankManager * m_RankMgr; + + /** Protects m_RankMgr agains simultaneous multi-threaded access. */ + cCriticalSection m_CSRankMgr; /** Loads the caches from a disk storage. */ @@ -178,6 +194,10 @@ protected: UUIDs that are not valid will not be added into the cache. ASSUMEs that a_UUID is a lowercased short UUID. */ void CacheUUIDToProfile(const AString & a_UUID); + + /** Called for each name-uuid pairing that is discovered. + If assigned, notifies the m_RankManager of the event. */ + void NotifyNameUUID(const AString & a_PlayerName, const AString & a_PlayerUUID); } ; // tolua_export -- cgit v1.2.3 From 3d2d8a096b72a0af9d4e21198d112d97c9318410 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 5 Oct 2014 20:03:21 +0200 Subject: cMojangAPI: Added periodical refreshes. --- src/Protocol/MojangAPI.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Protocol/MojangAPI.h') diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h index 252d32543..fa4c16e4e 100644 --- a/src/Protocol/MojangAPI.h +++ b/src/Protocol/MojangAPI.h @@ -93,6 +93,10 @@ public: void SetRankManager(cRankManager * a_RankManager) { m_RankMgr = a_RankManager; } protected: + /** The thread that periodically checks for stale data and re-queries it from the server. */ + class cUpdateThread; + + /** Holds data for a single player profile. */ struct sProfile { @@ -177,6 +181,9 @@ protected: /** Protects m_RankMgr agains simultaneous multi-threaded access. */ cCriticalSection m_CSRankMgr; + + /** The thread that periodically updates the stale data in the DB from the Mojang servers. */ + SharedPtr m_UpdateThread; /** Loads the caches from a disk storage. */ @@ -189,15 +196,29 @@ protected: Names that are not valid are not added into the cache. ASSUMEs that a_PlayerNames contains lowercased player names. */ void CacheNamesToUUIDs(const AStringVector & a_PlayerNames); + + /** Queries all the specified names and stores them into the m_PlayerNameToUUID cache. + Names that are not valid are not added into the cache. + ASSUMEs that a_PlayerNames contans lowercased player names. + For performance reasons takes a non-const reference and modifies the list given to it, until empty. */ + void QueryNamesToUUIDs(AStringVector & a_PlayerNames); /** Makes sure the specified UUID is in the m_UUIDToProfile cache. If missing, downloads it from Mojang API servers. UUIDs that are not valid will not be added into the cache. ASSUMEs that a_UUID is a lowercased short UUID. */ void CacheUUIDToProfile(const AString & a_UUID); + /** Queries the specified UUID's profile and stores it in the m_UUIDToProfile cache. If already present, updates the cache entry. + UUIDs that are not valid will not be added into the cache. + ASSUMEs that a_UUID is a lowercased short UUID. */ + void QueryUUIDToProfile(const AString & a_UUID); + /** Called for each name-uuid pairing that is discovered. If assigned, notifies the m_RankManager of the event. */ void NotifyNameUUID(const AString & a_PlayerName, const AString & a_PlayerUUID); + + /** Updates the stale values in the DB from the Mojang servers. Called from the cUpdateThread, blocks on the HTTPS API calls. */ + void Update(void); } ; // tolua_export -- cgit v1.2.3