6.1 KiB
Warcraft III: The Frozen Throne is an expansion pack for the tower defense game Warcraft III by Blizzard Entertainment. It was released for Microsoft Windows and Mac OS X in 2003. This article will explain how to get multiplayer gameplay working on Linux.
The game provides two options for multiplayer: "LAN" and "battle.net". The LAN option will work out of the box if all players are on the same subnet (broadcast traffic is routed properly). The "battle.net" option, which allows multiplayer over the open internet, is slightly more complicated because Blizzard has shut down the original Warcraft III multiplayer servers. Therefore, for this option to work:
- One player must set up a PvPGN server at a publicly reachable, static IPv4 address.
- All players must patch Warcraft III to use that server instead of the default.
- Then, either:
These instructions focus on how to accomplish this on Linux, but the basic concept is the same regardless of operating system. Although the game did receive a Mac OS X release, that version will not work because the PvPGN patch is only available for Windows. Therefore, Mac users should also follow the WINE instructions.
Dependencies
All players will need:
- Warcraft III: The Frozen Throne for Windows
- 32-bit WINE
Running Warcraft III with WINE
To run the game on Linux, you must install WINE, a compatibility layer created to allow running Windows applications on UNIX-like operating systems. There should be a package for it available from your Linux distro.
Once WINE is installed, check that it works by using it to run Warcraft III, as shown below. The game may not play nice with all desktop environments because it changes the screen resolution and runs in full screen. It seems to work acceptably in i3, although unfocusing the game window may cause issues.
$ cd /path/to/Warcraft_III
$ wine Frozen\ Throne.exe
NOTE: If you only want LAN multiplayer, this completes setup.
Patching Warcraft III for Online Play
Once you've confirmed that the game works with WINE, it's time to patch it to use a chosen PvPGN multiplayer server, instead of (now defunct) battle.net server hosted by Blizzard.
Host Instructions
To run your own PvPGN server, first you must build it from source. ohea.xyz provides a convenient Dockerfile and build script for doing this. The machine hosting the server should have a static, publicly reachable IPv4 address.
Using Docker
Clone the pvpgn Docker repo:
$ git clone https://git.ohea.xyz/containers/pvpgn
$ cp docker-compose.override.yml.example docker-compose.override.yml
Now you need to configure docker-compose.override.yml. The default configuration should be sufficent for most users. If you want to customize the PvPGN configuration files, the provided terms of service, or the provided new account creation info, you can uncomment the corresponding mappings.
Run the docker container:
$ docker compose up -d
Your PvPGN server should now be running. It can be stopped by runnning:
$ docker compose down
Without Docker
To build and install:
$ git clone https://git.ohea.xyz/containers/pvpgn
$ cd pvpgn
$ sudo ./build.sh
To run the server:
$ sudo /usr/local/pvpgn/sbin/bnetd -D
Use Ctrl+C to quit.
Client Instructions
-
Download the Warcraft 3 Loader for PvPGN and extract the ZIP into the directory containing
Frozen Throne.exe. -
Create the necessary registry entries to trick Warcraft 3 into connecting to your PvPGN server. This is most easily done by importing a
.regfile with the correct value.- An online tool to generate this is available at http://ohea.xyz/wc3reggen/.
Port Forwarding
The player hosting in-game needs to log into his router and enable port forwarding for TCP and UDP on ports 6113-6119. How to do this depends on the router.
Creating a VPN with Wireguard
Alternatively, if port forwarding isn't practical for your setup, Wireguard can be used to create a Virtual Private Network (VPN) instead. This effectively tricks the players' computers into thinking they are all on the same network. One player must host the VPN, and the other players must then connect to it. (Note that this is independent of who hosts in-game.)
Host Instructions
(TODO)
Client Instructions
To connect to someone else's Wireguard VPN:
-
First, install Wireguard. It should be available as a package for your Linux distro.
-
Then, generate a public/private key pair, like so:
$ umask 077
$ wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey
- Then create a config file,
/etc/wireguard/wg0.confas root:
[Interface]
PrivateKey = ****
Address = 10.0.5.*/24
DNS = 10.0.5.1
[Peer]
PublicKey = ****
PresharedKey = ****
AllowedIPs = 10.0.0.0/16
Endpoint = *.*.*.*:****
PrivateKeyshould be the private key generated in Step 2. It is the contents of/etc/wireguard/privatekey. Do not share this value with anyone.- In the value of
Address, replace the*with an 8-bit positive integer (i.e. less than 256) of your choice. PublicKeyshould be the public key generated in Step 2. It is the contents of/etc/wireguard/publickey. You must communicate this value to the VPN host.- The VPN host must provide you with the value for
PresharedKey. Endpointshould be the host VPN's IPv4 address, with the port to use Wireguard on after the:(default: 51820).
- To start Wireguard, run the following command:
$ sudo wg-quick up wg0
If it works, the IP address at DNS in the wg0.conf you just created should be pingable. All of your internet traffic will now be through the VPN.
5. To disconnect from the VPN when you're done playing, run the following command:
$ sudo wg-quick down wg0