mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-04 14:03:24 +01:00
Fix some database issues
This commit is contained in:
parent
22231d2652
commit
07f8940904
@ -20,6 +20,7 @@
|
||||
import at.pcgamingfreaks.Database.ConnectionProvider.ConnectionProvider;
|
||||
import at.pcgamingfreaks.Database.ConnectionProvider.MySQLConnectionProvider;
|
||||
import at.pcgamingfreaks.Database.DBTools;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Database.MinepacksPlayerData;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
||||
|
||||
import org.intellij.lang.annotations.Language;
|
||||
@ -72,4 +73,11 @@ protected void checkDB()
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updatePlayer(final @NotNull Connection connection, final @NotNull MinepacksPlayerData player) throws SQLException
|
||||
{
|
||||
DBTools.runStatement(connection, queryInsertPlayer, player.getName(), formatUUID(player.getUUID()), formatUUID(player.getUUID()));
|
||||
DBTools.runStatement(connection, queryUpdatePlayer, player.getName(), formatUUID(player.getUUID()));
|
||||
}
|
||||
}
|
@ -269,7 +269,7 @@ public void loadPlayer(final @NotNull MinepacksPlayerData player)
|
||||
{
|
||||
final int id = rs.getInt(fieldPlayerID);
|
||||
long cooldown = 0;
|
||||
if(syncCooldown) cooldown = rs.getTimestamp(fieldCdPlayerID).getTime();
|
||||
if(syncCooldown && rs.getTimestamp(fieldCdTime) != null) cooldown = rs.getTimestamp(fieldCdTime).getTime();
|
||||
final long cd = cooldown;
|
||||
plugin.getServer().getScheduler().runTask(plugin, () -> player.setLoaded(id, cd));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user