Client UUID versus ClientId

Discussion in 'Development' started by jasonwynn10, Mar 8, 2017.

Thread Status:
Not open for further replies.
  1. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
    Last edited: Mar 8, 2017
  2. HimbeersaftLP

    HimbeersaftLP Wither Skeleton

    Messages:
    1,471
    GitHub:
    HimbeersaftLP
  3. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
    I think you have it backwards
    PHP:
    $player->getClientId(); //Client Id
    $player->getUniqueId(); //UUID
     
  4. HimbeersaftLP

    HimbeersaftLP Wither Skeleton

    Messages:
    1,471
    GitHub:
    HimbeersaftLP
    Uhmm, no, I don't, I'm not sure about the UUID though
     
  5. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
  6. Jonas

    Jonas Baby Zombie

    Messages:
    192
    You can test that with two commands /uuid and /cid
     
  7. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
    Those aren't default commands on servers
     
  8. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Yes but you can make the commands
     
  9. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Im think the clientid is the UUID
     
  10. xBeastMode

    xBeastMode Shog Chips Verified

    Messages:
    0
    :facepalm: x 100
     
    SleepSpace9, dktapps and jasonwynn10 like this.
  11. Awzaw

    Awzaw Zombie Pigman Poggit Admin Verified

    Messages:
    712
    GitHub:
    awzaw
    The answer is in Player:

    PHP:
    /**
         * This might disappear in the future.
         * Please use getUniqueId() instead (IP + clientId + name combo, in the future it'll change to real UUID for online
         * auth)
         *
         * @deprecated
         *
         */
        
    public function getClientId(){
            return 
    $this->randomClientId;
        }
    So GetClientId() is deprecated and currently returns a random string, and getUniqueId() returns what it says above, IP + clientId + name combo
     
  12. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
    I have seen that, but isn't the uuid that same thing?
     
  13. wolfdale

    wolfdale Zombie

    Messages:
    252
    $player->getClientId() returns the clientId send by the player, UUID is also sent by the player
    https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Player.php#L1904
    https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Player.php#L1906
    https://github.com/pmmp/PocketMine-...cketmine/network/protocol/LoginPacket.php#L67
    https://github.com/pmmp/PocketMine-...cketmine/network/protocol/LoginPacket.php#L77
    ClientId can be easily changed but i don't think UUID can be changed (correct me if im wrong :D)
     
  14. Edwardthedog2

    Edwardthedog2 Skeleton Verified

    Messages:
    868
    GitHub:
    edwardthedog2
    UUID stands for "Universally Unique Identifier". It is unique for each player and profile that has been online on any server. It's used for recognizing a player online, and cannot be changed, even if the player changes their name (at least not usually anyway). The client ID however is just a long randomly generated number used to "identify" a player's MCPE client from everyone else's client. The problem with this however is that this client ID can be easily changed. This is done by modifying it in the game's files stored on your device.

    So in my opinion, it would be a better idea to use a player's UUID, although that's just my own thought.
     
  15. HimbeersaftLP

    HimbeersaftLP Wither Skeleton

    Messages:
    1,471
    GitHub:
    HimbeersaftLP
    UUID is even easier to change, as it's a combination of Name, IP and ClientID, you just have to change one of those and you have another UUID (yep, in MC Java Editon the UUID is unique to the account of the player and can't be changed, but not in PE)
     
  16. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,316
    GitHub:
    jasonwynn10
    Another thing I would like to know is where does the client secret fit into everything?
     
  17. BaconOFBurger

    BaconOFBurger Creeper

    Messages:
    4
    GitHub:
    BaconOFBurger
    The UUID is given via the Xbox account, unless you can access to Microsoft servers. You can't modify it.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.