SteamWar/BungeeCore
Archiviert
13
2

Insert bedrock information

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-07-25 11:39:55 +02:00
Ursprung a8a86b2457
Commit ef3c04a442

Datei anzeigen

@ -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.PendingConnection;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -32,6 +34,16 @@ public class SteamwarUser {
private static final Map<UUID, SteamwarUser> usersByUUID = new HashMap<>(); private static final Map<UUID, SteamwarUser> usersByUUID = new HashMap<>();
private static final Map<Integer, SteamwarUser> usersById = new HashMap<>(); private static final Map<Integer, SteamwarUser> usersById = new HashMap<>();
private static final Timestamp PERMA_BAN = Timestamp.from(Instant.ofEpochSecond(946684800)); 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 { private SteamwarUser(ResultSet rs) throws SQLException {
id = rs.getInt("id"); id = rs.getInt("id");
@ -66,6 +78,8 @@ public class SteamwarUser {
ConnectionListener.newPlayer(user.uuid); 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; return user;
} }