1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
|
++++++++++++++++++++++++++++++++++++++++
How to run the PokerTH dedicated server
++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++
1. System requirements
+++++++++++++++++++++++
The PokerTH server is officially supported on
Linux, Windows Vista and Windows Server 2008.
root/admin access during setup is recommended.
root/admin access is required if a strict firewall is running on the system.
RAM usage is low (about 5 MB when load is high), but due to frequent
allocations and thread usage, there will be problems if the PokerTH server
is run on a vserver with very limited memory.
+++++++++++++++++++++++++
2. Installation on Linux
+++++++++++++++++++++++++
2.1 Package dependencies (Linux)
---------------------------------
The following development packages are required to compile the server:
* qmake (Qt development tools)
* boost 1.44, latest recommended (requires libbz2)
- boost-thread
- boost-filesystem
- boost-datetime
- boost-program_options
- boost-iostreams
- boost-asio
- boost-regex
- boost-random
* libcurl4-gnutls
* libtinyxml
* libircclient
* libgsasl (at least 1.4)
* libsqlite3
* libgcrypt (should already be there as dependency to the previous libs)
The following packages are optional but recommended:
* monit (http://tildeslash.com/monit/)
* svn (subversion)
2.2 Compiling the server (Linux)
---------------------------------
If you have root access on the machine, create a new user for
the PokerTH daemon (for example named pokerth). The user is
*required* to have a home directory. Log in as the new user.
If you do not have root access, log in as usual.
To use the stable version, download the latest PokerTH
source release from http://www.pokerth.net/.
Unpack the source release:
tar xjf PokerTH-0.9.src.tar.bz2
If you wish to use the current development version instead, run
svn co http://pokerth.svn.sourceforge.net/svnroot/pokerth/trunk/pokerth
Enter the pokerth source directory:
cd pokerth
Edit pokerth.pro and remove the pokerth_game.pro entry.
Create the Makefile and compile the PokerTH dedicated server:
qmake -spec linux-g++ pokerth.pro
make
2.3 Post-compile actions (Linux)
---------------------------------
The binary for the server is created in the bin/ subdirectory.
Move it to the main directory:
mv bin/pokerth_server .
Make sure your firewall allows port 7234 (IP/IPv6, TCP).
If you wish to use a different port, allow this port in your firewall,
and continue the steps.
2.4 First run of the server (Linux)
------------------------------------
Run the dedicated server using the full path:
/home/username/pokerth/pokerth_server
It will not output anything and immediately return to the prompt.
Check that the server is running:
ps ax | grep pokerth_server
The server will have created a directory ~/.pokerth
Take a peek at the log file:
less ~/.pokerth/log-files/server_messages.log
It should look like this:
2007-Dec-23 21:38:01 MSG: Starting PokerTH dedicated server. Availability: IPv6 1, SCTP 1, Dual Stack 1.
If there are messages about non-existing avatar directories, you either
- did not start the pokerth_server using the full path (see above)
- did not move the pokerth_server to the main directory (step 2.3)
Now, stop the server again after the first start.
killall pokerth_server
2.5 Configuring the server (Linux)
-----------------------------------
Open ~/.pokerth/config.xml using your favourite editor.
If you intend to use non-ascii characters for any option, make sure
you use the UTF-8 charset.
The options are described in Chapter 4.
If you have root access on the machine, it is recommended that you
set up "monit" to automatically restart pokerth_server if it
terminates. The players will be very frustrated if for some reason the
server crashes and is not restarted immediately. The PokerTH server
has been thoroughly tested and is very stable, but you never know...
To set up monit, first create the init-script for the server.
2.6 Sample /etc/init.d/pokerth_server script (Linux)
-----------------------------------------------------
This is a sample start/stop script for the pokerth_server daemon.
It can only be used if you have root access on the machine.
The script will start the process pokerth_server as user "pokerth".
It uses a simple hack to find out the process id of pokerth_server. This
will not work if you intend to run more than one PokerTH server on
a single machine.
-- cut here --
#!/bin/bash
case $1 in
start)
sudo -H -u pokerth /home/pokerth/pokerth/pokerth_server
sleep 2
pgrep -n pokerth_server > /var/run/pokerth_server.pid ;;
stop)
kill `cat /var/run/pokerth_server.pid` ;;
*)
echo "Usage: pokerth_server {start|stop}" ;;
esac
-- cut here --
2.7 Sample monit configuration (Linux)
---------------------------------------
The previous step is required to set up monit, so make sure the
init-script works.
Use the sample monit configuration file which comes with your monit
package as base. Edit the basic configuration, and READ THE MANUAL.
It is recommended to run monit as daemon, and to use a check-interval
no longer than 120 seconds.
Add the following lines to the monitrc configuration file:
-- cut here --
check process pokerth_server with pidfile /var/run/pokerth_server.pid
start program = "/etc/init.d/pokerth_server start"
stop program = "/etc/init.d/pokerth_server stop"
if 5 restarts within 5 cycles then timeout
-- cut here --
Make sure that pokerth_server is terminated. Then start monit. It will
automatically start pokerth_server. The easiest way to restart the server,
once monit is running, is to log in as user "pokerth" and run
killall pokerth_server
This will cause monit to restart the pokerth_server within the configured
interval.
+++++++++++++++++++++++++++++++++
3. Configuration file config.xml
+++++++++++++++++++++++++++++++++
There are three areas for server configuration:
1. General server settings (like password and port)
2. IRC bot settings
For admin usage, the server can join any IRC channel as bot.
This will allow you to kick players and request server statistics.
3. Directory settings (which SHOULD be left as they are)
Relevant options are (with description):
1.
General server password:
<ServerPassword value="" />
Enable IPv6 (has effect only if dual stack sockets are not supported):
<ServerUseIpv6 value="0" />
Enable/disable SCTP (TCP will still be possible):
<ServerUseSctp value="0" />
The server port which is bound:
<ServerPort value="7234" />
2.
Make the server join as bot in an admin-only irc channel:
<UseAdminIRC value="0" />
(the following is only applicable if UseAdminIRC is 1)
The irc server:
<AdminIRCServerAddress value="chat.freenode.net" />
Port of the irc service:
<AdminIRCServerPort value="6667" />
Admin irc channel name
(it is recommended to use a password protected channel):
<AdminIRCChannel value="#test" />
The password for the admin irc channel:
<AdminIRCChannelPassword value="" />
Enable IPv6 for the irc server:
<AdminIRCServerUseIpv6 value="0" />
Nick name for the bot:
<AdminIRCServerNick value="PokerTH" />
3. DO NOT CHANGE THE FOLLOWING OPTIONS UNLESS REALLY REALLY NEEDED
Directory for server logging, write access needed:
<LogDir value="/Users/l-may/.pokerth/log-files/" />
Directory for PokerTH data files:
(only avatar data is needed, read access is sufficient):
<UserDataDir value="/Users/l-may/.pokerth/data/" />
Directory for avatar cache:
<CacheDir value="/Users/l-may/.pokerth/cache/" />
++++++++++++++++++++++++
4. Server Admin IRC bot
++++++++++++++++++++++++
The irc bot only accepts two commands within the configured channel.
Assuming the bot is named BotName, these commands are as follows:
Display statistics of the server:
BotName: stat
Kick player named "foo" from the server:
BotName: kick foo
Show the IP address of player "foo":
BotName: showip foo
Ban a certain nick from the server, so it can no longer be used.
For this command, the name "fooRegex" can be any regular expression.
(Note: This does not affect players which are currently logged in):
BotName: bannick fooRegex
Ban a certain client IP address from the server.
The IP address should be in the same format as printed by the
command "showip".
(Note: This does not affect players which are currently logged in):
BotName: banip 1.2.3.4
List all bans currently active on the server:
BotName: listban
Remove a ban with a certain id from the list of bans
(use the ban id from the listban command):
BotName: removeban 1
Send a global chat message through the server:
BotName: chat This is a global chat message.
Send a global message box through the server:
BotName: msg This is a global message box.
The bot always answers to "BotName: " style commands.
It ignores private messages.
2007-2012 by Lothar May
|