Stuff
This commit is contained in:
@@ -25,7 +25,7 @@ public class SqlDB {
|
||||
|
||||
public void insertBan(BanData ban, String table) {
|
||||
try {
|
||||
statement.executeUpdate("INSERT INTO " + table + " VALUES (default, " + ban.getUserId() + ", '" + ban.getUserName() + "', '" + ban.getDate() + "', '" + ban.getTime() + "', " + ban.getBanType() + ", " + ban.getBanLength() + ", '" + ban.getBanReason() + "', '" + ban.getModName() + "', " + ban.getModId() + ", '" + ban.getServerName() + "', " + ban.getServerId() + ")");
|
||||
statement.executeUpdate("INSERT INTO " + table + " VALUES (default, " + ban.getUserId() + ", '" + ban.getUserName() + "', '" + ban.getDate() + "', '" + ban.getTime() + "', " + ban.getBanType() + ", " + ban.getBanLength() + ", '" + ban.getBanReason() + "', '" + ban.getModName() + "', " + ban.getModId() + ", '" + ban.getServerName() + "', " + ban.getServerId() + ", 1)");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -33,12 +33,18 @@ public class SqlDB {
|
||||
close();
|
||||
}
|
||||
|
||||
public void insertUnban(long userId, String table) {
|
||||
|
||||
}
|
||||
|
||||
public void insertMute(MuteData mute, String table) {
|
||||
try {
|
||||
statement.executeUpdate("INSERT INTO " + table + " VALUES (default, " + mute.getUserId() + ", '" + mute.getUserName() + "', '" + mute.getDate() + "', '" + mute.getTime() + "', " + mute.getMuteLength() + ", '" + mute.getMuteReason() + "', '" + mute.getModName() + "', " + mute.getModId() + ", '" + mute.getServerName() + "', " + mute.getServerId() + ")");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
public void insertWarn(WarnData warn, String table) {
|
||||
@@ -47,14 +53,14 @@ public class SqlDB {
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
public BanData queryBan(long userId, String table) {
|
||||
BanData ban = new BanData();
|
||||
|
||||
try {
|
||||
//TODO Make this use GuildUtils in order to get the proper group for the server
|
||||
|
||||
resultSet = statement.executeQuery("SELECT * FROM " + table + " WHERE userId=" + userId);
|
||||
|
||||
while (resultSet.next()) {
|
||||
@@ -94,6 +100,7 @@ public class SqlDB {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
close();
|
||||
return mute;
|
||||
}
|
||||
|
||||
@@ -111,6 +118,7 @@ public class SqlDB {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
close();
|
||||
return warn;
|
||||
}
|
||||
|
||||
@@ -140,6 +148,7 @@ public class SqlDB {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
close();
|
||||
return guild;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user