Add Player::getClientUUID

This commit is contained in:
Qiuzhizhe 2022-11-17 14:34:27 +08:00
parent 39f689ede4
commit 08b1967cc3
No known key found for this signature in database
GPG Key ID: 4EF4BF5521540263
2 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,9 @@ class Player : public Mob {
#define AFTER_EXTRA
// Add new members to class
// mClientUUID 2720
// mCertificate 2736
// mClientSubId 3520
public:
enum PositionMode : char {
NORMAL,
@ -34,8 +37,9 @@ public:
LIAPI std::string getName();
LIAPI std::string getRealName();
LIAPI std::string getUuid();
LIAPI std::string getUuid()const;
LIAPI std::string getXuid()const;
LIAPI mce::UUID getClientUUID()const;
LIAPI unsigned char getClientSubId();
LIAPI string getDeviceTypeName();
LIAPI int getAvgPing();

View File

@ -311,7 +311,7 @@ bool Player::refreshAttributes(std::vector<Attribute const*> const& attributes)
return true;
}
string Player::getUuid() {
string Player::getUuid() const{
auto result = ExtendedCertificate::getIdentity(*getCertificate());
return result.asString();
}
@ -320,6 +320,10 @@ string Player::getXuid() const{
return ExtendedCertificate::getXuid(*getCertificate());
}
mce::UUID Player::getClientUUID()const{
return dAccess<mce::UUID>(this,2720);
};
unsigned char Player::getClientSubId() {
//ServerPlayer::sendNetworkPacket 参4
return dAccess<unsigned char>(this,3520);