Hello guys, i was trying to make multiplayer for me and my friend by video from DevLogLogan. When he was cheking so upnp gotta work fine, my worked fine from 1st try, but then he told to change “localhost” to var address_entry.text. It bassicaly means that you need to wrote ip and then connect, but my game only working in local host, how could i fix that?
here’s when it’s working but in local host: enet_peer.create_client(“localhost”, PORT)
and here’s when it doesn’t working: enet_peer.create_client(address_entry.text, PORT)
So if it works with localhost you can type localhost into that field, but you’ll be connecting to your own computer.
Whatever is printing your IP address could be a local one, usually starting with 192.168 which will work for other computers in your network. Or your network’s IP address which will only connect from outside your network.
You will have both a local IP address (starts with 192.168) and a internet IP address (could be anything) to find out your internet IP address you will simply have to google “what’s my ip?” as other servers can easily tell you your ip, but your computer doesn’t know by itself.
If you give your internet IP address to your friend, they can type it in to connect to your server. If your friend is hosting a server, they will have to tell you their IP address.