mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-10 04:21:18 +00:00
新功能 + BUG fix
检测是否有新版本 提示权限包到期 玩家登录时删除过期的或无效数据
This commit is contained in:
@ -216,6 +216,18 @@ public class MySQLPlayerDataDao extends DatabaseUtil implements IPlayerDataDao {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delPlayData(Long id) throws Exception {
|
||||
String sql = "DELETE FROM `" + PluginCfg.SQL_TABLE_PREFIX + "playerData` WHERE `id`='" + id + "' AND (`serverId`='" + PluginCfg.SQL_SERVER_ID + "' OR `serverId` IS NULL);";
|
||||
try {
|
||||
getDB().query(sql);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "&4Can't delete data by ID: {0}", id));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delPlayData(String uuid) throws Exception {
|
||||
String sql = "DELETE FROM `" + PluginCfg.SQL_TABLE_PREFIX + "playerData` WHERE `uuid`='" + uuid + "' AND `serverId`='" + PluginCfg.SQL_SERVER_ID + "';";
|
||||
|
@ -175,6 +175,18 @@ public class SqlitePlayerDataDao extends DatabaseUtil implements IPlayerDataDao
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delPlayData(Long id) throws Exception {
|
||||
String sql = "DELETE FROM \"main\".\"playerData\" WHERE (\"id\"='" + id + "');";
|
||||
try {
|
||||
getDB().query(sql);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
pm.getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "&4Can't delete data by ID: {0}", id));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delPlayData(String uuid) throws Exception {
|
||||
String sql = "DELETE FROM \"main\".\"playerData\" WHERE (\"uuid\"='" + uuid + "');";
|
||||
|
Reference in New Issue
Block a user