Compare commits
49 Commits
master-pac
...
stable-5.2
Author | SHA1 | Date | |
---|---|---|---|
083087ae78 | |||
aa8cfe19db | |||
dfeae6ac92 | |||
d79506d076 | |||
9d09cf17d2 | |||
2af5896ed1 | |||
f0cea26ac5 | |||
0edc870820 | |||
b9971da87a | |||
a1fa6f09dd | |||
d75ca63de4 | |||
9b877249e3 | |||
c9d8b13b00 | |||
|
06ea7329de | ||
b08d3334a2 | |||
3645c3538b | |||
|
744a72922d | ||
f29d050767 | |||
|
30386f391c | ||
3c730e2250 | |||
|
3a4d01b75a | ||
3845cd5b90 | |||
bf574d8019 | |||
8ccf85df69 | |||
bbd624535b | |||
|
01e0eab930 | ||
2e72eabafe | |||
4ef3bc602f | |||
2e12ab8aff | |||
d8a931c7b3 | |||
de8b12ef5d | |||
|
ec10d728b6 | ||
618bf71179 | |||
df01036c3f | |||
bdec7dde0b | |||
338d383d47 | |||
|
d59ae5df31 | ||
|
1ab22891da | ||
|
0c8a31c2b2 | ||
|
5840875a39 | ||
|
d205d1715f | ||
|
40aa13b63d | ||
|
1059d2ab9c | ||
|
46c71062e4 | ||
|
f96a7c33e0 | ||
|
1fbdbc145c | ||
|
70b5e43403 | ||
822ab80f30 | |||
f65bba2e5c |
11
.github/SECURITY.md
vendored
11
.github/SECURITY.md
vendored
@ -2,16 +2,13 @@
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We only support the latest stable version for security issues.
|
||||
See the [releases page](https://github.com/minetest/minetest/releases).
|
||||
We only support the minenux stable version for security issues.
|
||||
See the [releases page](https://github.com/minenux/minetest-engine-minetest/releases).
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
We ask that you report vulnerabilities privately, by contacting a core developer,
|
||||
to give us time to fix them. You can do that by emailing one of the following addresses:
|
||||
|
||||
* celeron55@gmail.com
|
||||
* rubenwardy@minetest.net
|
||||
We ask that you report vulnerabilities only using telegram group: https://t.me/venenux_minetest_bot
|
||||
to give us time to fix them.
|
||||
|
||||
Depending on severity, we will either create a private issue for the vulnerability
|
||||
and release a patch version of Minetest, or give you permission to file the issue publicly.
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -37,6 +37,7 @@ gtags.files
|
||||
/bin/
|
||||
/games/*
|
||||
!/games/minimal/
|
||||
!/games/minetest/
|
||||
/cache
|
||||
/textures/*
|
||||
!/textures/base/
|
||||
|
354
.gitlab-ci.yml
354
.gitlab-ci.yml
@ -1,16 +1,12 @@
|
||||
---
|
||||
# Github repository is cloned every day on Gitlab.com
|
||||
# https://gitlab.com/minetest/minetest
|
||||
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines
|
||||
# Github repository is really at minetest.org using the poikilos git.minetest.io
|
||||
# https://gitlab.com/minenux/minetest-engine-minetest
|
||||
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-minetest/pipelines
|
||||
# packages moved to https://build.opensuse.org/project/show/home:venenux:minenux
|
||||
# in future we only build here, or made apk packs for alpine
|
||||
|
||||
stages:
|
||||
- build
|
||||
- package
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
|
||||
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
|
||||
|
||||
.build_template: &build_definition
|
||||
stage: build
|
||||
@ -18,45 +14,17 @@ variables:
|
||||
- mkdir cmakebuild
|
||||
- mkdir -p artifact/minetest/usr/
|
||||
- cd cmakebuild
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
|
||||
- make -j2
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DRUN_IN_PLACE=OFF -DENABLE_CURL=ON -DENABLE_SOUND=ON -DENABLE_LUAJIT=ON -DENABLE_GETTEXT=ON -DENABLE_FREETYPE=ON -DENABLE_SYSTEM_GMP=ON -DENABLE_SYSTEM_JSONCPP=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
|
||||
- make -j$(nproc)
|
||||
- make install
|
||||
artifacts:
|
||||
when: on_success
|
||||
expire_in: 2h
|
||||
expire_in: 1h
|
||||
paths:
|
||||
- artifact/*
|
||||
|
||||
.debpkg_template: &debpkg_template
|
||||
stage: package
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get install -y git
|
||||
- mkdir -p build/deb/minetest/DEBIAN/
|
||||
- cp misc/debpkg-control build/deb/minetest/DEBIAN/control
|
||||
- cp -Rp artifact/minetest/usr build/deb/minetest/
|
||||
script:
|
||||
- git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest
|
||||
- rm -Rf build/deb/minetest/usr/share/minetest/games/minetest/.git
|
||||
- sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
|
||||
- sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
|
||||
- cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
|
||||
artifacts:
|
||||
when: on_success
|
||||
expire_in: 90 day
|
||||
paths:
|
||||
- ./*.deb
|
||||
|
||||
.debpkg_install: &debpkg_install
|
||||
stage: deploy
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get install -y libc6 libcurl3-gnutls libfreetype6 libirrlicht1.8 $LEVELDB_PKG liblua5.1-0 libluajit-5.1-2 libopenal1 libstdc++6 libvorbisfile3 libx11-6 zlib1g
|
||||
script:
|
||||
- dpkg -i ./*.deb
|
||||
|
||||
##
|
||||
## Debian
|
||||
## Debian mother of many distros
|
||||
##
|
||||
|
||||
# Jessie
|
||||
@ -65,29 +33,11 @@ build:debian-8:
|
||||
<<: *build_definition
|
||||
image: debian:8
|
||||
before_script:
|
||||
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
|
||||
- apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
|
||||
- apt-get update -y
|
||||
- apt-get -y install build-essential gcc-6 g++-6 libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
variables:
|
||||
CC: gcc-6
|
||||
CXX: g++-6
|
||||
|
||||
package:debian-8:
|
||||
image: debian:8
|
||||
dependencies:
|
||||
- build:debian-8
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1
|
||||
<<: *debpkg_template
|
||||
|
||||
deploy:debian-8:
|
||||
image: debian:8
|
||||
dependencies:
|
||||
- package:debian-8
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1
|
||||
<<: *debpkg_install
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev x11proto-xf86vidmode-dev
|
||||
|
||||
# Stretch
|
||||
|
||||
@ -95,246 +45,78 @@ build:debian-9:
|
||||
<<: *build_definition
|
||||
image: debian:9
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
package:debian-9:
|
||||
image: debian:9
|
||||
dependencies:
|
||||
- build:debian-9
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1v5
|
||||
<<: *debpkg_template
|
||||
# Bullseye
|
||||
|
||||
deploy:debian-9:
|
||||
image: debian:9
|
||||
dependencies:
|
||||
- package:debian-9
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1v5
|
||||
<<: *debpkg_install
|
||||
|
||||
##
|
||||
## Ubuntu
|
||||
##
|
||||
|
||||
# Trusty
|
||||
|
||||
build:ubuntu-14.04:
|
||||
build:debian-11:
|
||||
<<: *build_definition
|
||||
image: ubuntu:trusty
|
||||
image: debian:11
|
||||
before_script:
|
||||
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
|
||||
- apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
|
||||
- apt-get update -y
|
||||
- apt-get -y install build-essential gcc-6 g++-6 libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
variables:
|
||||
CC: gcc-6
|
||||
CXX: g++-6
|
||||
- apt-get update -y || true
|
||||
- apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
package:ubuntu-14.04:
|
||||
image: ubuntu:trusty
|
||||
dependencies:
|
||||
- build:ubuntu-14.04
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1
|
||||
<<: *debpkg_template
|
||||
##
|
||||
## winbuntu the distro for stupid users
|
||||
##
|
||||
|
||||
deploy:ubuntu-14.04:
|
||||
image: ubuntu:trusty
|
||||
dependencies:
|
||||
- package:ubuntu-14.04
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1
|
||||
<<: *debpkg_install
|
||||
# Focal most close to bullseye
|
||||
|
||||
# Xenial
|
||||
|
||||
build:ubuntu-16.04:
|
||||
build:ubuntu-20.04:
|
||||
<<: *build_definition
|
||||
image: ubuntu:xenial
|
||||
image: ubuntu:focal
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
package:ubuntu-16.04:
|
||||
image: ubuntu:xenial
|
||||
dependencies:
|
||||
- build:ubuntu-16.04
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1v5
|
||||
<<: *debpkg_template
|
||||
# Utopic most close to jessie
|
||||
|
||||
deploy:ubuntu-16.04:
|
||||
image: ubuntu:xenial
|
||||
dependencies:
|
||||
- package:ubuntu-16.04
|
||||
variables:
|
||||
LEVELDB_PKG: libleveldb1v5
|
||||
<<: *debpkg_install
|
||||
|
||||
# Yakkety
|
||||
|
||||
#build:ubuntu-16.10:
|
||||
# <<: *build_definition
|
||||
# image: ubuntu:yakkety
|
||||
# before_script:
|
||||
# - apt-get update -y
|
||||
# - apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
#package:ubuntu-16.10:
|
||||
# image: ubuntu:yakkety
|
||||
# dependencies:
|
||||
# - build:ubuntu-16.10
|
||||
# variables:
|
||||
# LEVELDB_PKG: libleveldb1v5
|
||||
# <<: *debpkg_template
|
||||
|
||||
#deploy:ubuntu-16.10:
|
||||
# image: ubuntu:yakkety
|
||||
# dependencies:
|
||||
# - package:ubuntu-16.10
|
||||
# variables:
|
||||
# LEVELDB_PKG: libleveldb1v5
|
||||
# <<: *debpkg_install
|
||||
|
||||
# Zesty
|
||||
|
||||
#build:ubuntu-17.04:
|
||||
# <<: *build_definition
|
||||
# image: ubuntu:zesty
|
||||
# before_script:
|
||||
# - apt-get update -y
|
||||
# - apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
#package:ubuntu-17.04:
|
||||
# image: ubuntu:zesty
|
||||
# dependencies:
|
||||
# - build:ubuntu-17.04
|
||||
# variables:
|
||||
# LEVELDB_PKG: libleveldb1v5
|
||||
# <<: *debpkg_template
|
||||
|
||||
#deploy:ubuntu-17.04:
|
||||
# image: ubuntu:zesty
|
||||
# dependencies:
|
||||
# - package:ubuntu-17.04
|
||||
# variables:
|
||||
# LEVELDB_PKG: libleveldb1v5
|
||||
# <<: *debpkg_install
|
||||
|
||||
##
|
||||
## Fedora
|
||||
##
|
||||
|
||||
build:fedora-24:
|
||||
build:ubuntu-14.10:
|
||||
<<: *build_definition
|
||||
image: fedora:24
|
||||
image: ubuntu:utopic
|
||||
before_script:
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake libcurl* openal* libvorbis* libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel bzip2-libs gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel doxygen spatialindex-devel bzip2-devel
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev
|
||||
|
||||
# Zesty most close to stretch
|
||||
|
||||
build:ubuntu-17.04:
|
||||
<<: *build_definition
|
||||
image: ubuntu:zesty
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu zesty-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
##
|
||||
## Mingw for Windows
|
||||
## Feladora shit distro
|
||||
##
|
||||
|
||||
.generic_win_template: &generic_win_template
|
||||
image: ubuntu:bionic
|
||||
build:fedora-36:
|
||||
<<: *build_definition
|
||||
image: fedora:36
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get install -y wget xz-utils unzip git cmake gettext
|
||||
- wget -q http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
|
||||
- sed -e "s|%PREFIX%|${WIN_ARCH}-w64-mingw32|" -e "s|%ROOTPATH%|/usr/${WIN_ARCH}-w64-mingw32|" < util/travis/toolchain_mingw.cmake.in > ${TOOLCHAIN_OUTPUT}
|
||||
- tar -xaf mingw.tar.xz -C /usr
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake pkgconfig bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
||||
.build_win_template: &build_win_template
|
||||
<<: *generic_win_template
|
||||
stage: build
|
||||
artifacts:
|
||||
when: on_success
|
||||
expire_in: 2h
|
||||
paths:
|
||||
- build/*
|
||||
|
||||
.package_win_template: &package_win_template
|
||||
<<: *generic_win_template
|
||||
stage: package
|
||||
script:
|
||||
- cd build/minetest/_build
|
||||
- make package
|
||||
- cd ../../../
|
||||
- mkdir minetest-win-${WIN_ARCH}
|
||||
- unzip build/minetest/_build/minetest-*-win*.zip -d minetest-win-${WIN_ARCH}
|
||||
- cp /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
|
||||
- cp /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
|
||||
- cp /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
|
||||
artifacts:
|
||||
when: on_success
|
||||
expire_in: 90 day
|
||||
paths:
|
||||
- minetest-win-*/*
|
||||
|
||||
build:win32:
|
||||
<<: *build_win_template
|
||||
script:
|
||||
- ./util/buildbot/buildwin32.sh build
|
||||
variables:
|
||||
NO_PACKAGE: "1"
|
||||
WIN_ARCH: "i686"
|
||||
TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake"
|
||||
|
||||
package:win32:
|
||||
<<: *package_win_template
|
||||
dependencies:
|
||||
- build:win32
|
||||
variables:
|
||||
NO_PACKAGE: "1"
|
||||
WIN_ARCH: "i686"
|
||||
TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake"
|
||||
|
||||
build:win64:
|
||||
<<: *build_win_template
|
||||
script:
|
||||
- ./util/buildbot/buildwin64.sh build
|
||||
variables:
|
||||
NO_PACKAGE: "1"
|
||||
WIN_ARCH: "x86_64"
|
||||
TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake"
|
||||
|
||||
package:win64:
|
||||
<<: *package_win_template
|
||||
dependencies:
|
||||
- build:win64
|
||||
variables:
|
||||
NO_PACKAGE: "1"
|
||||
WIN_ARCH: "x86_64"
|
||||
TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake"
|
||||
|
||||
package:docker:
|
||||
stage: package
|
||||
image: docker:stable
|
||||
services:
|
||||
- docker:dind
|
||||
build:fedora-37:
|
||||
<<: *build_definition
|
||||
image: fedora:37
|
||||
before_script:
|
||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
|
||||
script:
|
||||
- docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
|
||||
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
|
||||
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
|
||||
- docker push ${CONTAINER_IMAGE}/server:latest
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
image: python:3.7
|
||||
before_script:
|
||||
- pip install pip==18.1
|
||||
- pip install git+https://github.com/Python-Markdown/markdown.git
|
||||
- pip install git+https://github.com/mkdocs/mkdocs.git
|
||||
- pip install pygments
|
||||
script:
|
||||
- cd doc/mkdocs && ./build.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake pkgconfig bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "games/minetest"]
|
||||
path = games/minetest
|
||||
url = https://codeberg.org/minenux/minetest-game-minetest.git
|
117
CMakeLists.txt
117
CMakeLists.txt
@ -7,17 +7,55 @@ endif()
|
||||
|
||||
# This can be read from ${PROJECT_NAME} after project() is called
|
||||
project(minetest)
|
||||
set(PROJECT_NAME_CAPITALIZED "Minetest")
|
||||
set(PROJECT_NAME_CAPITALIZED "minetest")
|
||||
|
||||
# Works only for cmake 3.1 and greater
|
||||
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is installed
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
|
||||
else()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
message(STATUS "using gnu compiler and C11/C++11 standars")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
message(STATUS "using clang compiler and C11/C++11 standars")
|
||||
else()
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.0)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(GCC_MINIMUM_VERSION "4.8")
|
||||
set(CLANG_MINIMUM_VERSION "3.4")
|
||||
else()
|
||||
if(APPLE)
|
||||
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
|
||||
if (POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif ()
|
||||
endif ()
|
||||
endif()
|
||||
message(STATUS "using some installed compiler without default C11/C++11 standars")
|
||||
endif()
|
||||
|
||||
set(GCC_MINIMUM_VERSION "4.4")
|
||||
set(CLANG_MINIMUM_VERSION "3.3")
|
||||
|
||||
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 2)
|
||||
set(VERSION_PATCH 0)
|
||||
set(VERSION_PATCH 1)
|
||||
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
|
||||
|
||||
# Change to false for releases
|
||||
@ -75,11 +113,11 @@ if(WIN32)
|
||||
set(EXAMPLE_CONF_DIR ".")
|
||||
set(LOCALEDIR "locale")
|
||||
elseif(APPLE)
|
||||
set(BUNDLE_NAME ${PROJECT_NAME}.app)
|
||||
set(BUNDLE_NAME ${PROJECT_NAME}${VERSION_MAJOR}.app)
|
||||
set(BUNDLE_PATH "${BUNDLE_NAME}")
|
||||
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
|
||||
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
|
||||
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}")
|
||||
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(EXAMPLE_CONF_DIR ${DOCDIR})
|
||||
set(LOCALEDIR "${SHAREDIR}/locale")
|
||||
elseif(UNIX) # Linux, BSD etc
|
||||
@ -88,21 +126,21 @@ elseif(UNIX) # Linux, BSD etc
|
||||
set(BINDIR "bin")
|
||||
set(DOCDIR "doc")
|
||||
set(EXAMPLE_CONF_DIR ".")
|
||||
set(MANDIR "unix/man")
|
||||
set(XDG_APPS_DIR "unix/applications")
|
||||
set(APPDATADIR "unix/metainfo")
|
||||
set(ICONDIR "unix/icons")
|
||||
set(MANDIR "man")
|
||||
set(XDG_APPS_DIR "applications")
|
||||
set(APPDATADIR "metainfo")
|
||||
set(ICONDIR "icons")
|
||||
set(LOCALEDIR "locale")
|
||||
else()
|
||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
|
||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
||||
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
||||
set(EXAMPLE_CONF_DIR ${DOCDIR})
|
||||
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
|
||||
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo")
|
||||
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
|
||||
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/locale")
|
||||
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -164,9 +202,7 @@ if(RUN_IN_PLACE)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game" DESTINATION "${SHAREDIR}/games/"
|
||||
COMPONENT "SUBGAME_MINETEST_GAME" OPTIONAL PATTERN ".git*" EXCLUDE )
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minimal" DESTINATION "${SHAREDIR}/games/"
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/" DESTINATION "${SHAREDIR}/games"
|
||||
COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE )
|
||||
|
||||
if(BUILD_CLIENT)
|
||||
@ -185,20 +221,19 @@ install(FILES "doc/client_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
|
||||
install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
|
||||
install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
|
||||
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
|
||||
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
|
||||
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.conf.example")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
|
||||
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
|
||||
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}")
|
||||
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
|
||||
install(FILES "misc/minetest-xorg-icon-128.png"
|
||||
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
|
||||
RENAME "minetest.png")
|
||||
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.6")
|
||||
install(FILES "doc/minetestserver.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}${VERSION_MAJOR}server.6")
|
||||
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}" RENAME "net.minetest.${PROJECT_NAME}${VERSION_MAJOR}.desktop")
|
||||
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}" RENAME "net.minetest.${PROJECT_NAME}${VERSION_MAJOR}.appdata.xml")
|
||||
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.svg")
|
||||
install(FILES "misc/minetest-xorg-icon-128.png" DESTINATION "${ICONDIR}/hicolor/128x128/apps" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.png")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}")
|
||||
install(FILES "misc/${PROJECT_NAME}-icon.icns" DESTINATION "${SHAREDIR}" RENAME "${PROJECT_NAME}${VERSION_MAJOR}-icon.icns")
|
||||
install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
|
||||
endif()
|
||||
|
||||
@ -207,9 +242,9 @@ find_package(GMP REQUIRED)
|
||||
find_package(Json REQUIRED)
|
||||
find_package(Lua REQUIRED)
|
||||
|
||||
# JsonCPP doesn't compile well on GCC 4.8
|
||||
# JsonCPP doesn't compile well on GCC 4.8 but we use c++11 with gnu standars
|
||||
if(NOT ENABLE_SYSTEM_JSONCPP)
|
||||
set(GCC_MINIMUM_VERSION "4.9")
|
||||
set(GCC_MINIMUM_VERSION "4.6")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
@ -243,12 +278,12 @@ include(CPackComponent)
|
||||
|
||||
cpack_add_component(Docs
|
||||
DISPLAY_NAME "Documentation"
|
||||
DESCRIPTION "Documentation about Minetest and Minetest modding"
|
||||
DESCRIPTION "Documentation about ${PROJECT_NAME}${VERSION_MAJOR} and Minetest modding"
|
||||
)
|
||||
|
||||
cpack_add_component(SUBGAME_MINETEST_GAME
|
||||
DISPLAY_NAME "Minetest Game"
|
||||
DESCRIPTION "The official subgame for the Minetest engine, that can easily extended by mods."
|
||||
DISPLAY_NAME "${PROJECT_NAME}${VERSION_MAJOR} Game"
|
||||
DESCRIPTION "The official subgame for the ${PROJECT_NAME}${VERSION_MAJOR} engine, that can easily extended by mods."
|
||||
GROUP "Subgames"
|
||||
)
|
||||
|
||||
@ -260,7 +295,7 @@ cpack_add_component(SUBGAME_MINIMAL
|
||||
)
|
||||
|
||||
cpack_add_component_group(Subgames
|
||||
DESCRIPTION "Games for the Minetest engine."
|
||||
DESCRIPTION "Games for the ${PROJECT_NAME}${VERSION_MAJOR} engine."
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
@ -269,21 +304,21 @@ if(WIN32)
|
||||
|
||||
if(RUN_IN_PLACE)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win64")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${VERSION_MAJOR}-${VERSION_STRING}-win64")
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${VERSION_MAJOR}-${VERSION_STRING}-win32")
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
|
||||
else()
|
||||
set(CPACK_GENERATOR WIX ZIP)
|
||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_CAPITALIZED}")
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME}${VERSION_MAJOR} "${PROJECT_NAME}${VERSION_MAJOR}")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME}${VERSION_MAJOR})
|
||||
|
||||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/misc/minetest-icon.ico")
|
||||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/misc/${PROJECT_NAME}${VERSION_MAJOR}-icon.ico")
|
||||
# Supported languages can be found at
|
||||
# http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html
|
||||
#set(CPACK_WIX_CULTURES "ar-SA,bg-BG,ca-ES,hr-HR,cs-CZ,da-DK,nl-NL,en-US,et-EE,fi-FI,fr-FR,de-DE")
|
||||
@ -303,10 +338,10 @@ if(WIN32)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${VERSION_MAJOR}-${VERSION_STRING}-osx")
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${VERSION_MAJOR}-${VERSION_STRING}-linux")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
set(CPACK_SOURCE_GENERATOR TGZ)
|
||||
endif()
|
||||
|
20
Dockerfile
20
Dockerfile
@ -3,11 +3,11 @@ FROM debian:stretch
|
||||
USER root
|
||||
RUN apt-get update -y && \
|
||||
apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev \
|
||||
libsqlite3-dev libcurl4-gnutls-dev zlib1g-dev libgmp-dev libjsoncpp-dev git
|
||||
libsqlite3-dev libcurl4-gnutls-dev zlib1g-dev libgmp-dev libjsoncpp-dev libidn11-dev git
|
||||
|
||||
COPY . /usr/src/minetest
|
||||
COPY . /usr/src/minetest5
|
||||
|
||||
RUN mkdir -p /usr/src/minetest/cmakebuild && cd /usr/src/minetest/cmakebuild && \
|
||||
RUN mkdir -p /usr/src/minetest5/cmakebuild && cd /usr/src/minetest5/cmakebuild && \
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE \
|
||||
-DBUILD_SERVER=TRUE \
|
||||
-DBUILD_CLIENT=FALSE \
|
||||
@ -21,21 +21,21 @@ RUN mkdir -p /usr/src/minetest/cmakebuild && cd /usr/src/minetest/cmakebuild &&
|
||||
FROM debian:stretch
|
||||
|
||||
USER root
|
||||
RUN groupadd minetest && useradd -m -g minetest -d /var/lib/minetest minetest && \
|
||||
RUN groupadd minetest5 && useradd -m -g minetest5 -d /var/lib/minetest5 minetest5 && \
|
||||
apt-get update -y && \
|
||||
apt-get -y install libcurl3-gnutls libjsoncpp1 liblua5.1-0 libluajit-5.1-2 libpq5 libsqlite3-0 \
|
||||
libstdc++6 zlib1g libc6 && \
|
||||
apt-get clean && rm -rf /var/cache/apt/archives/* && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /var/lib/minetest
|
||||
WORKDIR /var/lib/minetest5
|
||||
|
||||
COPY --from=0 /usr/local/share/minetest /usr/local/share/minetest
|
||||
COPY --from=0 /usr/local/bin/minetestserver /usr/local/bin/minetestserver
|
||||
COPY --from=0 /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
|
||||
COPY --from=0 /usr/local/share/minetest5 /usr/local/share/minetest5
|
||||
COPY --from=0 /usr/local/bin/minetest5server /usr/local/bin/minetest5server
|
||||
COPY --from=0 /usr/local/share/doc/minetest5/minetest5.conf.example /etc/minetest5/minetest5.conf
|
||||
|
||||
USER minetest
|
||||
USER minetest5
|
||||
|
||||
EXPOSE 30000/udp
|
||||
|
||||
CMD ["/usr/local/bin/minetestserver", "--config", "/etc/minetest/minetest.conf"]
|
||||
CMD ["/usr/local/bin/minetest5server", "--config", "/etc/minetest5/minetest5.conf"]
|
||||
|
181
README.md
181
README.md
@ -1,20 +1,24 @@
|
||||
Minetest
|
||||
========
|
||||
Minetest5
|
||||
=========
|
||||
|
||||
[](https://travis-ci.org/minetest/minetest)
|
||||
[](https://hosted.weblate.org/engage/minetest/?utm_source=widget)
|
||||
[](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
|
||||
|
||||
Minetest is a free open-source voxel game engine with easy modding and game creation.
|
||||
this source is minetest modified up to 5.2 with namespace execution for distros integration with OS's
|
||||
also features the client identification patch to property get rid of cheaters.
|
||||
|
||||
Copyright (C) 2010-2019 Perttu Ahola <celeron55@gmail.com>
|
||||
and contributors (see source file comments and the version control log)
|
||||
|
||||
In case you downloaded the source code
|
||||
--------------------------------------
|
||||
If you downloaded the Minetest Engine source code in which this file is
|
||||
contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/)
|
||||
project too. See its README.txt for more information.
|
||||
|
||||
If you downloaded the **Minetest5 Engine** source code from git, in which this file is
|
||||
contained, you probably want to download the Minetest5 Game at https://codeberg.org/minenux/minetest-game-minetest/src/branch/stable-5.2
|
||||
project too. See its README.md information. Those sources are a little modification of original Minetest.
|
||||
|
||||
For Minetest4 series of same engine please use the respective branch.
|
||||
|
||||
Table of Contents
|
||||
------------------
|
||||
@ -31,15 +35,32 @@ Table of Contents
|
||||
|
||||
Further documentation
|
||||
----------------------
|
||||
- Website: http://minetest.net/
|
||||
- Wiki: http://wiki.minetest.net/
|
||||
- Developer wiki: http://dev.minetest.net/
|
||||
- Forum: http://forum.minetest.net/
|
||||
- GitHub: https://github.com/minetest/minetest/
|
||||
- This sources https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2-namespace
|
||||
- Minetest4 sources https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0-namespace
|
||||
- Wiki of this project (minenux) https://codeberg.org/venenux/venenux-minetest/wiki
|
||||
- Original Minetest Website: http://minetest.org/
|
||||
- Original Minetest Wiki: http://wiki.minetest.org/
|
||||
- Minetest Forum: http://forum.minetest.org/
|
||||
- Original Minetest GitHub: https://github.com/minetest/minetest/
|
||||
- [doc/](doc/) directory of source distribution
|
||||
|
||||
Generals of game
|
||||
----------------
|
||||
|
||||
This is **an engine that can acts as server and client**, it has **two main components**:
|
||||
|
||||
1. the **games** (that contains the mods and definition of how to play) and
|
||||
2. the **world** (that contains the creeated and playable data).
|
||||
|
||||
Paths places of those are in the [Paths](#paths) sections of this file.
|
||||
|
||||
Players used the client role of the program, that joins to a server that can be the same invoked
|
||||
or a remote server, currently many phone clients (apps like minetest that stolen its name)
|
||||
just used those remote servers to play.
|
||||
|
||||
Default controls
|
||||
----------------
|
||||
|
||||
All controls are re-bindable using settings.
|
||||
Some can be changed in the key config dialog in the settings tab.
|
||||
|
||||
@ -83,6 +104,7 @@ Some can be changed in the key config dialog in the settings tab.
|
||||
|
||||
Paths
|
||||
-----
|
||||
|
||||
Locations:
|
||||
|
||||
* `bin` - Compiled binaries
|
||||
@ -91,41 +113,40 @@ Locations:
|
||||
|
||||
Where each location is on each platform:
|
||||
|
||||
* Windows .zip / RUN_IN_PLACE source:
|
||||
* Others OS's / RUN_IN_PLACE source:
|
||||
* `bin` = `bin`
|
||||
* `share` = `.`
|
||||
* `user` = `.`
|
||||
* Windows installed:
|
||||
* `bin` = `C:\Program Files\Minetest\bin (Depends on the install location)`
|
||||
* `share` = `C:\Program Files\Minetest (Depends on the install location)`
|
||||
* `user` = `%APPDATA%\Minetest`
|
||||
* Linux installed:
|
||||
* `bin` = `/usr/bin`
|
||||
* `share` = `/usr/share/minetest`
|
||||
* `user` = `~/.minetest`
|
||||
* `share` = `/usr/share/minetest5`
|
||||
* `user` = `~/.minetest5`
|
||||
* macOS:
|
||||
* `bin` = `Contents/MacOS`
|
||||
* `share` = `Contents/Resources`
|
||||
* `user` = `Contents/User OR ~/Library/Application Support/minetest`
|
||||
* `user` = `Contents/User OR ~/Library/Application Support/minetest5`
|
||||
|
||||
Worlds can be found as separate folders in: `user/worlds/`
|
||||
|
||||
Configuration file
|
||||
------------------
|
||||
|
||||
- Default location:
|
||||
`user/minetest.conf`
|
||||
`user/minetest5.conf`
|
||||
- This file is created by closing Minetest for the first time.
|
||||
- A specific file can be specified on the command line:
|
||||
`--config <path-to-file>`
|
||||
- A run-in-place build will look for the configuration file in
|
||||
`location_of_exe/../minetest.conf` and also `location_of_exe/../../minetest.conf`
|
||||
`location_of_bin/../minetest5.conf` and also `location_of_bin/../../minetest5.conf`
|
||||
|
||||
Command-line options
|
||||
--------------------
|
||||
|
||||
- Use `--help`
|
||||
|
||||
Compiling
|
||||
---------
|
||||
|
||||
### Compiling on GNU/Linux
|
||||
|
||||
#### Dependencies
|
||||
@ -134,7 +155,7 @@ Compiling
|
||||
|------------|---------|------------|
|
||||
| GCC | 4.9+ | Can be replaced with Clang 3.4+ |
|
||||
| CMake | 2.6+ | |
|
||||
| Irrlicht | 1.7.3+ | |
|
||||
| Irrlicht | 1.6.0+ | Custom version recommended, see https://github.com/minetest/irrlicht |
|
||||
| SQLite3 | 3.0+ | |
|
||||
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
|
||||
| GMP | 5.0.0+ | Bundled mini-GMP is used if not present |
|
||||
@ -170,30 +191,30 @@ For Fedora users:
|
||||
|
||||
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
|
||||
|
||||
git clone --depth 1 https://github.com/minetest/minetest.git
|
||||
git clone --recursive https://codeberg.org/minenux/minetest-engine.git minetest
|
||||
cd minetest
|
||||
|
||||
Download minetest_game (otherwise only the "Minimal development test" game is available) using Git:
|
||||
|
||||
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
|
||||
git submodule init && git submodule update --recursive
|
||||
|
||||
Download source, without using Git:
|
||||
|
||||
wget https://github.com/minetest/minetest/archive/master.tar.gz
|
||||
tar xf master.tar.gz
|
||||
cd minetest-master
|
||||
wget https://codeberg.org/minenux/minetest-engine/archive/stable-5.2.tar.gz
|
||||
tar xf stable-5.2.tar.gz
|
||||
cd stable-5.2
|
||||
|
||||
Download minetest_game, without using Git:
|
||||
|
||||
cd games/
|
||||
wget https://github.com/minetest/minetest_game/archive/master.tar.gz
|
||||
tar xf master.tar.gz
|
||||
mv minetest_game-master minetest_game
|
||||
wget https://codeberg.org/minenux/minetest-game-minetest/archive/stable-5.2.tar.gz
|
||||
tar xf stable-5.2.tar.gz
|
||||
mv minetest-game-minetest_stable-5.2 minetest
|
||||
cd ..
|
||||
|
||||
#### Build
|
||||
|
||||
Build a version that runs directly from the source directory:
|
||||
Build a version that runs directly from the source directory there program are:
|
||||
|
||||
cmake . -DRUN_IN_PLACE=TRUE
|
||||
make -j$(nproc)
|
||||
@ -295,90 +316,9 @@ Library specific options:
|
||||
ZLIB_INCLUDE_DIR - Directory that contains zlib.h
|
||||
ZLIB_LIBRARY - Path to libz.a/libz.so/zlib.lib
|
||||
|
||||
### Compiling on Windows
|
||||
|
||||
### Requirements
|
||||
|
||||
- [Visual Studio 2015 or newer](https://visualstudio.microsoft.com)
|
||||
- [CMake](https://cmake.org/download/)
|
||||
- [vcpkg](https://github.com/Microsoft/vcpkg)
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
|
||||
### Compiling and installing the dependencies
|
||||
|
||||
It is highly recommended to use vcpkg as package manager.
|
||||
|
||||
#### a) Using vcpkg to install dependencies
|
||||
|
||||
After you successfully built vcpkg you can easily install the required libraries:
|
||||
```powershell
|
||||
vcpkg install irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit --triplet x64-windows
|
||||
```
|
||||
|
||||
- `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store.
|
||||
- `openal-soft`, `libvorbis` and `libogg` are optional, but required to use sound.
|
||||
- `freetype` is optional, it allows true-type font rendering.
|
||||
- `luajit` is optional, it replaces the integrated Lua interpreter with a faster just-in-time interpreter.
|
||||
|
||||
There are other optional libraries, but they are not tested if they can build and link correctly.
|
||||
|
||||
Use `--triplet` to specify the target triplet, e.g. `x64-windows` or `x86-windows`.
|
||||
|
||||
#### b) Compile the dependencies on your own
|
||||
|
||||
This is outdated and not recommended. Follow the instructions on https://dev.minetest.net/Build_Win32_Minetest_including_all_required_libraries#VS2012_Build
|
||||
|
||||
### Compile Minetest
|
||||
|
||||
#### a) Using the vcpkg toolchain and CMake GUI
|
||||
1. Start up the CMake GUI
|
||||
2. Select **Browse Source...** and select DIR/minetest
|
||||
3. Select **Browse Build...** and select DIR/minetest-build
|
||||
4. Select **Configure**
|
||||
5. Choose the right visual Studio version and target platform. It has to match the version of the installed dependencies
|
||||
6. Choose **Specify toolchain file for cross-compiling**
|
||||
7. Click **Next**
|
||||
8. Select the vcpkg toolchain file e.g. `D:/vcpkg/scripts/buildsystems/vcpkg.cmake`
|
||||
9. Click Finish
|
||||
10. Wait until cmake have generated the cash file
|
||||
11. If there are any errors, solve them and hit **Configure**
|
||||
12. Click **Generate**
|
||||
13. Click **Open Project**
|
||||
14. Compile Minetest inside Visual studio.
|
||||
|
||||
#### b) Using the vcpkg toolchain and the commandline
|
||||
|
||||
Run the following script in PowerShell:
|
||||
|
||||
```powershell
|
||||
cmake . -G"Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=0 -DENABLE_CURSES=0
|
||||
cmake --build . --config Release
|
||||
```
|
||||
Make sure that the right compiler is selected and the path to the vcpkg toolchain is correct.
|
||||
|
||||
#### c) Using your own compiled libraries
|
||||
|
||||
**This is outdated and not recommended**
|
||||
|
||||
Follow the instructions on https://dev.minetest.net/Build_Win32_Minetest_including_all_required_libraries#VS2012_Build
|
||||
|
||||
### Windows Installer using WiX Toolset
|
||||
|
||||
Requirements:
|
||||
* [Visual Studio 2017](https://visualstudio.microsoft.com/)
|
||||
* [WiX Toolset](https://wixtoolset.org/)
|
||||
|
||||
In the Visual Studio 2017 Installer select **Optional Features -> WiX Toolset**.
|
||||
|
||||
Build the binaries as described above, but make sure you unselect `RUN_IN_PLACE`.
|
||||
|
||||
Open the generated project file with Visual Studio. Right-click **Package** and choose **Generate**.
|
||||
It may take some minutes to generate the installer.
|
||||
|
||||
|
||||
Docker
|
||||
------
|
||||
We provide Minetest server Docker images using the GitLab mirror registry.
|
||||
|
||||
Images are built on each commit and available using the following tag scheme:
|
||||
|
||||
@ -404,15 +344,14 @@ You can also host your Minetest server inside a Kubernetes cluster. See our exam
|
||||
|
||||
Version scheme
|
||||
--------------
|
||||
|
||||
We use `major.minor.patch` since 5.0.0-dev. Prior to that we used `0.major.minor`.
|
||||
|
||||
- Major is incremented when the release contains breaking changes, all other
|
||||
numbers are set to 0.
|
||||
- Minor is incremented when the release contains new non-breaking features,
|
||||
patch is set to 0.
|
||||
- Patch is incremented when the release only contains bugfixes and very
|
||||
minor/trivial features considered necessary.
|
||||
In minenux we used `4.minor.patch` for 0.4.X and `5.2.patch` for 5.2.X
|
||||
|
||||
Since 5.0.0-dev and 0.4.17-dev, the dev notation refers to the next release,
|
||||
i.e.: 5.0.0-dev is the development version leading to 5.0.0.
|
||||
Prior to that we used `previous_version-dev`.
|
||||
- Major in minenux is used only to those two releases, until 6.X comes in.
|
||||
- Minor in 4.X will be always "0" cos will be only backported things.
|
||||
- Patch is incremented when release contains bugfixes and veryminor/trivial features.
|
||||
|
||||
In minenux we do not use "-dev" notation, next release is never reached until
|
||||
a new tag. We only backports patchs and push bugfixes, fetures are avoided as possible.
|
||||
|
@ -940,6 +940,9 @@ core.register_chatcommand("ban", {
|
||||
if not core.get_player_by_name(param) then
|
||||
return false, "Player is not online."
|
||||
end
|
||||
if core.is_singleplayer() then
|
||||
return false, "You cannot ban players in singleplayer!"
|
||||
end
|
||||
if not core.ban_player(param) then
|
||||
return false, "Failed to ban player."
|
||||
end
|
||||
|
@ -39,11 +39,24 @@ local function create_world_formspec(dialogdata)
|
||||
local gamepath = game_by_gameidx.path
|
||||
local gameconfig = Settings(gamepath.."/game.conf")
|
||||
|
||||
local allowed_mapgens = (gameconfig:get("allowed_mapgens") or ""):split()
|
||||
for key, value in pairs(allowed_mapgens) do
|
||||
allowed_mapgens[key] = value:trim()
|
||||
end
|
||||
|
||||
local disallowed_mapgens = (gameconfig:get("disallowed_mapgens") or ""):split()
|
||||
for key, value in pairs(disallowed_mapgens) do
|
||||
disallowed_mapgens[key] = value:trim()
|
||||
end
|
||||
|
||||
if #allowed_mapgens > 0 then
|
||||
for i = #mapgens, 1, -1 do
|
||||
if table.indexof(allowed_mapgens, mapgens[i]) == -1 then
|
||||
table.remove(mapgens, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if disallowed_mapgens then
|
||||
for i = #mapgens, 1, -1 do
|
||||
if table.indexof(disallowed_mapgens, mapgens[i]) > 0 then
|
||||
@ -87,11 +100,11 @@ local function create_world_formspec(dialogdata)
|
||||
if #pkgmgr.games == 0 then
|
||||
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
|
||||
fgettext("You have no games installed.") .. "]label[2.25,4.4;" ..
|
||||
fgettext("Download one from minetest.net") .. "]"
|
||||
fgettext("Download one from minetest.org") .. "]"
|
||||
elseif #pkgmgr.games == 1 and pkgmgr.games[1].id == "minimal" then
|
||||
retval = retval .. "box[1.75,4;8.7,1;#ff8800]label[2,4;" ..
|
||||
fgettext("Warning: The minimal development test is meant for developers.") .. "]label[2,4.4;" ..
|
||||
fgettext("Download a game, such as Minetest Game, from minetest.net") .. "]"
|
||||
fgettext("Download a game, such as Minetest Game, from minetest.org") .. "]"
|
||||
end
|
||||
|
||||
return retval
|
||||
|
@ -11,14 +11,14 @@ local minetest_example_header = [[
|
||||
# By default, all the settings are commented and not functional.
|
||||
# Uncomment settings by removing the preceding #.
|
||||
|
||||
# minetest.conf is read by default from:
|
||||
# ../minetest.conf
|
||||
# ../../minetest.conf
|
||||
# minetest5.conf is read by default from:
|
||||
# ../minetest5.conf
|
||||
# ../../minetest5.conf
|
||||
# Any other path can be chosen by passing the path as a parameter
|
||||
# to the program, eg. "minetest.exe --config ../minetest.conf.example".
|
||||
# to the program, eg. "minetest --config ../minetest5.conf.example".
|
||||
|
||||
# Further documentation:
|
||||
# http://wiki.minetest.net/
|
||||
# http://wiki.minetest.org/
|
||||
|
||||
]]
|
||||
|
||||
|
@ -118,7 +118,7 @@ local function init_globals()
|
||||
menudata.worldlist:set_sortmode("alphabetic")
|
||||
|
||||
if not core.settings:get("menu_last_game") then
|
||||
local default_game = core.settings:get("default_game") or "minetest"
|
||||
local default_game = core.settings:get("default_game") or "minetest5"
|
||||
core.settings:set("menu_last_game", default_game)
|
||||
end
|
||||
|
||||
|
@ -107,7 +107,7 @@ function get_mods(path,retval,modpack)
|
||||
-- Read from config
|
||||
toadd.name = name
|
||||
toadd.author = mod_conf.author
|
||||
toadd.release = tonumber(mod_conf.release or "0")
|
||||
toadd.release = tonumber(mod_conf.release or 0)
|
||||
toadd.path = prefix
|
||||
toadd.type = "mod"
|
||||
|
||||
@ -155,7 +155,7 @@ function pkgmgr.get_texture_packs()
|
||||
retval[#retval + 1] = {
|
||||
name = item,
|
||||
author = conf:get("author"),
|
||||
release = tonumber(conf:get("release") or "0"),
|
||||
release = tonumber(conf:get("release") or 0),
|
||||
list_name = name,
|
||||
type = "txp",
|
||||
path = path,
|
||||
|
@ -101,8 +101,8 @@ return {
|
||||
local logofile = defaulttexturedir .. "logo.png"
|
||||
local version = core.get_version()
|
||||
return "image[0.5,1;" .. core.formspec_escape(logofile) .. "]" ..
|
||||
"label[0.5,3.2;" .. version.project .. " " .. version.string .. "]" ..
|
||||
"label[0.5,3.5;http://minetest.net]" ..
|
||||
"label[0.5,3.2;" .. version.project .. " MinenuX fork" .. " " .. version.string .. "]" ..
|
||||
"label[0.5,3.5;http://minetest.org]" ..
|
||||
"tablecolumns[color;text]" ..
|
||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
||||
"table[3.5,-0.25;8.5,6.05;list_credits;" ..
|
||||
|
@ -42,10 +42,10 @@
|
||||
# Flags are always separated by comma without spaces.
|
||||
# - default possible_flags
|
||||
# * noise_params_2d:
|
||||
# Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistance>, <lacunarity>[, <default flags>]
|
||||
# Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistence>, <lacunarity>[, <default flags>]
|
||||
# - default
|
||||
# * noise_params_3d:
|
||||
# Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistance>, <lacunarity>[, <default flags>]
|
||||
# Format is <offset>, <scale>, (<spreadX>, <spreadY>, <spreadZ>), <seed>, <octaves>, <persistence>, <lacunarity>[, <default flags>]
|
||||
# - default
|
||||
# * v3f:
|
||||
# Format is (<X>, <Y>, <Z>)
|
||||
@ -561,9 +561,6 @@ enable_parallax_occlusion (Parallax occlusion) bool false
|
||||
# 1 = relief mapping (slower, more accurate).
|
||||
parallax_occlusion_mode (Parallax occlusion mode) int 1 0 1
|
||||
|
||||
# Strength of parallax.
|
||||
3d_paralax_strength (Parallax occlusion strength) float 0.025
|
||||
|
||||
# Number of parallax occlusion iterations.
|
||||
parallax_occlusion_iterations (Parallax occlusion iterations) int 4
|
||||
|
||||
@ -713,6 +710,9 @@ fall_bobbing_amount (Fall bobbing factor) float 0.03
|
||||
# Note that the interlaced mode requires shaders to be enabled.
|
||||
3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside,crossview,pageflip
|
||||
|
||||
# Strength of 3D mode parallax.
|
||||
3d_paralax_strength (3D mode parallax strength) float 0.025
|
||||
|
||||
# In-game chat console height, between 0.1 (10%) and 1.0 (100%).
|
||||
console_height (Console height) float 0.6 0.1 1.0
|
||||
|
||||
@ -996,16 +996,16 @@ show_debug (Show debug info) bool false
|
||||
[Server / Singleplayer]
|
||||
|
||||
# Name of the server, to be displayed when players join and in the serverlist.
|
||||
server_name (Server name) string Minetest server
|
||||
server_name (Server name) string Minetest5 server
|
||||
|
||||
# Description of server, to be displayed when players join and in the serverlist.
|
||||
server_description (Server description) string mine here
|
||||
|
||||
# Domain name of server, to be displayed in the serverlist.
|
||||
server_address (Server address) string game.minetest.net
|
||||
server_address (Server address) string game.minetest.org
|
||||
|
||||
# Homepage of server, to be displayed in the serverlist.
|
||||
server_url (Server URL) string https://minetest.net
|
||||
server_url (Server URL) string https://minetest.org
|
||||
|
||||
# Automatically report to the serverlist.
|
||||
server_announce (Announce server) bool false
|
||||
@ -1062,7 +1062,7 @@ max_packets_per_iteration (Max. packets per iteration) int 1024
|
||||
|
||||
# Default game when creating a new world.
|
||||
# This will be overridden when creating a world from the main menu.
|
||||
default_game (Default game) string minetest
|
||||
default_game (Default game) string minetest5
|
||||
|
||||
# Message of the day displayed to players connecting.
|
||||
motd (Message of the day) string
|
||||
@ -1149,7 +1149,7 @@ active_object_send_range_blocks (Active object send range) int 4
|
||||
# active block stuff, stated in mapblocks (16 nodes).
|
||||
# In active blocks objects are loaded and ABMs run.
|
||||
# This is also the minimum range in which active objects (mobs) are maintained.
|
||||
# This should be configured together with active_object_range.
|
||||
# This should be configured together with active_object_send_range_blocks.
|
||||
active_block_range (Active block range) int 3
|
||||
|
||||
# From how far blocks are sent to clients, stated in mapblocks (16 nodes).
|
||||
@ -1372,7 +1372,7 @@ name (Player name) string
|
||||
|
||||
# Set the language. Leave empty to use the system language.
|
||||
# A restart is required after changing this.
|
||||
language (Language) enum ,ar,ca,cs,da,de,dv,el,eo,es,et,eu,fil,fr,hu,id,it,ja,ja_KS,jbo,kk,kn,lo,lt,ms,my,nb,nl,nn,pl,pt,pt_BR,ro,ru,sl,sr_Cyrl,sv,sw,th,tr,uk,vi
|
||||
language (Language) enum ,ar,ca,cs,da,de,dv,el,en,eo,es,et,eu,fil,fr,hu,id,it,ja,ja_KS,jbo,kk,kn,lo,lt,ms,my,nb,nl,nn,pl,pt,pt_BR,ro,ru,sl,sr_Cyrl,sv,sw,th,tr,uk,vi
|
||||
|
||||
# Level of logging to be written to debug.txt:
|
||||
# - <nothing> (no logging)
|
||||
@ -2135,3 +2135,12 @@ contentdb_url (ContentDB URL) string https://content.minetest.net
|
||||
# These flags are independent from Minetest versions,
|
||||
# so see a full list at https://content.minetest.net/help/content_flags/
|
||||
contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default
|
||||
|
||||
[venenux]
|
||||
|
||||
# provides rapid dig, but just break the block, still valid pick must be handle
|
||||
# by example you can dig a stone with a wood pick, with this you are able
|
||||
# to dig with one action, but the tool will sufers same as if you dig normally
|
||||
instant_dig (Dig Nodes on punch) bool true
|
||||
|
||||
|
||||
|
@ -25,6 +25,38 @@ const float BS = 10.0;
|
||||
const float fogStart = FOG_START;
|
||||
const float fogShadingParameter = 1 / ( 1 - fogStart);
|
||||
|
||||
#ifdef ENABLE_TONE_MAPPING
|
||||
|
||||
/* Hable's UC2 Tone mapping parameters
|
||||
A = 0.22;
|
||||
B = 0.30;
|
||||
C = 0.10;
|
||||
D = 0.20;
|
||||
E = 0.01;
|
||||
F = 0.30;
|
||||
W = 11.2;
|
||||
equation used: ((x * (A * x + C * B) + D * E) / (x * (A * x + B) + D * F)) - E / F
|
||||
*/
|
||||
|
||||
vec3 uncharted2Tonemap(vec3 x)
|
||||
{
|
||||
return ((x * (0.22 * x + 0.03) + 0.002) / (x * (0.22 * x + 0.3) + 0.06)) - 0.03333;
|
||||
}
|
||||
|
||||
vec4 applyToneMapping(vec4 color)
|
||||
{
|
||||
color = vec4(pow(color.rgb, vec3(2.2)), color.a);
|
||||
const float gamma = 1.6;
|
||||
const float exposureBias = 5.5;
|
||||
color.rgb = uncharted2Tonemap(exposureBias * color.rgb);
|
||||
// Precalculated white_scale from
|
||||
//vec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W));
|
||||
vec3 whiteScale = vec3(1.036015346);
|
||||
color.rgb *= whiteScale;
|
||||
return vec4(pow(color.rgb, vec3(1.0 / gamma)), color.a);
|
||||
}
|
||||
#endif
|
||||
|
||||
void get_texture_flags()
|
||||
{
|
||||
vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0));
|
||||
@ -114,6 +146,11 @@ void main(void)
|
||||
vec4 col = vec4(color.rgb, base.a);
|
||||
|
||||
col.rgb *= emissiveColor.rgb * vIDiff;
|
||||
|
||||
#ifdef ENABLE_TONE_MAPPING
|
||||
col = applyToneMapping(col);
|
||||
#endif
|
||||
|
||||
// Due to a bug in some (older ?) graphics stacks (possibly in the glsl compiler ?),
|
||||
// the fog will only be rendered correctly if the last operation before the
|
||||
// clamp() is an addition. Else, the clamp() seems to be ignored.
|
||||
|
@ -55,10 +55,10 @@ endif(WIN32)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GetText DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})
|
||||
find_package_handle_standard_args(GettextLib DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})
|
||||
|
||||
|
||||
if(GETTEXT_FOUND)
|
||||
if(GETTEXTLIB_FOUND)
|
||||
# BSD variants require special linkage as they don't use glibc
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
|
||||
set(GETTEXT_LIBRARY "intl")
|
||||
|
@ -11,14 +11,14 @@ if(ENABLE_SYSTEM_JSONCPP)
|
||||
find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Json DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)
|
||||
|
||||
if(JSONCPP_FOUND)
|
||||
if(JSON_FOUND)
|
||||
message(STATUS "Using system JSONCPP library.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT JSONCPP_FOUND)
|
||||
if(NOT JSON_FOUND)
|
||||
message(STATUS "Using bundled JSONCPP library.")
|
||||
set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jsoncpp)
|
||||
set(JSON_LIBRARY jsoncpp)
|
||||
|
@ -6,56 +6,16 @@
|
||||
#
|
||||
# This module is similar to FindLua51.cmake except that it finds LuaJit instead.
|
||||
|
||||
FIND_PATH(LUA_INCLUDE_DIR luajit.h
|
||||
HINTS
|
||||
$ENV{LUA_DIR}
|
||||
PATH_SUFFIXES include/luajit-2.1 include/luajit-2.0 include/luajit-5_1-2.1 include/luajit-5_1-2.0 include luajit
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
)
|
||||
|
||||
# Test if running on vcpkg toolchain
|
||||
if(DEFINED VCPKG_TARGET_TRIPLET AND DEFINED VCPKG_APPLOCAL_DEPS)
|
||||
# On vcpkg luajit is 'lua51' and normal lua is 'lua'
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES lua51
|
||||
HINTS
|
||||
$ENV{LUA_DIR}
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
else()
|
||||
FIND_LIBRARY(LUA_LIBRARY
|
||||
NAMES luajit-5.1
|
||||
HINTS
|
||||
$ENV{LUA_DIR}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/luajit.h")
|
||||
FILE(STRINGS "${LUA_INCLUDE_DIR}/luajit.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"LuaJIT .+\"")
|
||||
|
||||
STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||
UNSET(lua_version_str)
|
||||
ENDIF()
|
||||
find_package (PkgConfig REQUIRED)
|
||||
pkg_check_modules (LuaJIT QUIET REQUIRED luajit)
|
||||
set (LUA_LIBRARY ${LuaJIT_LIBRARIES})
|
||||
set (LUA_INCLUDE_DIR ${LuaJIT_INCLUDE_DIRS})
|
||||
set (LUA_VERSION_STRING ${LuaJIT_VERSION})
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT
|
||||
REQUIRED_VARS LUA_LIBRARY LUA_INCLUDE_DIR
|
||||
VERSION_VAR LUA_VERSION_STRING)
|
||||
|
||||
|
@ -20,13 +20,13 @@ if(NOT GP2XWIZ)
|
||||
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
||||
# to TRUE if all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
||||
find_package_handle_standard_args(Vorbis DEFAULT_MSG
|
||||
OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
|
||||
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
|
||||
else(NOT GP2XWIZ)
|
||||
find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis_dec)
|
||||
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
||||
find_package_handle_standard_args(Vorbis DEFAULT_MSG
|
||||
VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
|
||||
endif(NOT GP2XWIZ)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
Minetest Lua Client Modding API Reference 5.2.0
|
||||
================================================
|
||||
* More information at <http://www.minetest.net/>
|
||||
* Developer Wiki: <http://dev.minetest.net/>
|
||||
* More information at <http://www.minetest.org/>
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
@ -1,8 +1,7 @@
|
||||
Minetest Lua Modding API Reference
|
||||
==================================
|
||||
|
||||
* More information at <http://www.minetest.net/>
|
||||
* Developer Wiki: <http://dev.minetest.net/>
|
||||
* More information at <http://www.minetest.org/>
|
||||
* (Unofficial) Minetest Modding Book by rubenwardy: <https://rubenwardy.com/minetest_modding_book/>
|
||||
|
||||
Introduction
|
||||
@ -64,9 +63,17 @@ The game directory can contain the following files:
|
||||
* `game.conf`, with the following keys:
|
||||
* `name`: Required, human readable name e.g. `name = Minetest`
|
||||
* `description`: Short description to be shown in the content tab
|
||||
* `allowed_mapgens = <comma-separated mapgens>`
|
||||
e.g. `allowed_mapgens = v5,v6,flat`
|
||||
Mapgens not in this list are removed from the list of mapgens for
|
||||
the game.
|
||||
If not specified, all mapgens are allowed.
|
||||
* `disallowed_mapgens = <comma-separated mapgens>`
|
||||
e.g. `disallowed_mapgens = v5,v6,flat`
|
||||
These mapgens are removed from the list of mapgens for the game.
|
||||
When both `allowed_mapgens` and `disallowed_mapgens` are
|
||||
specified, `allowed_mapgens` is applied before
|
||||
`disallowed_mapgens`.
|
||||
* `minetest.conf`:
|
||||
Used to set default settings when running this game.
|
||||
* `settingtypes.txt`:
|
||||
@ -1010,22 +1017,24 @@ The function of `param2` is determined by `paramtype2` in node definition.
|
||||
* Values range 0 - 179. The value stored in `param2` is multiplied by two to
|
||||
get the actual rotation in degrees of the node.
|
||||
* `paramtype2 = "meshoptions"`
|
||||
* Only valid for "plantlike" drawtype. The value of `param2` becomes a
|
||||
bitfield which can be used to change how the client draws plantlike nodes.
|
||||
* Bits 0, 1 and 2 form a mesh selector.
|
||||
Currently the following meshes are choosable:
|
||||
* Only valid for "plantlike" drawtype. `param2` encodes the shape and
|
||||
optional modifiers of the "plant". `param2` is a bitfield.
|
||||
* Bits 0 to 2 select the shape.
|
||||
Use only one of the values below:
|
||||
* 0 = a "x" shaped plant (ordinary plant)
|
||||
* 1 = a "+" shaped plant (just rotated 45 degrees)
|
||||
* 2 = a "*" shaped plant with 3 faces instead of 2
|
||||
* 3 = a "#" shaped plant with 4 faces instead of 2
|
||||
* 4 = a "#" shaped plant with 4 faces that lean outwards
|
||||
* 5-7 are unused and reserved for future meshes.
|
||||
* Bits 3 through 7 are optional flags that can be combined and give these
|
||||
effects:
|
||||
* bit 3 (0x08) - Makes the plant slightly vary placement horizontally
|
||||
* bit 4 (0x10) - Makes the plant mesh 1.4x larger
|
||||
* bit 5 (0x20) - Moves each face randomly a small bit down (1/8 max)
|
||||
* bits 6-7 are reserved for future use.
|
||||
* Bits 3 to 7 are used to enable any number of optional modifiers.
|
||||
Just add the corresponding value(s) below to `param2`:
|
||||
* 8 - Makes the plant slightly vary placement horizontally
|
||||
* 16 - Makes the plant mesh 1.4x larger
|
||||
* 32 - Moves each face randomly a small bit down (1/8 max)
|
||||
* values 64 and 128 (bits 6-7) are reserved for future use.
|
||||
* Example: `param2 = 0` selects a normal "x" shaped plant
|
||||
* Example: `param2 = 17` selects a "+" shaped plant, 1.4x larger (1+16)
|
||||
* `paramtype2 = "color"`
|
||||
* `param2` tells which color is picked from the palette.
|
||||
The palette should have 256 pixels.
|
||||
@ -2332,8 +2341,8 @@ Elements
|
||||
* `name` fieldname data is transferred to Lua
|
||||
* `caption 1`...: name shown on top of tab
|
||||
* `current_tab`: index of selected tab 1...
|
||||
* `transparent` (optional): show transparent
|
||||
* `draw_border` (optional): draw border
|
||||
* `transparent` (optional): if true, tabs are semi-transparent
|
||||
* `draw_border` (optional): if true, draw a thin line at tab base
|
||||
|
||||
### `tabheader[<X>,<Y>;<H>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]`
|
||||
|
||||
@ -4073,14 +4082,15 @@ Utilities
|
||||
connection_uptime = 200, -- seconds since client connected
|
||||
protocol_version = 32, -- protocol version used by client
|
||||
formspec_version = 2, -- supported formspec version
|
||||
-- following information is available on debug build only!!!
|
||||
-- DO NOT USE IN MODS
|
||||
--ser_vers = 26, -- serialization version used by client
|
||||
--major = 0, -- major version number
|
||||
--minor = 4, -- minor version number
|
||||
--patch = 10, -- patch version number
|
||||
--vers_string = "0.4.9-git", -- full version string
|
||||
--state = "Active" -- current client state
|
||||
-- following information is available on minenux only build. dont assume in mods
|
||||
serialization_version = 26, -- serialization version used by client
|
||||
major = 5, -- major version number
|
||||
minor = 2, -- minor version number
|
||||
patch = 1, -- patch version number
|
||||
version_string = "5.2.1", -- full version string (or maybe version_string)
|
||||
platform = "Linux", -- as PLATFORM variable
|
||||
sysinfo = "Linux/2.6.32 x86",
|
||||
state = "Active" -- current client state
|
||||
}
|
||||
|
||||
* `minetest.mkdir(path)`: returns success.
|
||||
@ -5403,8 +5413,8 @@ Misc.
|
||||
insecure functions if the calling mod has been listed as trusted in the
|
||||
`secure.trusted_mods` setting or security is disabled, otherwise returns
|
||||
`nil`.
|
||||
* Only works at init time and must be called from the mod's main scope (not
|
||||
from a function).
|
||||
* Only works at init time and must be called from the mod's main scope
|
||||
(ie: the init.lua of the mod, not from another Lua file or within a function).
|
||||
* **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE
|
||||
IT IN A LOCAL VARIABLE!**
|
||||
|
||||
@ -7020,6 +7030,7 @@ Used by `minetest.register_node`.
|
||||
-- node is deleted from the world or the drops are added. This is
|
||||
-- generally the result of either the node being dug or an attached node
|
||||
-- becoming detached.
|
||||
-- oldmeta is the NodeMetaRef of the oldnode before deletion.
|
||||
-- drops is a table of ItemStacks, so any metadata to be preserved can
|
||||
-- be added directly to one or more of the dropped items. See
|
||||
-- "ItemStackMetaRef".
|
||||
@ -7044,10 +7055,14 @@ Used by `minetest.register_node`.
|
||||
|
||||
on_punch = function(pos, node, puncher, pointed_thing),
|
||||
-- default: minetest.node_punch
|
||||
-- Called when puncher (an ObjectRef) punches the node at pos.
|
||||
-- By default calls minetest.register_on_punchnode callbacks.
|
||||
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing),
|
||||
-- default: nil
|
||||
-- Called when clicker (an ObjectRef) "rightclicks"
|
||||
-- ("rightclick" here stands for the placement key) while pointing at
|
||||
-- the node at pos with 'node' being the node table.
|
||||
-- itemstack will hold clicker's wielded item.
|
||||
-- Shall return the leftover itemstack.
|
||||
-- Note: pointed_thing can be nil, if a mod calls this function.
|
||||
|
@ -1,21 +1,21 @@
|
||||
.TH minetest 6 "2 February 2019" "" ""
|
||||
.TH minetest5 6 "2 February 2019" "" ""
|
||||
|
||||
.SH NAME
|
||||
minetest, minetestserver \- Multiplayer infinite-world block sandbox
|
||||
minetest5, minetest5server \- Multiplayer infinite-world block sandbox
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B minetest
|
||||
.B minetest5
|
||||
[\fB--server SERVER OPTIONS\fR | \fBCLIENT OPTIONS\fR]
|
||||
[\fBCOMMON OPTIONS\fR]
|
||||
[\fBWORLD PATH\fR]
|
||||
|
||||
.B minetestserver
|
||||
.B minetest5server
|
||||
[\fBSERVER OPTIONS\fR]
|
||||
[\fBCOMMON OPTIONS\fR]
|
||||
[\fBWORLD PATH\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B Minetest is one of the first InfiniMiner/Minecraft(/whatever) inspired games
|
||||
.B minetest5 is one of the first InfiniMiner/Minecraft(/whatever) inspired games
|
||||
(started October 2010), with a goal of taking the survival multiplayer gameplay
|
||||
in a slightly different direction.
|
||||
.PP
|
||||
@ -121,7 +121,7 @@ Display an interactive terminal over ncurses during execution.
|
||||
Colon delimited list of directories to search for games.
|
||||
|
||||
.SH BUGS
|
||||
Please report all bugs at https://github.com/minetest/minetest/issues.
|
||||
Please report all bugs at https://github.com/minenux/minetest-engine-minetest/issues.
|
||||
|
||||
.SH AUTHOR
|
||||
.PP
|
||||
@ -131,4 +131,4 @@ This man page was originally written by
|
||||
Juhani Numminen <juhaninumminen0@gmail.com>.
|
||||
|
||||
.SH WWW
|
||||
http://www.minetest.net/
|
||||
http://www.minetest.org/
|
||||
|
@ -1,2 +1,2 @@
|
||||
.so man6/minetest.6
|
||||
.so man6/minetest5.6
|
||||
|
||||
|
1
games/minetest
Submodule
1
games/minetest
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit ac2dd7e3e5928bba584419718010ffbcfc3d1401
|
@ -62,16 +62,52 @@ endif(LUA_ANSI)
|
||||
# COMMON_CFLAGS has no effect without this line
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_CFLAGS}")
|
||||
|
||||
|
||||
# Standard flags to use for each build type.
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wextra -Wshadow -W -pedantic -std=gnu99")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g")
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -O1 -g")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 -g")
|
||||
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is ins
|
||||
talled
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
|
||||
else()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wextra -Wshadow -W -pedantic ")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 ${CMAKE_C_FLAGS} ")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} -O0 -g")
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} -O1 -g")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 ${CMAKE_C_FLAGS} -g")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} ")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} ")
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} ")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} ")
|
||||
else()
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.0)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
else()
|
||||
if(APPLE)
|
||||
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
|
||||
if (POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif ()
|
||||
endif ()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(src build)
|
||||
|
||||
|
@ -73,7 +73,7 @@ static void *ll_load (lua_State *L, const char *path) {
|
||||
|
||||
|
||||
static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
|
||||
lua_CFunction f = (lua_CFunction)dlsym(lib, sym);
|
||||
lua_CFunction f = __extension__(lua_CFunction)dlsym(lib, sym);
|
||||
if (f == NULL) lua_pushstring(L, dlerror());
|
||||
return f;
|
||||
}
|
||||
|
@ -4,13 +4,13 @@
|
||||
# Uncomment settings by removing the preceding #.
|
||||
|
||||
# minetest.conf is read by default from:
|
||||
# ../minetest.conf
|
||||
# ../../minetest.conf
|
||||
# ../minetest5.conf
|
||||
# ../../minetest5.conf
|
||||
# Any other path can be chosen by passing the path as a parameter
|
||||
# to the program, eg. "minetest.exe --config ../minetest.conf.example".
|
||||
# to the program, eg. "minetest --config ../minetest5.conf.example".
|
||||
|
||||
# Further documentation:
|
||||
# http://wiki.minetest.net/
|
||||
# http://wiki.minetest.org/
|
||||
|
||||
#
|
||||
# Controls
|
||||
@ -1191,7 +1191,7 @@
|
||||
|
||||
# Name of the server, to be displayed when players join and in the serverlist.
|
||||
# type: string
|
||||
# server_name = Minetest server
|
||||
server_name = Minetest5 server
|
||||
|
||||
# Description of server, to be displayed when players join and in the serverlist.
|
||||
# type: string
|
||||
@ -1199,11 +1199,11 @@
|
||||
|
||||
# Domain name of server, to be displayed in the serverlist.
|
||||
# type: string
|
||||
# server_address = game.minetest.net
|
||||
# server_address = game.minetest.org
|
||||
|
||||
# Homepage of server, to be displayed in the serverlist.
|
||||
# type: string
|
||||
# server_url = https://minetest.net
|
||||
# server_url = https://minetest.org
|
||||
|
||||
# Automatically report to the serverlist.
|
||||
# type: bool
|
||||
@ -1211,7 +1211,7 @@
|
||||
|
||||
# Announce to this serverlist.
|
||||
# type: string
|
||||
# serverlist_url = servers.minetest.net
|
||||
# serverlist_url = servers.minetest.org
|
||||
|
||||
# Remove color codes from incoming chat messages
|
||||
# Use this to stop players from being able to use color in their messages
|
||||
@ -1272,7 +1272,7 @@
|
||||
# Default game when creating a new world.
|
||||
# This will be overridden when creating a world from the main menu.
|
||||
# type: string
|
||||
# default_game = minetest
|
||||
default_game = minetest5
|
||||
|
||||
# Message of the day displayed to players connecting.
|
||||
# type: string
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>net.minetest.minetest.desktop</id>
|
||||
<id>net.minetest.minetest5.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>LGPL-2.1+ and CC-BY-SA-3.0 and MIT and Apache-2.0</project_license>
|
||||
<content_rating type="oars-1.0">
|
||||
@ -9,20 +9,20 @@
|
||||
<content_attribute id="social-chat">intense</content_attribute>
|
||||
<content_attribute id="social-info">mild</content_attribute>
|
||||
</content_rating>
|
||||
<name>Minetest</name>
|
||||
<name>minetest5</name>
|
||||
<summary>Multiplayer infinite-world block sandbox game</summary>
|
||||
<description>
|
||||
<p>
|
||||
Minetest is an infinite-world block sandbox game and game engine.
|
||||
minetest5 is an infinite-world block sandbox game and game engine.
|
||||
</p><p>
|
||||
Players can create and destroy various types of blocks in a
|
||||
three-dimensional open world. This allows forming structures in
|
||||
every possible creation, on multiplayer servers or in singleplayer.
|
||||
</p><p>
|
||||
Minetest is designed to be simple, stable, and portable.
|
||||
minetest5 is designed to be simple, stable, and portable.
|
||||
It is lightweight enough to run on fairly old hardware.
|
||||
</p><p>
|
||||
Minetest has many features, including:
|
||||
minetest5 has many features, including:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Ability to walk around, dig, and build in a near-infinite voxel world</li>
|
||||
@ -33,34 +33,20 @@
|
||||
<li>Beautiful lightning-fast map generator</li>
|
||||
</ul>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image width="1920" height="1080">http://www.minetest.net/media/gallery/1.jpg</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image width="1920" height="1080">http://www.minetest.net/media/gallery/3.jpg</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image width="1920" height="1080">http://www.minetest.net/media/gallery/5.jpg</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<keywords>
|
||||
<keyword>sandbox</keyword>
|
||||
<keyword>world</keyword>
|
||||
<keyword>mining</keyword>
|
||||
<keyword>multiplayer</keyword>
|
||||
</keywords>
|
||||
<url type="homepage">http://minetest.net</url>
|
||||
<url type="bugtracker">http://www.minetest.net/development/#reporting-issues</url>
|
||||
<url type="homepage">http://minetest.org</url>
|
||||
<url type="bugtracker">https://codeberg.org/minenux/minetest-engine-minetest/issues</url>
|
||||
<url type="translate">http://dev.minetest.net/Translation</url>
|
||||
<url type="donation">http://www.minetest.net/development/#donate</url>
|
||||
<url type="faq">http://wiki.minetest.net/FAQ</url>
|
||||
<url type="help">http://wiki.minetest.net</url>
|
||||
<url type="donation">https://paypalme/mckaygerhard</url>
|
||||
<url type="help">https://t.me/venenux_minetest</url>
|
||||
<provides>
|
||||
<binary>minetest</binary>
|
||||
<binary>minetest5</binary>
|
||||
</provides>
|
||||
<translation type="gettext">minetest</translation>
|
||||
<update_contact>sfan5@live.de</update_contact>
|
||||
<releases>
|
||||
<release date="2020-04-05" version="5.2.0"/>
|
||||
</releases>
|
||||
|
@ -1,6 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Name=Minetest
|
||||
GenericName=Minetest
|
||||
Name=minetest5
|
||||
GenericName=minetest5
|
||||
Comment=Multiplayer infinite-world block sandbox
|
||||
Comment[de]=Mehrspieler-Sandkastenspiel mit unendlichen Blockwelten
|
||||
Comment[es]=Juego sandbox multijugador con mundos infinitos
|
||||
@ -8,8 +8,8 @@ Comment[fr]=Jeu multijoueurs de type bac à sable avec des mondes infinis
|
||||
Comment[ja]=マルチプレイに対応した、無限の世界のブロック型サンドボックスゲームです
|
||||
Comment[ru]=Игра-песочница с безграничным миром, состоящим из блоков
|
||||
Comment[tr]=Tek-Çok oyuncuyla küplerden sonsuz dünyalar inşa et
|
||||
Exec=minetest
|
||||
Icon=minetest
|
||||
Exec=minetest5
|
||||
Icon=minetest5
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Game;Simulation;
|
||||
|
@ -38,7 +38,7 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", ""
|
||||
VALUE "Comments", "VenenuX powered"
|
||||
VALUE "CompanyName", PROJECT_NAME_C " community"
|
||||
VALUE "FileDescription", PROJECT_NAME_C " engine"
|
||||
VALUE "FileVersion", VERSION_STRING
|
||||
|
@ -62,7 +62,7 @@ set(USE_GETTEXT FALSE)
|
||||
|
||||
if(ENABLE_GETTEXT)
|
||||
find_package(GettextLib)
|
||||
if(GETTEXT_FOUND)
|
||||
if(GETTEXTLIB_FOUND)
|
||||
if(WIN32)
|
||||
message(STATUS "GetText library: ${GETTEXT_LIBRARY}")
|
||||
message(STATUS "GetText DLL: ${GETTEXT_DLL}")
|
||||
@ -70,7 +70,15 @@ if(ENABLE_GETTEXT)
|
||||
endif()
|
||||
set(USE_GETTEXT TRUE)
|
||||
message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
|
||||
endif(GETTEXT_FOUND)
|
||||
# On some platforms, such as Linux with GNU libc, the gettext
|
||||
# functions are present in the C standard library and libintl
|
||||
# is not required. For other libc (uClibc-ng or musl or older debians)
|
||||
# libintl may be required.
|
||||
find_package(Intl)
|
||||
if(NOT Intl_LIBRARIES STREQUAL "")
|
||||
message(STATUS "GetText Intl : ${Intl_LIBRARIES}")
|
||||
endif()
|
||||
endif(GETTEXTLIB_FOUND)
|
||||
else()
|
||||
mark_as_advanced(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
|
||||
message(STATUS "GetText disabled.")
|
||||
@ -170,7 +178,16 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
|
||||
set(USE_POSTGRESQL FALSE)
|
||||
|
||||
if(ENABLE_POSTGRESQL)
|
||||
find_package("PostgreSQL")
|
||||
if(CMAKE_VERSION VERSION_LESS "3.20")
|
||||
find_package(PostgreSQL QUIET)
|
||||
# Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes
|
||||
# but we don't need them, so continue anyway if only those are missing.
|
||||
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
|
||||
set(PostgreSQL_FOUND TRUE)
|
||||
endif()
|
||||
else()
|
||||
find_package(PostgreSQL)
|
||||
endif()
|
||||
|
||||
if(PostgreSQL_FOUND)
|
||||
set(USE_POSTGRESQL TRUE)
|
||||
@ -523,10 +540,10 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
|
||||
|
||||
|
||||
if(BUILD_CLIENT)
|
||||
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})
|
||||
add_dependencies(${PROJECT_NAME} GenerateVersion)
|
||||
add_executable(${PROJECT_NAME}${VERSION_MAJOR} ${client_SRCS} ${extra_windows_SRCS})
|
||||
add_dependencies(${PROJECT_NAME}${VERSION_MAJOR} GenerateVersion)
|
||||
set(client_LIBS
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${ZLIB_LIBRARIES}
|
||||
${IRRLICHT_LIBRARY}
|
||||
${JPEG_LIBRARIES}
|
||||
@ -546,63 +563,64 @@ if(BUILD_CLIENT)
|
||||
)
|
||||
if(ENABLE_GLES)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${OPENGLES2_LIBRARIES}
|
||||
${EGL_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
if(USE_GETTEXT)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${Intl_LIBRARIES}
|
||||
${GETTEXT_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
if(USE_CURL)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${CURL_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
if(USE_FREETYPE)
|
||||
if(FREETYPE_PKGCONFIG_FOUND)
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
set_target_properties(${PROJECT_NAME}${VERSION_MAJOR}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}"
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
${PROJECT_NAME}${VERSION_MAJOR}
|
||||
${FREETYPE_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
if (USE_CURSES)
|
||||
target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${CURSES_LIBRARIES})
|
||||
endif()
|
||||
if (USE_POSTGRESQL)
|
||||
target_link_libraries(${PROJECT_NAME} ${PostgreSQL_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${PostgreSQL_LIBRARIES})
|
||||
endif()
|
||||
if (USE_LEVELDB)
|
||||
target_link_libraries(${PROJECT_NAME} ${LEVELDB_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${LEVELDB_LIBRARY})
|
||||
endif()
|
||||
if (USE_REDIS)
|
||||
target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${REDIS_LIBRARY})
|
||||
endif()
|
||||
if (USE_SPATIAL)
|
||||
target_link_libraries(${PROJECT_NAME} ${SPATIAL_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${SPATIAL_LIBRARY})
|
||||
endif()
|
||||
endif(BUILD_CLIENT)
|
||||
|
||||
|
||||
if(BUILD_SERVER)
|
||||
add_executable(${PROJECT_NAME}server ${server_SRCS} ${extra_windows_SRCS})
|
||||
add_dependencies(${PROJECT_NAME}server GenerateVersion)
|
||||
add_executable(${PROJECT_NAME}${VERSION_MAJOR}server ${server_SRCS} ${extra_windows_SRCS})
|
||||
add_dependencies(${PROJECT_NAME}${VERSION_MAJOR}server GenerateVersion)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}server
|
||||
${PROJECT_NAME}${VERSION_MAJOR}server
|
||||
${ZLIB_LIBRARIES}
|
||||
${SQLITE3_LIBRARY}
|
||||
${JSON_LIBRARY}
|
||||
@ -610,31 +628,28 @@ if(BUILD_SERVER)
|
||||
${GMP_LIBRARY}
|
||||
${PLATFORM_LIBS}
|
||||
)
|
||||
set_target_properties(${PROJECT_NAME}server PROPERTIES
|
||||
set_target_properties(${PROJECT_NAME}${VERSION_MAJOR}server PROPERTIES
|
||||
COMPILE_DEFINITIONS "SERVER")
|
||||
if (USE_GETTEXT)
|
||||
target_link_libraries(${PROJECT_NAME}server ${GETTEXT_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${Intl_LIBRARIES} ${GETTEXT_LIBRARY})
|
||||
endif()
|
||||
if (USE_CURSES)
|
||||
target_link_libraries(${PROJECT_NAME}server ${CURSES_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${CURSES_LIBRARIES})
|
||||
endif()
|
||||
if (USE_POSTGRESQL)
|
||||
target_link_libraries(${PROJECT_NAME}server ${PostgreSQL_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${PostgreSQL_LIBRARIES})
|
||||
endif()
|
||||
if (USE_LEVELDB)
|
||||
target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${LEVELDB_LIBRARY})
|
||||
endif()
|
||||
if (USE_REDIS)
|
||||
target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${REDIS_LIBRARY})
|
||||
endif()
|
||||
if (USE_SPATIAL)
|
||||
target_link_libraries(${PROJECT_NAME}server ${SPATIAL_LIBRARY})
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${SPATIAL_LIBRARY})
|
||||
endif()
|
||||
if(USE_CURL)
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}server
|
||||
${CURL_LIBRARY}
|
||||
)
|
||||
target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${CURL_LIBRARY})
|
||||
endif()
|
||||
endif(BUILD_SERVER)
|
||||
|
||||
@ -647,9 +662,9 @@ set(GETTEXT_BLACKLISTED_LOCALES
|
||||
ky
|
||||
)
|
||||
|
||||
option(APPLY_LOCALE_BLACKLIST "Use a blacklist to avoid broken locales" TRUE)
|
||||
option(APPLY_LOCALE_BLACKLIST "Use a blacklist to avoid known broken locales" TRUE)
|
||||
|
||||
if (GETTEXT_FOUND AND APPLY_LOCALE_BLACKLIST)
|
||||
if (GETTEXTLIB_FOUND AND APPLY_LOCALE_BLACKLIST)
|
||||
set(GETTEXT_USED_LOCALES "")
|
||||
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
|
||||
if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};")
|
||||
@ -657,11 +672,13 @@ if (GETTEXT_FOUND AND APPLY_LOCALE_BLACKLIST)
|
||||
endif()
|
||||
endforeach()
|
||||
message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}")
|
||||
elseif (GETTEXTLIB_FOUND)
|
||||
set(GETTEXT_USED_LOCALES ${GETTEXT_AVAILABLE_LOCALES})
|
||||
endif()
|
||||
|
||||
# Set some optimizations and tweaks
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
if(MSVC)
|
||||
# Visual Studio
|
||||
@ -689,19 +706,73 @@ if(MSVC)
|
||||
set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MD")
|
||||
else()
|
||||
# GCC or compatible compilers such as Clang
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is installed
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
elseif (CMAKE_C_COMPILER_VERSION VERSION_EQUAL 4.6)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu1x")
|
||||
else()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
message(STATUS "using gnu compiler")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1y")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
endif()
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
message(STATUS "using clang compiler")
|
||||
else()
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.0)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
else()
|
||||
if(APPLE)
|
||||
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
|
||||
if (POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif ()
|
||||
endif ()
|
||||
endif()
|
||||
message(STATUS "using default installed compiler")
|
||||
endif()
|
||||
|
||||
if(WARN_ALL)
|
||||
set(RELEASE_WARNING_FLAGS "-Wall")
|
||||
else()
|
||||
set(RELEASE_WARNING_FLAGS "")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare")
|
||||
endif()
|
||||
|
||||
if(APPLE AND USE_LUAJIT)
|
||||
# required per http://luajit.org/install.html
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
||||
elseif(UNIX AND USE_LUAJIT)
|
||||
check_c_source_compiles("#ifndef __aarch64__\n#error\n#endif\nint main(){}" IS_AARCH64)
|
||||
if(IS_AARCH64)
|
||||
# Move text segment below LuaJIT's 47-bit limit (see issue #9367)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
# FreeBSD uses lld, and lld does not support -Ttext-segment, suggesting
|
||||
# --image-base instead. Not sure if it's equivalent change for the purpose
|
||||
# but at least if fixes build on FreeBSD/aarch64
|
||||
# XXX: the condition should also be changed to check for lld regardless of
|
||||
# os, bit CMake doesn't have anything like CMAKE_LINKER_IS_LLD yet
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--image-base=0x200000000")
|
||||
else()
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x200000000")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
@ -713,7 +784,7 @@ else()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux"
|
||||
AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
|
||||
AND CMAKE_CXX_COMPILER_VERSION MATCHES "^9\\.")
|
||||
@ -794,7 +865,7 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
if(BUILD_CLIENT)
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
install(TARGETS ${PROJECT_NAME}${VERSION_MAJOR}
|
||||
RUNTIME DESTINATION ${BINDIR}
|
||||
LIBRARY DESTINATION ${BINDIR}
|
||||
ARCHIVE DESTINATION ${BINDIR}
|
||||
@ -812,7 +883,7 @@ if(BUILD_CLIENT)
|
||||
if(USE_GETTEXT)
|
||||
foreach(LOCALE ${GETTEXT_USED_LOCALES})
|
||||
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
|
||||
set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
|
||||
set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}${VERSION_MAJOR}.mo")
|
||||
install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
|
||||
endforeach()
|
||||
endif()
|
||||
@ -843,7 +914,7 @@ if(BUILD_CLIENT)
|
||||
endif(BUILD_CLIENT)
|
||||
|
||||
if(BUILD_SERVER)
|
||||
install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR})
|
||||
install(TARGETS ${PROJECT_NAME}${VERSION_MAJOR}server DESTINATION ${BINDIR})
|
||||
endif()
|
||||
|
||||
if (USE_GETTEXT)
|
||||
@ -852,7 +923,7 @@ if (USE_GETTEXT)
|
||||
foreach(LOCALE ${GETTEXT_USED_LOCALES})
|
||||
set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po")
|
||||
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
|
||||
set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
|
||||
set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}${VERSION_MAJOR}.mo")
|
||||
|
||||
add_custom_command(OUTPUT ${MO_BUILD_PATH}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}
|
||||
|
@ -1244,13 +1244,21 @@ void Client::sendRespawn()
|
||||
|
||||
void Client::sendReady()
|
||||
{
|
||||
const char *platform_name = porting::getPlatformName();
|
||||
const std::string sysinfo = porting::get_sysinfo();
|
||||
const size_t version_len = strlen(g_version_hash) + 1 + strlen(platform_name) + 1 + sysinfo.size();
|
||||
|
||||
NetworkPacket pkt(TOSERVER_CLIENT_READY,
|
||||
1 + 1 + 1 + 1 + 2 + sizeof(char) * strlen(g_version_hash) + 2);
|
||||
1 + 1 + 1 + 1 + 2 + sizeof(char) * version_len + 2);
|
||||
|
||||
pkt << (u8) VERSION_MAJOR << (u8) VERSION_MINOR << (u8) VERSION_PATCH
|
||||
<< (u8) 0 << (u16) strlen(g_version_hash);
|
||||
<< (u8) 0 << (u16) version_len;
|
||||
|
||||
pkt.putRawString(g_version_hash, (u16) strlen(g_version_hash));
|
||||
pkt << (u8) 0;
|
||||
pkt.putRawString(platform_name, (u16) strlen(platform_name));
|
||||
pkt << (u8) 0;
|
||||
pkt.putRawString(sysinfo.c_str(), sysinfo.size());
|
||||
pkt << (u16)FORMSPEC_API_VERSION;
|
||||
Send(&pkt);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
|
||||
return false;
|
||||
}
|
||||
|
||||
RenderingEngine::get_instance()->setupTopLevelWindow(PROJECT_NAME_C);
|
||||
RenderingEngine::get_instance()->setupTopLevelWindow(PROJECT_NAME + std::to_string(VERSION_MAJOR));
|
||||
|
||||
/*
|
||||
This changes the minimum allowed number of vertices in a VBO.
|
||||
@ -198,7 +198,8 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
|
||||
// Set the window caption
|
||||
const wchar_t *text = wgettext("Main Menu");
|
||||
RenderingEngine::get_raw_device()->
|
||||
setWindowCaption((utf8_to_wide(PROJECT_NAME_C) +
|
||||
setWindowCaption((utf8_to_wide(PROJECT_NAME) +
|
||||
L"" + utf8_to_wide(std::to_string(VERSION_MAJOR)) +
|
||||
L" " + utf8_to_wide(g_version_hash) +
|
||||
L" [" + text + L"]").c_str());
|
||||
delete[] text;
|
||||
|
@ -17,6 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include "content_mapblock.h"
|
||||
#include "util/numeric.h"
|
||||
#include "util/directiontables.h"
|
||||
|
@ -1386,8 +1386,9 @@ bool Game::createClient(const std::string &playername,
|
||||
|
||||
/* Set window caption
|
||||
*/
|
||||
std::wstring str = utf8_to_wide(PROJECT_NAME_C);
|
||||
str += L" ";
|
||||
std::wstring str = utf8_to_wide(PROJECT_NAME);
|
||||
str += utf8_to_wide(std::to_string(VERSION_MAJOR));
|
||||
str += L" VenenuX ";
|
||||
str += utf8_to_wide(g_version_hash);
|
||||
str += L" [";
|
||||
str += driver->getName();
|
||||
@ -3571,6 +3572,11 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
|
||||
}
|
||||
}
|
||||
|
||||
if(g_settings->getBool("instant_dig")) {
|
||||
runData.dig_instantly = true;
|
||||
runData.dig_time_complete = 0;
|
||||
}
|
||||
|
||||
if (!runData.digging) {
|
||||
infostream << "Started digging" << std::endl;
|
||||
runData.dig_instantly = runData.dig_time_complete == 0;
|
||||
@ -4157,7 +4163,7 @@ void Game::showPauseMenu()
|
||||
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
|
||||
<< strgettext("Exit to OS") << "]"
|
||||
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]"
|
||||
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n"
|
||||
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME << std::to_string(VERSION_MAJOR) << " " << VERSION_STRING << "\n"
|
||||
<< "\n"
|
||||
<< strgettext("Game info:") << "\n";
|
||||
const std::string &address = client->getAddressName();
|
||||
@ -4251,7 +4257,7 @@ void the_game(bool *kill,
|
||||
} catch (SerializationError &e) {
|
||||
error_message = std::string("A serialization error occurred:\n")
|
||||
+ e.what() + "\n\nThe server is probably "
|
||||
" running a different version of " PROJECT_NAME_C ".";
|
||||
" running a different version of " + PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".";
|
||||
errorstream << error_message << std::endl;
|
||||
} catch (ServerError &e) {
|
||||
error_message = e.what();
|
||||
|
@ -54,7 +54,7 @@ GameUI::GameUI()
|
||||
void GameUI::init()
|
||||
{
|
||||
// First line of debug text
|
||||
m_guitext = gui::StaticText::add(guienv, utf8_to_wide(PROJECT_NAME_C).c_str(),
|
||||
m_guitext = gui::StaticText::add(guienv, utf8_to_wide(PROJECT_NAME).c_str(),
|
||||
core::rect<s32>(0, 0, 0, 0), false, false, guiroot);
|
||||
|
||||
// Second line of debug text
|
||||
@ -98,7 +98,7 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_
|
||||
|
||||
std::ostringstream os(std::ios_base::binary);
|
||||
os << std::fixed
|
||||
<< PROJECT_NAME_C " " << g_version_hash
|
||||
<< PROJECT_NAME << std::to_string(VERSION_MAJOR) << " " << g_version_hash
|
||||
<< " | FPS: " << fps
|
||||
<< std::setprecision(0)
|
||||
<< " | drawtime: " << drawtime_avg << "ms"
|
||||
|
@ -316,7 +316,7 @@ KeyPress::KeyPress(const char *name)
|
||||
int chars_read = mbtowc(&Char, name, 1);
|
||||
FATAL_ERROR_IF(chars_read != 1, "Unexpected multibyte character");
|
||||
m_name = "";
|
||||
warningstream << "KeyPress: Unknown key '" << name << "', falling back to first char.";
|
||||
warningstream << "KeyPress: Unknown key '" << name << "', falling back to first char." << std::endl;
|
||||
}
|
||||
|
||||
KeyPress::KeyPress(const irr::SEvent::SKeyInput &in, bool prefer_character)
|
||||
|
@ -890,7 +890,7 @@ static void updateFastFaceRow(
|
||||
v3s16 p_corrected;
|
||||
v3s16 face_dir_corrected;
|
||||
u16 lights[4] = {0, 0, 0, 0};
|
||||
u8 waving;
|
||||
u8 waving = 0;
|
||||
TileSpec tile;
|
||||
getTileInfo(data, p, face_dir,
|
||||
makes_face, p_corrected, face_dir_corrected,
|
||||
|
@ -340,15 +340,14 @@ bool RenderingEngine::setWindowIcon()
|
||||
#if defined(XORG_USED)
|
||||
#if RUN_IN_PLACE
|
||||
return setXorgWindowIconFromPath(
|
||||
porting::path_share + "/misc/" PROJECT_NAME "-xorg-icon-128.png");
|
||||
porting::path_share + "/misc/" + PROJECT_NAME + std::to_string(VERSION_MAJOR) + "-xorg-icon-128.png");
|
||||
#else
|
||||
// We have semi-support for reading in-place data if we are
|
||||
// compiled with RUN_IN_PLACE. Don't break with this and
|
||||
// also try the path_share location.
|
||||
return setXorgWindowIconFromPath(
|
||||
ICON_DIR "/hicolor/128x128/apps/" PROJECT_NAME ".png") ||
|
||||
setXorgWindowIconFromPath(porting::path_share + "/misc/" PROJECT_NAME
|
||||
"-xorg-icon-128.png");
|
||||
ICON_DIR "/hicolor/128x128/apps/" PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".png") ||
|
||||
setXorgWindowIconFromPath(porting::path_share + "/misc/" PROJECT_NAME + std::to_string(VERSION_MAJOR) + "-xorg-icon-128.png");
|
||||
#endif
|
||||
#elif defined(_WIN32)
|
||||
const video::SExposedVideoData exposedData = driver->getExposedVideoData();
|
||||
|
@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <SMaterial.h>
|
||||
#include <memory>
|
||||
#include "util/numeric.h"
|
||||
#include "config.h"
|
||||
|
||||
@ -282,7 +281,7 @@ struct TileLayer
|
||||
//! If true, the tile has its own color.
|
||||
bool has_color = false;
|
||||
|
||||
std::shared_ptr<std::vector<FrameSpec>> frames = nullptr;
|
||||
std::vector<FrameSpec> *frames = nullptr;
|
||||
|
||||
/*!
|
||||
* The color of the tile, or if the tile does not own
|
||||
|
@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
class MapBlock;
|
||||
@ -331,7 +332,13 @@ public:
|
||||
m_version_major = major;
|
||||
m_version_minor = minor;
|
||||
m_version_patch = patch;
|
||||
m_full_version = full;
|
||||
m_full_version = full.c_str();
|
||||
const size_t pos1 = full.find('\x00');
|
||||
if (pos1 != std::string::npos)
|
||||
m_platform = full.substr(pos1 + 1).c_str();
|
||||
const size_t pos2 = full.find('\x00', pos1 + 1);
|
||||
if (pos2 != std::string::npos)
|
||||
m_sysinfo = full.substr(pos2 + 1);
|
||||
}
|
||||
|
||||
/* read version information */
|
||||
@ -339,6 +346,8 @@ public:
|
||||
u8 getMinor() const { return m_version_minor; }
|
||||
u8 getPatch() const { return m_version_patch; }
|
||||
const std::string &getFull() const { return m_full_version; }
|
||||
const std::string &getPlatform() const { return m_platform; }
|
||||
const std::string &getSysInfo() const { return m_sysinfo; }
|
||||
private:
|
||||
// Version is stored in here after INIT before INIT2
|
||||
u8 m_pending_serialization_version = SER_FMT_VER_INVALID;
|
||||
@ -412,6 +421,8 @@ private:
|
||||
u8 m_version_patch = 0;
|
||||
|
||||
std::string m_full_version = "unknown";
|
||||
std::string m_platform = "unknown";
|
||||
std::string m_sysinfo = "unknown";
|
||||
|
||||
u16 m_deployed_compression = 0;
|
||||
|
||||
|
@ -415,12 +415,13 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
|
||||
Collision uncertainty radius
|
||||
Make it a bit larger than the maximum distance of movement
|
||||
*/
|
||||
f32 d = pos_max_d * 1.1f;
|
||||
// A fairly large value in here makes moving smoother
|
||||
//f32 d = pos_max_d * 1.1;
|
||||
// A fairly large value in here makes moving smoother but more rare too
|
||||
//f32 d = 0.15*BS;
|
||||
f32 d = 0.3f; // Temporary fix, any nonzero d causes collision glitches, the more the greater it is.
|
||||
|
||||
// This should always apply, otherwise there are glitches
|
||||
assert(d > pos_max_d); // invariant
|
||||
//assert(d > pos_max_d); // invariant
|
||||
|
||||
int loopcount = 0;
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
#include "cmake_config.h"
|
||||
#elif defined (__ANDROID__) || defined (ANDROID)
|
||||
#define PROJECT_NAME "minetest"
|
||||
#define PROJECT_NAME_C "Minetest"
|
||||
#define VERSION_MAJOR "5"
|
||||
#define PROJECT_NAME_C "Minetest5"
|
||||
#define STATIC_SHAREDIR ""
|
||||
#include "android_version.h"
|
||||
#ifdef NDEBUG
|
||||
@ -22,6 +23,7 @@
|
||||
#define BUILD_TYPE "Debug"
|
||||
#endif
|
||||
#else
|
||||
#include "cmake_config.h"
|
||||
#ifdef NDEBUG
|
||||
#define BUILD_TYPE "Release"
|
||||
#else
|
||||
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
bool getGameMinetestConfig(const std::string &game_path, Settings &conf)
|
||||
{
|
||||
std::string conf_path = game_path + DIR_DELIM + "minetest.conf";
|
||||
std::string conf_path = game_path + DIR_DELIM + PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".conf";
|
||||
return conf.readConfigFile(conf_path.c_str());
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ std::string getWorldGameId(const std::string &world_path, bool can_be_legacy)
|
||||
return "";
|
||||
// The "mesetint" gameid has been discarded
|
||||
if (conf.get("gameid") == "mesetint")
|
||||
return "minetest";
|
||||
return LEGACY_GAMEID;
|
||||
return conf.get("gameid");
|
||||
}
|
||||
|
||||
|
@ -1428,12 +1428,34 @@ void PlayerSAO::setMaxSpeedOverride(const v3f &vel)
|
||||
|
||||
bool PlayerSAO::checkMovementCheat()
|
||||
{
|
||||
if (isAttached() || m_is_singleplayer ||
|
||||
if (m_is_singleplayer ||
|
||||
g_settings->getBool("disable_anticheat")) {
|
||||
m_last_good_position = m_base_position;
|
||||
return false;
|
||||
}
|
||||
if (UnitSAO *parent = dynamic_cast<UnitSAO *>(getParent())) {
|
||||
v3f attachment_pos;
|
||||
{
|
||||
int parent_id;
|
||||
std::string bone;
|
||||
v3f attachment_rot;
|
||||
getAttachment(&parent_id, &bone, &attachment_pos, &attachment_rot);
|
||||
}
|
||||
|
||||
v3f parent_pos = parent->getBasePosition();
|
||||
f32 diff = m_base_position.getDistanceFromSQ(parent_pos) - attachment_pos.getLengthSQ();
|
||||
const f32 maxdiff = 4.0f * BS; // fair trade-off value for various latencies
|
||||
|
||||
if (diff > maxdiff * maxdiff) {
|
||||
setBasePosition(parent_pos);
|
||||
actionstream << "Server: " << m_player->getName()
|
||||
<< " moved away from parent; diff=" << sqrtf(diff) / BS
|
||||
<< " resetting position." << std::endl;
|
||||
return true;
|
||||
}
|
||||
// Player movement is locked to the entity. Skip further checks
|
||||
return false;
|
||||
}
|
||||
bool cheated = false;
|
||||
/*
|
||||
Check player movements
|
||||
|
@ -136,9 +136,9 @@ long WINAPI Win32ExceptionHandler(struct _EXCEPTION_POINTERS *pExceptInfo)
|
||||
MINIDUMP_USER_STREAM mdus;
|
||||
bool minidump_created = false;
|
||||
|
||||
std::string dumpfile = porting::path_user + DIR_DELIM PROJECT_NAME ".dmp";
|
||||
std::string dumpfile = porting::path_user + DIR_DELIM PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".dmp";
|
||||
|
||||
std::string version_str(PROJECT_NAME " ");
|
||||
std::string version_str(PROJECT_NAME + std::to_string(VERSION_MAJOR) + " ");
|
||||
version_str += g_version_hash;
|
||||
|
||||
HANDLE hFile = CreateFileA(dumpfile.c_str(), GENERIC_WRITE,
|
||||
|
@ -46,6 +46,7 @@ void set_default_settings(Settings *settings)
|
||||
settings->setDefault("enable_vbo", "true");
|
||||
settings->setDefault("free_move", "false");
|
||||
settings->setDefault("pitch_move", "false");
|
||||
settings->setDefault("instant_dig", "false");
|
||||
settings->setDefault("fast_move", "false");
|
||||
settings->setDefault("noclip", "false");
|
||||
settings->setDefault("screenshot_path", ".");
|
||||
@ -345,7 +346,7 @@ void set_default_settings(Settings *settings)
|
||||
settings->setDefault("max_simultaneous_block_sends_per_client", "40");
|
||||
settings->setDefault("time_send_interval", "5");
|
||||
|
||||
settings->setDefault("default_game", "minetest");
|
||||
settings->setDefault("default_game", lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR)); // minetst 5 is renamed in cmake at install as minetest
|
||||
settings->setDefault("motd", "");
|
||||
settings->setDefault("max_users", "15");
|
||||
settings->setDefault("creative_mode", "false");
|
||||
|
@ -142,7 +142,7 @@ void init_gettext(const char *path, const std::string &configured_language,
|
||||
// Hack to force gettext to see the right environment
|
||||
if (current_language != configured_language) {
|
||||
errorstream << "MSVC localization workaround active. "
|
||||
"Restarting " PROJECT_NAME_C " in a new environment!" << std::endl;
|
||||
<< "Restarting " << PROJECT_NAME + std::to_string(VERSION_MAJOR) << " in a new environment!" << std::endl;
|
||||
|
||||
std::string parameters;
|
||||
|
||||
@ -217,7 +217,8 @@ void init_gettext(const char *path, const std::string &configured_language,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static std::string name = lowercase(PROJECT_NAME);
|
||||
std::string name = lowercase(PROJECT_NAME + std::to_string(VERSION_MAJOR));
|
||||
infostream << "Gettext: domainname=\"" << name << "\" path=\"" << path << "\"" << std::endl;
|
||||
bindtextdomain(name.c_str(), path);
|
||||
textdomain(name.c_str());
|
||||
|
||||
|
@ -133,7 +133,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
||||
core::rect<s32> rect(0, 0, 600 * s, 40 * s);
|
||||
rect += topleft + v2s32(25 * s, 3 * s);
|
||||
//gui::IGUIStaticText *t =
|
||||
const wchar_t *text = wgettext("Keybindings. (If this menu screws up, remove stuff from minetest.conf)");
|
||||
const wchar_t *text = wgettext("Keybindings. (If this menu screws up, remove stuff from minetest5.conf)");
|
||||
Environment->addStaticText(text,
|
||||
rect, false, true, this, -1);
|
||||
delete[] text;
|
||||
|
@ -44,7 +44,7 @@ PcgRandom g_callerid_randomness;
|
||||
HTTPFetchRequest::HTTPFetchRequest() :
|
||||
timeout(g_settings->getS32("curl_timeout")),
|
||||
connect_timeout(timeout),
|
||||
useragent(std::string(PROJECT_NAME_C "/") + g_version_hash + " (" + porting::get_sysinfo() + ")")
|
||||
useragent(std::string(PROJECT_NAME_C "-VenenuX/") + g_version_hash + " (" + porting::get_sysinfo() + ")")
|
||||
{
|
||||
}
|
||||
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -343,7 +343,7 @@ static void print_allowed_options(const OptionList &allowed_options)
|
||||
|
||||
static void print_version()
|
||||
{
|
||||
std::cout << PROJECT_NAME_C " " << g_version_hash
|
||||
std::cout << PROJECT_NAME_C " by VenenuX" << g_version_hash
|
||||
<< " (" << porting::getPlatformName() << ")" << std::endl;
|
||||
#ifndef SERVER
|
||||
std::cout << "Using Irrlicht " IRRLICHT_SDK_VERSION << std::endl;
|
||||
@ -498,7 +498,7 @@ static bool init_common(const Settings &cmd_args, int argc, char *argv[])
|
||||
|
||||
static void startup_message()
|
||||
{
|
||||
infostream << PROJECT_NAME << " " << _("with")
|
||||
infostream << PROJECT_NAME << std::to_string(VERSION_MAJOR) << " " << _("with")
|
||||
<< " SER_FMT_VER_HIGHEST_READ="
|
||||
<< (int)SER_FMT_VER_HIGHEST_READ << ", "
|
||||
<< g_build_info << std::endl;
|
||||
@ -519,16 +519,16 @@ static bool read_config_file(const Settings &cmd_args)
|
||||
g_settings_path = cmd_args.get("config");
|
||||
} else {
|
||||
std::vector<std::string> filenames;
|
||||
filenames.push_back(porting::path_user + DIR_DELIM + "minetest.conf");
|
||||
filenames.push_back(porting::path_user + DIR_DELIM + PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".conf");
|
||||
// Legacy configuration file location
|
||||
filenames.push_back(porting::path_user +
|
||||
DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
|
||||
DIR_DELIM + ".." + DIR_DELIM + PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".conf");
|
||||
|
||||
#if RUN_IN_PLACE
|
||||
// Try also from a lower level (to aid having the same configuration
|
||||
// for many RUN_IN_PLACE installs)
|
||||
filenames.push_back(porting::path_user +
|
||||
DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
|
||||
DIR_DELIM + ".." + DIR_DELIM + ".." + DIR_DELIM + PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".conf");
|
||||
#endif
|
||||
|
||||
for (const std::string &filename : filenames) {
|
||||
@ -778,7 +778,7 @@ static bool determine_subgame(GameParams *game_params)
|
||||
if (game_params->game_spec.isValid()) {
|
||||
gamespec = game_params->game_spec;
|
||||
infostream << "Using commanded gameid [" << gamespec.id << "]" << std::endl;
|
||||
} else { // Otherwise we will be using "minetest"
|
||||
} else { // Otherwise we will be using default_game from config
|
||||
gamespec = findSubgame(g_settings->get("default_game"));
|
||||
infostream << "Using default gameid [" << gamespec.id << "]" << std::endl;
|
||||
if (!gamespec.isValid()) {
|
||||
@ -869,7 +869,7 @@ static bool run_dedicated_server(const GameParams &game_params, const Settings &
|
||||
if (!name_ok) {
|
||||
if (admin_nick.empty()) {
|
||||
errorstream << "No name given for admin. "
|
||||
<< "Please check your minetest.conf that it "
|
||||
<< "Please check your "<< PROJECT_NAME << std::to_string(VERSION_MAJOR) << ".conf that it "
|
||||
<< "contains a 'name = ' to your main admin account."
|
||||
<< std::endl;
|
||||
} else {
|
||||
|
@ -629,6 +629,13 @@ MapgenBasic::MapgenBasic(int mapgenid, MapgenParams *params, EmergeManager *emer
|
||||
// Lava falls back to water as both are suitable as cave liquids.
|
||||
if (c_lava_source == CONTENT_IGNORE)
|
||||
c_lava_source = c_water_source;
|
||||
|
||||
if (c_stone == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen: Mapgen alias 'mapgen_stone' is invalid!" << std::endl;
|
||||
if (c_water_source == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen: Mapgen alias 'mapgen_water_source' is invalid!" << std::endl;
|
||||
if (c_river_water_source == CONTENT_IGNORE)
|
||||
warningstream << "Mapgen: Mapgen alias 'mapgen_river_water_source' is invalid!" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,6 +132,21 @@ MapgenV6::MapgenV6(MapgenV6Params *params, EmergeManager *emerge)
|
||||
c_stair_cobble = c_cobble;
|
||||
if (c_stair_desert_stone == CONTENT_IGNORE)
|
||||
c_stair_desert_stone = c_desert_stone;
|
||||
|
||||
if (c_stone == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_stone' is invalid!" << std::endl;
|
||||
if (c_dirt == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_dirt' is invalid!" << std::endl;
|
||||
if (c_dirt_with_grass == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_dirt_with_grass' is invalid!" << std::endl;
|
||||
if (c_sand == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_sand' is invalid!" << std::endl;
|
||||
if (c_water_source == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_water_source' is invalid!" << std::endl;
|
||||
if (c_lava_source == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_lava_source' is invalid!" << std::endl;
|
||||
if (c_cobble == CONTENT_IGNORE)
|
||||
errorstream << "Mapgen v6: Mapgen alias 'mapgen_cobble' is invalid!" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,6 +44,12 @@ void make_tree(MMVManip &vmanip, v3s16 p0, bool is_apple_tree,
|
||||
MapNode treenode(ndef->getId("mapgen_tree"));
|
||||
MapNode leavesnode(ndef->getId("mapgen_leaves"));
|
||||
MapNode applenode(ndef->getId("mapgen_apple"));
|
||||
if (treenode == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_tree' is invalid!" << std::endl;
|
||||
if (leavesnode == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_leaves' is invalid!" << std::endl;
|
||||
if (applenode == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_apple' is invalid!" << std::endl;
|
||||
|
||||
PseudoRandom pr(seed);
|
||||
s16 trunk_h = pr.range(4, 5);
|
||||
@ -145,6 +151,9 @@ treegen::error make_ltree(MMVManip &vmanip, v3s16 p0,
|
||||
const NodeDefManager *ndef, TreeDef tree_definition)
|
||||
{
|
||||
MapNode dirtnode(ndef->getId("mapgen_dirt"));
|
||||
if (dirtnode == CONTENT_IGNORE)
|
||||
errorstream << "Treegen (make_ltree): Mapgen alias 'mapgen_dirt' is invalid!" << std::endl;
|
||||
|
||||
s32 seed;
|
||||
if (tree_definition.explicit_seed)
|
||||
seed = tree_definition.seed + 14002;
|
||||
@ -662,6 +671,10 @@ void make_jungletree(MMVManip &vmanip, v3s16 p0, const NodeDefManager *ndef,
|
||||
c_tree = ndef->getId("mapgen_tree");
|
||||
if (c_leaves == CONTENT_IGNORE)
|
||||
c_leaves = ndef->getId("mapgen_leaves");
|
||||
if (c_tree == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_jungletree' is invalid!" << std::endl;
|
||||
if (c_leaves == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_jungleleaves' is invalid!" << std::endl;
|
||||
|
||||
MapNode treenode(c_tree);
|
||||
MapNode leavesnode(c_leaves);
|
||||
@ -765,6 +778,10 @@ void make_pine_tree(MMVManip &vmanip, v3s16 p0, const NodeDefManager *ndef,
|
||||
c_leaves = ndef->getId("mapgen_leaves");
|
||||
if (c_snow == CONTENT_IGNORE)
|
||||
c_snow = CONTENT_AIR;
|
||||
if (c_tree == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_pine_tree' is invalid!" << std::endl;
|
||||
if (c_leaves == CONTENT_IGNORE)
|
||||
errorstream << "Treegen: Mapgen alias 'mapgen_pine_needles' is invalid!" << std::endl;
|
||||
|
||||
MapNode treenode(c_tree);
|
||||
MapNode leavesnode(c_leaves);
|
||||
|
@ -935,6 +935,8 @@ enum ToServerCommand
|
||||
u8 reserved
|
||||
u16 len
|
||||
u8[len] full_version_string
|
||||
u8[len] platform
|
||||
u8[len] sysinfo
|
||||
*/
|
||||
|
||||
TOSERVER_FIRST_SRP = 0x50,
|
||||
|
@ -173,6 +173,16 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
|
||||
return;
|
||||
}
|
||||
|
||||
RemotePlayer *player = m_env->getPlayer(playername);
|
||||
|
||||
// If player is already connected, cancel
|
||||
if (player && player->getPeerId() != PEER_ID_INEXISTENT) {
|
||||
actionstream << "Server: Player with name \"" << playername <<
|
||||
"\" tried to connect, but player with same name is already connected" << std::endl;
|
||||
DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_ALREADY_CONNECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
m_clients.setPlayerName(pkt->getPeerId(), playername);
|
||||
//TODO (later) case insensitivity
|
||||
|
||||
@ -593,7 +603,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
<< std::endl;
|
||||
std::istringstream is(datastring, std::ios_base::binary);
|
||||
// Create an action
|
||||
InventoryAction *a = InventoryAction::deSerialize(is);
|
||||
std::unique_ptr<InventoryAction> a(InventoryAction::deSerialize(is));
|
||||
if (!a) {
|
||||
infostream << "TOSERVER_INVENTORY_ACTION: "
|
||||
<< "InventoryAction::deSerialize() returned NULL"
|
||||
@ -610,11 +620,29 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
where the client made a bad prediction.
|
||||
*/
|
||||
|
||||
const bool player_has_interact = checkPriv(player->getName(), "interact");
|
||||
|
||||
auto check_inv_access = [player, player_has_interact] (
|
||||
const InventoryLocation &loc) -> bool {
|
||||
if (loc.type == InventoryLocation::CURRENT_PLAYER)
|
||||
return false; // Only used internally on the client, never sent
|
||||
if (loc.type == InventoryLocation::PLAYER) {
|
||||
// Allow access to own inventory in all cases
|
||||
return loc.name == player->getName();
|
||||
}
|
||||
if (!player_has_interact) {
|
||||
infostream << "Cannot modify foreign inventory: "
|
||||
<< "No interact privilege" << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/*
|
||||
Handle restrictions and special cases of the move action
|
||||
*/
|
||||
if (a->getType() == IAction::Move) {
|
||||
IMoveAction *ma = (IMoveAction*)a;
|
||||
IMoveAction *ma = (IMoveAction*)a.get();
|
||||
|
||||
ma->from_inv.applyCurrentPlayer(player->getName());
|
||||
ma->to_inv.applyCurrentPlayer(player->getName());
|
||||
@ -623,15 +651,11 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
if (ma->from_inv != ma->to_inv)
|
||||
setInventoryModified(ma->to_inv);
|
||||
|
||||
bool from_inv_is_current_player =
|
||||
(ma->from_inv.type == InventoryLocation::PLAYER) &&
|
||||
(ma->from_inv.name == player->getName());
|
||||
if (!check_inv_access(ma->from_inv) ||
|
||||
!check_inv_access(ma->to_inv))
|
||||
return;
|
||||
|
||||
bool to_inv_is_current_player =
|
||||
(ma->to_inv.type == InventoryLocation::PLAYER) &&
|
||||
(ma->to_inv.name == player->getName());
|
||||
|
||||
InventoryLocation *remote = from_inv_is_current_player ?
|
||||
InventoryLocation *remote = ma->from_inv.type == InventoryLocation::PLAYER ?
|
||||
&ma->to_inv : &ma->from_inv;
|
||||
|
||||
// Check for out-of-range interaction
|
||||
@ -651,7 +675,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
<< (ma->from_inv.dump()) << ":" << ma->from_list
|
||||
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list
|
||||
<< " because src is " << ma->from_list << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -663,18 +686,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
<< (ma->from_inv.dump()) << ":" << ma->from_list
|
||||
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list
|
||||
<< " because dst is " << ma->to_list << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
|
||||
// Disallow moving items in elsewhere than player's inventory
|
||||
// if not allowed to interact
|
||||
if (!checkPriv(player->getName(), "interact") &&
|
||||
(!from_inv_is_current_player ||
|
||||
!to_inv_is_current_player)) {
|
||||
infostream << "Cannot move outside of player's inventory: "
|
||||
<< "No interact privilege" << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -682,7 +693,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
Handle restrictions and special cases of the drop action
|
||||
*/
|
||||
else if (a->getType() == IAction::Drop) {
|
||||
IDropAction *da = (IDropAction*)a;
|
||||
IDropAction *da = (IDropAction*)a.get();
|
||||
|
||||
da->from_inv.applyCurrentPlayer(player->getName());
|
||||
|
||||
@ -695,13 +706,11 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
infostream << "Ignoring IDropAction from "
|
||||
<< (da->from_inv.dump()) << ":" << da->from_list
|
||||
<< " because src is " << da->from_list << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
|
||||
// Disallow dropping items if not allowed to interact
|
||||
if (!checkPriv(player->getName(), "interact")) {
|
||||
delete a;
|
||||
if (!player_has_interact || !check_inv_access(da->from_inv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -710,7 +719,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
infostream << "Ignoring IDropAction from "
|
||||
<< (da->from_inv.dump()) << ":" << da->from_list
|
||||
<< " because player is dead." << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -718,29 +726,28 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
||||
Handle restrictions and special cases of the craft action
|
||||
*/
|
||||
else if (a->getType() == IAction::Craft) {
|
||||
ICraftAction *ca = (ICraftAction*)a;
|
||||
ICraftAction *ca = (ICraftAction*)a.get();
|
||||
|
||||
ca->craft_inv.applyCurrentPlayer(player->getName());
|
||||
|
||||
setInventoryModified(ca->craft_inv);
|
||||
|
||||
//bool craft_inv_is_current_player =
|
||||
// (ca->craft_inv.type == InventoryLocation::PLAYER) &&
|
||||
// (ca->craft_inv.name == player->getName());
|
||||
|
||||
// Disallow crafting if not allowed to interact
|
||||
if (!checkPriv(player->getName(), "interact")) {
|
||||
if (!player_has_interact) {
|
||||
infostream << "Cannot craft: "
|
||||
<< "No interact privilege" << std::endl;
|
||||
delete a;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_inv_access(ca->craft_inv))
|
||||
return;
|
||||
} else {
|
||||
// Unknown action. Ignored.
|
||||
return;
|
||||
}
|
||||
|
||||
// Do the action
|
||||
a->apply(this, playersao, this);
|
||||
// Eat the action
|
||||
delete a;
|
||||
}
|
||||
|
||||
void Server::handleCommand_ChatMessage(NetworkPacket* pkt)
|
||||
|
@ -317,6 +317,18 @@ ContentFeatures::ContentFeatures()
|
||||
reset();
|
||||
}
|
||||
|
||||
ContentFeatures::~ContentFeatures()
|
||||
{
|
||||
#ifndef SERVER
|
||||
for (u16 j = 0; j < 6; j++) {
|
||||
delete tiles[j].layers[0].frames;
|
||||
delete tiles[j].layers[1].frames;
|
||||
}
|
||||
for (u16 j = 0; j < CF_SPECIAL_COUNT; j++)
|
||||
delete special_tiles[j].layers[0].frames;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ContentFeatures::reset()
|
||||
{
|
||||
/*
|
||||
@ -653,7 +665,7 @@ static void fillTileAttribs(ITextureSource *tsrc, TileLayer *layer,
|
||||
} else {
|
||||
std::ostringstream os(std::ios::binary);
|
||||
if (!layer->frames) {
|
||||
layer->frames = std::make_shared<std::vector<FrameSpec>>();
|
||||
layer->frames = new std::vector<FrameSpec>();
|
||||
}
|
||||
layer->frames->resize(frame_count);
|
||||
|
||||
|
@ -404,7 +404,7 @@ struct ContentFeatures
|
||||
*/
|
||||
|
||||
ContentFeatures();
|
||||
~ContentFeatures() = default;
|
||||
~ContentFeatures();
|
||||
void reset();
|
||||
void serialize(std::ostream &os, u16 protocol_version) const;
|
||||
void deSerialize(std::istream &is);
|
||||
|
@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
extern char **environ;
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
@ -390,11 +391,11 @@ bool setSystemPaths()
|
||||
path_share += DIR_DELIM "..";
|
||||
}
|
||||
|
||||
// Use "C:\Users\<user>\AppData\Roaming\<PROJECT_NAME_C>"
|
||||
// Use "C:\Users\<user>\AppData\Roaming\<PROJECT_NAME VERSION_MAJOR>"
|
||||
DWORD len = GetEnvironmentVariable("APPDATA", buf, sizeof(buf));
|
||||
FATAL_ERROR_IF(len == 0 || len > sizeof(buf), "Failed to get APPDATA");
|
||||
|
||||
path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME_C;
|
||||
path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME + std::to_string(VERSION_MAJOR) ;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -426,7 +427,7 @@ bool setSystemPaths()
|
||||
trylist.push_back(static_sharedir);
|
||||
|
||||
trylist.push_back(bindir + DIR_DELIM ".." DIR_DELIM "share"
|
||||
DIR_DELIM + PROJECT_NAME);
|
||||
DIR_DELIM + lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR));
|
||||
trylist.push_back(bindir + DIR_DELIM "..");
|
||||
|
||||
#ifdef __ANDROID__
|
||||
@ -455,7 +456,7 @@ bool setSystemPaths()
|
||||
|
||||
#ifndef __ANDROID__
|
||||
path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
|
||||
+ PROJECT_NAME;
|
||||
+ PROJECT_NAME + std::to_string(VERSION_MAJOR);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@ -480,7 +481,7 @@ bool setSystemPaths()
|
||||
|
||||
path_user = std::string(getHomeOrFail())
|
||||
+ "/Library/Application Support/"
|
||||
+ PROJECT_NAME;
|
||||
+ PROJECT_NAME + std::to_string(VERSION_MAJOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -491,7 +492,7 @@ bool setSystemPaths()
|
||||
{
|
||||
path_share = STATIC_SHAREDIR;
|
||||
path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
|
||||
+ lowercase(PROJECT_NAME);
|
||||
+ lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -573,15 +574,15 @@ void initializePaths()
|
||||
path_cache = path_user + DIR_DELIM + "cache";
|
||||
# else
|
||||
// Initialize path_cache
|
||||
// First try $XDG_CACHE_HOME/PROJECT_NAME
|
||||
// First try $XDG_CACHE_HOME/PROJECT_NAME+VERSION_MAJOR
|
||||
const char *cache_dir = getenv("XDG_CACHE_HOME");
|
||||
const char *home_dir = getenv("HOME");
|
||||
if (cache_dir) {
|
||||
path_cache = std::string(cache_dir) + DIR_DELIM + PROJECT_NAME;
|
||||
path_cache = std::string(cache_dir) + DIR_DELIM + lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR);
|
||||
} else if (home_dir) {
|
||||
// Then try $HOME/.cache/PROJECT_NAME
|
||||
// Then try $HOME/.cache/PROJECT_NAME+VERSION_MAJOR
|
||||
path_cache = std::string(home_dir) + DIR_DELIM + ".cache"
|
||||
+ DIR_DELIM + PROJECT_NAME;
|
||||
+ DIR_DELIM + lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR);
|
||||
} else {
|
||||
// If neither works, use $PATH_USER/cache
|
||||
path_cache = path_user + DIR_DELIM + "cache";
|
||||
@ -598,18 +599,18 @@ void initializePaths()
|
||||
#if USE_GETTEXT
|
||||
bool found_localedir = false;
|
||||
# ifdef STATIC_LOCALEDIR
|
||||
if (STATIC_LOCALEDIR[0] && fs::PathExists(STATIC_LOCALEDIR)) {
|
||||
found_localedir = true;
|
||||
path_locale = STATIC_LOCALEDIR;
|
||||
infostream << "Using locale directory " << STATIC_LOCALEDIR << std::endl;
|
||||
} else {
|
||||
/* STATIC_LOCALEDIR may be a generalized path such as /usr/share/locale that
|
||||
* doesn't necessarily contain our locale files, so check data path first. */
|
||||
path_locale = getDataPath("locale");
|
||||
if (fs::PathExists(path_locale)) {
|
||||
found_localedir = true;
|
||||
infostream << "Using in-place locale directory " << path_locale
|
||||
<< " even though a static one was provided "
|
||||
<< "(RUN_IN_PLACE or CUSTOM_LOCALEDIR)." << std::endl;
|
||||
}
|
||||
<< " even though a static one was provided." << std::endl;
|
||||
} else if (STATIC_LOCALEDIR[0] && fs::PathExists(STATIC_LOCALEDIR)) {
|
||||
found_localedir = true;
|
||||
path_locale = STATIC_LOCALEDIR;
|
||||
infostream << "Using static locale directory " << STATIC_LOCALEDIR
|
||||
<< std::endl;
|
||||
}
|
||||
# else
|
||||
path_locale = getDataPath("locale");
|
||||
|
@ -139,9 +139,9 @@ extern std::string path_share;
|
||||
|
||||
/*
|
||||
Directory for storing user data. Examples:
|
||||
Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>"
|
||||
Linux: "~/.<PROJECT_NAME>"
|
||||
Mac: "~/Library/Application Support/<PROJECT_NAME>"
|
||||
Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME VERSION_MAJOR>"
|
||||
Linux: "~/.<PROJECT_NAME VERSION_MAJOR>"
|
||||
Mac: "~/Library/Application Support/<PROJECT_NAME VERSION_MAJOR>"
|
||||
*/
|
||||
extern std::string path_user;
|
||||
|
||||
@ -234,21 +234,21 @@ inline u64 getTimeMs()
|
||||
{
|
||||
struct timespec ts;
|
||||
os_get_clock(&ts);
|
||||
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
||||
return ((u64) ts.tv_sec) * 1000LL + ((u64) ts.tv_nsec) / 1000000LL;
|
||||
}
|
||||
|
||||
inline u64 getTimeUs()
|
||||
{
|
||||
struct timespec ts;
|
||||
os_get_clock(&ts);
|
||||
return ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
|
||||
return ((u64) ts.tv_sec) * 1000000LL + ((u64) ts.tv_nsec) / 1000LL;
|
||||
}
|
||||
|
||||
inline u64 getTimeNs()
|
||||
{
|
||||
struct timespec ts;
|
||||
os_get_clock(&ts);
|
||||
return ts.tv_sec * 1000000000 + ts.tv_nsec;
|
||||
return ((u64) ts.tv_sec) * 1000000000LL + ((u64) ts.tv_nsec);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -48,7 +48,7 @@ void android_main(android_app *app)
|
||||
|
||||
try {
|
||||
app_dummy();
|
||||
char *argv[] = {strdup(PROJECT_NAME), NULL};
|
||||
char *argv[] = {strdup(PROJECT_NAME + std::to_string(VERSION_MAJOR)), NULL}; // TODO
|
||||
main(ARRLEN(argv) - 1, argv);
|
||||
free(argv[0]);
|
||||
} catch (std::exception &e) {
|
||||
|
@ -28,7 +28,7 @@ extern "C" {
|
||||
#include "common/c_converter.h"
|
||||
#include "common/c_internal.h"
|
||||
#include "constants.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#define CHECK_TYPE(index, name, type) { \
|
||||
int t = lua_type(L, (index)); \
|
||||
@ -41,12 +41,14 @@ extern "C" {
|
||||
}
|
||||
#define CHECK_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER)
|
||||
#define CHECK_FLOAT_RANGE(value, name) \
|
||||
if (value < F1000_MIN || value > F1000_MAX) { \
|
||||
std::ostringstream error_text; \
|
||||
error_text << "Invalid float vector dimension range '" name "' " << \
|
||||
if (value < F1000_MIN || value > F1000_MAX || std::isnan(value) || std::isinf(value) ) { \
|
||||
warningstream << "Invalid float vector dimension range or null value given '" name "' " << \
|
||||
"(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
|
||||
" got " << value << ")." << std::endl; \
|
||||
throw LuaError(error_text.str()); \
|
||||
" got " << value << "). restarted to max / min" << std::endl; \
|
||||
if (value < F1000_MIN) \
|
||||
value = F1000_MIN; \
|
||||
else \
|
||||
value = F1000_MAX; \
|
||||
}
|
||||
#define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE)
|
||||
|
||||
@ -164,10 +166,12 @@ v2f check_v2f(lua_State *L, int index)
|
||||
lua_getfield(L, index, "x");
|
||||
CHECK_POS_COORD("x");
|
||||
p.X = lua_tonumber(L, -1);
|
||||
CHECK_FLOAT_RANGE(p.X, "x")
|
||||
lua_pop(L, 1);
|
||||
lua_getfield(L, index, "y");
|
||||
CHECK_POS_COORD("y");
|
||||
p.Y = lua_tonumber(L, -1);
|
||||
CHECK_FLOAT_RANGE(p.Y, "x")
|
||||
lua_pop(L, 1);
|
||||
return p;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ extern "C" {
|
||||
#include <lauxlib.h>
|
||||
}
|
||||
|
||||
#include "config.h"
|
||||
#include "common/c_types.h"
|
||||
|
||||
|
||||
@ -54,6 +55,15 @@ extern "C" {
|
||||
#define CUSTOM_RIDX_CURRENT_MOD_NAME (CUSTOM_RIDX_BASE + 2)
|
||||
#define CUSTOM_RIDX_BACKTRACE (CUSTOM_RIDX_BASE + 3)
|
||||
|
||||
// Determine if CUSTOM_RIDX_SCRIPTAPI will hold a light or full userdata
|
||||
#if defined(__aarch64__) && USE_LUAJIT
|
||||
/* LuaJIT has a 47-bit limit for lightuserdata on this platform and we cannot
|
||||
* assume that the ScriptApi class was allocated at a fitting address. */
|
||||
#define INDIRECT_SCRIPTAPI_RIDX 1
|
||||
#else
|
||||
#define INDIRECT_SCRIPTAPI_RIDX 0
|
||||
#endif
|
||||
|
||||
// Pushes the error handler onto the stack and returns its index
|
||||
#define PUSH_ERROR_HANDLER(L) \
|
||||
(lua_rawgeti((L), LUA_REGISTRYINDEX, CUSTOM_RIDX_BACKTRACE), lua_gettop((L)))
|
||||
|
@ -90,7 +90,11 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
|
||||
luaL_openlibs(m_luastack);
|
||||
|
||||
// Make the ScriptApiBase* accessible to ModApiBase
|
||||
#if INDIRECT_SCRIPTAPI_RIDX
|
||||
*(void **)(lua_newuserdata(m_luastack, sizeof(void *))) = this;
|
||||
#else
|
||||
lua_pushlightuserdata(m_luastack, this);
|
||||
#endif
|
||||
lua_rawseti(m_luastack, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
|
||||
|
||||
// Add and save an error handler
|
||||
|
@ -480,7 +480,7 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path,
|
||||
cur_path = fs::RemoveLastPathComponent(cur_path, &component);
|
||||
if (component == "..") {
|
||||
// Parent components can't be allowed or we could allow something like
|
||||
// /home/user/minetest/worlds/foo/noexist/../../../../../../etc/passwd.
|
||||
// /home/user/minetest5/worlds/foo/noexist/../../../../../../etc/passwd.
|
||||
// If we have previous non-relative elements in the path we might be
|
||||
// able to remove them so that things like worlds/foo/noexist/../auth.txt
|
||||
// could be allowed, but those paths will be interpreted as nonexistent
|
||||
@ -499,7 +499,12 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path,
|
||||
|
||||
// Get server from registry
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
|
||||
ScriptApiBase *script = (ScriptApiBase *) lua_touserdata(L, -1);
|
||||
ScriptApiBase *script;
|
||||
#if INDIRECT_SCRIPTAPI_RIDX
|
||||
script = (ScriptApiBase *) *(void**)(lua_touserdata(L, -1));
|
||||
#else
|
||||
script = (ScriptApiBase *) lua_touserdata(L, -1);
|
||||
#endif
|
||||
lua_pop(L, 1);
|
||||
const IGameDef *gamedef = script->getGameDef();
|
||||
if (!gamedef)
|
||||
|
@ -30,7 +30,12 @@ ScriptApiBase *ModApiBase::getScriptApiBase(lua_State *L)
|
||||
{
|
||||
// Get server from registry
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
|
||||
ScriptApiBase *sapi_ptr = (ScriptApiBase*) lua_touserdata(L, -1);
|
||||
ScriptApiBase *sapi_ptr;
|
||||
#if INDIRECT_SCRIPTAPI_RIDX
|
||||
sapi_ptr = (ScriptApiBase*) *(void**)(lua_touserdata(L, -1));
|
||||
#else
|
||||
sapi_ptr = (ScriptApiBase*) lua_touserdata(L, -1);
|
||||
#endif
|
||||
lua_pop(L, 1);
|
||||
return sapi_ptr;
|
||||
}
|
||||
|
@ -162,7 +162,9 @@ int ModApiServer::l_get_player_information(lua_State *L)
|
||||
u32 uptime;
|
||||
u16 prot_vers;
|
||||
u8 ser_vers,major,minor,patch;
|
||||
std::string vers_string;
|
||||
std::string version_string;
|
||||
std::string platform;
|
||||
std::string sysinfo;
|
||||
|
||||
#define ERET(code) \
|
||||
if (!(code)) { \
|
||||
@ -182,7 +184,7 @@ int ModApiServer::l_get_player_information(lua_State *L)
|
||||
&avg_jitter))
|
||||
|
||||
ERET(getServer(L)->getClientInfo(player->getPeerId(), &state, &uptime, &ser_vers,
|
||||
&prot_vers, &major, &minor, &patch, &vers_string))
|
||||
&prot_vers, &major, &minor, &patch, &version_string, &platform, &sysinfo))
|
||||
|
||||
lua_newtable(L);
|
||||
int table = lua_gettop(L);
|
||||
@ -237,7 +239,6 @@ int ModApiServer::l_get_player_information(lua_State *L)
|
||||
lua_pushnumber(L, player->formspec_version);
|
||||
lua_settable(L, table);
|
||||
|
||||
#ifndef NDEBUG
|
||||
lua_pushstring(L,"serialization_version");
|
||||
lua_pushnumber(L, ser_vers);
|
||||
lua_settable(L, table);
|
||||
@ -255,13 +256,20 @@ int ModApiServer::l_get_player_information(lua_State *L)
|
||||
lua_settable(L, table);
|
||||
|
||||
lua_pushstring(L,"version_string");
|
||||
lua_pushstring(L, vers_string.c_str());
|
||||
lua_pushstring(L, version_string.c_str());
|
||||
lua_settable(L, table);
|
||||
|
||||
lua_pushstring(L,"platform");
|
||||
lua_pushstring(L, platform.c_str());
|
||||
lua_settable(L, table);
|
||||
|
||||
lua_pushstring(L,"sysinfo");
|
||||
lua_pushstring(L, sysinfo.c_str());
|
||||
lua_settable(L, table);
|
||||
|
||||
lua_pushstring(L,"state");
|
||||
lua_pushstring(L,ClientInterface::state2Name(state).c_str());
|
||||
lua_settable(L, table);
|
||||
#endif
|
||||
|
||||
#undef ERET
|
||||
return 1;
|
||||
|
@ -432,7 +432,7 @@ int ModApiUtil::l_get_version(lua_State *L)
|
||||
lua_createtable(L, 0, 3);
|
||||
int table = lua_gettop(L);
|
||||
|
||||
lua_pushstring(L, PROJECT_NAME_C);
|
||||
lua_pushstring(L, PROJECT_NAME);
|
||||
lua_setfield(L, table, "project");
|
||||
|
||||
lua_pushstring(L, g_version_string);
|
||||
|
@ -1263,7 +1263,9 @@ bool Server::getClientInfo(
|
||||
u8* major,
|
||||
u8* minor,
|
||||
u8* patch,
|
||||
std::string* vers_string
|
||||
std::string* version_string,
|
||||
std::string* platform,
|
||||
std::string* sysinfo
|
||||
)
|
||||
{
|
||||
*state = m_clients.getClientState(peer_id);
|
||||
@ -1282,7 +1284,9 @@ bool Server::getClientInfo(
|
||||
*major = client->getMajor();
|
||||
*minor = client->getMinor();
|
||||
*patch = client->getPatch();
|
||||
*vers_string = client->getFull();
|
||||
*version_string = client->getFull();
|
||||
*platform = client->getPlatform();
|
||||
*sysinfo = client->getSysInfo();
|
||||
|
||||
m_clients.unlock();
|
||||
|
||||
|
@ -335,7 +335,7 @@ public:
|
||||
bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
|
||||
bool getClientInfo(session_t peer_id, ClientState *state, u32 *uptime,
|
||||
u8* ser_vers, u16* prot_vers, u8* major, u8* minor, u8* patch,
|
||||
std::string* vers_string);
|
||||
std::string* version_string, std::string* platform, std::string* sysinfo);
|
||||
|
||||
void printToConsoleOnly(const std::string &text);
|
||||
|
||||
|
@ -444,14 +444,14 @@ ServerEnvironment::ServerEnvironment(ServerMap *map,
|
||||
warningstream << "/!\\ You are using old player file backend. "
|
||||
<< "This backend is deprecated and will be removed in a future release /!\\"
|
||||
<< std::endl << "Switching to SQLite3 or PostgreSQL is advised, "
|
||||
<< "please read http://wiki.minetest.net/Database_backends." << std::endl;
|
||||
<< "please read http://wiki.minetest.org/Database_backends." << std::endl;
|
||||
}
|
||||
|
||||
if (auth_backend_name == "files") {
|
||||
warningstream << "/!\\ You are using old auth file backend. "
|
||||
<< "This backend is deprecated and will be removed in a future release /!\\"
|
||||
<< std::endl << "Switching to SQLite3 is advised, "
|
||||
<< "please read http://wiki.minetest.net/Database_backends." << std::endl;
|
||||
<< "please read http://wiki.minetest.org/Database_backends." << std::endl;
|
||||
}
|
||||
|
||||
m_player_database = openPlayerDatabase(player_backend_name, path_world, conf);
|
||||
|
@ -389,8 +389,9 @@ void TerminalChatConsole::step(int ch)
|
||||
// draw title
|
||||
move(0, 0);
|
||||
clrtoeol();
|
||||
addstr(PROJECT_NAME_C);
|
||||
addstr(" ");
|
||||
addstr(PROJECT_NAME);
|
||||
// addstr(std::tostring(VERSION_MAJOR));
|
||||
addstr(" VenenuX ");
|
||||
addstr(g_version_hash);
|
||||
|
||||
u32 minutes = m_time_of_day % 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user