I've been making a multilayer game for a while and have a config that the game loads for the IP and stuff. I just recently put all the loading stuff into a function just so its easier to go through the code, but now the game isn't really working. It works fine on my computer connecting to the server myself, but when someone else tries to do it it seems like the game is working like it says the IP and everything from the config. When it tries to connect it either doesn't work or crashes just saying the program stopped working. Here is the code... I don't know if this is what is causing it to not work or something else.
I assume that line 47 is printing out the right IP and port?
Are you sure that the other computers can access the server? If you're using a home server with an address of 192.168.1.x or 10.x.x.x then the IP address is not visible to the internet at large. Your router performs network address translation to let you talk to the internet.
Yes everything is port forwarded and working until I put loading into the function. I think a long time ago I had sorta a problem like this where it wouldn't save the file or something but I don't know, and yes it is just printing the IP and port from the config, which works.