1
1
mirror of https://github.com/geekfrog/PermissionsTime.git synced 2025-09-08 18:45:38 +00:00

权限包功能

give功能
配置BUG修复
This commit is contained in:
GeekFrog
2017-07-12 05:21:26 +08:00
parent d0e3e86377
commit f00284314f
15 changed files with 334 additions and 97 deletions

View File

@ -26,7 +26,7 @@ public class SqlManager {
}
public boolean updateDatabase() {
if(db != null && db.isOpen()){
if (db != null && db.isOpen()) {
db.close();
}
if (PluginCfg.USE_MYSQL) {
@ -37,7 +37,7 @@ public class SqlManager {
}
db.open();
try {
if(!pds.tableExist()){
if (!pds.tableExist()) {
pds.creatTable();
}
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX) + "连接数据库成功");
@ -47,4 +47,17 @@ public class SqlManager {
}
return false;
}
public boolean giveTime(String uuid, String packageName, int days) {
for (int i = 0; i < 3; i++) {
try {
if (pds.addTime(uuid, packageName, days)) {
return true;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return false;
}
}