Last active
August 29, 2015 14:14
-
-
Save whilb/b3f1ea5dcaf464c4ec7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class rankmanager implements Listener{ | |
//Fix your cases! | |
main plugin; | |
dbutils dbutils; | |
ranktypes ranktypes = new ranktypes(); | |
public rankmanager(main plugin, dbutils dbutils){ | |
this.plugin = plugin; | |
this.dbutils = dbutils; | |
} | |
//Update to support UUID's ASAP! DOn't use string! (hint: player.getUniqueId().toString();) | |
//UUID's fit nicely in a VARCHAR(36) | |
@SuppressWarnings("unused") | |
public void setRank(String player, rankTypes rank) { | |
try { | |
dbutils.updateSQL("UPDATE player_account SET rank=" + rank.getId() + " WHERE player='" + player + "';"); | |
} catch (SQLException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum RankTypes{ | |
DEFAULT(0), | |
PAID1(1), | |
PAID2(2), | |
HELPER(3), | |
SRMOD(4), | |
MOD(5), | |
BUILDER(6), | |
DEVELOPER(7), | |
ADMIN(8), | |
OWNER(9), | |
FOUNDER(10); | |
private int id; | |
private RankTypes(int id) { | |
this.id = id; | |
} | |
public int getId() { | |
return this.id; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment