Hello, i need to find all connections to server.
Way with foreach in BasePlayer.activePlayerList with checks - bad way, cause i need to find connection of players which are loading right now.
Getting list of player IP addresses?
Discussion in 'Rust Development' started by HOUGAN_Y, Oct 16, 2017.
-
Then I think your best bet would be to store all the IPs yourself, via hooks such as CanClientLogin
-
-
Wulf Community Admin
-
When i said clean, i mean:
Easy logic - i need to check does server already have connection with same ip, but other port, so i need something like:
foreach (var check in ListOfConnectedIP)
if check.ipaddress.split(':')[0] == connection.blablabla && check.ipaddress.split(':')[1] != connection.blablasdf)
then reject both. -
Wulf Community Admin
-
Code:
private static string RemovePort(string address) => new Uri($"http://{address}").Host;
-
foreach (var check in ListOfConnectedIP)
if check.ipaddress.split(':')[0] == connection.blablabla && check.ipaddress.split(':')[1] != connection.blablasdf)
then reject both.
but there are no listofconnectedip, i can find only IP of already loaded players, but i also need to get IP of players that are loading right now. -
Wulf Community Admin
-
yes i know how to get IP of new connection, but then i need to foreach into already connected connections xD
But i know only how to get IP of full-loaded players. -
Wulf Community Admin