Hosted by M5 Hosting
Valid XHTML 1.0!


Compiling Urban Terror 4.1/4.1.1 Server Binary HOW-TO


This guide will explain how to compile a patched version of the Urban Terror 4.1/4.1.1 server binary on Linux. The version of code used here is responsible for generating the patched server binaries that you download from www.urbanterror.info. The server binary is called ioUrTded.i386 (32 bit version) or ioUrTded.x86_64 (64 bit version). The information in this HOW-TO overlaps somewhat with the information in this forum thread.


Step A: Installing Necessary Software

You will be acquiring the source code for the server binary via the Subversion source control system, using the svn command. Therefore you need to make sure Subversion is installed on the system that you plan to compile on. On Debian Linux (and on Ubuntu), you would execute this command, as root, to install Subversion:

debian:~# apt-get install subversion

If the svn command works for you, you are all set to go.

From now on all commands should not be executed as the root user.


Step B: Download Source Code

Next, you will download the source code for the server binary. You can execute the following command directly from your home directory:

user@debian:~$ svn checkout svn://svn.clanwtf.net/repos/ioUrT-server-4.1

This will download the source code and place it into directory ioUrT-server-4.1 .


Step C: Choose Extra Patches

This step is optional. The source code repository only fixes critical bugs and exploits. It does not include, by default, new features or bug fixes that are not critical in nature. However, there is a directory containing extra patches, some of which introduce nice new features. To read more about these extra patches, have a look in the extra-patches directory:

user@debian:~$ cd ioUrT-server-4.1/extra-patches/
user@debian:~/ioUrT-server-4.1/extra-patches$ ls
user@debian:~/ioUrT-server-4.1/extra-patches$ less README-extra-patches.txt

You should read the file README-extra-patches.txt if you plan on using any extra patches. To exit out of less, type 'q'.

If you would like to use some of the extra patches, you need to apply them to the source code using the patch command. This is actually very easy, so let me expain it. First, delete the patch files that you don't want to use. For example, let's say that I would like to use all patches except for ip2loc.patch and playerdb.patch. Then I would delete those patches:

user@debian:~/ioUrT-server-4.1/extra-patches$ rm ip2loc.patch playerdb.patch

Note that it's perfectly OK to apply all patches by not deleting any of them.

Next, assuming the use of a typical Linux shell such as bash (highly likely), you would apply the remaining patches like so:

user@debian:~/ioUrT-server-4.1/extra-patches$ cd ..
user@debian:~/ioUrT-server-4.1$ for patchfile in extra-patches/*.patch; do
> patch -N -p0 < $patchfile
> done

You now have those extra patches applied to your source tree.

Note that some of the patches conflict with each other in a minor way, but these conflicts are harmless. In particular, ip2loc.patch and playerdb.patch will both attempt to define the same new function, NET_IsIP() . This is not a problem, since the second patch that attempts to add that function will just skip over that section.


Step D: Compile

We are now ready to compile the server binary. First, I would like to point out a very important detail. From my experience, running a 64 bit Urban Terror server binary is a very bad idea. It seems that some additional layers of emulation code are introduced when running a 64 bit server binary. This will make a noticeable difference in the amout of CPU consumed by the server process (about twice as much CPU). Furthermore, lag spikes caused by minor server hiccups will be much more prominent when using a 64 bit server binary. I would therefore strongly urge you to compile a 32 bit binary and run that, even if your server operating system is 64 bit. More about this a bit later.

The build process depends on an environment variable COPYDIR , which is the location where to place the final version of the server binary. This can be a temporary directory. So, we're going to create a temporary directory for that purpose, and then set the environment variable COPYDIR . From your home directory:

user@debian:~$ mkdir copydir
user@debian:~$ cd copydir/
user@debian:~/copydir$ export COPYDIR=`pwd`

Now, from the same shell that you ran the export command, return to the source code directory:

user@debian:~/copydir$ cd ~/ioUrT-server-4.1/

... and if you're not on a 64 bit operating system, compile the server binary:

user@debian:~/ioUrT-server-4.1$ make copyfiles

If you are on a 64 bit system, I would strongly suggest forcing the compilation of a 32 bit binary by adding ARCH=i386 like so:

user@debian:~/ioUrT-server-4.1$ make ARCH=i386 copyfiles

Now let's go to our copydir and see what we've got:

user@debian:~/ioUrT-server-4.1$ cd "$COPYDIR"
user@debian:~/copydir$ ls -l

You should see a file ioUrTded.i386 in this directory (or ioUrTded.x86_64 if you decided, going against the advice given, to compile a 64 bit binary on a 64 bit platform). The directories baseq3 and missionpack that were created can be completely ignored. You probably want to delete the directories copydir and ioUrT-server-4.1 after you are done with this procedure. Congratulations! If you have any problems, please don't hesitate to contact me; my email address is nlandys@gmail.com and I go by the name "Rambetter".    ;-)



Appendix A: List Of Changes

This source code is based on the server code found in the archive ioUrbanTerrorSource_2007_12_20.zip , which is the "original" Urban Terror 4.1 source code. If you would like to see all changes that have been made to this original source code, excluding the extra patches, you can do the following:

user@debian:~$ svn checkout svn://svn.clanwtf.net/repos/ioUrT-server-4.1
user@debian:~$ cd ioUrT-server-4.1/
user@debian:~/ioUrT-server-4.1$ svn rm extra-patches/ urt-patch/
user@debian:~/ioUrT-server-4.1$ svn diff -r1 | less

Revision 1 is the original source code with nothing changed.


Appendix B: ioquake3-UrT-server-4.1 Branch

I (Rambetter) am currently putting more effort into maintaining another branch of the server source code. This source code is not based on the original ioUrbanTerror server source code; it's based on ioquake3 1.36. I am running all of my servers using this branch now. The changes to this branch may be a little bolder in nature; I've attempted to address several design issues of ioquake3 in this branch. Therefore, this branch is not limited only to serious expoit and bug fixes. To get this branch of the server source code:

user@debian:~$ svn checkout svn://svn.clanwtf.net/repos/ioquake3-UrT-server-4.1

The procedure for compiling this source code is practically identical to the procedure for compiling the ioUrT-server-4.1 branch. Revision 14 in this branch is equal to plain vanilla ioquake3 1.36 (svn://svn.icculus.org/quake3/tags/1.36/).

One important note about this branch. Please who are using B3 or stats programs that parse log files seem to be having problems using this branch. The problem is simply that the log format is very slightly different in some areas. I could easily address these problems if someone tells me where B3 and the stats programs are failing during parsing of the logs. So, if you'd like to use ioquake3-UrT-server-4.1 and are using B3 or a stats program, and if you're technically inclined, please figure out where the log parsing is failing and send me that info so that I can "adjust" the logging code in this branch. My email address is nlandys@gmail.com.