cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. (/thread-2246.html) |
cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - Zee1234 - 12-11-2015 I was testing out cRankManager:GetPlayerPermissions(UUID), seeing how it returned the *, when I found out it returned... literally nothing. So I tried it out with non-admin groups, and it continued to return nothing. So I tried a different, imperfect method to replicate it. Code and outputs below.
The Code:
No rank assigned:
Rank assigned:
So did I do something wrong? I currently don't have a way to compile a debug build, so can't provide any information that might give. RE: cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - Schwertspize - 12-11-2015 I think GetUUID Is wrong here. @line 17 here (maybe I'm wrong but this one has a very bad documentation) GetUUID gets the official mojang UUID which is unique per player. GetUniqueID gets unique ID which is unique per player AND online being. Only for cuberite (internal) If you leave and reconnect, GetUUID is still the same but GetUniqueID returns another value. The no logical way to veg the answer, just try both RE: cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - Zee1234 - 12-11-2015 Documentation specifically states that you use UUID, not UniqueID. Either way though, I tested it. No errors, but no list in any of the 4 parts, so no, that's not how it works. RE: cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - NiLSPACE - 12-11-2015 I find the documentation to be really on point. GetUniqueID returns the ID within the server that identifies all entities. (btw, that ID is also needed for the client, since they also have to identify the entity as well). GetUUID returns the ID that Mojang created, or Cuberite generated in case the server is running in offline mode. Could you look at what GetUUID returns? Also, perhaps you could try GetGroupPermissions on a specific group, just to see if it returns what you expect it to return. RE: cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - Zee1234 - 12-12-2015 Added on LOG(table.concat(cRankManager:GetGroupPermissions("Default").", ")) And it worked as expected. Also, the return of GetUUID is printed into the logs above as the string of letters and characters. |