News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Want to start a server for my friends

Started by DasOsmium, September 22, 2020, 02:47:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DasOsmium

Hello everyone,
I have a question about multiplayer. I want to host from my Desktop PC a multiplayer game for my friend and me. Is there any way, that I can host a game from my Desktop or do I have to rent a server?

prissi

You can use your decktop PC, if it has an reasonable upload speed and is behind an UPnP router and you have a fully working IPv4 address. (Because uPnP does not work with IP6, and your router may block the simutrans port 13353on IP6.) Then just click the box start as server on the load dialog when loading a game. It will be even announced on the listserver, should everything work as intended.

DasOsmium

@prissi
thank you for your fast answer. I am going to try it.

prissi

See the easyserver thread. To test locally, you cannot use the announce server for any other comoputer behind your router.

DasOsmium

I started simutrans with the commandline as a server. But I can only join with my local IP4 not my online address.
This doesn't help me, becuase my friends and I are not in the same Network.
Do I have to change something there or does multiplay not work over the internet?

Mariculous

Quote from: DasOsmium on September 22, 2020, 03:30:04 PMDo I have to change something there or does multiplay not work over the internet?
You need to setup port forwarding from your router to your desktop PC for TCP port 13353.

If your router supports uPnP, you can use the -easyserver flag instead of -server, so simutrans should set this up automatically.
Otherwise, you'll have to set it up manually in your routers configuration panel.

prissi

To play with friend, use the graphic Simutrans executable. Just click "load as server" on the game selection screen. This will start a server sesson and try to open a port on the router, should you own a uPNP capable router, which has a real IPv4 address. You play then on the server program, no need to start a second client.

The are multiple way this may fail, most common nowadays the lack of a real IPv4 address or a router without uPnP. If something fails, you have to forward tcp on port 13353 for both IPv4 and IP6 to your PC on the router. Also beware that your IP6 likely changes each time!

DasOsmium

Hello,
I tried many things. I tried to start as an easyserver, as normal server. I even tried, which had the best respond with Hamachi. When I played over Hamachi, my friend was able to see the map, althoungh I could see, what he had build, we can't.
Do you have experience with these typ of issues?

prissi

First thing: On you local PC, you just start simutrans with the server commandline switch and play on the server. Do not use the commandline server, this only needed for server in the cloud or somewhere without a monitor. So when your friend can see the map, and he can build, you can see the map on the normal program which runs as server and build as well. To run the normal program as server, the easiest way is to click "start as server" on the game loading screen, even if the router does not support uPnP.

So now to connection troubles. It really depends what kind of connection you have. Go to http://test-ipv6.com/ Check if you have IP6 or IPv4 connection.

Assuming you have windows. Next check your local iP: start cmd to open commandline and type "ipconfig"

If your IP4 and the IP from the webpage differ, you are behind one (or more) routers. If easyserver does not work, there is a chance that your router does not support uPnP or the router has no IPv4.

Try your router first, this should be the one where the standard gateway like 192.168.1.1 or so. If the IP are different. So type the number in the line in the Standardgateway into your webbroser and log onto your router. Check the IP of the router. If this is not the IP you saw from the inital webpage, you have no IPv4 usable for routing. If teh IP6 is there then see below for IP6.

If the IPv4 are identical, you have to set up port forwarding for port 13353 tcp to your PC with the local IP address you found from IPCONFIG (and of course allow Simutrans to connect through the firewall).

If the webpage says that you have IP6 and the IP6 on the webpage is the same as the IP6 on your computer, and not starting with fe80:.... then your friend can connect to your server using the name "net:[your IP6 address]" If you friend does not have IP6, then you cannot connect.