Author Topic: How to set up a server  (Read 24625 times)

0 Members and 1 Guest are viewing this topic.

Offline Ashley

How to set up a server
« on: October 14, 2011, 11:18:47 PM »
How to set up a Simutrans server
guide for revision 4851 and above (new listings server)

1. Opening ports
Your server needs to be able to accept incoming connections from the Internet. If you are hosting it on server directly connected to the Internet this shouldn't be a problem, however if you are running it on your home DSL connection (for example) you may need to forward the port the server is listening on from your Router/Firewall to your server.

The default port is 13353 however you can change this by specifying a different port when you run the game. A reasonably fast connection is required to host a game, 10MBit/s is recommended.


2. Starting the server
To run the game in server mode append the -server command line switch, e.g.:

Code: [Select]
simutrans -server 13356
The port number is optional and defaults to 13353. If you wish to run multiple instances of the game on one machine you'll need to specify different ports for each one.

When starting a dedicated server on a remote machine, it is advised to compile it for yourself, using the posix backend. It will run without graphics, but will require much less CPU time, so it can even run decently on a virtual server.


3. Publicizing your server
For players to be able to connect to your server and play they first need to be able to find it. A central listings server (http://servers.simutrans.org) is provided for this purpose. To make use of this facility you need only to enable server announcements either via the command line flag or an entry in simuconf.tab:

Code: [Select]
simutrans -server -announce -server_dns my.domain.com -server_name "My Server Name"
This will run a server on the default port (13353) and enable announcements. The "-server_dns" flag must be set to the external address (or DNS name) of your server. This can be a DNS name, IPv4 or IPv6 address. E.g.:

Code: [Select]
myserver.example.com
23.45.67.89
2001:8b0:345::23

Note: The listings server will not accept announcements claiming to be from a different address than the one they are announcing for. So if your server's Internet address is 23.45.67.89 and you configure it to announce itself as 99.88.77.66 the listings server will ignore it. In the case of DNS names a DNS query will be performed for the name and the list of IP addresses returned will be compared to the IP address of the announce request. If none of these match the announce will be ignored.


4. Further options
simuconf.tab permits configuring of further options:

Code: [Select]
# Automatically announce server on the central server directory (http://servers.simutrans.org/)
# 0 (default) = off, 1 = on
#server_announce = 0

# Interval of server announcement (if enabled)
# Value is number of seconds between server announcements, default is 900 (15 minutes)
# Minimum value is 60 (1 minute), for accurate listing it is recommended not to increase
# this value to greater than 3600 (1 hour)
# To disable announcements set server_announce to 0
#server_announce_interval = 900

# Fully Qualified Domain Name (FQDN) or IP address of your server (IPv6 or IPv4)
#server_dns = 127.0.0.1

# Name of server in server listing
#server_name = My Simutrans Server

# Additional information about your server (for display on the list server)
#server_comments = Comments about my server

# Email address of server maintainer (for display on the list server)
#server_email = maintainer@your.server

# Pakset download URL (for display on the list server)
#server_pakurl = http://your.domain/pakset.zip

# Server info URL (for display on the list server)
#server_infurl = http://your.domain/server-info.html

All of these fields are displayed on your server's listing on the listings server:

http://servers.simutrans.org/list

The only essential ones are server_announce and server_dns.

When selecting a pakset, you should either use a "standard" set or give a download for the entire modified pak. Please, remember that pak sets nightlies are updated every sunday night.

When creating a game, you can do as you like. However, the time to download/save/load a game is somewhat critical, as it will happen quite often. Therefore you might consider to create a map without trees and just distribute trees/forest manually.

If industry growth is enabled, but you still want some control about the locations of primary industries (coal mines, forest, ... ) you can place them also beforehand. When new industries appear, they will try to connect to those first.

It's good practice to lock the "human" player and rename it to "Spectator", this means that new players joining your server are forced to pick a player slot (since all new players connect in slot 0).

I'd also recommend locking the Public Service player to avoid abuse.

An example command to start up a server in full:

Code: [Select]
simutrans -log 1 -debug 2 -server 13353 -announce -server_dns 22.33.44.55 -lang en -load network1
Whenever a client joins or leaves the game an autosave checkpoint is created. These are saved as "server<portnumber>-network.sve" under the root of the Simutrans game directory. If you start up the game without the "-load" flag it will automatically reload this checkpoint save. This can be used to recover from a crash.


Edit by Igor: Topic formatting
« Last Edit: February 10, 2013, 02:28:52 PM by IgorEliezer »
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Offline Xelofino

Re: How to set up a server (r4851 and above)
« Reply #1 on: October 16, 2011, 09:02:41 PM »
Wow, now this is a very helpful tutorial. Does the server send all the infos automatically or do i habe to change them? Thank you very much timothy. Its very interesting and i hope more people will join in server games. Btw how can i start the server graphicless?

Xelofino

edit: I tried to start the server as you wrote it down and it worked instantly. It has shown me all the very important infos on the listing page but there is a little problem. How can I now add additional information like pakset download or comment, e-mail etc. ? Do i have to make the server in the list first and then afterwards start it? But otherwise, great compliment!
« Last Edit: October 17, 2011, 11:13:07 AM by Xelofino »

Offline Ashley

Re: How to set up a server (r4851 and above)
« Reply #2 on: October 19, 2011, 10:27:03 AM »
The game server communicates automatically with the listing server if you set announce to 1, as detailed above.

The extra information is set via the config file, e.g.:

#server_email = maintainer@your.server

Uncomment that line in the simuconf.tab and change the email address to whatever you want.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3950
  • Total likes: 143
  • Helpful: 71
  • Lost In Stupid Parenthesis
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
I'd like to ask the game hosts to update their servers since a new stable version is out, or people will not be able to join the servers (I, for example  ;) ).

Thanks.

OpiesRevenge

  • Guest
Re: How to set up a server (111.0 (r4851) and above)
« Reply #4 on: January 26, 2012, 07:56:47 PM »
I have been trying to set up a server and I am still unable to get it to work. I am editing config.tab (the main one not the one in the pak128 file) I have edited the network info area, Im not sure if this is the right place.

It would be nice to see the page, I could just copy paste and add my info. Like if someone that has a server could just copy paste what I have to enter and tell me where to put it. I will add the ip and port. I set up my router to let traffic to the server using the default 13353 port (should it be TCP or UDP i have both to make sure for now). Also is there any thing I need to do diffrently since I have a router other then set it to forward the port to the server? Is there somthing I have to add to the config.tab to adjust for having 5 pcs on my router and 7 ip addresses used. If I need to enter the server ip where do I put it or will my isp ip do the trick alone if i set port forwarding and allow the firewall to let traffic threw.

Im sure you can tell that im not sure about code work or networking but am willing to do what I need to so I can set up a server for about 6 freinds and myself. I have played the game they have just seen it so it will be a trial and error game im sure.

Offline Ashley

Re: How to set up a server (111.0 (r4851) and above)
« Reply #5 on: January 26, 2012, 08:13:22 PM »
Setting port forwarding on your router should be all you need to do, you may also need to configure the firewall on your local machine to permit incoming connections on that port though.

The bare minimum you need to do to get a server to run is:

1. In simuconf.tab (under the config directory):

Code: [Select]
server_announce = 1

server_dns = <The IP address of your router, e.g. the *external* IP address!>

server_name = <Some name you pick>

e.g.

Code: [Select]
server_announce = 1

server_dns = 81.12.123.22

server_name = My server

2. Run the game with "-server 13353" on the command line.

3. Optionally load a savegame, with -load <savegame name>
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: How to set up a server
« Reply #6 on: August 15, 2013, 08:34:05 PM »
It is also recommended o set the savegameformat for netgaming to zip unless you have a very slow upload. Generally for hosting only the upload speed is important. Even vserver seem to have enough CPU power for simutrans.

Andy

  • Guest
Re: How to set up a server
« Reply #7 on: December 22, 2014, 03:51:34 PM »
So where do you put the server info, and what is a command line?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2592
  • Total likes: 289
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: How to set up a server
« Reply #8 on: December 22, 2014, 04:20:07 PM »
Command Line: Lines of commands to be passed to the executable for the executable to interpret and modify its functionality.

You can use the Command Prompt on Windows or the Terminal on Linux/Mac to type those commands or create a shortcut for the executable and add those command lines properties to the shortcut.

Offline vzrenggamani

  • *
  • Posts: 81
  • Total likes: 11
  • Helpful: 0
  • SetanKothak Families :v :v
    • OpenWorld Tech
  • Languages: ID, EN, C++, HTML
Re: How to set up a server
« Reply #9 on: September 27, 2015, 02:43:33 PM »
My Server Not Listed On server.simutrans.org . i Am using Simu Nightly rr7594

SIMUTRANS INDONESIA WEBSITE  <<< Indonesia Simutrans Addons Center And Web
HOPE YOU UNDERSTAND MY ENGLISH

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: How to set up a server
« Reply #10 on: September 27, 2015, 07:58:26 PM »
Are your machine using a public IP address, or a dns name that can be resolved? If the sreverlist server does not get an answer under the advertised address, it will discard the server.

Offline vzrenggamani

  • *
  • Posts: 81
  • Total likes: 11
  • Helpful: 0
  • SetanKothak Families :v :v
    • OpenWorld Tech
  • Languages: ID, EN, C++, HTML
Re: How to set up a server
« Reply #11 on: January 06, 2016, 08:17:28 AM »
I am using Public IP Address . so, the command line like "-server 27015 -server_DNS 36.214.35.371 -announce"

SIMUTRANS INDONESIA WEBSITE  <<< Indonesia Simutrans Addons Center And Web
HOPE YOU UNDERSTAND MY ENGLISH

Offline Yona-TYT

Re: How to set up a server
« Reply #12 on: May 29, 2016, 02:56:57 PM »

Hello such !.
I tried to create a server with a wireless network (no Internet access) but this does not work for me, is there any command for this?


Regards!!

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: How to set up a server
« Reply #13 on: May 29, 2016, 08:22:48 PM »
That really depends if you have a full Internet access or just running via a proxy like construct or a private IP address. Most IP4 wireless using a internal proxy. In such a case a server cannot work, as it has no unique IP address. It is the same as you would use a 192.168.0.1 IP from you router at home.

It may work with IP6 though, assuming you have a wireless modem in your computer. If you got an IP6 address, use this for Simutrans (Unfourtunately the listserver cannot handle IPv6 anymore, that was switched off last year from the provider.)

Offline fherb

Re: How to set up a server
« Reply #14 on: July 12, 2016, 08:53:49 PM »
Before I set up my server, I compiled it by myself. All things are working fine and I described these process in my blog in German language here: http://greplacement.fherb.de/2016/07/10/simutrans-server-uebersetzen/.

Maybe interesting for other users: I improved the start time of the clients (preparing and download of the map) additional by changing zip-level from standard (level 6) to the lowest compressing level 1. (0 would be uncompressed) This is only possibly by changing the source and a new compilation step. In case that is also interesting for English speaking users, i could translate this blog article. Maybe next days.

But I have a question: One of the sources for me to do these compilation was: http://cheesehead-techblog.blogspot.de/2012/01/starting-simutrans-server.html (simple to find this article via google if you are looking for server compilation of simutrans)

In this article Ian wrote this:

Quote
... discovered and triaged Launchpad Bug #931181, which makes non-Debian versions of Simutrans incompatible with Debian versions due to a differing sha-1 implementation.


He referenced his own article http://cheesehead-techblog.blogspot.de/2012/02/simutrans-packaging-bug.html.

When I follow his started thread http://forum.simutrans.com/index.php?topic=9315.0 for this problem, so I estimate this "bug" was a special problem by very special conditions of his trials. But: One of the most detailed articles for compiling simutrans today is still his blog article. And this article contains a work-around paragraph for this problem.

This is some years ago. But my question to the insider: Is something of this bug still relevant? Maybe it would be time to write a "no more relevant comment" under his article.

Best regards, Frank

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: How to set up a server
« Reply #15 on: July 12, 2016, 09:52:02 PM »
I was not aware of this article, and I vaguely remember that the SHA implementation was different in Debian 6. So this may have been solved by the progress of time.

Offline Vladki

Re: How to set up a server
« Reply #16 on: July 13, 2016, 06:42:44 AM »
The experimental server is compiled and running on debian, without any sha workarounds. Windows clients connect ok. All I had to do was to set backend posix and color depth 0

Offline MobileRod

Re: How to set up a server
« Reply #17 on: September 24, 2016, 10:23:48 PM »
I'm trying to set up a test server over Ubuntu 16.04, but I'm having trouble to identify my server (external DNS and/or so on) to announce it.
It seems the game is already on, but I don't know how to discover the information needed to announce the server.

Every help will be appreciated. Thanks in advance  ;)

Offline River

Re: How to set up a server
« Reply #18 on: September 24, 2016, 11:25:07 PM »
I'm trying to set up a test server over Ubuntu 16.04, but I'm having trouble to identify my server (external DNS and/or so on) to announce it.
It seems the game is already on, but I don't know how to discover the information needed to announce the server.

Every help will be appreciated. Thanks in advance  ;)

you need to have added minimal: -server <port number>  -announce -server_dns <your ip here> -server_name "My Server Name"
also you need to add the port number you are running the server on to the port forwarding in your router.

Offline MobileRod

Re: How to set up a server
« Reply #19 on: September 24, 2016, 11:41:49 PM »
Thanks, River!
I suppose I'm having trouble in discovering what my IP is, but I'll give it a try  :thumbsup:

Offline River

Re: How to set up a server
« Reply #20 on: September 24, 2016, 11:44:36 PM »
Thanks, River!
I suppose I'm having trouble in discovering what my IP is, but I'll give it a try  :thumbsup:
getting your ip address is easy, i just google "my ip address" and i find a page that shows it. you could try https://www.iplocation.net/find-ip-address also in the bottom right of your posts it shows your ip address on the forum.

Offline ROCAMBOLER529

Re: How to set up a server
« Reply #21 on: July 12, 2017, 10:11:46 PM »
This isnt very helpful, we dont know where we can create or set up a new server. We have the world and a very good internet connection and a port but where we can create or set up a server or LAN world. We think that simutrans need a own section for the simutrans server to play and create because this for to play with friends is too dificult.

by: ROCAMBOLER529 & The Argentian.