Tutorial for Perl TetriNET Server (pts) v0.20.
pts requires perl 5.005 or later. If you have not installed a perl interpreter yet, install perl first (ActivePerl is recommended).
Download a pts distribution from SourceForge or www.necoware.com, and unpacks it (with WinZip or whatever). .zip archives are for MS-Windows, using CRLF as a line ending.
pts requires perl 5.005 or later. Most UNIX users would already have it, but if your system have not installed it yet, install perl first.
Download a pts distribution from SourceForge or www.necoware.com, and unpacks it (with `tar xzf pts-*.tar.gz'). .tar.gz archives are for UNIX, using LF as a line ending.
When you run pts at first time, some errors that some important files cannot be opened will be logged, though it's OK, the files will be created when you shut down the server properly.
Double click on pts.pl, then MS-DOS prompt (or command prompt) will open and starting messages will be shown. Connect your own server with a tetrinet (or tetrifast) client and make sure the server is correctly running.
In the default setting, you don't have proper way to shut down the server, so that you need to kill the pts process forcibly. Activate the MS-DOS prompt and hit Ctrl+C, then the MS-DOS prompt will close and also the running pts process will be killed. Note that this way will not save current data to file.
cd to pts directory and type `./pts.pl &', then pts launches and starting messages will be shown. Connect your own server with a tetrinet (or tetrifast) client and make sure the server is correctly running.
In the default setting, you don't have proper way to shut down the server, so that you need to kill the pts process forcibly. Show pts's pid with `cat pts.pid' and kill the pts process with `kill -INT pid' (pid is a number what you showed just before).
Open pts.pl with a text editor, so you will see there are some constants in the top part of the program. You'd like to leave most settings as default, but some settings are noticeable:
If you set this to 1, pts runs as a daemon process (so that you can launch pts.pl as just `./pts.pl', no & required in the end). This needs fork() and setsid() are available. This won't work on MS-Windows.
If you set this to 1, pts will not fork() in the process of looking up host name (See below). If your OS or perl doesn't support fork(), you should set this on.
If you set this to 1, pts can get millisecond resolution time. This effects ping time and total time of game (perl only can count seconds, not milliseconds, in the default).
You will need to install Time::HiRes perl module manually. If you are using ActivePerl on MS-Windows, open MS-DOS prompt and type `ppm install Time::HiRes'. It will install the module automatically. If you are on UNIX, get the source from CPAN and install it.
If you set this to 1, pts will lookup user's host name when user connected (host name is readable name like `yahoo.com' as opposed to IP adreess like `216.115.109.6').
If your system has fork(), you can async DNS lookup (Don't know what it is? Don't worry about it, it's good thing anyway). If fork() is unavailable, you cannot async DNS lookup, so that if a user connects the server, pts process will stop some seconds. (Not exactly, but it seems stopped for players in the server. They will not get any response from the server during the time). The `some seconds' is actually 0.1 seconds or less for most cases, but sometimes it takes 10 seconds or 3 minutes, depending on the network and the connecting user. If your system doesn't support fork() but you want to avoid the stop time, turn this option off.
The pts.ini file is main config file. Edit it for what you want.
The pts.secure file contains op/admin passwords. In default, op (you can get op authority with /op pass) password is `Password5' and admin (you can get admin authority with /admin pass) password is `Password9'. You can write passwords as a plain text (not encrypted word).
If you want write encrypted passwords for pts.secure, use util/encrypt.pl program. It returns encrypted string. Write the returned value to the Password* field, and set Crypted to 1.
Admin password should be set, because /shutdown (this should be used only by admins) is the proper way to shut down the server.
Massage of the Day (motd) is the message shown when you have connected. You can use these color tags in the message: <black> <gray> <lgray> <dblue> <blue> <lblue> <dgreen> <lgreen> <teal> <rust> <red> <pink> <purple> <yellow> <white> <bold> <italic> <underline>