SteamWar/SpigotCore
Archiviert
13
0
Dieser Commit ist enthalten in:
Lixfel 2019-03-22 19:50:51 +01:00
Ursprung cecd3edfe5
Commit 2e63e8fa15
2 geänderte Dateien mit 8 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -36,8 +36,13 @@ public class BauweltMember{
this(bauweltID, memberID, build, changeGM, teleport, worldEdit, testblock, true); this(bauweltID, memberID, build, changeGM, teleport, worldEdit, testblock, true);
} }
public BauweltMember(UUID bauweltID, UUID memberID, boolean build, boolean changeGM, boolean teleport, boolean worldEdit, boolean testblock){
this(WarkingUser.get(bauweltID).getId(), WarkingUser.get(memberID).getId(), build, changeGM, teleport, worldEdit, testblock, true);
}
public void remove(){ public void remove(){
sql.update("DELETE FROM BauweltMember WHERE BauweltID = ? AND MemberID = ?"); sql.update("DELETE FROM BauweltMember WHERE BauweltID = " + BauweltID + " AND MemberID = " + MemberID);
memberCache.remove(this);
} }
private void updateDB(){ private void updateDB(){

Datei anzeigen

@ -1,7 +1,5 @@
package de.warking.hunjy.MySQL; package de.warking.hunjy.MySQL;
import org.bukkit.entity.Player;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
@ -30,7 +28,7 @@ public class WarkingUser {
} }
public WarkingUser(String name){ public WarkingUser(String name){
ResultSet dbplayer = sql.select("SELECT * FROM UserData WHERE UserName = '" + name + "'"); ResultSet dbplayer = sql.select("SELECT * FROM UserData WHERE lower(UserName) = '" + name.toLowerCase() + "'");
init(dbplayer); init(dbplayer);
} }
@ -65,7 +63,7 @@ public class WarkingUser {
public static WarkingUser get(String userName){ public static WarkingUser get(String userName){
for(WarkingUser user : allUsers) for(WarkingUser user : allUsers)
if(user.UserName.equals(userName)) if(user.UserName.equalsIgnoreCase(userName))
return user; return user;
WarkingUser offline = new WarkingUser(userName); WarkingUser offline = new WarkingUser(userName);
allUsers.remove(offline); allUsers.remove(offline);