From 325ae8a1837c0d587ae015e096be6cdb92e77e75 Mon Sep 17 00:00:00 2001
From: RElesgoe <RElesgoe@users.noreply.github.com>
Date: Fri, 2 Oct 2020 17:47:56 -0700
Subject: [PATCH 1/5] Fix regression where /ping command did not return the
 specified user's ping

---
 src/bnetd/command.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bnetd/command.cpp b/src/bnetd/command.cpp
index 2287f3c..7577cc4 100644
--- a/src/bnetd/command.cpp
+++ b/src/bnetd/command.cpp
@@ -4825,7 +4825,7 @@ namespace pvpgn
 				msgtemp = localize(c, "Your latency {}", conn_get_latency(c));
 			}
 			else if ((user = connlist_find_connection_by_accountname(text)))
-				msgtemp = localize(c, "{} latency ()", text, conn_get_latency(user));
+				msgtemp = localize(c, "{} latency {}", text, conn_get_latency(user));
 			else
 			{
 				msgtemp = localize(c, "Invalid user.");

From 82fb9def9e9693ac7d114ccf4b7dfc23fa5de967 Mon Sep 17 00:00:00 2001
From: RElesgoe <RElesgoe@users.noreply.github.com>
Date: Sat, 3 Oct 2020 16:32:27 -0700
Subject: [PATCH 2/5] Update README.md

---
 README.md | 132 +++++++++++++++++++++++++++---------------------------
 1 file changed, 65 insertions(+), 67 deletions(-)

diff --git a/README.md b/README.md
index 32c42e4..05d269e 100644
--- a/README.md
+++ b/README.md
@@ -55,94 +55,91 @@ Set `loglevels = fatal,error,warn,info,debug,trace` in `bnetd.conf` before obtai
 Submit pull requests to contribute to this project. Utilize C++11 features and adhere to the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md) whenever possible.
 
 ## Building
-See [docs/ports.md](https://github.com/pvpgn/pvpgn-server/blob/master/docs/ports.md) for operating systems and compilers that have been confirmed to work with PvPGN. Any operating system that supports WinAPI or POSIX, and any C++11 compliant compiler should be able to build PvPGN. The CMake files have been hardcoded to reject compilers older than Visual Studio 2015 and GCC 5.1.
+See [docs/ports.md](https://github.com/pvpgn/pvpgn-server/blob/master/docs/ports.md) for operating systems and compilers that have been confirmed to work with PvPGN. Any operating system that supports WinAPI or POSIX, and any C++11 compliant compiler should be able to build PvPGN.
 
-#### Windows
-Use [Magic Builder](https://github.com/pvpgn/pvpgn-magic-builder).
+The CMake files have been hardcoded to reject compilers older than Visual Studio 2015 and GCC 5.1.
 
-Alternatively, use cmake to generate the .sln project and build it from Visual Studio.
+On Windows, [Magic Builder](https://github.com/pvpgn/pvpgn-magic-builder) is a convenient tool for building PvPGN.
+
+### Obtain packages.
+
+#### Ubuntu / Debian
 ```
-cmake -g "Visual Studio 14 2015" -H./ -B./build
-```
-This will generate .sln in `build` directory.
-
-#### Linux in general
-Do not blindly run these commands. The main problem with older distributions is installing CMake 3.2.x and GCC 5, so external repositories are used in the examples.
-
-```
-apt-get install git install cmake make build-essential zlib1g-dev
-apt-get install liblua5.1-0-dev #Lua support
-apt-get install mysql-server mysql-client libmysqlclient-dev #MySQL support
-cd /home
-git clone https://github.com/pvpgn/pvpgn-server.git
-cmake -D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn -D WITH_MYSQL=true -D WITH_LUA=true ../
-make
-make install
+apt install build-essential git cmake zlib1g-dev
+apt install liblua5.1-0-dev # Lua support
+apt install mysql-server mysql-client libmysqlclient-dev # MySQL support
+apt install sqlite3 libsqlite3-dev # SQLite3 support
+apt install postgresql libpq-dev # PostgreSQL support
 ```
 
-#### Ubuntu 16.04, 18.04
+#### CentOS 8
 ```
-sudo apt-get -y install build-essential git cmake zlib1g-dev
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server && cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
+dnf install gcc-c++ make git cmake zlib-devel
+# Lua 5.1 must be compiled and installed from source.
+dnf install mysql-server mysql-devel
+dnf install sqlite-devel
+dnf install postgresql
 ```
 
-#### Ubuntu 14.04
-```
-sudo apt-get -y install build-essential zlib1g-dev git
-sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-sudo apt-get -y update
-sudo apt-get -y install gcc-5 g++-5
-sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
-sudo add-apt-repository -y ppa:george-edison55/cmake-3.x
-sudo apt-get update
-sudo apt-get -y install cmake
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server && cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
-```
-
-#### Debian 8 with clang compiler
-```
-sudo apt-get -y install build-essential zlib1g-dev clang libc++-dev git
-wget https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz
-tar xvfz cmake-3.7.1-Linux-x86_64.tar.gz
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server && CC=/usr/bin/clang CXX=/usr/bin/clang++ ../cmake-3.7.1-Linux-x86_64/bin/cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
-```
-
-#### CentOS 7
+##### CentOS 7
 ```
 sudo yum -y install epel-release centos-release-scl
 sudo yum -y install git zlib-devel cmake3 devtoolset-4-gcc*
 sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server
-CC=/opt/rh/devtoolset-4/root/usr/bin/gcc CXX=/opt/rh/devtoolset-4/root/usr/bin/g++ cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
 ```
 
-#### Fedora 25
+##### Fedora
 ```
-sudo dnf -y install gcc-c++ gcc make zlib-devel cmake git
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server
-cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
+dnf install gcc-c++ make git cmake zlib-devel
+# Lua?
+dnf install community-mysql-server
+# SQLite3?
+# PostgreSQL?
 ```
 
 #### FreeBSD 11
 ```
-sudo pkg install -y git cmake
-git clone https://github.com/pvpgn/pvpgn-server.git
-cd pvpgn-server
-cmake -G "Unix Makefiles" -H./ -B./build
-cd build && make
+pkg install git cmake
+# Lua?
+# MySQL?
+# SQLite3?
+# PostgreSQL?
+```
+
+### Generate a makefile or Visual Studio solution
+
+```
+git clone https://github.com/pvpgn/pvpgn-server.git
+cd pvpgn-server && mkdir build && cd build
+
+cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" ../
+```
+
+- On Linux, you may want to specify a custom installation directory by passing `-DCMAKE_INSTALL_PREFIX=/usr/local/pvpgn` to CMake.
+- Additional CMake options are:
+  - `-DWITH_BNETD=true`
+  - `-DWITH_D2CS=true`
+  - `-DWITH_D2DBS=true`
+  - `-DWITH_LUA=false`
+  - `-DWITH_WIN32_GUI=true`
+  - `-DWITH_MYSQL=false`
+  - `-DWITH_SQLITE3=false`
+  - `-DWITH_PGSQL=false`
+  - `-DWITH_ODBC=false`
+
+### Build and install
+
+#### Linux
+```
+make && make install
+```
+
+#### Windows (Visual Studio)
+First open *Developer PowerShell for VS ...* or *Developer Command Prompt for VS ...*
+```
+msbuild pvpgn.sln -target:ALL_BUILD;INSTALL /p:Configuration="RelWithDebInfo"
 ```
 
-Full instructions: [Русский](http://harpywar.com/?a=articles&b=2&c=1&d=74) | [English](http://harpywar.com/?a=articles&b=2&c=1&d=74&lang=en)
 
 ## Hosting on LAN or VPS with private IP address
 Some VPS providers do not assign your server a direct public IP. If that is the case or you host at home behind NAT you need to setup the route translation in `address_translation.conf`. The public address is pushed as the route server address to game clients when seeking games. Failure to push the correct address to game clients results in players not being able to match and join games (long game search and error).
@@ -150,6 +147,7 @@ Some VPS providers do not assign your server a direct public IP. If that is the
 If your network interface is directly bound to public IP, PvPGN can figure it out on it's own and this step is not necessary.
 
 ## License
+PvPGN-PRO is licensed under the GNU GPL v2 (or later). See LICENSE file for more information.
 
     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License

From 0d945bd20299f46e66d7d596a05a0f877d23533f Mon Sep 17 00:00:00 2001
From: cen1 <cen.is.imba@gmail.com>
Date: Mon, 5 Oct 2020 17:20:22 +0200
Subject: [PATCH 3/5] Update README.md

Add libcurl to apt command
---
 README.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 05d269e..3fb8f1c 100644
--- a/README.md
+++ b/README.md
@@ -65,11 +65,11 @@ On Windows, [Magic Builder](https://github.com/pvpgn/pvpgn-magic-builder) is a c
 
 #### Ubuntu / Debian
 ```
-apt install build-essential git cmake zlib1g-dev
-apt install liblua5.1-0-dev # Lua support
-apt install mysql-server mysql-client libmysqlclient-dev # MySQL support
-apt install sqlite3 libsqlite3-dev # SQLite3 support
-apt install postgresql libpq-dev # PostgreSQL support
+apt install -y build-essential git cmake zlib1g-dev libcurl4-openssl-dev
+apt install -y liblua5.1-0-dev # Lua support
+apt install -y mysql-server mysql-client libmysqlclient-dev # MySQL support
+apt install -y sqlite3 libsqlite3-dev # SQLite3 support
+apt install -y postgresql libpq-dev # PostgreSQL support
 ```
 
 #### CentOS 8

From 987ba4c42cbedc5935f65af1758848a7321d4746 Mon Sep 17 00:00:00 2001
From: cen1 <cen.is.imba@gmail.com>
Date: Mon, 5 Oct 2020 18:01:26 +0200
Subject: [PATCH 4/5] add lua 5.1 build instructions

---
 README.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 3fb8f1c..6c9379c 100644
--- a/README.md
+++ b/README.md
@@ -74,11 +74,11 @@ apt install -y postgresql libpq-dev # PostgreSQL support
 
 #### CentOS 8
 ```
-dnf install gcc-c++ make git cmake zlib-devel
-# Lua 5.1 must be compiled and installed from source.
-dnf install mysql-server mysql-devel
-dnf install sqlite-devel
-dnf install postgresql
+dnf -y install wget gcc-c++ make git cmake zlib-devel libcurl-devel
+dnf -y install readline-devel && wget -c https://www.lua.org/ftp/lua-5.1.5.tar.gz -O - | tar -xz && cd lua-5.1.5 && make linux && make install # Lua 5.1 must be compiled and installed from source. Newer version not supported yet.
+dnf -y install mysql-server mysql-devel
+dnf -y install sqlite-devel
+dnf -y install postgresql
 ```
 
 ##### CentOS 7

From c50a499f9a03281f7264544141d104e3bd8580b7 Mon Sep 17 00:00:00 2001
From: cen1 <cen.is.imba@gmail.com>
Date: Mon, 5 Oct 2020 19:11:06 +0200
Subject: [PATCH 5/5] updated distro instructions

---
 README.md | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 6c9379c..8af0b32 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,7 @@ On Windows, [Magic Builder](https://github.com/pvpgn/pvpgn-magic-builder) is a c
 
 ### Obtain packages.
 
-#### Ubuntu / Debian
+#### Ubuntu / Debian 10
 ```
 apt install -y build-essential git cmake zlib1g-dev libcurl4-openssl-dev
 apt install -y liblua5.1-0-dev # Lua support
@@ -83,23 +83,21 @@ dnf -y install postgresql
 
 ##### CentOS 7
 ```
-sudo yum -y install epel-release centos-release-scl
-sudo yum -y install git zlib-devel cmake3 devtoolset-4-gcc*
-sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
+yum -y install epel-release centos-release-scl
+yum -y install git zlib-devel cmake3 libcurl-devel devtoolset-7-gcc*
+ln -s /usr/bin/cmake3 /usr/bin/cmake
+scl enable devtoolset-7 bash
 ```
 
-##### Fedora
+##### Fedora 32
 ```
-dnf install gcc-c++ make git cmake zlib-devel
-# Lua?
-dnf install community-mysql-server
-# SQLite3?
-# PostgreSQL?
+dnf -y install gcc-c++ make git cmake zlib-devel libcurl-devel
+dnf -y install community-mysql-server
 ```
 
-#### FreeBSD 11
+#### FreeBSD 12
 ```
-pkg install git cmake
+env ASSUME_ALWAYS_YES=yes pkg install git cmake curl
 # Lua?
 # MySQL?
 # SQLite3?