diff options
author | Mattes D <github@xoft.cz> | 2014-08-26 14:23:21 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-08-26 14:23:21 +0200 |
commit | be32c0527cd6c69289217999927c3308d8169465 (patch) | |
tree | 2b106aeae7032205c8bc1abf06c9e7f646021af9 /src/Protocol/MojangAPI.cpp | |
parent | Type warning fixes. (diff) | |
parent | RankMgr: Exported the default-rank functions. (diff) | |
download | cuberite-be32c0527cd6c69289217999927c3308d8169465.tar cuberite-be32c0527cd6c69289217999927c3308d8169465.tar.gz cuberite-be32c0527cd6c69289217999927c3308d8169465.tar.bz2 cuberite-be32c0527cd6c69289217999927c3308d8169465.tar.lz cuberite-be32c0527cd6c69289217999927c3308d8169465.tar.xz cuberite-be32c0527cd6c69289217999927c3308d8169465.tar.zst cuberite-be32c0527cd6c69289217999927c3308d8169465.zip |
Diffstat (limited to 'src/Protocol/MojangAPI.cpp')
-rw-r--r-- | src/Protocol/MojangAPI.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 83c2dc300..4e5c41a8a 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -10,6 +10,7 @@ #include "inifile/iniFile.h" #include "json/json.h" #include "PolarSSL++/BlockingSslClientSocket.h" +#include "../RankManager.h" @@ -300,6 +301,7 @@ void cMojangAPI::AddPlayerNameToUUIDMapping(const AString & a_PlayerName, const cCSLock Lock(m_CSUUIDToName); m_UUIDToName[UUID] = sProfile(a_PlayerName, UUID, "", "", Now); } + NotifyNameUUID(a_PlayerName, a_UUID); } @@ -322,6 +324,7 @@ void cMojangAPI::AddPlayerProfile(const AString & a_PlayerName, const AString & cCSLock Lock(m_CSUUIDToProfile); m_UUIDToProfile[UUID] = sProfile(a_PlayerName, UUID, a_Properties, Now); } + NotifyNameUUID(a_PlayerName, a_UUID); } @@ -669,6 +672,7 @@ void cMojangAPI::CacheNamesToUUIDs(const AStringVector & a_PlayerNames) continue; } m_NameToUUID[StrToLower(JsonName)] = sProfile(JsonName, JsonUUID, "", "", Now); + NotifyNameUUID(JsonName, JsonUUID); } // for idx - root[] } // cCSLock (m_CSNameToUUID) @@ -792,6 +796,21 @@ void cMojangAPI::CacheUUIDToProfile(const AString & a_UUID) cCSLock Lock(m_CSNameToUUID); m_NameToUUID[StrToLower(PlayerName)] = sProfile(PlayerName, a_UUID, Properties, Now); } + NotifyNameUUID(PlayerName, a_UUID); +} + + + + + +void cMojangAPI::NotifyNameUUID(const AString & a_PlayerName, const AString & a_UUID) +{ + // Notify the rank manager: + cCSLock Lock(m_CSRankMgr); + if (m_RankMgr != NULL) + { + m_RankMgr->NotifyNameUUID(a_PlayerName, a_UUID); + } } |