mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-07 20:56:57 +00:00
功能扩展 + BUG修复
1.命令提示语言支持 2.mysql模式下的bug(时间累积和创建表) 3.支持自定义时间单位 天、小时、分钟
This commit is contained in:
@ -70,9 +70,9 @@ public class SqlitePlayerDataDao extends DatabaseUtil implements IPlayerDataDao
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setTime(String uuid, String packageName, int days) throws Exception {
|
||||
public boolean setTime(String uuid, String packageName, int time) throws Exception {
|
||||
long now = new Date().getTime();
|
||||
long addTime = days * TIME_UNIT;
|
||||
long addTime = time * TIME_UNIT;
|
||||
long expire = now + addTime;
|
||||
PlayerDataBean pdb = queryPlayerData(uuid, packageName);
|
||||
if (pdb == null) {
|
||||
@ -85,9 +85,9 @@ public class SqlitePlayerDataDao extends DatabaseUtil implements IPlayerDataDao
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addTime(String uuid, String packageName, int days) throws Exception {
|
||||
public boolean addTime(String uuid, String packageName, int time) throws Exception {
|
||||
long now = new Date().getTime();
|
||||
long addTime = days * TIME_UNIT;
|
||||
long addTime = time * TIME_UNIT;
|
||||
long expire = now + addTime;
|
||||
PlayerDataBean pdb = queryPlayerData(uuid, packageName);
|
||||
if (pdb == null) {
|
||||
|
Reference in New Issue
Block a user