So, I'm currently creating a MySQL-based rank system for my network. Right now I'm stumped on how to cast the player to see if they're a rank. Seems like I already know how to do this though I can't figure it out. If you're not understanding, this is what I'm talking about: Code:java if(p.isRank(Rank.OWNER) {//lala other code} Current code: Code:java public boolean isRank(Rank rank) {//SQL code checking the rank...return true;} Thanks in advance.
It seems to me like you are using an enum for ranks, while this sounds cool, it is a horrible idea. Whenever you want to make changes to ranks or permissions it looks like you will be needing to hardcode and then recompile your entire backend. That is fairly inefficient. What you should do is go more of the route of the traditional permissions system and have ranks defined in the sql and then another table with players and their ranks. This allows you to edit permissions on the fly by editing the sql entries, rather than having to hardcode your changes.