The International Simutrans Forum

 

Author Topic: Want to start a server for my friends  (Read 535 times)

0 Members and 1 Guest are viewing this topic.

Offline DasOsmium

  • *
  • Posts: 4
Want to start a server for my friends
« on: September 22, 2020, 02:47:35 PM »
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?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10241
  • Languages: De,EN,JP
Re: Want to start a server for my friends
« Reply #1 on: September 22, 2020, 02:56:13 PM »
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.

Offline DasOsmium

  • *
  • Posts: 4
Re: Want to start a server for my friends
« Reply #2 on: September 22, 2020, 03:00:32 PM »
@prissi
thank you for your fast answer. I am going to try it.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10241
  • Languages: De,EN,JP
Re: Want to start a server for my friends
« Reply #3 on: September 22, 2020, 03:02:19 PM »
See the easyserver thread. To test locally, you cannot use the announce server for any other comoputer behind your router.

Offline DasOsmium

  • *
  • Posts: 4
Re: Want to start a server for my friends
« Reply #4 on: September 22, 2020, 03:30:04 PM »
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?

Offline Freahk

  • Devotee
  • *
  • Posts: 1325
  • Languages: DE, EN
Re: Want to start a server for my friends
« Reply #5 on: September 22, 2020, 03:54:48 PM »
Do 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10241
  • Languages: De,EN,JP
Re: Want to start a server for my friends
« Reply #6 on: September 23, 2020, 07:32:53 AM »
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!

Offline DasOsmium

  • *
  • Posts: 4
Re: Want to start a server for my friends
« Reply #7 on: October 05, 2020, 01:35:52 PM »
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?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10241
  • Languages: De,EN,JP
Re: Want to start a server for my friends
« Reply #8 on: October 06, 2020, 02:11:03 AM »
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.