Skip to content

Commit

Permalink
バグ解決
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyaPeyaPeyang committed Nov 30, 2020
1 parent 2c43a16 commit 9e77de7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.psac-serve</groupId>
<artifactId>PeyangBanServer</artifactId>
<version>1.2</version>
<version>1.3</version>

<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/psacserve/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static void initDatabase()
"STAFF integer," +
"BANNEDBY text" +
")");
logS.execute("CREATE TABLE IF NOT EXISTS ban(" +
logS.execute("CREATE TABLE IF NOT EXISTS log(" +
"UUID text," +
"BANID text," +
"DATE text," +
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/psacserve/Moderate/Ban.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void pardon(String player, String pardonnedBy, String pardonReason
ResultSet set = banLp.executeQuery();
if (!set.next())
return;
SQLModifier.insert(log, "ban",
SQLModifier.insert(log, "log",
set.getString("UUID"),
set.getString("BANID"),
set.getString("DATE"),
Expand Down Expand Up @@ -99,7 +99,7 @@ public static LinkedList<BanEntry> getBans(String uuid)
LinkedList<BanEntry> bans = new LinkedList<>();

try (Connection connection = BanServer.log.getConnection();
PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM ban WHERE UUID=?"))
PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM log WHERE UUID=?"))
{
statement.setString(1, uuid.replace("-", ""));
ResultSet set = statement.executeQuery();
Expand Down Expand Up @@ -151,7 +151,7 @@ public static LinkedList<BanEntry> getBansFromID(String banid)
{
final LinkedList<BanEntry> bans = new LinkedList<>();
try (final Connection connection = BanServer.log.getConnection();
final PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM ban WHERE BANID=?");
final PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM log WHERE BANID=?");
final Connection cs = BanServer.bans.getConnection();
PreparedStatement bs = cs.prepareStatement("SELECT UUID, BANNEDBY, BANID, REASON, EXPIRE, STAFF, DATE FROM ban WHERE BANID=?"))
{
Expand All @@ -178,7 +178,7 @@ public static LinkedList<BanEntry> getBansDate(Long before, Long after)
{
final LinkedList<BanEntry> bans = new LinkedList<>();
try (final Connection connection = BanServer.log.getConnection();
final PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM ban WHERE DATE BETWEEN ?" + (before != null ? " AND ?": ""));
final PreparedStatement statement = connection.prepareStatement("SELECT UUID, UNBANREASON, BANNEDBY, UNBANNEDBY, BANID, REASON, STAFF, UNBANDATE, DATE, EXPIRE FROM log WHERE DATE BETWEEN ?" + (before != null ? " AND ?": ""));
final Connection cs = BanServer.bans.getConnection();
PreparedStatement bs = cs.prepareStatement("SELECT UUID, BANNEDBY, BANID, REASON, EXPIRE, STAFF, DATE FROM ban WHERE DATE BETWEEN ?" + (before != null ? " AND ?": "")))
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/psacserve/server/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static Result parse(final String method, final String path, final String
try (final Connection connection = BanServer.bans.getConnection();
final Connection l = BanServer.log.getConnection();
final PreparedStatement sr = connection.prepareStatement("SELECT STAFF FROM ban WHERE DATE BETWEEN ? AND ?");
final PreparedStatement spb = l.prepareStatement("SELECT STAFF FROM main.ban WHERE DATE BETWEEN ? AND ?"))
final PreparedStatement spb = l.prepareStatement("SELECT STAFF FROM log WHERE DATE BETWEEN ? AND ?"))
{
sr.setLong(1, btw);
sr.setLong(2, new Date().getTime());
Expand Down

0 comments on commit 9e77de7

Please sign in to comment.