Get Permissions of Player (offline)

Discussion in 'Plugin Development' started by stargateanubis14, Jan 16, 2012.

Thread Status:
Not open for further replies.
  1. I'm trying to do some checks to see if a user has a permission node, but that player may or may not be online at the time (the command is a script that is run that updates certain players stats based on their permissions).
    I'm using PermissionsBukkit as my permissions plugin.
    obviously, i cannot use Bukkit.getPlayer("playername");, because that will only get someone who is online.
    I heard that the getofflineplayer method may be able to do this, but its not implemented...

    So...Does anyone know of any other way to check a permission node of a player who isn't online?
    I can do it via command (/permissions check )..

    Thanks!
     
  2. Offline

    XeroBytez

    I'm also looking for a way to do this. I want to be able to read all of the groups and users in my config.yml programmatically.
     
  3. Offline

    TACTICALboom

    You could log names, save them to a file, then when needed pull names a compare them to the specified player your looking for as a string,use that string see if the permissions file contains it,then get that player's category's permissions ,or get them from the 'player dat's' but that sounds inefficient in my opinion. There's a much better way to do it then that, but i thought of name logging instantly for some reason. If you need to check if a player is online, just insert a null check. Wait, scratch that why not just get the name string from args[0], null check that player object, and then use basic .yml rule from there to find player information...the permissions nodes are just strings...as is everything else...I'm confusing myself, as i didn't read the whole post initially, just the title.
     
  4. I'm pretty sure getofflineplayer is now implemented, please correct me if I'm wrong.
     
  5. Yes, but hasPermission isn't (For OfflinePlayer)
     
  6. Offline

    TACTICALboom

    You just need a string to check the Yaml, why getoffilineplayer anyway if your arg would match the desired object.
    iKeirNez It is, but as tips48 stated, you cant use that on co-op(in simple terms) with bukkits method getoffilineplayer.
     
  7. Oh ok my bad.
     
Thread Status:
Not open for further replies.

Share This Page