SteamWar/SpigotCore
Archiviert
13
0
Dieser Commit ist enthalten in:
Lixfel 2019-03-20 18:46:17 +01:00
Ursprung 52f56e55dc
Commit b7ee0fb0b9
4 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -22,7 +22,7 @@ public class Core extends JavaPlugin{
public static MySQL sql; public static MySQL sql;
public static String chatPrefix = "§6War§7King» §r"; public static final String chatPrefix = "§6War§7King» §r";
private static Core instance; private static Core instance;
private CacheManager cacheManager; private CacheManager cacheManager;
private FileManager fileManager; private FileManager fileManager;

Datei anzeigen

@ -32,7 +32,7 @@ public class Bauwelt {
sql.update("INSERT INTO Bauwelt" + sql.update("INSERT INTO Bauwelt" +
" (UserID, TNTDmg, FireDmg)" + " (UserID, TNTDmg, FireDmg)" +
" VALUES" + " VALUES" +
" ('" + UserID + "', '" + TNTDmg + "', '" + FireDmg + "')" + " ('" + UserID + "', '" + sql.booleanToInt(TNTDmg) + "', '" + sql.booleanToInt(FireDmg) + "')" +
" ON DUPLICATE KEY UPDATE" + " ON DUPLICATE KEY UPDATE" +
" TNTDmg = VALUES(TNTDmg), FireDmg = VALUES(FireDmg)"); " TNTDmg = VALUES(TNTDmg), FireDmg = VALUES(FireDmg)");
} }

Datei anzeigen

@ -41,7 +41,7 @@ public class BauweltMember{
sql.update("INSERT INTO BauweltMember" + sql.update("INSERT INTO BauweltMember" +
" (BauweltID, MemberID, Build, ChangeGM, Teleport, WorldEdit, Testblock)" + " (BauweltID, MemberID, Build, ChangeGM, Teleport, WorldEdit, Testblock)" +
" VALUES" + " VALUES" +
" ('" + BauweltID + "', '" + MemberID + "', '" + Build + "', '" + ChangeGM + "', '" + Teleport + "', '" + WorldEdit + "', '" + Testblock + "')" + " ('" + BauweltID + "', '" + MemberID + "', '" + sql.booleanToInt(Build) + "', '" + sql.booleanToInt(ChangeGM) + "', '" + sql.booleanToInt(Teleport) + "', '" + sql.booleanToInt(WorldEdit) + "', '" + sql.booleanToInt(Testblock) + "')" +
" ON DUPLICATE KEY UPDATE" + " ON DUPLICATE KEY UPDATE" +
" Build = VALUES(Build), ChangeGM = VALUES(ChangeGM), Teleport = VALUES(Teleport), WorldEdit = VALUES(WorldEdit), Testblock = VALUES(Testblock)"); " Build = VALUES(Build), ChangeGM = VALUES(ChangeGM), Teleport = VALUES(Teleport), WorldEdit = VALUES(WorldEdit), Testblock = VALUES(Testblock)");
} }

Datei anzeigen

@ -17,6 +17,13 @@ public class MySQL {
private String PASSWORD = ""; private String PASSWORD = "";
private Connection con; private Connection con;
public static Integer booleanToInt(boolean b){
if(b)
return 1;
else
return 0;
}
public MySQL() { public MySQL() {
this.HOST = Core.getInstance().getFileManager().getConfig().getString("HOST"); this.HOST = Core.getInstance().getFileManager().getConfig().getString("HOST");
this.PORT = Core.getInstance().getFileManager().getConfig().getString("PORT"); this.PORT = Core.getInstance().getFileManager().getConfig().getString("PORT");