Legacy GM Using Local Host for Networked Game

I

Irishes

Guest
I have followed Fatal Sheep's and several GMNet tutorials on building a networked game. The end result is always the ability to run several instances of a game on the same machine and each instance is able to connect to each other. Is it possible to use software like xampp to host a running game maker server and allow anyone on my personal network to connect to a certain localhost port and then join that server? And if so, can I be pointed to any helpful tutorials? My networking knowledge is very basic and I apologize if this is a simple question.
 
I

icuurd12b42

Guest
I think the answer is in port forwarding that would connect incoming external connections to your PC and specifically to the port(s) the server is listening to.
 
I

Irishes

Guest
Xammp by default has an open port of 80 I could use. I currently have a website up that is only view able if you are connected to my wifi and navigate to the local host address(127.0.0.1:80). So I guess what Im asking is, how could I have allow clients to connect on my local network. The tutorials usually end when it comes to the port forwarding part.
 
I

icuurd12b42

Guest
This falls in the realm of setting up your router(s)/modem

port 80 is usually for http. you dont need to use that one specifically. in fact you should stay away from it
127.0.0.1 is a fake ip it's not your PC's IP, it a stub because it's easy to remember. It's like the "self" keyword in GML... Your actual IP can be found on the router, it resolves to your machine, it's akin to "id" for instance in GML... you get it? id and self point to the same instance in gml though (in 1.5) the values have different digits... 127.0.0.1 and the IP on the router act the same way.

look at the code for the game's server section, look at the ip : port it opens, 127.0.0.1:somethingnot80please
look at your router, see what IP your router says your pc really uses (as seen by others on the network or the internet)
change the code in the game's client section, look at the ip : port it opens, change the 127.0.0.1 part to the ip the router says. and the port to be the same.
run the server on your machine
run the client on your machine
client should connect. Since it's connecting locally
run the client on another pc in the house, the client should connect to your PC to the port the game server code has opened, I mean if it's allowed by the router.
Try from another machine that does not see your machine on your local network but only through the internet (a friend's machine or a machine not on the same network, meaning the only way they can see it is the long way around) if it's allowed in by the router the client should see your game server... if not you need to tweak you modem and any router in between the internet and the modem to allow external connections to happen. you would need to do this for outside ppl to see you web server too. This part you need to find a good port forwarding tutorial that matches your hardware (not a game maker one) on the internet.
 
I

Irishes

Guest
I didn't realize it was as simple as changing the loop back address to my actual ip and port. I haven't actually forwarded my port but I will try that after this. My final question is, if I had my own website and domain, would it be possible to host the server there and use the ip address of that site? Assuming the host supported Game Maker
 
I

icuurd12b42

Guest
You need web site provider that allows running binaries servers as opposed to simple php or asp pages... For simple game devs playing around or without much resources/capital, peer to peer is still the most cost efficient method. you can make php/asp code on most web site providers to connect players since it's quite easy to figure out the ip of the client connecting to the server php... you can keep track of the ips of who started a game as a server on their machine and who want to play and connect them simply by sending back the server ips to the clients. It's basically how The first Diablo Games worked in the 90's
 
Top