Merge branch 'develop' of https://github.com/pvpgn/pvpgn-server into develop

This commit is contained in:
relesgoe 2020-10-06 01:28:02 -07:00
commit f7c24b2d89
2 changed files with 69 additions and 73 deletions

140
README.md
View file

@ -55,94 +55,89 @@ 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 10
```
cmake -g "Visual Studio 14 2015" -H./ -B./build
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
```
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.
#### CentOS 8
```
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
```
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 32
```
dnf -y install gcc-c++ make git cmake zlib-devel libcurl-devel
dnf -y install community-mysql-server
```
#### FreeBSD 12
```
env ASSUME_ALWAYS_YES=yes pkg install git cmake curl
# Lua?
# MySQL?
# SQLite3?
# PostgreSQL?
```
### Generate a makefile or Visual Studio solution
```
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
cd pvpgn-server && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" ../
```
#### Ubuntu 16.04, 18.04
- 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
```
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
make && make install
```
#### Ubuntu 14.04
#### Windows (Visual Studio)
First open *Developer PowerShell for VS ...* or *Developer Command Prompt for VS ...*
```
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
msbuild pvpgn.sln -target:ALL_BUILD;INSTALL /p:Configuration="RelWithDebInfo"
```
#### 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
```
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
```
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
```
#### 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
```
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 +145,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

View file

@ -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.");