Merge critical issue fixes to stable #8
2 changed files with 19 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ dependencies {
|
|||
implementation 'org.postgresql:postgresql:42.7.7'
|
||||
implementation 'org.flywaydb:flyway-core:10.7.2'
|
||||
implementation 'org.flywaydb:flyway-database-postgresql:10.7.2'
|
||||
implementation 'com.google.code.gson:gson:2.11.0'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ import java.util.Objects;
|
|||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
||||
public class Ban implements CommandExecutor {
|
||||
|
||||
BanHammer plugin;
|
||||
|
|
@ -309,6 +312,21 @@ public class Ban implements CommandExecutor {
|
|||
}
|
||||
}
|
||||
|
||||
private void kickPlayer(PlayerBan b){
|
||||
final Gson gson = new Gson();
|
||||
try {
|
||||
Connection conn = plugin.db.getConnection();
|
||||
|
||||
String preparedJson = gson.toJson(b);
|
||||
PreparedStatement ps = conn.prepareStatement("SELECT pg_notify('ban_jobs', ?)");
|
||||
ps.setString(1, preparedJson);
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e) {
|
||||
plugin.getLogger().severe(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private String resolveBanMessagePlaceholders(String s, String player, String scope, String reason, String operator) {
|
||||
return s.replace("{player}", player)
|
||||
.replace("{scope}", scope)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue