I am working on a game where I amongst others have a GUI GamepickScreen, Gamechooser, Game and Player object.
Now the server based Gamechooser class handles the login of the user, and being able to choose a session from a list of games.
It sends that information to the client based GUI Gamepickscreen. During the login method a new Player instance is created with the name filled in on the screen.
That Player instance is thus on the server side as well and in it's constructor it stores the playername and IP address.
How can I fetch the public IP address of the client so that a server-based class can store it?