UUID Questions

Discussion in 'Plugin Development' started by Niknea, Apr 5, 2014.

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

    amhokies

    No, because the UUID class does not have that method.

    EDIT: Unless your data is persisting between player logins, (i.e. You keep the data stored when the player logs out, then back) then there's no situation that I can think of where you would need to use the UUIDs.
     
  2. Offline

    Gater12

    Niknea
    ? The Player object is the player itself.... AFAIK
     
  3. Offline

    Niknea

  4. Offline

    amhokies

    I've forgotten what you need fixing exactly.
     
  5. Offline

    Wolfey

    Code:java
    1. @EvenHandler
    2. public void onPlayerJoin(PlayerJoinEvent e) {
    3. Player p = e.getPlayer();
    4. if(p.hasPermission("permission")) {
    5. // run code
    6. }
    7. }

    You should be using the player class, not the uuid.
     
  6. Offline

    Niknea

    Wolfey but then what if they changed there name? They wont have the perm anymore.
     
  7. Offline

    Wolfey

    Um... I'm pretty sure it should work perfectly. If it doesn't, then there is no way to actually check if a player has permisson to something.
     
  8. Offline

    Niknea

    Wolfey But that will get the players name, once 1.8 comes out they can change there name, leaving the permissions nodes to the account with the name, so another player that has that name gets it, thats why I want to get there UUID.
     
  9. Offline

    xTigerRebornx

    Niknea They can't change their name while in-game, and the storing of the permissions will be handled by whatever Permissions plugin the user may have installed. If the person using your plugin doesn't have the permission plugin properly updated to handle UUID's, then its the user's fault
     
    Wolfey and Niknea like this.
  10. Offline

    ROTN

    I know I've told you this before, but this is for anyone else wondering.

    PEX and any other permissions manager you are using will be updating their plugins to use UUID's. You'll have to worry about changing that.
     
    Niknea likes this.
  11. Shouldn't player.hasPermission(...) be used to test permissions, if the player is online? Requirement would be a permissions plugin that supports uuids, which may be the point of your question. Your permissions plugin needs to do the uuid-handling then Player.hasPermission is the right method to call .
     
  12. Offline

    FlareLine

    Use toString(); instead of leaving it as a UUID.
    It makes it so much easier to do things with it.
     
  13. Offline

    BillyGalbreath

    OOP (Object Oriented Programing) deals with Objects. The player itself is an object containing many things, including the player's name and its UUID. The server doesnt recognize a player's name. That's why when you do Bukkit.getPlayer("someName") it is actually checking each player object one by one checking the containing name in the object for a match. Same thing for Bukkit.getUUID(UUID), it's checking each and every Player object one by one. Very resource intensive actions.
    Permission plugins (even the one built into Bukkit) currently uses names. There is no way of checking a user's permission nodes using UUIDs yet, AFAIK. This is part of the big restructure Bukkit is having to deal with. You think we got it bad on our parts, imagine what the Bukkit team has to go through. :S
    Everyone is going to have to wait for permission plugins and/or Bukkit permissions to be updated to the UUID system before we can start using player specific permissions. Until then, there is literally nothing we can do but wait.
     
  14. Offline

    Forseth11

    You only need to do the UUID plugin updates if your plugin saves data for players. You do not actually need to make the UUID conversion. I am not going to because I am going to use the name changing feature to allow players to reset their stats. Going by UUID takes up more space, makes the plugin more confusing, and it makes it so players can not reset their stats if they change their name.
     
Thread Status:
Not open for further replies.

Share This Page