summaryrefslogtreecommitdiffstats
path: root/src/Protocol/MojangAPI.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-21 20:47:52 +0200
committerMattes D <github@xoft.cz>2014-08-21 20:47:52 +0200
commit0c04bf962ed025789c1979c6d4fb122735b1a46b (patch)
tree45d95981acb121f8b14b27500489ef9d10e82fd2 /src/Protocol/MojangAPI.h
parentRankMgr: Added cRankManager::RemovePlayerRank(). (diff)
downloadcuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar.gz
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar.bz2
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar.lz
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar.xz
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.tar.zst
cuberite-0c04bf962ed025789c1979c6d4fb122735b1a46b.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/MojangAPI.h22
1 files changed, 21 insertions, 1 deletions
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 <time.h>
+
+
+
+
+// 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