109 lines
4.5 KiB
Markdown
109 lines
4.5 KiB
Markdown
[*Warcraft III: The Frozen Throne*](http://en.wikipedia.org/wiki/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.
|
|
|
|
### Dependencies
|
|
You will need:
|
|
|
|
* *Warcraft III: The Frozen Throne* for Windows
|
|
* 32-bit WINE
|
|
|
|
If all players are not on the same LAN subnet, they each must use a version of the game patches to use alternative battle.net servers. The game host must set up port forwarding, or, if this isn't an option, all players must connect to the same VPN. Instructions for both options follow.
|
|
|
|
## Running *Warcraft III* with WINE
|
|
|
|
To run the game on Linux, you must install [WINE](http://winehq.org), a compatibility layer created to allow running Windows applications on UNIX 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](http://i3wm.org), 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. All players must be on the same subnet and its broadcast address must work properly.*
|
|
|
|
## 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 IPv4 address.
|
|
|
|
#### Using Docker
|
|
|
|
**(TODO)**
|
|
|
|
#### 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
|
|
|
|
1. Download the [Warcraft 3 Loader for PvPGN](http://pvpgn.pro/w3l.html) and extract the ZIP into the directory containing `Frozen Throne.exe`.
|
|
|
|
**(TODO)**
|
|
|
|
## 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](http://www.wireguard.com) 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:
|
|
|
|
1. First, install Wireguard. It should be available as a package for your Linux distro.
|
|
|
|
2. 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
|
|
```
|
|
|
|
3. Then create a config file, `/etc/wireguard/wg0.conf` as root:
|
|
```
|
|
[Interface]
|
|
PrivateKey = ****
|
|
Address = 10.0.5.*/24
|
|
DNS = 10.0.5.1
|
|
|
|
[Peer]
|
|
PublicKey = ****
|
|
PresharedKey = ****
|
|
AllowedIPs = 10.0.0.0/16
|
|
Endpoint = *.*.*.*:****
|
|
```
|
|
* `PrivateKey` should 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.
|
|
* `PublicKey` should 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`.
|
|
* `Endpoint` should be the host VPN's IPv4 address, with the port to use Wireguard on after the `:` (default: 51820).
|
|
4. 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
|
|
```
|