Ulysses

General => Developers Corner => Topic started by: iViscosity on August 16, 2017, 12:52:00 PM

Title: ULib.ucl.getInheritanceTree
Post by: iViscosity on August 16, 2017, 12:52:00 PM
EDIT: Nevermind, I ended up going onto my own server and running it myself (the RCON tool didn't show the formatting so I wasn't sure), what I thought was the case.

EDIT2: I have a separate question though, how does ULX check if a player can target another player? Like, inheritance-wize?

I'm a bit confused about how ULib.ucl.getInheritanceTree() (http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.getInheritanceTree) works. From the example it gives:
Code: [Select]
PrintTable( ULib.ucl.getInheritanceTree() )
user:
   trusted:
       members:
   thedumbones:
   admin:
       superadmin:
       serverowner:
       clanowner:
   respected:
does that mean like this (going down means higher in the chain)
Code: [Select]
user         —       thedumbones         —       admin         —       respected
  |                                                   |
trusted                                       superadmin         —       serverowner         —       clanowner
   |                                           
members
So in simple words, trusted inherits from user, and members inherits from trusted, then superadmin, serverowner, and clanowner inherit from admin, etc.?

Sorry if that doesn't really make sense I'm not really sure how to explain it.
Title: Re: ULib.ucl.getInheritanceTree
Post by: Megiddo on August 16, 2017, 02:26:56 PM
For edit two, ULib.getUsers is called with the value of ULib.ucl.getGroupCanTarget, and now you have all the players the user can target. :)
Title: Re: ULib.ucl.getInheritanceTree
Post by: iViscosity on August 16, 2017, 02:44:16 PM
Ahhhh, that makes a lot of sense. Thanks :)

(I was wondering because of this (https://github.com/TeamUlysses/ulx/pull/105) :)))