From 19861ae58c8adc1d3cecd8613258148f15216673 Mon Sep 17 00:00:00 2001 From: gsd Date: Sat, 29 Jun 2024 23:35:14 +0300 Subject: [PATCH] real ip fix 3 --- src/main/java/app/entities/server/Server.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/app/entities/server/Server.java b/src/main/java/app/entities/server/Server.java index 35461c0..af1315b 100644 --- a/src/main/java/app/entities/server/Server.java +++ b/src/main/java/app/entities/server/Server.java @@ -137,4 +137,14 @@ public class Server extends ExternalValveClient { public SteamID searchPlayer(String player_nickname){ return players.stream().filter(player -> player.getName().equals(player_nickname)).map(player -> player.getSteam()).findFirst().orElse(null); } + + public void setIp(String ip) { + String port; + try { + port = getAddress().split(":")[1]; + } catch (Exception e) { + port = ""; + } + this.ip = new StringBuilder().append(ip).append(":").append(port).toString(); + } }