Search:  
Gentoo Wiki

Unreal_Tournament_2004

Contents

About

To start off with you will have to request a special server CD key (unless you are running the server on a computer with the full game already installed). The server cd-key is not needed, if you want to create a private server not linked to the stats-service and the global server list.
This can be done by visiting Epic's UT2004 KeyGen Site and then following the instructions supplied in the email.

Warning: You must enter an email capable of receiving a .reg file (if your email provider filters out the whole email you will need to use a different email address).

You must then emerge the ut2k4 dedicated server package: emerge ut2004-ded

That emerge takes a long time because it downloads more than 600Mb from some internet mirrors that aren't particularly fast.

You may notice that ut2004-ded depends on sys-devel/gcc-3.3.6-r1. To avoid this dependency, you can emerge libstdc++-v3 before ut2004-ded. This will allow you to install ut2004-ded without installing gcc-3.3.6-r1.

Starting the Server

The ebuild provides some rc-scripts to start and stop the server.

To start the server:

/etc/init.d/ut2004-ded start

The command line option that are used to start the server are defined in the /etc/init.d/ut2004-ded file. For example to run a Capture The Flag server change the OPTIONS line to:

OPTIONS='server CTF-BridgeOfFate?game=XGame.xCTFGame ini=Default.ini log=server.log -nohomedir'

Stopping the Server

To stop the server:

/etc/init.d/ut2004-ded stop

Advanced Configuration

More options concerning the server can be found in /opt/ut2004-ded/System/Default.ini.

Mutators

Adding a mutator support is simply done by adding mutator=MutatorNameto the command line options. For example to add the Instagib mutator change the OPTIONS line in /etc/init.d/ut2004-ded and add ?mutator=XGame.MutInstaGib

Code: Mutators Example
# No Mutators
#OPTIONS='server CTF-BridgeOfFate?game=XGame.xCTFGame ini=Default.ini log=server.log -nohomedir'
# InstaGib Mutator
OPTIONS='server CTF-BridgeOfFate?game=XGame.xCTFGame?mutator=XGame.MutInstaGib ini=Default.ini log=server.log -nohomedir'
# If you want to use multiple mutators simply separate them with a comma
#OPTIONS='server CTF-BridgeOfFate?game=XGame.xCTFGame?mutator=XGame.MMutInstaGib,UnrealGame.MutLowGrav ini=Default.ini log=server.log -nohomedir'

The different mutators available are:

UT2004 Webadmin System

UT2004 can use one of two admin systems. The first is like Unreal Tournament or like most other games, one admin user and password which allows you access to everything.

This we will call the basic admin system.

UT2004 also has an XAdmin system which allows you to have multiple user accounts and passwords each with different admin levels. For example, one user could have access to kick but not ban while another user could have access to everything but setting a game password.

First, we will setup the generic options needed for both systems

Find in your /opt/ut2004-ded/System/Default.ini file this section:

File: Default.ini
[UWeb.WebServer]

Applications[0]=xWebAdmin.UTServerAdmin
ApplicationPaths[0]=/ServerAdmin
Applications[1]=xWebAdmin.UTImageServer
ApplicationPaths[1]=/images
bEnabled=False
ListenPort=80 

Change bEnabled=False to True

You may also wish to change ListenPort=80 to another value as this will be the port which you run your WebAdmin interface on.

Basic Admin System

To enable WebAdmin from the command line (ie. just 1 user name/pass) then add ?AdminName=XXXX?AdminPassword=XX to your OPTIONS line in /etc/init.d/ut2004-ded.

An example command line would now be OPTIONS='server CTF-BridgeOfFate?game=XGame.xCTFGame?AdminName=myname?AdminPassword=mypass ini=Default.ini log=server.log -nohomedir'

XAdmin System

To enable the Xadmin system find the section [Engine.GameInfo] in /opt/ut2004-ded/System/Default.ini and change the value of the line AccessControlClass= line to XAdmin.AccessControlIni

Now start your server and you will notice a new file xadmin.ini is created in your System(/opt/ut2004-ded/System/) folder . This is where all your admin user/passwords/levels are stored. It is strongly recommended that you do not edit this file directly but that you set your admins up via webadmin.

Now browse to your server ip:port e.g. http://123.4.56.78:80 and you will be prompted for a user and password. This is default set to Admin / Admin and it is case sensitive. You will now be able to access the admins and groups menu on the top right of the screen. We strongly recommend one of the first things you do is to change the default password.

Also, note that you will have to login via console with your username in the format adminlogin user password

HTTP Map Download

This step is optional. If a client has to download a map or other package from the server, it will by default use the game's internal channel download system, which is known to be very slow. You can instruct the server to redirect clients to an HTTP address which provides almost instantaneous map downloads by setting up a web server (eg. Apache).

The game will request files by just their names (not including the folders they are in), so we need a method to map files to the folders they are stored in. This can be done, for example, based on the file extension using the following mod_rewrite rules in Apache:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule  ^(.*).ut2$  /.gamedata/Maps/$1.ut2          [nocase,last]
    RewriteRule  ^(.*).ka$   /.gamedata/KarmaData/$1.ka      [nocase,last]
    RewriteRule  ^(.*).u$    /.gamedata/System/$1.u          [nocase,last]
    RewriteRule  ^(.*).uax$  /.gamedata/Sounds/$1.uax        [nocase,last]
    RewriteRule  ^(.*).ukx$  /.gamedata/Animations/$1.ukx    [nocase,last]
    RewriteRule  ^(.*).usx$  /.gamedata/StaticMeshes/$1.usx  [nocase,last]
    RewriteRule  ^(.*).utx$  /.gamedata/Textures/$1.utx      [nocase,last]
</IfModule>

Where .gamedata is a symlink to /opt/ut2004-ded that would have to be created in /var/www/localhost/htdocs.

Next adjust your /opt/ut2004-ded/System/UT2004.ini.

Comment out the ChannelDownload option by putting a # in front of it:

LanServerMaxTickRate=35
DownloadManagers=IpDrv.HTTPDownload
#DownloadManagers=Engine.ChannelDownload
AllowPlayerPortUnreach=False

Then disable compression and configure your server's IP:

[IpDrv.HTTPDownload]
RedirectToURL=http://192.168.0.1/ut2004/
ProxyServerHost=
ProxyServerPort=3128
UseCompression=False

Using DNS aliases instead of the IP address does not seem to work.

Once that's done, restart your UT2004 server and reload Apache to apply the changes. Your clients should

See also

This tutorial is a modified version for Gentoo of a tutorial by UnrealAdmin.org. The original tutorial can be found here. SevenL Networks is a Gentoo Dedicated Server supplier www.sevenl.net.

Retrieved from "http://www.gentoo-wiki.info/Unreal_Tournament_2004"

Last modified: Wed, 10 Sep 2008 04:57:00 +0000 Hits: 31,527