Difference between revisions of "Setting up an UFO2000 server"

From UFOpaedia
Jump to navigation Jump to search
Line 1: Line 1:
==Running the server==
 
 
=Setting up your own game server=
 
=Setting up your own game server=
 
In principle, for playing online, you ''do need'' an online server. Usually the public <code>ufo2000.net</code> server should do just fine. But maybe you want to set up a private server or a backup server.
 
In principle, for playing online, you ''do need'' an online server. Usually the public <code>ufo2000.net</code> server should do just fine. But maybe you want to set up a private server or a backup server.
  
===How to get the binary and what it brings with it===
+
==How to get the binary and what it brings with it==
 
In order to do so, you can either use the supplied [http://prdownloads.sourceforge.net/ufo2000/ufo2000-0.9.1176-beta.exe?download precompiled ufo2000.exe] from the [http://ufo2000.sourceforge.net project page], or for linux, you will need to compile it yourself. Don't worry, the latter is no big deal. You should have a look at [[Compiling for Linux (UFO2000)#Compiling_the_server]], then.
 
In order to do so, you can either use the supplied [http://prdownloads.sourceforge.net/ufo2000/ufo2000-0.9.1176-beta.exe?download precompiled ufo2000.exe] from the [http://ufo2000.sourceforge.net project page], or for linux, you will need to compile it yourself. Don't worry, the latter is no big deal. You should have a look at [[Compiling for Linux (UFO2000)#Compiling_the_server]], then.
  
===Starting and stopping===
+
==Starting and stopping==
 
You should have either the <code>ufo2000-srv.exe</code> (Windows) or the <code>ufo2000-srv</code> (Linux). You can either start it manually (stopping with CTRL+C) or let it be done by an init-script/the systems service-manager. For the moment, it is not recommended, to use the ''demonized''-mode, as there have been [http://openxcom.org/forum/index.php/topic,1799.msg40898.html#msg40898 reports of problems with that]. On piece of advice at this point: If you choose to run the server on a regular basis, e. g. on a root-server, you really ''should'' not run the server as root. Better use an init-script, running it as a limited user. That way, it's far less dangerous, running the ufo2000-server. There are no known security issues, but the problem usually are the not known one. If somebody may find any, the service run as root is ''a big security risk''. So keep that in mind, when running ufo2000 servers, or any other gaming server for that matter.
 
You should have either the <code>ufo2000-srv.exe</code> (Windows) or the <code>ufo2000-srv</code> (Linux). You can either start it manually (stopping with CTRL+C) or let it be done by an init-script/the systems service-manager. For the moment, it is not recommended, to use the ''demonized''-mode, as there have been [http://openxcom.org/forum/index.php/topic,1799.msg40898.html#msg40898 reports of problems with that]. On piece of advice at this point: If you choose to run the server on a regular basis, e. g. on a root-server, you really ''should'' not run the server as root. Better use an init-script, running it as a limited user. That way, it's far less dangerous, running the ufo2000-server. There are no known security issues, but the problem usually are the not known one. If somebody may find any, the service run as root is ''a big security risk''. So keep that in mind, when running ufo2000 servers, or any other gaming server for that matter.
  
 
If you want the server to be a backup-server, don't forget to add it to [http://ufopaedia.org/index.php?title=Server_%28UFO2000%29#Back-up_Servers this list]!
 
If you want the server to be a backup-server, don't forget to add it to [http://ufopaedia.org/index.php?title=Server_%28UFO2000%29#Back-up_Servers this list]!
  
===Ports and routers===
+
==Ports and routers==
 
When running, the server automatically opens up a tiny web server, showing the current players on the server. You can reach it via <code>http://<server-adress>:2000</code>. The Port 2000 (TCP) is also the port, where the server listens for connections of the game. If you run it behind a NAT (e. g. used by most home routers), you will also need to forward that port to the computer, running the service.
 
When running, the server automatically opens up a tiny web server, showing the current players on the server. You can reach it via <code>http://<server-adress>:2000</code>. The Port 2000 (TCP) is also the port, where the server listens for connections of the game. If you run it behind a NAT (e. g. used by most home routers), you will also need to forward that port to the computer, running the service.
  
===Configuration===
+
==Configuration==
 
The file <code>ufo2000-srv.conf</code> contains a few options for configuration:
 
The file <code>ufo2000-srv.conf</code> contains a few options for configuration:
  
Line 27: Line 26:
 
Most of it should be rather self explaining. As said before, for the moment better not use the <code>deamonize</code>-option.
 
Most of it should be rather self explaining. As said before, for the moment better not use the <code>deamonize</code>-option.
  
===Stats and passwords===
+
==Stats and passwords==
 
For all games, there is a function for recording of results. These results are saved in the file <code>ufo2000.db</code>. All users connecting to the server, will have the opportunity to choose a password, when connecting the first time with a certain user name. This password will remain! It's saved as a MD5-hash, and can only be changed by manipulating the database-table <code>ufo2000_users</code>. You can either delete a user completely, or let him give you a new password-hash. The user has no way of changing it himself and you won't have any means of recovering a lost password, as there are only hashes in the table.
 
For all games, there is a function for recording of results. These results are saved in the file <code>ufo2000.db</code>. All users connecting to the server, will have the opportunity to choose a password, when connecting the first time with a certain user name. This password will remain! It's saved as a MD5-hash, and can only be changed by manipulating the database-table <code>ufo2000_users</code>. You can either delete a user completely, or let him give you a new password-hash. The user has no way of changing it himself and you won't have any means of recovering a lost password, as there are only hashes in the table.
  
===Logs===
+
==Logs==
 
The file <code>ufo2000-srv.log</code> contains server logs. If you experience problems, first look there, to further isolate the problem.
 
The file <code>ufo2000-srv.log</code> contains server logs. If you experience problems, first look there, to further isolate the problem.
  
 
[[Category:UFO2000]]
 
[[Category:UFO2000]]

Revision as of 08:54, 30 May 2015

Setting up your own game server

In principle, for playing online, you do need an online server. Usually the public ufo2000.net server should do just fine. But maybe you want to set up a private server or a backup server.

How to get the binary and what it brings with it

In order to do so, you can either use the supplied precompiled ufo2000.exe from the project page, or for linux, you will need to compile it yourself. Don't worry, the latter is no big deal. You should have a look at Compiling for Linux (UFO2000)#Compiling_the_server, then.

Starting and stopping

You should have either the ufo2000-srv.exe (Windows) or the ufo2000-srv (Linux). You can either start it manually (stopping with CTRL+C) or let it be done by an init-script/the systems service-manager. For the moment, it is not recommended, to use the demonized-mode, as there have been reports of problems with that. On piece of advice at this point: If you choose to run the server on a regular basis, e. g. on a root-server, you really should not run the server as root. Better use an init-script, running it as a limited user. That way, it's far less dangerous, running the ufo2000-server. There are no known security issues, but the problem usually are the not known one. If somebody may find any, the service run as root is a big security risk. So keep that in mind, when running ufo2000 servers, or any other gaming server for that matter.

If you want the server to be a backup-server, don't forget to add it to this list!

Ports and routers

When running, the server automatically opens up a tiny web server, showing the current players on the server. You can reach it via http://<server-adress>:2000. The Port 2000 (TCP) is also the port, where the server listens for connections of the game. If you run it behind a NAT (e. g. used by most home routers), you will also need to forward that port to the computer, running the service.

Configuration

The file ufo2000-srv.conf contains a few options for configuration:

daemonize               = 0
tcp_port                = 2000
players_count_limit     = 32
connections_count_limit = 64
login_time_limit        = 10000
username_size_limit     = 25
packet_size_limit       = 65536

Most of it should be rather self explaining. As said before, for the moment better not use the deamonize-option.

Stats and passwords

For all games, there is a function for recording of results. These results are saved in the file ufo2000.db. All users connecting to the server, will have the opportunity to choose a password, when connecting the first time with a certain user name. This password will remain! It's saved as a MD5-hash, and can only be changed by manipulating the database-table ufo2000_users. You can either delete a user completely, or let him give you a new password-hash. The user has no way of changing it himself and you won't have any means of recovering a lost password, as there are only hashes in the table.

Logs

The file ufo2000-srv.log contains server logs. If you experience problems, first look there, to further isolate the problem.