diff options
author | Mattes D <github@xoft.cz> | 2014-08-21 20:47:52 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-08-21 20:47:52 +0200 |
commit | 0c04bf962ed025789c1979c6d4fb122735b1a46b (patch) | |
tree | 45d95981acb121f8b14b27500489ef9d10e82fd2 /src/Protocol/MojangAPI.cpp | |
parent | RankMgr: Added cRankManager::RemovePlayerRank(). (diff) | |
download | cuberite-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 '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 823ff5469..3786fecc9 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); + } } |