Merge pull request #1290 from mc-server/Ranks
Rewriting permission system to use UUIDs and Ranks
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user