diff options
author | Mattes D <github@xoft.cz> | 2014-08-26 16:09:16 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-08-26 16:09:16 +0200 |
commit | 98974412fa6d7662b84555e079a6306dd4d90db3 (patch) | |
tree | 733c745ef60441671524169c1bdff022dbf86867 /src/Protocol/MojangAPI.cpp | |
parent | Profiling: Added profiling script for x64 executable. (diff) | |
parent | Merge pull request #1290 from mc-server/Ranks (diff) | |
download | cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.gz cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.bz2 cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.lz cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.xz cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.zst cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.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); + } } |