mirror of
https://github.com/plexusorg/Plex.git
synced 2025-06-29 06:46:43 +00:00
Format
This commit is contained in:
@ -7,7 +7,6 @@ import dev.plex.cache.PlayerCache;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.storage.StorageType;
|
||||
import dev.plex.util.PlexLog;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
@ -38,7 +37,8 @@ public class SQLPlayerData
|
||||
statement.setString(1, uuid.toString());
|
||||
ResultSet set = statement.executeQuery();
|
||||
return set.next();
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -53,7 +53,8 @@ public class SQLPlayerData
|
||||
statement.setString(1, username);
|
||||
ResultSet set = statement.executeQuery();
|
||||
return set.next();
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -104,7 +105,8 @@ public class SQLPlayerData
|
||||
plexPlayer.setCommandSpy(commandspy);
|
||||
}
|
||||
return plexPlayer;
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -153,7 +155,8 @@ public class SQLPlayerData
|
||||
return plexPlayer;
|
||||
}
|
||||
return null;
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -216,11 +219,13 @@ public class SQLPlayerData
|
||||
plexPlayer.setCommandSpy(commandspy);
|
||||
}
|
||||
return plexPlayer;
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
} else if (Plex.get().getStorageType() == StorageType.SQLITE)
|
||||
}
|
||||
else if (Plex.get().getStorageType() == StorageType.SQLITE)
|
||||
{
|
||||
PlexLog.warn("Querying a user by IP running SQLite can cause performance issues! Please try to switch to a remote DB ASAP!");
|
||||
try (Connection con = Plex.get().getSqlConnection().getCon())
|
||||
@ -260,7 +265,8 @@ public class SQLPlayerData
|
||||
plexPlayer.setCommandSpy(commandspy);
|
||||
}
|
||||
return plexPlayer;
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -290,7 +296,8 @@ public class SQLPlayerData
|
||||
statement.setBoolean(9, player.isCommandSpy());
|
||||
statement.setString(10, player.getUuid().toString());
|
||||
statement.executeUpdate();
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
@ -318,7 +325,8 @@ public class SQLPlayerData
|
||||
statement.setBoolean(9, player.isVanished());
|
||||
statement.setBoolean(10, player.isCommandSpy());
|
||||
statement.execute();
|
||||
} catch (SQLException throwables)
|
||||
}
|
||||
catch (SQLException throwables)
|
||||
{
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
|
@ -4,12 +4,13 @@ import com.google.common.collect.Lists;
|
||||
import dev.plex.Plex;
|
||||
import dev.plex.punishment.extra.Note;
|
||||
import dev.plex.util.TimeUtils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.*;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -6,7 +6,6 @@ import dev.plex.punishment.Punishment;
|
||||
import dev.plex.punishment.PunishmentType;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.TimeUtils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
@ -47,7 +46,8 @@ public class SQLPunishment
|
||||
punishment.setIp(set.getString("ip"));
|
||||
punishments.add(punishment);
|
||||
}
|
||||
} catch (SQLException e)
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return punishments;
|
||||
@ -76,7 +76,8 @@ public class SQLPunishment
|
||||
punishment.setIp(set.getString("ip"));
|
||||
punishments.add(punishment);
|
||||
}
|
||||
} catch (SQLException e)
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -103,7 +104,8 @@ public class SQLPunishment
|
||||
statement.setLong(9, punishment.getEndDate().toInstant().toEpochMilli());
|
||||
PlexLog.debug("Executing punishment");
|
||||
statement.execute();
|
||||
} catch (SQLException e)
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -126,7 +128,8 @@ public class SQLPunishment
|
||||
statement1.setString(3, uuid.toString());
|
||||
statement1.setString(4, PunishmentType.TEMPBAN.name());
|
||||
statement1.executeUpdate();
|
||||
} catch (SQLException e)
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -151,7 +154,8 @@ public class SQLPunishment
|
||||
statement1.setString(3, uuid.toString());
|
||||
statement1.setString(4, PunishmentType.TEMPBAN.name());
|
||||
statement1.executeUpdate();
|
||||
} catch (SQLException e)
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Reference in New Issue
Block a user