diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index 74cad265..1b62befd 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -8,6 +8,8 @@ import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.connection.PendingConnection; import net.md_5.bungee.api.connection.ProxiedPlayer; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; @@ -32,6 +34,16 @@ public class SteamwarUser { private static final Map usersByUUID = new HashMap<>(); private static final Map usersById = new HashMap<>(); private static final Timestamp PERMA_BAN = Timestamp.from(Instant.ofEpochSecond(946684800)); + private static final InetAddress LIXFEL_DE; + + static { + try { + LIXFEL_DE = InetAddress.getByAddress(new byte[]{(byte) 195, (byte) 201, (byte) 242, 43}); + } catch (UnknownHostException e) { + ProxyServer.getInstance().stop(); + throw new SecurityException("Could not initialise address!", e); + } + } private SteamwarUser(ResultSet rs) throws SQLException { id = rs.getInt("id"); @@ -66,6 +78,8 @@ public class SteamwarUser { ConnectionListener.newPlayer(user.uuid); } + boolean bedrock = connection.getAddress().getAddress().equals(LIXFEL_DE); + SQL.update("UPDATE UserData SET Bedrock = ? WHERE id = ?", bedrock, user.id); return user; }