Dark Steve Heading
Contents







Local server time is:
7:40 PM, Friday, 13th o December 2024.



Today is Boomtime, the 55th of The Aftermath, 3190.

Or kill me.

Installing PvPGN on a Rapberry Pi


Originally completed and posted 18/02/2022.

The Player vs Player Gaming Network (PvPGN) is great if you want a private server to play Starcraft, Warcraft II & III, or Diablo with friends remotely. However, it does have limitations, and doesn't support Starcraft II or even the original Starcraft past v1.16.1.

Also, particularly on lower powered hardware, there can be a noticeable lag when you tell a unit to "hold position" or change course to another location. It can sometimes take up to a second for the unit to respond. This isn't a huge issue while you're playing, and you tend to adjust to the slight delay, but the delay is there.

As RaspberryPiOS is based on Debian Linux, the following guide is based on a 2017 Debian guide I found here, written by HarpyWar. Anyway, here we go!


Step 1: Install required dependencies


Since this install will be a private server for just me and a few friends, I'll have it use plain text files for user accounts instead of an SQL database. This will save precious resources on my Pi! First I installed supporting libraries:
sudo apt-get -y install build-essential clang libc++-dev git cmake zlib1g-dev
If you'd rather use MySQL as the database instead of plain text files, you need to include that, too:
sudo apt-get -y install build-essential clang libc++-dev git cmake zlib1g-dev liblua5.1-0-dev libmysql++-dev
The version of liblua used here (5.1-0-dev) is still part of RaspberryPiOS's package library, but that may change. To check which versions are available, use this command:
sudo apt-cache search liblua
That should provide you with a list of all currently avaiable versions. Please note, liblua is not required for PvPGN to work, it's only required if you want to run Lua scripts as part of your setup. I didn't realise this before I compiled and installed it myself!

Step 2: Download the latest source code and unpack archive


As of writing this, the latest version of PvPGN is 1.99.7.2.0, released July 2018. However you can check the list of realease here. I downloaded the latest stable release, and extracted the source.
wget https://github.com/pvpgn/pvpgn-server/archive/master.tar.gz
tar xf master.tar.gz

Step 3: Compile the source and install


Now the source is extracted, I prepared for the build.
cd pvpgn-server-master
mkdir build
cd build
Then I configured the build and compiled.
cmake ../
If you want to use MySQL/Lua, use the following instead:
cmake -D WITH_MYSQL=true -D WITH_LUA=true ../
Then I built and installed.
make && make install

Step 4: Configuring the PvPGN server


Configuration files can be found in /usr/local/etc/pvpgn/

Configuring PvPGN so I could play on my LAN with people on the WAN requires multiple steps other than the conf files. I needed to forward ports on my router and ensure my internal machines had static IPs. I already had static IPs for my two desktop machines, but I needed to forward ports.

For Warcraft III, I needed to forward port 6200 to my Pi. The matching line in address_translation.conf is under the heading w3route server ip translation.
0.0.0.0:6200      200.100.50.25:6200      192.168.1.0/24           ANY
The above assumes my real-world IP is 200.100.50.25, and my LAN IPs are 192.168.1.x

For Starcraft/Broodwar, I needed to forward a range of IPs starting with 6112. I needed to forward several, so Starcraft and PvPGN can use one port per player. Given I'll have up to three or so external players, I forwarded ports 6112 to 6116 to my Pi.

Next I had to forward a port per local machine. For this, I forwarded ports 16112 and 16113 to my two desktop machines. The matching line in address_translation.conf is under the heading Game Translations for clients/games (client data ports).
#Desktop1            Real-world IP:Port       Local Network
192.168.1.10:16112   200.100.50.25:16112      192.168.1.0/24  ANY
#Desktop2            Real-world IP:Port       Local Network
192.168.1.20:16113   200.100.50.25:16113      192.168.1.0/24  ANY
Next comes bnetd.conf. Most of its settings are either obvious or can be left at their defaults. However I did ensure I set the effective user and group to games (which is appropriate for RaspberryPiOS). On FreeBSD, it needed to be set to bnetd. Also, there's the storage path for user files. I used the default "file:mode=plain" line, but altered the paths to be:
/usr/local/etc/pvpgn/users/
/usr/local/etc/pvpgn/clans/
/usr/local/etc/pvpgn/teams/
I also created these paths, and chmod'd them so they were writable. I found that if I didn't make them writable, every user account would be lost on reboot. This happened whether I used the default paths or chose my own. For some reason, PvPGN couldn't write to the created paths, even when launched by root.

Logs, files, and scripts can be found in /usr/local/var/pvpgn/

Step 5: Running the configured PvPGN server


To run the PvPGN server, I ran the following:
/usr/local/sbin/bnetd
And it ran successfully! See my Installing Starcraft and Broodwar guide for instructions on configuring Starcraft, Broodwar, and Warcraft III so they connect to a private PvPGN server.

When a user connects to PvPGN, they need to create an account. This is generally pretty straight forward, but they need to provide an email address. This email address is not used for activation or confirmation, it's just held on the server. They can enter a dummy address, but you can reassure your users their details are not used against them.

Happy gaming!


This page last modified: 18 February 2022 23:47:40.