Boolean to Int
Dieser Commit ist enthalten in:
Ursprung
52f56e55dc
Commit
b7ee0fb0b9
@ -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;
|
||||||
|
@ -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)");
|
||||||
}
|
}
|
||||||
|
@ -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)");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren