Compare commits

...

49 Commits

Author SHA1 Message Date
083087ae78 Check property duplicate login names
* Check for duplicate login in TOSERVER_INIT handler
  backported 492110a640
  i.e. checks for duplicate logins before sending all media data to the client
2023-09-17 20:20:22 -04:00
aa8cfe19db antihacks: Patch fast/teleport vulnerability when attached to an entity
* backported https://github.com/minetest/minetest/pull/10340/commits
* Fixed God Mode
* use core::radToDeg and a single v3f to multiply attachment_pos with
* Use getLength() for diffvec
2023-09-17 20:08:04 -04:00
dfeae6ac92 antihacks : Prevent players accessing inventories of other players
* this backported https://github.com/minetest/minetest/pull/10341
  Inventory: Protect Craft and Drop actions was implemented later
  as Inventory: Protect Craft and Drop actions commit
  backporting https://github.com/minetest/minetest/pull/10353
* also backported https://github.com/minetest/minetest/pull/11035
  Additional inventory access protections
2023-09-17 18:53:42 -04:00
d79506d076 load warning fix for lua src build in 2023-09-17 17:42:12 -04:00
9d09cf17d2 pkgmgr: Fix crash when .conf release field is invalid
* Fixes Issue when trying to access online content
  https://github.com/minetest/minetest/issues/10942
* backported
  cd840b7c9d
2023-09-17 15:25:47 -04:00
2af5896ed1 Slap u64 on everything time-y
* get_us_time() will overflow and reset to zero every now and then.
  Had it happen several times in one day,
  https://github.com/minetest/minetest/issues/10105
* backported b5eda416ce
2023-09-17 15:20:14 -04:00
f0cea26ac5 fix the implements of client enhanced information
* miscmatch of a variable pos
2023-09-11 23:53:57 -04:00
0edc870820 implements client enhanced information
* closes https://codeberg.org/minenux/minetest-engine-multicraft2/issues/49
* it takes from https://github.com/MultiCraft/MultiCraft2/pull/50
* backported from "Add platform information to get_player_information"
2023-09-07 16:06:58 -04:00
b9971da87a Merge branch 'stable-4.0-cifixes' into 'stable-5.2-namespaces'
* fix install apt bypass cert check and
  ajust the packages need for build dependencies
  this forwadport commit 240bad96f75447769b65191c7b1b5ac026ba266f
* this commit forwardport those in final way:
  Fix sourceslit on older distros a0f578e8af5fd5f130be6acbb6923f16f145f36b
  Fix feladora libcurl dependencies 240bad96f75447769b65191c7b1b5ac026ba266f
2023-02-01 00:13:15 -04:00
a1fa6f09dd Fix gitlab ci build step on stable 5.2/5.2-namespase: try 1
* ajust the packages need for build dependencies
* ajust the build parameters for cmake CI build
* remove the packaging and deploy stages
* use only for build checks, gitlab ci are not complety free
* remove packaging we use OBS, add feladora 37, 36, remove olders
* this commit forwardport those:
  fix being stuck at tzdata 22d915301695f4d34729369ee1edcd2631e6d792
  add feladora 37, 36, remove 24 5835777690c1b5dfe673ae25e81552c68c6afaaf
  Fix sourceslit on older distros a0f578e8af5fd5f130be6acbb6923f16f145f36b
  Fix feladora libcurl dependencies 240bad96f75447769b65191c7b1b5ac026ba266f
2023-01-31 23:53:05 -04:00
d75ca63de4 featured powered player setttings : dig
* dragon fire hacked, the instant dig is currently false for now
2023-01-07 18:25:20 -04:00
9b877249e3 Don't allow banning in singleplayer
* fixes https://github.com/minetest/minetest/issues/11819)
2023-01-07 18:01:59 -04:00
c9d8b13b00 changing references to real final minetest.org from oldcoder 2022-12-29 13:20:57 -04:00
mckaygerhard
06ea7329de Adap the "Remove unnecessary float limits from script API" to checks of floats
* backport 8ff3fadba0
* issues related:
    * https://github.com/minetest/minetest/issues/11742
    * https://github.com/minetest/minetest/issues/6129
* really close #4
* TODO adapt to use FLOAT checks
2022-07-20 21:55:33 +02:00
b08d3334a2 Invalid float vector dimension range: clamp and warn instead of crash
* backported from https://github.com/minetest/minetest/pull/12389
* issues related:
    * https://github.com/minetest/minetest/issues/11742
    * https://github.com/minetest/minetest/issues/6129
* close https://codeberg.org/minenux/minetest-engine-minetest/issues/4
2022-06-03 16:34:30 -04:00
3645c3538b real install all found games dirs, fix f29d050767579e55f1c434d89f198cbeb38673dc
* the commit was wrongly made, commit f29d050767579e55f1c434d89f198cbeb38673dc
  uses a "*" and we nee to follow cmake doc as  http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:install
2022-03-22 16:45:18 -04:00
sfan5
744a72922d Look for PostgreSQL library properly and fix CI
* fixed in cmake 3.20 but it's relatively easy to add a workaround
* This was only fixed by Kitware/CMake@8b066f1 (CMake 3.20),
* backported a24899bf2d
2021-12-03 22:13:14 -04:00
f29d050767 install all found games so no matter what names changed the default one 2021-12-03 18:52:05 -04:00
sfan5
30386f391c Remove std::shared_ptr use in TileLayer
* https://github.com/minetest/minetest/pull/10090
2021-12-03 18:38:40 -04:00
3c730e2250 temporally comment mersioned title due invalid c++ conversion 2021-12-02 23:04:40 -04:00
lhofhansl
3a4d01b75a Fix build for newer versions of GCC (#11246) 2021-12-02 21:52:48 -04:00
3845cd5b90 minetest game submodule updated to use new art and name minenux 2021-11-30 22:52:06 -04:00
bf574d8019 fix flags: complete fix for 4ef3bc602f and set C++11/C++0X depends on compiler
* related to https://codeberg.org/minenux/minetest-engine/issues/18
* buildin jsoncpp need it to compile, so use gnu++11
* use c++11 but with gnu xtensions
* related to https://codeberg.org/minenux/minetest-engine/issues/14
* complete fix for 4ef3bc602f and set C++11/C++0X depends on compiler
* final set continuation of commit 4ef3bc602fbbf45eccf21789f3eff2776b58a78b
* property fix backported commit 582ee14446
* added missing flags for standar 11 in CC not only in C++
* property set flags due C++11 now is need in all the code
* almost the last changes need c++11 standard, this is c++0x in olders
2021-11-30 22:10:04 -04:00
8ccf85df69 Fix no locales being generated when APPLY_LOCALE_BLACKLIST=0
* backported from 6caed7073c
2021-11-30 17:44:33 -04:00
bbd624535b missing end line on c++ keycode stream 2021-11-30 17:35:10 -04:00
orbea
01e0eab930 Fix Install the locale directory in a standard location
* related https://codeberg.org/minenux/minetest-engine/issues/20
* fixed builds in linux distributions
* already done 2349d31bae
* related: https://github.com/minetest/minetest/pull/9618
* backported ca8957f500
* Fix detection of in-place path_locale when RUN_IN_PLACE=0
* related: https://github.com/minetest/minetest/issues/9745
* cmake: Silence warnings backported https://github.com/minetest/minetest/pull/9750
* Fixes https://github.com/minetest/minetest/issues/9734
2021-11-30 17:29:57 -04:00
2e72eabafe Fix detection of in-place path_locale when RUN_IN_PLACE=0
* adress https://codeberg.org/minenux/minetest-engine/issues/20
* broken by 2349d31bae1bfc4d58fd88efbc88261e69b11dad (side effect)
* https://github.com/minetest/minetest/issues/9745
2021-11-30 17:04:39 -04:00
4ef3bc602f set C++11/C++0X depends on compiler
* almost the last changes need c++11 standard, this is c++0x in olders
* build in jsoncpp need it to compile
2021-11-29 09:31:32 -04:00
2e12ab8aff fix misctakes on commit f65bba2e5c326ac064d7b9a979e11565a47d2a9b
* original work mistakes on some macros
2021-11-29 09:07:02 -04:00
d8a931c7b3 as submodule set minetest 5 game with some backports from 5.3
* Use node particles for TNT explosions
  featured https://github.com/minetest/minetest_game/pull/2695
* Fix builtin item metatable
  backported https://github.com/minetest/minetest_game/pull/2328
* updated README for our fork minenux
* minetest 5 game with some backports from 5.3
* Fix boat floating in the air when water being drained away
  backported https://github.com/minetest/minetest_game/pull/2788
  fixed
* Do not crash when a skeleton key is used on an unknown node
  backported https://github.com/minetest/minetest_game/pull/2806
* default: Add missing nodes to list
  backported https://github.com/minetest/minetest_game/pull/2799
* Fix crash on TNT explosions if tnt is disabled
2021-11-23 23:24:17 -04:00
de8b12ef5d provide the minetest game as submodule, so we can work unified in sync
* change README to my repos
* change git ignore to include necessary
* aded one module the minetest game
* set default game to minetest
2021-11-23 22:39:06 -04:00
sfan5
ec10d728b6 Fix broken config check in 659245a 2021-11-23 21:59:49 -04:00
618bf71179 fixed the d value to fix collision glitches using 0.3f
* Either way is fine, even if this turns out to make things better
  it can't solve all issues. Ultimately the d has to go and the current
  solution is beyond repair imo.
* backported comits are in:
    * https://github.com/minetest/minetest/pull/9365
    * https://github.com/minetest/minetest/pull/9327
* fixes:
    * https://github.com/minetest/minetest/issues/6886
      Unexpected collision when beginning a jump that pushes the player
    * https://github.com/minetest/minetest/issues/9143
      Huge increase in collision since 5.X

* code updating respect 5.X conflicts:
	src/collision.cpp
2021-11-23 17:36:28 -04:00
df01036c3f CMake: link with Intl when necessary for kfreebsd of non-glibc libs like alpine
* non Glibc system linking with Intl library may be needed whenGettext support is enabled.
* https://git.alpinelinux.org/aports/tree/community/minetest/0001-CMake-link-with-Intl-when-necessary.patch
* Fixes: clientlauncher.cpp:(.text+0xcac): undefined reference to `libintl_gettext'
2021-11-22 00:58:43 -04:00
bdec7dde0b use pkg-config to find luajit
* From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Date: Tue, 27 Dec 2016 15:23:09 +0100
* cherry-pick 7336cbdfe22fb7a774359b325bc6a65cfa6a729d
2021-11-22 00:10:10 -04:00
338d383d47 Fix FreeBSD aarch64 faulies when use luajit
* FreeBSD uses lld, and lld does not support -Ttext-segment,
  suggesting --image-base instead. Not sure if it's equivalent change
  for the purpose at least if fixes build on FreeBSD/aarch64.
  Note that the code checks for FreeBSD, while it should really check
  for lld on any system, however I don't know any CMake facilities which allow this
* https://codeberg.org/minenux/minetest-engine/issues/16
2021-11-21 22:52:44 -04:00
Wuzzy
d59ae5df31 Print error if invalid mapgen alias was detected (#9579) 2021-11-21 22:36:38 -04:00
DS
1ab22891da Allow to select en as language in settings menu (#9604)
fixes #9599
2021-11-21 22:35:51 -04:00
sfan5
0c8a31c2b2 Work around LuaJIT issues on aarch64 (#9614)
- Move the text segment below the 47-bit limit, needed for script_exception_wrapper which must be lightuserdata
- Replace CUSTOM_RIDX_SCRIPTAPI with full userdata
2021-11-21 21:48:48 -04:00
rubenwardy
5840875a39 Clarify use of minetest.request_insecure_environment() (#9597) 2021-11-21 20:43:23 -04:00
Danila Shutov
d205d1715f Add tone mapping for entities (#9521)
fixes #9301
2021-11-21 20:39:48 -04:00
Wren Turkal
40aa13b63d Add allowed_mapgens option in game.conf. (#9263)
The game.conf has a disallowed_mapgens option. However, some games
require a certain mapgen to be used, like the CTF plugin. This change
adds an option to specify allowed mapgens so that the setting can be
specified in a way that needn't be updated as map generators are added
to Minetest.
2021-11-21 20:38:22 -04:00
Wuzzy
1059d2ab9c Some minor Lua API documentation clarifications (#9461)
See #5854
2021-11-21 20:36:59 -04:00
Paramat
46c71062e4 merge commit 1bcdc2d7 for docs fixed in buildin minimal game 2021-11-21 20:29:32 -04:00
rubenwardy
f96a7c33e0 Fix build on FreeBSD, broken since open_url 2021-11-21 20:21:50 -04:00
SmallJoker
1fbdbc145c Silence GCC warning in mapblock_mesh
Fixes following warning:
  warning: ‘waving’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2021-11-21 20:20:33 -04:00
sfan5
70b5e43403 Fix build error on Ubuntu 16.04 2021-11-21 20:08:30 -04:00
822ab80f30 retrieve more client info on minetest 5.X or 5.2 for minetest5
* take from https://forum.minetest.net/viewtopic.php?p=354631#p354631
* usefull for give more info for idetification of clients cheaters
2021-11-21 19:54:55 -04:00
f65bba2e5c use minetest<version> as name per program and files
* permits to handle multiple versions of minetest on same integration
* permits better integration for distributions on linux and mac
* for progress on https://codeberg.org/minenux/minetest-engine/issues/6
* fix missing include dir for subgame.cpp
2021-11-21 14:59:53 -04:00
72 changed files with 847 additions and 806 deletions

11
.github/SECURITY.md vendored
View File

@ -2,16 +2,13 @@
## Supported Versions ## Supported Versions
We only support the latest stable version for security issues. We only support the minenux stable version for security issues.
See the [releases page](https://github.com/minetest/minetest/releases). See the [releases page](https://github.com/minenux/minetest-engine-minetest/releases).
## Reporting a Vulnerability ## Reporting a Vulnerability
We ask that you report vulnerabilities privately, by contacting a core developer, We ask that you report vulnerabilities only using telegram group: https://t.me/venenux_minetest_bot
to give us time to fix them. You can do that by emailing one of the following addresses: to give us time to fix them.
* celeron55@gmail.com
* rubenwardy@minetest.net
Depending on severity, we will either create a private issue for the vulnerability 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. and release a patch version of Minetest, or give you permission to file the issue publicly.

1
.gitignore vendored
View File

@ -37,6 +37,7 @@ gtags.files
/bin/ /bin/
/games/* /games/*
!/games/minimal/ !/games/minimal/
!/games/minetest/
/cache /cache
/textures/* /textures/*
!/textures/base/ !/textures/base/

View File

@ -1,16 +1,12 @@
--- ---
# Github repository is cloned every day on Gitlab.com # Github repository is really at minetest.org using the poikilos git.minetest.io
# https://gitlab.com/minetest/minetest # https://gitlab.com/minenux/minetest-engine-minetest
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines # 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: stages:
- build - 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 .build_template: &build_definition
stage: build stage: build
@ -18,45 +14,17 @@ variables:
- mkdir cmakebuild - mkdir cmakebuild
- mkdir -p artifact/minetest/usr/ - mkdir -p artifact/minetest/usr/
- cd cmakebuild - cd cmakebuild
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE .. - 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 -j2 - make -j$(nproc)
- make install - make install
artifacts: artifacts:
when: on_success when: on_success
expire_in: 2h expire_in: 1h
paths: paths:
- artifact/* - 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 # Jessie
@ -65,29 +33,11 @@ build:debian-8:
<<: *build_definition <<: *build_definition
image: debian:8 image: debian:8
before_script: before_script:
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list - echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F - echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- apt-get update -y - echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
- 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 - apt-get update -y || true
variables: - 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
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
# Stretch # Stretch
@ -95,246 +45,78 @@ build:debian-9:
<<: *build_definition <<: *build_definition
image: debian:9 image: debian:9
before_script: before_script:
- apt-get update -y - echo "" > /etc/apt/apt.conf.d/50venenuxcustom
- 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 "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: # Bullseye
image: debian:9
dependencies:
- build:debian-9
variables:
LEVELDB_PKG: libleveldb1v5
<<: *debpkg_template
deploy:debian-9: build:debian-11:
image: debian:9 <<: *build_definition
dependencies: image: debian:11
- package:debian-9 before_script:
variables: - apt-get update -y || true
LEVELDB_PKG: libleveldb1v5 - 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
<<: *debpkg_install
## ##
## Ubuntu ## winbuntu the distro for stupid users
## ##
# Trusty # Focal most close to bullseye
build:ubuntu-14.04: build:ubuntu-20.04:
<<: *build_definition
image: ubuntu:focal
before_script:
- 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
# Utopic most close to jessie
build:ubuntu-14.10:
<<: *build_definition
image: ubuntu:utopic
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/ 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
##
## Feladora shit distro
##
build:fedora-36:
<<: *build_definition <<: *build_definition
image: ubuntu:trusty image: fedora:36
before_script: before_script:
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list - 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
- 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:ubuntu-14.04: build:fedora-37:
image: ubuntu:trusty
dependencies:
- build:ubuntu-14.04
variables:
LEVELDB_PKG: libleveldb1
<<: *debpkg_template
deploy:ubuntu-14.04:
image: ubuntu:trusty
dependencies:
- package:ubuntu-14.04
variables:
LEVELDB_PKG: libleveldb1
<<: *debpkg_install
# Xenial
build:ubuntu-16.04:
<<: *build_definition <<: *build_definition
image: ubuntu:xenial image: fedora:37
before_script: before_script:
- apt-get update -y - 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
- 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.04:
image: ubuntu:xenial
dependencies:
- build:ubuntu-16.04
variables:
LEVELDB_PKG: libleveldb1v5
<<: *debpkg_template
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_definition
image: fedora:24
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
##
## Mingw for Windows
##
.generic_win_template: &generic_win_template
image: ubuntu:bionic
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
.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
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

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "games/minetest"]
path = games/minetest
url = https://codeberg.org/minenux/minetest-game-minetest.git

View File

@ -7,17 +7,55 @@ endif()
# This can be read from ${PROJECT_NAME} after project() is called # This can be read from ${PROJECT_NAME} after project() is called
project(minetest) 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
set(CMAKE_CXX_STANDARD 11) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(GCC_MINIMUM_VERSION "4.8") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(CLANG_MINIMUM_VERSION "3.4") 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)
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 # Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(VERSION_MAJOR 5) set(VERSION_MAJOR 5)
set(VERSION_MINOR 2) set(VERSION_MINOR 2)
set(VERSION_PATCH 0) set(VERSION_PATCH 1)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string") set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases # Change to false for releases
@ -75,11 +113,11 @@ if(WIN32)
set(EXAMPLE_CONF_DIR ".") set(EXAMPLE_CONF_DIR ".")
set(LOCALEDIR "locale") set(LOCALEDIR "locale")
elseif(APPLE) elseif(APPLE)
set(BUNDLE_NAME ${PROJECT_NAME}.app) set(BUNDLE_NAME ${PROJECT_NAME}${VERSION_MAJOR}.app)
set(BUNDLE_PATH "${BUNDLE_NAME}") set(BUNDLE_PATH "${BUNDLE_NAME}")
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS) set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources) set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}") set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}${VERSION_MAJOR}")
set(EXAMPLE_CONF_DIR ${DOCDIR}) set(EXAMPLE_CONF_DIR ${DOCDIR})
set(LOCALEDIR "${SHAREDIR}/locale") set(LOCALEDIR "${SHAREDIR}/locale")
elseif(UNIX) # Linux, BSD etc elseif(UNIX) # Linux, BSD etc
@ -88,21 +126,21 @@ elseif(UNIX) # Linux, BSD etc
set(BINDIR "bin") set(BINDIR "bin")
set(DOCDIR "doc") set(DOCDIR "doc")
set(EXAMPLE_CONF_DIR ".") set(EXAMPLE_CONF_DIR ".")
set(MANDIR "unix/man") set(MANDIR "man")
set(XDG_APPS_DIR "unix/applications") set(XDG_APPS_DIR "applications")
set(APPDATADIR "unix/metainfo") set(APPDATADIR "metainfo")
set(ICONDIR "unix/icons") set(ICONDIR "icons")
set(LOCALEDIR "locale") set(LOCALEDIR "locale")
else() 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(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(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
set(EXAMPLE_CONF_DIR ${DOCDIR}) set(EXAMPLE_CONF_DIR ${DOCDIR})
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications") set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo") set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo")
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons") 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()
endif() endif()
@ -164,9 +202,7 @@ if(RUN_IN_PLACE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures") install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
endif() endif()
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game" DESTINATION "${SHAREDIR}/games/" install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/" DESTINATION "${SHAREDIR}/games"
COMPONENT "SUBGAME_MINETEST_GAME" OPTIONAL PATTERN ".git*" EXCLUDE )
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minimal" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE ) COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE )
if(BUILD_CLIENT) 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/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.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 "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) if(UNIX AND NOT APPLE)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6") install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}") install(FILES "doc/minetestserver.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}${VERSION_MAJOR}server.6")
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}") install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}" RENAME "net.minetest.${PROJECT_NAME}${VERSION_MAJOR}.desktop")
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps") install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}" RENAME "net.minetest.${PROJECT_NAME}${VERSION_MAJOR}.appdata.xml")
install(FILES "misc/minetest-xorg-icon-128.png" install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.svg")
DESTINATION "${ICONDIR}/hicolor/128x128/apps" install(FILES "misc/minetest-xorg-icon-128.png" DESTINATION "${ICONDIR}/hicolor/128x128/apps" RENAME "${PROJECT_NAME}${VERSION_MAJOR}.png")
RENAME "minetest.png")
endif() endif()
if(APPLE) 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") install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
endif() endif()
@ -207,9 +242,9 @@ find_package(GMP REQUIRED)
find_package(Json REQUIRED) find_package(Json REQUIRED)
find_package(Lua 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) if(NOT ENABLE_SYSTEM_JSONCPP)
set(GCC_MINIMUM_VERSION "4.9") set(GCC_MINIMUM_VERSION "4.6")
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -243,12 +278,12 @@ include(CPackComponent)
cpack_add_component(Docs cpack_add_component(Docs
DISPLAY_NAME "Documentation" 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 cpack_add_component(SUBGAME_MINETEST_GAME
DISPLAY_NAME "Minetest Game" DISPLAY_NAME "${PROJECT_NAME}${VERSION_MAJOR} Game"
DESCRIPTION "The official subgame for the Minetest engine, that can easily extended by mods." DESCRIPTION "The official subgame for the ${PROJECT_NAME}${VERSION_MAJOR} engine, that can easily extended by mods."
GROUP "Subgames" GROUP "Subgames"
) )
@ -260,7 +295,7 @@ cpack_add_component(SUBGAME_MINIMAL
) )
cpack_add_component_group(Subgames cpack_add_component_group(Subgames
DESCRIPTION "Games for the Minetest engine." DESCRIPTION "Games for the ${PROJECT_NAME}${VERSION_MAJOR} engine."
) )
if(WIN32) if(WIN32)
@ -269,21 +304,21 @@ if(WIN32)
if(RUN_IN_PLACE) if(RUN_IN_PLACE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) 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() else()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32") set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}${VERSION_MAJOR}-${VERSION_STRING}-win32")
endif() endif()
set(CPACK_GENERATOR ZIP) set(CPACK_GENERATOR ZIP)
else() else()
set(CPACK_GENERATOR WIX ZIP) set(CPACK_GENERATOR WIX ZIP)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}") set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${VERSION_MAJOR}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_CAPITALIZED}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}${VERSION_MAJOR}")
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}") set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME}${VERSION_MAJOR} "${PROJECT_NAME}${VERSION_MAJOR}")
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME}) 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 # Supported languages can be found at
# http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html # 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") #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() endif()
elseif(APPLE) elseif(APPLE)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) 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) set(CPACK_GENERATOR ZIP)
else() 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_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ) set(CPACK_SOURCE_GENERATOR TGZ)
endif() endif()

View File

@ -3,11 +3,11 @@ FROM debian:stretch
USER root USER root
RUN apt-get update -y && \ RUN apt-get update -y && \
apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev \ 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 \ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE \
-DBUILD_SERVER=TRUE \ -DBUILD_SERVER=TRUE \
-DBUILD_CLIENT=FALSE \ -DBUILD_CLIENT=FALSE \
@ -21,21 +21,21 @@ RUN mkdir -p /usr/src/minetest/cmakebuild && cd /usr/src/minetest/cmakebuild &&
FROM debian:stretch FROM debian:stretch
USER root 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 update -y && \
apt-get -y install libcurl3-gnutls libjsoncpp1 liblua5.1-0 libluajit-5.1-2 libpq5 libsqlite3-0 \ apt-get -y install libcurl3-gnutls libjsoncpp1 liblua5.1-0 libluajit-5.1-2 libpq5 libsqlite3-0 \
libstdc++6 zlib1g libc6 && \ libstdc++6 zlib1g libc6 && \
apt-get clean && rm -rf /var/cache/apt/archives/* && \ apt-get clean && rm -rf /var/cache/apt/archives/* && \
rm -rf /var/lib/apt/lists/* 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/share/minetest5 /usr/local/share/minetest5
COPY --from=0 /usr/local/bin/minetestserver /usr/local/bin/minetestserver COPY --from=0 /usr/local/bin/minetest5server /usr/local/bin/minetest5server
COPY --from=0 /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf COPY --from=0 /usr/local/share/doc/minetest5/minetest5.conf.example /etc/minetest5/minetest5.conf
USER minetest USER minetest5
EXPOSE 30000/udp 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
View File

@ -1,20 +1,24 @@
Minetest Minetest5
======== =========
[![Build Status](https://travis-ci.org/minetest/minetest.svg?branch=master)](https://travis-ci.org/minetest/minetest)
[![Translation status](https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg)](https://hosted.weblate.org/engage/minetest/?utm_source=widget) [![Translation status](https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg)](https://hosted.weblate.org/engage/minetest/?utm_source=widget)
[![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) [![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](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. 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> Copyright (C) 2010-2019 Perttu Ahola <celeron55@gmail.com>
and contributors (see source file comments and the version control log) and contributors (see source file comments and the version control log)
In case you downloaded the source code 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/) If you downloaded the **Minetest5 Engine** source code from git, in which this file is
project too. See its README.txt for more information. 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 Table of Contents
------------------ ------------------
@ -31,15 +35,32 @@ Table of Contents
Further documentation Further documentation
---------------------- ----------------------
- Website: http://minetest.net/ - This sources https://codeberg.org/minenux/minetest-engine/src/branch/stable-5.2-namespace
- Wiki: http://wiki.minetest.net/ - Minetest4 sources https://codeberg.org/minenux/minetest-engine/src/branch/stable-4.0-namespace
- Developer wiki: http://dev.minetest.net/ - Wiki of this project (minenux) https://codeberg.org/venenux/venenux-minetest/wiki
- Forum: http://forum.minetest.net/ - Original Minetest Website: http://minetest.org/
- GitHub: https://github.com/minetest/minetest/ - 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 - [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 Default controls
---------------- ----------------
All controls are re-bindable using settings. All controls are re-bindable using settings.
Some can be changed in the key config dialog in the settings tab. 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 Paths
----- -----
Locations: Locations:
* `bin` - Compiled binaries * `bin` - Compiled binaries
@ -91,41 +113,40 @@ Locations:
Where each location is on each platform: Where each location is on each platform:
* Windows .zip / RUN_IN_PLACE source: * Others OS's / RUN_IN_PLACE source:
* `bin` = `bin` * `bin` = `bin`
* `share` = `.` * `share` = `.`
* `user` = `.` * `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: * Linux installed:
* `bin` = `/usr/bin` * `bin` = `/usr/bin`
* `share` = `/usr/share/minetest` * `share` = `/usr/share/minetest5`
* `user` = `~/.minetest` * `user` = `~/.minetest5`
* macOS: * macOS:
* `bin` = `Contents/MacOS` * `bin` = `Contents/MacOS`
* `share` = `Contents/Resources` * `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/` Worlds can be found as separate folders in: `user/worlds/`
Configuration file Configuration file
------------------ ------------------
- Default location: - Default location:
`user/minetest.conf` `user/minetest5.conf`
- This file is created by closing Minetest for the first time. - This file is created by closing Minetest for the first time.
- A specific file can be specified on the command line: - A specific file can be specified on the command line:
`--config <path-to-file>` `--config <path-to-file>`
- A run-in-place build will look for the configuration file in - 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 Command-line options
-------------------- --------------------
- Use `--help` - Use `--help`
Compiling Compiling
--------- ---------
### Compiling on GNU/Linux ### Compiling on GNU/Linux
#### Dependencies #### Dependencies
@ -134,7 +155,7 @@ Compiling
|------------|---------|------------| |------------|---------|------------|
| GCC | 4.9+ | Can be replaced with Clang 3.4+ | | GCC | 4.9+ | Can be replaced with Clang 3.4+ |
| CMake | 2.6+ | | | CMake | 2.6+ | |
| Irrlicht | 1.7.3+ | | | Irrlicht | 1.6.0+ | Custom version recommended, see https://github.com/minetest/irrlicht |
| SQLite3 | 3.0+ | | | SQLite3 | 3.0+ | |
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present | | LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
| GMP | 5.0.0+ | Bundled mini-GMP 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: 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 cd minetest
Download minetest_game (otherwise only the "Minimal development test" game is available) using Git: 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: Download source, without using Git:
wget https://github.com/minetest/minetest/archive/master.tar.gz wget https://codeberg.org/minenux/minetest-engine/archive/stable-5.2.tar.gz
tar xf master.tar.gz tar xf stable-5.2.tar.gz
cd minetest-master cd stable-5.2
Download minetest_game, without using Git: Download minetest_game, without using Git:
cd games/ cd games/
wget https://github.com/minetest/minetest_game/archive/master.tar.gz wget https://codeberg.org/minenux/minetest-game-minetest/archive/stable-5.2.tar.gz
tar xf master.tar.gz tar xf stable-5.2.tar.gz
mv minetest_game-master minetest_game mv minetest-game-minetest_stable-5.2 minetest
cd .. cd ..
#### Build #### 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 cmake . -DRUN_IN_PLACE=TRUE
make -j$(nproc) make -j$(nproc)
@ -295,90 +316,9 @@ Library specific options:
ZLIB_INCLUDE_DIR - Directory that contains zlib.h ZLIB_INCLUDE_DIR - Directory that contains zlib.h
ZLIB_LIBRARY - Path to libz.a/libz.so/zlib.lib 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 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: 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 Version scheme
-------------- --------------
We use `major.minor.patch` since 5.0.0-dev. Prior to that we used `0.major.minor`. 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 In minenux we used `4.minor.patch` for 0.4.X and `5.2.patch` for 5.2.X
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.
Since 5.0.0-dev and 0.4.17-dev, the dev notation refers to the next release, - Major in minenux is used only to those two releases, until 6.X comes in.
i.e.: 5.0.0-dev is the development version leading to 5.0.0. - Minor in 4.X will be always "0" cos will be only backported things.
Prior to that we used `previous_version-dev`. - 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.

View File

@ -940,6 +940,9 @@ core.register_chatcommand("ban", {
if not core.get_player_by_name(param) then if not core.get_player_by_name(param) then
return false, "Player is not online." return false, "Player is not online."
end end
if core.is_singleplayer() then
return false, "You cannot ban players in singleplayer!"
end
if not core.ban_player(param) then if not core.ban_player(param) then
return false, "Failed to ban player." return false, "Failed to ban player."
end end

View File

@ -39,11 +39,24 @@ local function create_world_formspec(dialogdata)
local gamepath = game_by_gameidx.path local gamepath = game_by_gameidx.path
local gameconfig = Settings(gamepath.."/game.conf") 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() local disallowed_mapgens = (gameconfig:get("disallowed_mapgens") or ""):split()
for key, value in pairs(disallowed_mapgens) do for key, value in pairs(disallowed_mapgens) do
disallowed_mapgens[key] = value:trim() disallowed_mapgens[key] = value:trim()
end 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 if disallowed_mapgens then
for i = #mapgens, 1, -1 do for i = #mapgens, 1, -1 do
if table.indexof(disallowed_mapgens, mapgens[i]) > 0 then if table.indexof(disallowed_mapgens, mapgens[i]) > 0 then
@ -87,11 +100,11 @@ local function create_world_formspec(dialogdata)
if #pkgmgr.games == 0 then if #pkgmgr.games == 0 then
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" .. retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
fgettext("You have no games installed.") .. "]label[2.25,4.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 elseif #pkgmgr.games == 1 and pkgmgr.games[1].id == "minimal" then
retval = retval .. "box[1.75,4;8.7,1;#ff8800]label[2,4;" .. 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("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 end
return retval return retval

View File

@ -11,14 +11,14 @@ local minetest_example_header = [[
# By default, all the settings are commented and not functional. # By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #. # Uncomment settings by removing the preceding #.
# minetest.conf is read by default from: # minetest5.conf is read by default from:
# ../minetest.conf # ../minetest5.conf
# ../../minetest.conf # ../../minetest5.conf
# Any other path can be chosen by passing the path as a parameter # 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: # Further documentation:
# http://wiki.minetest.net/ # http://wiki.minetest.org/
]] ]]

View File

@ -118,7 +118,7 @@ local function init_globals()
menudata.worldlist:set_sortmode("alphabetic") menudata.worldlist:set_sortmode("alphabetic")
if not core.settings:get("menu_last_game") then 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) core.settings:set("menu_last_game", default_game)
end end

View File

@ -107,7 +107,7 @@ function get_mods(path,retval,modpack)
-- Read from config -- Read from config
toadd.name = name toadd.name = name
toadd.author = mod_conf.author 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.path = prefix
toadd.type = "mod" toadd.type = "mod"
@ -155,7 +155,7 @@ function pkgmgr.get_texture_packs()
retval[#retval + 1] = { retval[#retval + 1] = {
name = item, name = item,
author = conf:get("author"), author = conf:get("author"),
release = tonumber(conf:get("release") or "0"), release = tonumber(conf:get("release") or 0),
list_name = name, list_name = name,
type = "txp", type = "txp",
path = path, path = path,

View File

@ -101,8 +101,8 @@ return {
local logofile = defaulttexturedir .. "logo.png" local logofile = defaulttexturedir .. "logo.png"
local version = core.get_version() local version = core.get_version()
return "image[0.5,1;" .. core.formspec_escape(logofile) .. "]" .. return "image[0.5,1;" .. core.formspec_escape(logofile) .. "]" ..
"label[0.5,3.2;" .. version.project .. " " .. version.string .. "]" .. "label[0.5,3.2;" .. version.project .. " MinenuX fork" .. " " .. version.string .. "]" ..
"label[0.5,3.5;http://minetest.net]" .. "label[0.5,3.5;http://minetest.org]" ..
"tablecolumns[color;text]" .. "tablecolumns[color;text]" ..
"tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
"table[3.5,-0.25;8.5,6.05;list_credits;" .. "table[3.5,-0.25;8.5,6.05;list_credits;" ..

View File

@ -42,10 +42,10 @@
# Flags are always separated by comma without spaces. # Flags are always separated by comma without spaces.
# - default possible_flags # - default possible_flags
# * noise_params_2d: # * 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 # - default
# * noise_params_3d: # * 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 # - default
# * v3f: # * v3f:
# Format is (<X>, <Y>, <Z>) # Format is (<X>, <Y>, <Z>)
@ -561,9 +561,6 @@ enable_parallax_occlusion (Parallax occlusion) bool false
# 1 = relief mapping (slower, more accurate). # 1 = relief mapping (slower, more accurate).
parallax_occlusion_mode (Parallax occlusion mode) int 1 0 1 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. # Number of parallax occlusion iterations.
parallax_occlusion_iterations (Parallax occlusion iterations) int 4 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. # Note that the interlaced mode requires shaders to be enabled.
3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside,crossview,pageflip 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%). # In-game chat console height, between 0.1 (10%) and 1.0 (100%).
console_height (Console height) float 0.6 0.1 1.0 console_height (Console height) float 0.6 0.1 1.0
@ -996,16 +996,16 @@ show_debug (Show debug info) bool false
[Server / Singleplayer] [Server / Singleplayer]
# Name of the server, to be displayed when players join and in the serverlist. # 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. # Description of server, to be displayed when players join and in the serverlist.
server_description (Server description) string mine here server_description (Server description) string mine here
# Domain name of server, to be displayed in the serverlist. # 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. # 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. # Automatically report to the serverlist.
server_announce (Announce server) bool false 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. # Default game when creating a new world.
# This will be overridden when creating a world from the main menu. # 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. # Message of the day displayed to players connecting.
motd (Message of the day) string 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). # active block stuff, stated in mapblocks (16 nodes).
# In active blocks objects are loaded and ABMs run. # In active blocks objects are loaded and ABMs run.
# This is also the minimum range in which active objects (mobs) are maintained. # 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 active_block_range (Active block range) int 3
# From how far blocks are sent to clients, stated in mapblocks (16 nodes). # 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. # Set the language. Leave empty to use the system language.
# A restart is required after changing this. # 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: # Level of logging to be written to debug.txt:
# - <nothing> (no logging) # - <nothing> (no logging)
@ -2135,3 +2135,12 @@ contentdb_url (ContentDB URL) string https://content.minetest.net
# These flags are independent from Minetest versions, # These flags are independent from Minetest versions,
# so see a full list at https://content.minetest.net/help/content_flags/ # so see a full list at https://content.minetest.net/help/content_flags/
contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default 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

View File

@ -25,6 +25,38 @@ const float BS = 10.0;
const float fogStart = FOG_START; const float fogStart = FOG_START;
const float fogShadingParameter = 1 / ( 1 - fogStart); 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() void get_texture_flags()
{ {
vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0)); vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0));
@ -114,6 +146,11 @@ void main(void)
vec4 col = vec4(color.rgb, base.a); vec4 col = vec4(color.rgb, base.a);
col.rgb *= emissiveColor.rgb * vIDiff; 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 ?), // 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 // the fog will only be rendered correctly if the last operation before the
// clamp() is an addition. Else, the clamp() seems to be ignored. // clamp() is an addition. Else, the clamp() seems to be ignored.

View File

@ -55,10 +55,10 @@ endif(WIN32)
include(FindPackageHandleStandardArgs) 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 # BSD variants require special linkage as they don't use glibc
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly") if(${CMAKE_SYSTEM_NAME} MATCHES "BSD|DragonFly")
set(GETTEXT_LIBRARY "intl") set(GETTEXT_LIBRARY "intl")

View File

@ -11,14 +11,14 @@ if(ENABLE_SYSTEM_JSONCPP)
find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp) find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp)
include(FindPackageHandleStandardArgs) 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.") message(STATUS "Using system JSONCPP library.")
endif() endif()
endif() endif()
if(NOT JSONCPP_FOUND) if(NOT JSON_FOUND)
message(STATUS "Using bundled JSONCPP library.") message(STATUS "Using bundled JSONCPP library.")
set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jsoncpp) set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jsoncpp)
set(JSON_LIBRARY jsoncpp) set(JSON_LIBRARY jsoncpp)

View File

@ -6,56 +6,16 @@
# #
# This module is similar to FindLua51.cmake except that it finds LuaJit instead. # This module is similar to FindLua51.cmake except that it finds LuaJit instead.
FIND_PATH(LUA_INCLUDE_DIR luajit.h find_package (PkgConfig REQUIRED)
HINTS pkg_check_modules (LuaJIT QUIET REQUIRED luajit)
$ENV{LUA_DIR} set (LUA_LIBRARY ${LuaJIT_LIBRARIES})
PATH_SUFFIXES include/luajit-2.1 include/luajit-2.0 include/luajit-5_1-2.1 include/luajit-5_1-2.0 include luajit set (LUA_INCLUDE_DIR ${LuaJIT_INCLUDE_DIRS})
PATHS set (LUA_VERSION_STRING ${LuaJIT_VERSION})
~/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()
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT
REQUIRED_VARS LUA_LIBRARY LUA_INCLUDE_DIR REQUIRED_VARS LUA_LIBRARY LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING) VERSION_VAR LUA_VERSION_STRING)

View File

@ -20,13 +20,13 @@ if(NOT GP2XWIZ)
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
# to TRUE if all listed variables are TRUE. # to TRUE if all listed variables are TRUE.
include(FindPackageHandleStandardArgs) 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_INCLUDE_DIR VORBIS_INCLUDE_DIR
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY) OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
else(NOT GP2XWIZ) else(NOT GP2XWIZ)
find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h) find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
find_library(VORBIS_LIBRARY NAMES vorbis_dec) 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) VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
endif(NOT GP2XWIZ) endif(NOT GP2XWIZ)

View File

@ -1,7 +1,6 @@
Minetest Lua Client Modding API Reference 5.2.0 Minetest Lua Client Modding API Reference 5.2.0
================================================ ================================================
* More information at <http://www.minetest.net/> * More information at <http://www.minetest.org/>
* Developer Wiki: <http://dev.minetest.net/>
Introduction Introduction
------------ ------------

View File

@ -1,8 +1,7 @@
Minetest Lua Modding API Reference Minetest Lua Modding API Reference
================================== ==================================
* More information at <http://www.minetest.net/> * More information at <http://www.minetest.org/>
* Developer Wiki: <http://dev.minetest.net/>
* (Unofficial) Minetest Modding Book by rubenwardy: <https://rubenwardy.com/minetest_modding_book/> * (Unofficial) Minetest Modding Book by rubenwardy: <https://rubenwardy.com/minetest_modding_book/>
Introduction Introduction
@ -64,9 +63,17 @@ The game directory can contain the following files:
* `game.conf`, with the following keys: * `game.conf`, with the following keys:
* `name`: Required, human readable name e.g. `name = Minetest` * `name`: Required, human readable name e.g. `name = Minetest`
* `description`: Short description to be shown in the content tab * `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>` * `disallowed_mapgens = <comma-separated mapgens>`
e.g. `disallowed_mapgens = v5,v6,flat` e.g. `disallowed_mapgens = v5,v6,flat`
These mapgens are removed from the list of mapgens for the game. 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`: * `minetest.conf`:
Used to set default settings when running this game. Used to set default settings when running this game.
* `settingtypes.txt`: * `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 * Values range 0 - 179. The value stored in `param2` is multiplied by two to
get the actual rotation in degrees of the node. get the actual rotation in degrees of the node.
* `paramtype2 = "meshoptions"` * `paramtype2 = "meshoptions"`
* Only valid for "plantlike" drawtype. The value of `param2` becomes a * Only valid for "plantlike" drawtype. `param2` encodes the shape and
bitfield which can be used to change how the client draws plantlike nodes. optional modifiers of the "plant". `param2` is a bitfield.
* Bits 0, 1 and 2 form a mesh selector. * Bits 0 to 2 select the shape.
Currently the following meshes are choosable: Use only one of the values below:
* 0 = a "x" shaped plant (ordinary plant) * 0 = a "x" shaped plant (ordinary plant)
* 1 = a "+" shaped plant (just rotated 45 degrees) * 1 = a "+" shaped plant (just rotated 45 degrees)
* 2 = a "*" shaped plant with 3 faces instead of 2 * 2 = a "*" shaped plant with 3 faces instead of 2
* 3 = a "#" shaped plant with 4 faces instead of 2 * 3 = a "#" shaped plant with 4 faces instead of 2
* 4 = a "#" shaped plant with 4 faces that lean outwards * 4 = a "#" shaped plant with 4 faces that lean outwards
* 5-7 are unused and reserved for future meshes. * 5-7 are unused and reserved for future meshes.
* Bits 3 through 7 are optional flags that can be combined and give these * Bits 3 to 7 are used to enable any number of optional modifiers.
effects: Just add the corresponding value(s) below to `param2`:
* bit 3 (0x08) - Makes the plant slightly vary placement horizontally * 8 - Makes the plant slightly vary placement horizontally
* bit 4 (0x10) - Makes the plant mesh 1.4x larger * 16 - Makes the plant mesh 1.4x larger
* bit 5 (0x20) - Moves each face randomly a small bit down (1/8 max) * 32 - Moves each face randomly a small bit down (1/8 max)
* bits 6-7 are reserved for future use. * 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"` * `paramtype2 = "color"`
* `param2` tells which color is picked from the palette. * `param2` tells which color is picked from the palette.
The palette should have 256 pixels. The palette should have 256 pixels.
@ -2332,8 +2341,8 @@ Elements
* `name` fieldname data is transferred to Lua * `name` fieldname data is transferred to Lua
* `caption 1`...: name shown on top of tab * `caption 1`...: name shown on top of tab
* `current_tab`: index of selected tab 1... * `current_tab`: index of selected tab 1...
* `transparent` (optional): show transparent * `transparent` (optional): if true, tabs are semi-transparent
* `draw_border` (optional): draw border * `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>]` ### `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 connection_uptime = 200, -- seconds since client connected
protocol_version = 32, -- protocol version used by client protocol_version = 32, -- protocol version used by client
formspec_version = 2, -- supported formspec version formspec_version = 2, -- supported formspec version
-- following information is available on debug build only!!! -- following information is available on minenux only build. dont assume in mods
-- DO NOT USE IN MODS serialization_version = 26, -- serialization version used by client
--ser_vers = 26, -- serialization version used by client major = 5, -- major version number
--major = 0, -- major version number minor = 2, -- minor version number
--minor = 4, -- minor version number patch = 1, -- patch version number
--patch = 10, -- patch version number version_string = "5.2.1", -- full version string (or maybe version_string)
--vers_string = "0.4.9-git", -- full version string platform = "Linux", -- as PLATFORM variable
--state = "Active" -- current client state sysinfo = "Linux/2.6.32 x86",
state = "Active" -- current client state
} }
* `minetest.mkdir(path)`: returns success. * `minetest.mkdir(path)`: returns success.
@ -5403,8 +5413,8 @@ Misc.
insecure functions if the calling mod has been listed as trusted in the insecure functions if the calling mod has been listed as trusted in the
`secure.trusted_mods` setting or security is disabled, otherwise returns `secure.trusted_mods` setting or security is disabled, otherwise returns
`nil`. `nil`.
* Only works at init time and must be called from the mod's main scope (not * Only works at init time and must be called from the mod's main scope
from a function). (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 * **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE
IT IN A LOCAL VARIABLE!** 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 -- 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 -- generally the result of either the node being dug or an attached node
-- becoming detached. -- becoming detached.
-- oldmeta is the NodeMetaRef of the oldnode before deletion.
-- drops is a table of ItemStacks, so any metadata to be preserved can -- 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 -- be added directly to one or more of the dropped items. See
-- "ItemStackMetaRef". -- "ItemStackMetaRef".
@ -7044,10 +7055,14 @@ Used by `minetest.register_node`.
on_punch = function(pos, node, puncher, pointed_thing), on_punch = function(pos, node, puncher, pointed_thing),
-- default: minetest.node_punch -- default: minetest.node_punch
-- Called when puncher (an ObjectRef) punches the node at pos.
-- By default calls minetest.register_on_punchnode callbacks. -- By default calls minetest.register_on_punchnode callbacks.
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing), on_rightclick = function(pos, node, clicker, itemstack, pointed_thing),
-- default: nil -- 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. -- itemstack will hold clicker's wielded item.
-- Shall return the leftover itemstack. -- Shall return the leftover itemstack.
-- Note: pointed_thing can be nil, if a mod calls this function. -- Note: pointed_thing can be nil, if a mod calls this function.

View File

@ -1,21 +1,21 @@
.TH minetest 6 "2 February 2019" "" "" .TH minetest5 6 "2 February 2019" "" ""
.SH NAME .SH NAME
minetest, minetestserver \- Multiplayer infinite-world block sandbox minetest5, minetest5server \- Multiplayer infinite-world block sandbox
.SH SYNOPSIS .SH SYNOPSIS
.B minetest .B minetest5
[\fB--server SERVER OPTIONS\fR | \fBCLIENT OPTIONS\fR] [\fB--server SERVER OPTIONS\fR | \fBCLIENT OPTIONS\fR]
[\fBCOMMON OPTIONS\fR] [\fBCOMMON OPTIONS\fR]
[\fBWORLD PATH\fR] [\fBWORLD PATH\fR]
.B minetestserver .B minetest5server
[\fBSERVER OPTIONS\fR] [\fBSERVER OPTIONS\fR]
[\fBCOMMON OPTIONS\fR] [\fBCOMMON OPTIONS\fR]
[\fBWORLD PATH\fR] [\fBWORLD PATH\fR]
.SH DESCRIPTION .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 (started October 2010), with a goal of taking the survival multiplayer gameplay
in a slightly different direction. in a slightly different direction.
.PP .PP
@ -121,7 +121,7 @@ Display an interactive terminal over ncurses during execution.
Colon delimited list of directories to search for games. Colon delimited list of directories to search for games.
.SH BUGS .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 .SH AUTHOR
.PP .PP
@ -131,4 +131,4 @@ This man page was originally written by
Juhani Numminen <juhaninumminen0@gmail.com>. Juhani Numminen <juhaninumminen0@gmail.com>.
.SH WWW .SH WWW
http://www.minetest.net/ http://www.minetest.org/

View File

@ -1,2 +1,2 @@
.so man6/minetest.6 .so man6/minetest5.6

1
games/minetest Submodule

@ -0,0 +1 @@
Subproject commit ac2dd7e3e5928bba584419718010ffbcfc3d1401

View File

@ -62,16 +62,52 @@ endif(LUA_ANSI)
# COMMON_CFLAGS has no effect without this line # COMMON_CFLAGS has no effect without this line
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_CFLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_CFLAGS}")
# check compatible compileer must be after project definition and set flags, assume if C++ is installed also CC is ins
# Standard flags to use for each build type. talled
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -Wextra -Wshadow -W -pedantic -std=gnu99") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g") else()
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} -O1 -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2 -g") endif()
endif(CMAKE_COMPILER_IS_GNUCC) 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) add_subdirectory(src build)

View File

@ -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) { 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()); if (f == NULL) lua_pushstring(L, dlerror());
return f; return f;
} }

View File

@ -4,13 +4,13 @@
# Uncomment settings by removing the preceding #. # Uncomment settings by removing the preceding #.
# minetest.conf is read by default from: # minetest.conf is read by default from:
# ../minetest.conf # ../minetest5.conf
# ../../minetest.conf # ../../minetest5.conf
# Any other path can be chosen by passing the path as a parameter # 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: # Further documentation:
# http://wiki.minetest.net/ # http://wiki.minetest.org/
# #
# Controls # Controls
@ -1191,7 +1191,7 @@
# Name of the server, to be displayed when players join and in the serverlist. # Name of the server, to be displayed when players join and in the serverlist.
# type: string # type: string
# server_name = Minetest server server_name = Minetest5 server
# Description of server, to be displayed when players join and in the serverlist. # Description of server, to be displayed when players join and in the serverlist.
# type: string # type: string
@ -1199,11 +1199,11 @@
# Domain name of server, to be displayed in the serverlist. # Domain name of server, to be displayed in the serverlist.
# type: string # type: string
# server_address = game.minetest.net # server_address = game.minetest.org
# Homepage of server, to be displayed in the serverlist. # Homepage of server, to be displayed in the serverlist.
# type: string # type: string
# server_url = https://minetest.net # server_url = https://minetest.org
# Automatically report to the serverlist. # Automatically report to the serverlist.
# type: bool # type: bool
@ -1211,7 +1211,7 @@
# Announce to this serverlist. # Announce to this serverlist.
# type: string # type: string
# serverlist_url = servers.minetest.net # serverlist_url = servers.minetest.org
# Remove color codes from incoming chat messages # Remove color codes from incoming chat messages
# Use this to stop players from being able to use color in their 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. # Default game when creating a new world.
# This will be overridden when creating a world from the main menu. # This will be overridden when creating a world from the main menu.
# type: string # type: string
# default_game = minetest default_game = minetest5
# Message of the day displayed to players connecting. # Message of the day displayed to players connecting.
# type: string # type: string

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application"> <component type="desktop-application">
<id>net.minetest.minetest.desktop</id> <id>net.minetest.minetest5.desktop</id>
<metadata_license>CC0-1.0</metadata_license> <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> <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"> <content_rating type="oars-1.0">
@ -9,20 +9,20 @@
<content_attribute id="social-chat">intense</content_attribute> <content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">mild</content_attribute> <content_attribute id="social-info">mild</content_attribute>
</content_rating> </content_rating>
<name>Minetest</name> <name>minetest5</name>
<summary>Multiplayer infinite-world block sandbox game</summary> <summary>Multiplayer infinite-world block sandbox game</summary>
<description> <description>
<p> <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> </p><p>
Players can create and destroy various types of blocks in a Players can create and destroy various types of blocks in a
three-dimensional open world. This allows forming structures in three-dimensional open world. This allows forming structures in
every possible creation, on multiplayer servers or in singleplayer. every possible creation, on multiplayer servers or in singleplayer.
</p><p> </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. It is lightweight enough to run on fairly old hardware.
</p><p> </p><p>
Minetest has many features, including: minetest5 has many features, including:
</p> </p>
<ul> <ul>
<li>Ability to walk around, dig, and build in a near-infinite voxel world</li> <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> <li>Beautiful lightning-fast map generator</li>
</ul> </ul>
</description> </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> <keywords>
<keyword>sandbox</keyword> <keyword>sandbox</keyword>
<keyword>world</keyword> <keyword>world</keyword>
<keyword>mining</keyword> <keyword>mining</keyword>
<keyword>multiplayer</keyword> <keyword>multiplayer</keyword>
</keywords> </keywords>
<url type="homepage">http://minetest.net</url> <url type="homepage">http://minetest.org</url>
<url type="bugtracker">http://www.minetest.net/development/#reporting-issues</url> <url type="bugtracker">https://codeberg.org/minenux/minetest-engine-minetest/issues</url>
<url type="translate">http://dev.minetest.net/Translation</url> <url type="translate">http://dev.minetest.net/Translation</url>
<url type="donation">http://www.minetest.net/development/#donate</url> <url type="donation">https://paypalme/mckaygerhard</url>
<url type="faq">http://wiki.minetest.net/FAQ</url> <url type="help">https://t.me/venenux_minetest</url>
<url type="help">http://wiki.minetest.net</url>
<provides> <provides>
<binary>minetest</binary> <binary>minetest5</binary>
</provides> </provides>
<translation type="gettext">minetest</translation>
<update_contact>sfan5@live.de</update_contact>
<releases> <releases>
<release date="2020-04-05" version="5.2.0"/> <release date="2020-04-05" version="5.2.0"/>
</releases> </releases>

View File

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Name=Minetest Name=minetest5
GenericName=Minetest GenericName=minetest5
Comment=Multiplayer infinite-world block sandbox Comment=Multiplayer infinite-world block sandbox
Comment[de]=Mehrspieler-Sandkastenspiel mit unendlichen Blockwelten Comment[de]=Mehrspieler-Sandkastenspiel mit unendlichen Blockwelten
Comment[es]=Juego sandbox multijugador con mundos infinitos 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[ja]=
Comment[ru]=Игра-песочница с безграничным миром, состоящим из блоков Comment[ru]=Игра-песочница с безграничным миром, состоящим из блоков
Comment[tr]=Tek-Çok oyuncuyla küplerden sonsuz dünyalar inşa et Comment[tr]=Tek-Çok oyuncuyla küplerden sonsuz dünyalar inşa et
Exec=minetest Exec=minetest5
Icon=minetest Icon=minetest5
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Game;Simulation; Categories=Game;Simulation;

View File

@ -38,7 +38,7 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "Comments", "" VALUE "Comments", "VenenuX powered"
VALUE "CompanyName", PROJECT_NAME_C " community" VALUE "CompanyName", PROJECT_NAME_C " community"
VALUE "FileDescription", PROJECT_NAME_C " engine" VALUE "FileDescription", PROJECT_NAME_C " engine"
VALUE "FileVersion", VERSION_STRING VALUE "FileVersion", VERSION_STRING

View File

@ -62,7 +62,7 @@ set(USE_GETTEXT FALSE)
if(ENABLE_GETTEXT) if(ENABLE_GETTEXT)
find_package(GettextLib) find_package(GettextLib)
if(GETTEXT_FOUND) if(GETTEXTLIB_FOUND)
if(WIN32) if(WIN32)
message(STATUS "GetText library: ${GETTEXT_LIBRARY}") message(STATUS "GetText library: ${GETTEXT_LIBRARY}")
message(STATUS "GetText DLL: ${GETTEXT_DLL}") message(STATUS "GetText DLL: ${GETTEXT_DLL}")
@ -70,7 +70,15 @@ if(ENABLE_GETTEXT)
endif() endif()
set(USE_GETTEXT TRUE) set(USE_GETTEXT TRUE)
message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") 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() else()
mark_as_advanced(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT) mark_as_advanced(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
message(STATUS "GetText disabled.") message(STATUS "GetText disabled.")
@ -170,7 +178,16 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
set(USE_POSTGRESQL FALSE) set(USE_POSTGRESQL FALSE)
if(ENABLE_POSTGRESQL) 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) if(PostgreSQL_FOUND)
set(USE_POSTGRESQL TRUE) set(USE_POSTGRESQL TRUE)
@ -523,10 +540,10 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
if(BUILD_CLIENT) if(BUILD_CLIENT)
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS}) add_executable(${PROJECT_NAME}${VERSION_MAJOR} ${client_SRCS} ${extra_windows_SRCS})
add_dependencies(${PROJECT_NAME} GenerateVersion) add_dependencies(${PROJECT_NAME}${VERSION_MAJOR} GenerateVersion)
set(client_LIBS set(client_LIBS
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${IRRLICHT_LIBRARY} ${IRRLICHT_LIBRARY}
${JPEG_LIBRARIES} ${JPEG_LIBRARIES}
@ -546,63 +563,64 @@ if(BUILD_CLIENT)
) )
if(ENABLE_GLES) if(ENABLE_GLES)
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${OPENGLES2_LIBRARIES} ${OPENGLES2_LIBRARIES}
${EGL_LIBRARIES} ${EGL_LIBRARIES}
) )
else() else()
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
) )
endif() endif()
if(USE_GETTEXT) if(USE_GETTEXT)
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${Intl_LIBRARIES}
${GETTEXT_LIBRARY} ${GETTEXT_LIBRARY}
) )
endif() endif()
if(USE_CURL) if(USE_CURL)
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${CURL_LIBRARY} ${CURL_LIBRARY}
) )
endif() endif()
if(USE_FREETYPE) if(USE_FREETYPE)
if(FREETYPE_PKGCONFIG_FOUND) if(FREETYPE_PKGCONFIG_FOUND)
set_target_properties(${PROJECT_NAME} set_target_properties(${PROJECT_NAME}${VERSION_MAJOR}
PROPERTIES PROPERTIES
COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}" COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}"
) )
endif() endif()
target_link_libraries( target_link_libraries(
${PROJECT_NAME} ${PROJECT_NAME}${VERSION_MAJOR}
${FREETYPE_LIBRARY} ${FREETYPE_LIBRARY}
) )
endif() endif()
if (USE_CURSES) if (USE_CURSES)
target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${CURSES_LIBRARIES})
endif() endif()
if (USE_POSTGRESQL) if (USE_POSTGRESQL)
target_link_libraries(${PROJECT_NAME} ${PostgreSQL_LIBRARIES}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${PostgreSQL_LIBRARIES})
endif() endif()
if (USE_LEVELDB) if (USE_LEVELDB)
target_link_libraries(${PROJECT_NAME} ${LEVELDB_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${LEVELDB_LIBRARY})
endif() endif()
if (USE_REDIS) if (USE_REDIS)
target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${REDIS_LIBRARY})
endif() endif()
if (USE_SPATIAL) if (USE_SPATIAL)
target_link_libraries(${PROJECT_NAME} ${SPATIAL_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR} ${SPATIAL_LIBRARY})
endif() endif()
endif(BUILD_CLIENT) endif(BUILD_CLIENT)
if(BUILD_SERVER) if(BUILD_SERVER)
add_executable(${PROJECT_NAME}server ${server_SRCS} ${extra_windows_SRCS}) add_executable(${PROJECT_NAME}${VERSION_MAJOR}server ${server_SRCS} ${extra_windows_SRCS})
add_dependencies(${PROJECT_NAME}server GenerateVersion) add_dependencies(${PROJECT_NAME}${VERSION_MAJOR}server GenerateVersion)
target_link_libraries( target_link_libraries(
${PROJECT_NAME}server ${PROJECT_NAME}${VERSION_MAJOR}server
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${SQLITE3_LIBRARY} ${SQLITE3_LIBRARY}
${JSON_LIBRARY} ${JSON_LIBRARY}
@ -610,31 +628,28 @@ if(BUILD_SERVER)
${GMP_LIBRARY} ${GMP_LIBRARY}
${PLATFORM_LIBS} ${PLATFORM_LIBS}
) )
set_target_properties(${PROJECT_NAME}server PROPERTIES set_target_properties(${PROJECT_NAME}${VERSION_MAJOR}server PROPERTIES
COMPILE_DEFINITIONS "SERVER") COMPILE_DEFINITIONS "SERVER")
if (USE_GETTEXT) if (USE_GETTEXT)
target_link_libraries(${PROJECT_NAME}server ${GETTEXT_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${Intl_LIBRARIES} ${GETTEXT_LIBRARY})
endif() endif()
if (USE_CURSES) if (USE_CURSES)
target_link_libraries(${PROJECT_NAME}server ${CURSES_LIBRARIES}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${CURSES_LIBRARIES})
endif() endif()
if (USE_POSTGRESQL) if (USE_POSTGRESQL)
target_link_libraries(${PROJECT_NAME}server ${PostgreSQL_LIBRARIES}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${PostgreSQL_LIBRARIES})
endif() endif()
if (USE_LEVELDB) if (USE_LEVELDB)
target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${LEVELDB_LIBRARY})
endif() endif()
if (USE_REDIS) if (USE_REDIS)
target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${REDIS_LIBRARY})
endif() endif()
if (USE_SPATIAL) if (USE_SPATIAL)
target_link_libraries(${PROJECT_NAME}server ${SPATIAL_LIBRARY}) target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${SPATIAL_LIBRARY})
endif() endif()
if(USE_CURL) if(USE_CURL)
target_link_libraries( target_link_libraries(${PROJECT_NAME}${VERSION_MAJOR}server ${CURL_LIBRARY})
${PROJECT_NAME}server
${CURL_LIBRARY}
)
endif() endif()
endif(BUILD_SERVER) endif(BUILD_SERVER)
@ -647,9 +662,9 @@ set(GETTEXT_BLACKLISTED_LOCALES
ky 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 "") set(GETTEXT_USED_LOCALES "")
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};") if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};")
@ -657,11 +672,13 @@ if (GETTEXT_FOUND AND APPLY_LOCALE_BLACKLIST)
endif() endif()
endforeach() endforeach()
message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}") message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}")
elseif (GETTEXTLIB_FOUND)
set(GETTEXT_USED_LOCALES ${GETTEXT_AVAILABLE_LOCALES})
endif() endif()
# Set some optimizations and tweaks # Set some optimizations and tweaks
include(CheckCXXCompilerFlag) include(CheckCSourceCompiles)
if(MSVC) if(MSVC)
# Visual Studio # Visual Studio
@ -689,19 +706,73 @@ if(MSVC)
set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MD") set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MD")
else() else()
# GCC or compatible compilers such as Clang # 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) if(WARN_ALL)
set(RELEASE_WARNING_FLAGS "-Wall") set(RELEASE_WARNING_FLAGS "-Wall")
else() else()
set(RELEASE_WARNING_FLAGS "") set(RELEASE_WARNING_FLAGS "")
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare") set(WARNING_FLAGS "${WARNING_FLAGS} -Wsign-compare")
endif() endif()
if(APPLE AND USE_LUAJIT) if(APPLE AND USE_LUAJIT)
# required per http://luajit.org/install.html # required per http://luajit.org/install.html
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") 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() endif()
if(MINGW) if(MINGW)
@ -713,7 +784,7 @@ else()
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)") if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
else() 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" if(CMAKE_SYSTEM_NAME STREQUAL "Linux"
AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_VERSION MATCHES "^9\\.") AND CMAKE_CXX_COMPILER_VERSION MATCHES "^9\\.")
@ -794,7 +865,7 @@ if(WIN32)
endif() endif()
if(BUILD_CLIENT) if(BUILD_CLIENT)
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME}${VERSION_MAJOR}
RUNTIME DESTINATION ${BINDIR} RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${BINDIR} LIBRARY DESTINATION ${BINDIR}
ARCHIVE DESTINATION ${BINDIR} ARCHIVE DESTINATION ${BINDIR}
@ -812,7 +883,7 @@ if(BUILD_CLIENT)
if(USE_GETTEXT) if(USE_GETTEXT)
foreach(LOCALE ${GETTEXT_USED_LOCALES}) foreach(LOCALE ${GETTEXT_USED_LOCALES})
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) 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}) install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
endforeach() endforeach()
endif() endif()
@ -843,7 +914,7 @@ if(BUILD_CLIENT)
endif(BUILD_CLIENT) endif(BUILD_CLIENT)
if(BUILD_SERVER) if(BUILD_SERVER)
install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR}) install(TARGETS ${PROJECT_NAME}${VERSION_MAJOR}server DESTINATION ${BINDIR})
endif() endif()
if (USE_GETTEXT) if (USE_GETTEXT)
@ -852,7 +923,7 @@ if (USE_GETTEXT)
foreach(LOCALE ${GETTEXT_USED_LOCALES}) foreach(LOCALE ${GETTEXT_USED_LOCALES})
set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po") set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po")
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) 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} add_custom_command(OUTPUT ${MO_BUILD_PATH}
COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}

View File

@ -1244,13 +1244,21 @@ void Client::sendRespawn()
void Client::sendReady() 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, 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 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.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; pkt << (u16)FORMSPEC_API_VERSION;
Send(&pkt); Send(&pkt);
} }

View File

@ -104,7 +104,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
return false; 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. 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 // Set the window caption
const wchar_t *text = wgettext("Main Menu"); const wchar_t *text = wgettext("Main Menu");
RenderingEngine::get_raw_device()-> 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" " + utf8_to_wide(g_version_hash) +
L" [" + text + L"]").c_str()); L" [" + text + L"]").c_str());
delete[] text; delete[] text;

View File

@ -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. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <cmath>
#include "content_mapblock.h" #include "content_mapblock.h"
#include "util/numeric.h" #include "util/numeric.h"
#include "util/directiontables.h" #include "util/directiontables.h"

View File

@ -1386,8 +1386,9 @@ bool Game::createClient(const std::string &playername,
/* Set window caption /* Set window caption
*/ */
std::wstring str = utf8_to_wide(PROJECT_NAME_C); std::wstring str = utf8_to_wide(PROJECT_NAME);
str += L" "; str += utf8_to_wide(std::to_string(VERSION_MAJOR));
str += L" VenenuX ";
str += utf8_to_wide(g_version_hash); str += utf8_to_wide(g_version_hash);
str += L" ["; str += L" [";
str += driver->getName(); 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) { if (!runData.digging) {
infostream << "Started digging" << std::endl; infostream << "Started digging" << std::endl;
runData.dig_instantly = runData.dig_time_complete == 0; 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;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
<< strgettext("Exit to OS") << "]" << strgettext("Exit to OS") << "]"
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]" << "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" << "\n"
<< strgettext("Game info:") << "\n"; << strgettext("Game info:") << "\n";
const std::string &address = client->getAddressName(); const std::string &address = client->getAddressName();
@ -4251,7 +4257,7 @@ void the_game(bool *kill,
} catch (SerializationError &e) { } catch (SerializationError &e) {
error_message = std::string("A serialization error occurred:\n") error_message = std::string("A serialization error occurred:\n")
+ e.what() + "\n\nThe server is probably " + 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; errorstream << error_message << std::endl;
} catch (ServerError &e) { } catch (ServerError &e) {
error_message = e.what(); error_message = e.what();

View File

@ -54,7 +54,7 @@ GameUI::GameUI()
void GameUI::init() void GameUI::init()
{ {
// First line of debug text // 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); core::rect<s32>(0, 0, 0, 0), false, false, guiroot);
// Second line of debug text // 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); std::ostringstream os(std::ios_base::binary);
os << std::fixed os << std::fixed
<< PROJECT_NAME_C " " << g_version_hash << PROJECT_NAME << std::to_string(VERSION_MAJOR) << " " << g_version_hash
<< " | FPS: " << fps << " | FPS: " << fps
<< std::setprecision(0) << std::setprecision(0)
<< " | drawtime: " << drawtime_avg << "ms" << " | drawtime: " << drawtime_avg << "ms"

View File

@ -316,7 +316,7 @@ KeyPress::KeyPress(const char *name)
int chars_read = mbtowc(&Char, name, 1); int chars_read = mbtowc(&Char, name, 1);
FATAL_ERROR_IF(chars_read != 1, "Unexpected multibyte character"); FATAL_ERROR_IF(chars_read != 1, "Unexpected multibyte character");
m_name = ""; 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) KeyPress::KeyPress(const irr::SEvent::SKeyInput &in, bool prefer_character)

View File

@ -890,7 +890,7 @@ static void updateFastFaceRow(
v3s16 p_corrected; v3s16 p_corrected;
v3s16 face_dir_corrected; v3s16 face_dir_corrected;
u16 lights[4] = {0, 0, 0, 0}; u16 lights[4] = {0, 0, 0, 0};
u8 waving; u8 waving = 0;
TileSpec tile; TileSpec tile;
getTileInfo(data, p, face_dir, getTileInfo(data, p, face_dir,
makes_face, p_corrected, face_dir_corrected, makes_face, p_corrected, face_dir_corrected,

View File

@ -340,15 +340,14 @@ bool RenderingEngine::setWindowIcon()
#if defined(XORG_USED) #if defined(XORG_USED)
#if RUN_IN_PLACE #if RUN_IN_PLACE
return setXorgWindowIconFromPath( 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 #else
// We have semi-support for reading in-place data if we are // We have semi-support for reading in-place data if we are
// compiled with RUN_IN_PLACE. Don't break with this and // compiled with RUN_IN_PLACE. Don't break with this and
// also try the path_share location. // also try the path_share location.
return setXorgWindowIconFromPath( return setXorgWindowIconFromPath(
ICON_DIR "/hicolor/128x128/apps/" PROJECT_NAME ".png") || ICON_DIR "/hicolor/128x128/apps/" PROJECT_NAME + std::to_string(VERSION_MAJOR) + ".png") ||
setXorgWindowIconFromPath(porting::path_share + "/misc/" PROJECT_NAME setXorgWindowIconFromPath(porting::path_share + "/misc/" PROJECT_NAME + std::to_string(VERSION_MAJOR) + "-xorg-icon-128.png");
"-xorg-icon-128.png");
#endif #endif
#elif defined(_WIN32) #elif defined(_WIN32)
const video::SExposedVideoData exposedData = driver->getExposedVideoData(); const video::SExposedVideoData exposedData = driver->getExposedVideoData();

View File

@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string> #include <string>
#include <vector> #include <vector>
#include <SMaterial.h> #include <SMaterial.h>
#include <memory>
#include "util/numeric.h" #include "util/numeric.h"
#include "config.h" #include "config.h"
@ -282,7 +281,7 @@ struct TileLayer
//! If true, the tile has its own color. //! If true, the tile has its own color.
bool has_color = false; 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 * The color of the tile, or if the tile does not own

View File

@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <list> #include <list>
#include <vector> #include <vector>
#include <set> #include <set>
#include <memory>
#include <mutex> #include <mutex>
class MapBlock; class MapBlock;
@ -331,7 +332,13 @@ public:
m_version_major = major; m_version_major = major;
m_version_minor = minor; m_version_minor = minor;
m_version_patch = patch; 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 */ /* read version information */
@ -339,6 +346,8 @@ public:
u8 getMinor() const { return m_version_minor; } u8 getMinor() const { return m_version_minor; }
u8 getPatch() const { return m_version_patch; } u8 getPatch() const { return m_version_patch; }
const std::string &getFull() const { return m_full_version; } 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: private:
// Version is stored in here after INIT before INIT2 // Version is stored in here after INIT before INIT2
u8 m_pending_serialization_version = SER_FMT_VER_INVALID; u8 m_pending_serialization_version = SER_FMT_VER_INVALID;
@ -412,6 +421,8 @@ private:
u8 m_version_patch = 0; u8 m_version_patch = 0;
std::string m_full_version = "unknown"; std::string m_full_version = "unknown";
std::string m_platform = "unknown";
std::string m_sysinfo = "unknown";
u16 m_deployed_compression = 0; u16 m_deployed_compression = 0;

View File

@ -415,12 +415,13 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
Collision uncertainty radius Collision uncertainty radius
Make it a bit larger than the maximum distance of movement Make it a bit larger than the maximum distance of movement
*/ */
f32 d = pos_max_d * 1.1f; //f32 d = pos_max_d * 1.1;
// A fairly large value in here makes moving smoother // A fairly large value in here makes moving smoother but more rare too
//f32 d = 0.15*BS; //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 // This should always apply, otherwise there are glitches
assert(d > pos_max_d); // invariant //assert(d > pos_max_d); // invariant
int loopcount = 0; int loopcount = 0;

View File

@ -13,7 +13,8 @@
#include "cmake_config.h" #include "cmake_config.h"
#elif defined (__ANDROID__) || defined (ANDROID) #elif defined (__ANDROID__) || defined (ANDROID)
#define PROJECT_NAME "minetest" #define PROJECT_NAME "minetest"
#define PROJECT_NAME_C "Minetest" #define VERSION_MAJOR "5"
#define PROJECT_NAME_C "Minetest5"
#define STATIC_SHAREDIR "" #define STATIC_SHAREDIR ""
#include "android_version.h" #include "android_version.h"
#ifdef NDEBUG #ifdef NDEBUG
@ -22,6 +23,7 @@
#define BUILD_TYPE "Debug" #define BUILD_TYPE "Debug"
#endif #endif
#else #else
#include "cmake_config.h"
#ifdef NDEBUG #ifdef NDEBUG
#define BUILD_TYPE "Release" #define BUILD_TYPE "Release"
#else #else

View File

@ -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) 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()); return conf.readConfigFile(conf_path.c_str());
} }
@ -230,7 +230,7 @@ std::string getWorldGameId(const std::string &world_path, bool can_be_legacy)
return ""; return "";
// The "mesetint" gameid has been discarded // The "mesetint" gameid has been discarded
if (conf.get("gameid") == "mesetint") if (conf.get("gameid") == "mesetint")
return "minetest"; return LEGACY_GAMEID;
return conf.get("gameid"); return conf.get("gameid");
} }

View File

@ -1428,12 +1428,34 @@ void PlayerSAO::setMaxSpeedOverride(const v3f &vel)
bool PlayerSAO::checkMovementCheat() bool PlayerSAO::checkMovementCheat()
{ {
if (isAttached() || m_is_singleplayer || if (m_is_singleplayer ||
g_settings->getBool("disable_anticheat")) { g_settings->getBool("disable_anticheat")) {
m_last_good_position = m_base_position; m_last_good_position = m_base_position;
return false; 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; bool cheated = false;
/* /*
Check player movements Check player movements

View File

@ -136,9 +136,9 @@ long WINAPI Win32ExceptionHandler(struct _EXCEPTION_POINTERS *pExceptInfo)
MINIDUMP_USER_STREAM mdus; MINIDUMP_USER_STREAM mdus;
bool minidump_created = false; 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; version_str += g_version_hash;
HANDLE hFile = CreateFileA(dumpfile.c_str(), GENERIC_WRITE, HANDLE hFile = CreateFileA(dumpfile.c_str(), GENERIC_WRITE,

View File

@ -46,6 +46,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("enable_vbo", "true"); settings->setDefault("enable_vbo", "true");
settings->setDefault("free_move", "false"); settings->setDefault("free_move", "false");
settings->setDefault("pitch_move", "false"); settings->setDefault("pitch_move", "false");
settings->setDefault("instant_dig", "false");
settings->setDefault("fast_move", "false"); settings->setDefault("fast_move", "false");
settings->setDefault("noclip", "false"); settings->setDefault("noclip", "false");
settings->setDefault("screenshot_path", "."); 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("max_simultaneous_block_sends_per_client", "40");
settings->setDefault("time_send_interval", "5"); 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("motd", "");
settings->setDefault("max_users", "15"); settings->setDefault("max_users", "15");
settings->setDefault("creative_mode", "false"); settings->setDefault("creative_mode", "false");

View File

@ -142,7 +142,7 @@ void init_gettext(const char *path, const std::string &configured_language,
// Hack to force gettext to see the right environment // Hack to force gettext to see the right environment
if (current_language != configured_language) { if (current_language != configured_language) {
errorstream << "MSVC localization workaround active. " 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; std::string parameters;
@ -217,7 +217,8 @@ void init_gettext(const char *path, const std::string &configured_language,
#endif #endif
#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); bindtextdomain(name.c_str(), path);
textdomain(name.c_str()); textdomain(name.c_str());

View File

@ -133,7 +133,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, 600 * s, 40 * s); core::rect<s32> rect(0, 0, 600 * s, 40 * s);
rect += topleft + v2s32(25 * s, 3 * s); rect += topleft + v2s32(25 * s, 3 * s);
//gui::IGUIStaticText *t = //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, Environment->addStaticText(text,
rect, false, true, this, -1); rect, false, true, this, -1);
delete[] text; delete[] text;

View File

@ -44,7 +44,7 @@ PcgRandom g_callerid_randomness;
HTTPFetchRequest::HTTPFetchRequest() : HTTPFetchRequest::HTTPFetchRequest() :
timeout(g_settings->getS32("curl_timeout")), timeout(g_settings->getS32("curl_timeout")),
connect_timeout(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() + ")")
{ {
} }

View File

@ -343,7 +343,7 @@ static void print_allowed_options(const OptionList &allowed_options)
static void print_version() 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; << " (" << porting::getPlatformName() << ")" << std::endl;
#ifndef SERVER #ifndef SERVER
std::cout << "Using Irrlicht " IRRLICHT_SDK_VERSION << std::endl; 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() static void startup_message()
{ {
infostream << PROJECT_NAME << " " << _("with") infostream << PROJECT_NAME << std::to_string(VERSION_MAJOR) << " " << _("with")
<< " SER_FMT_VER_HIGHEST_READ=" << " SER_FMT_VER_HIGHEST_READ="
<< (int)SER_FMT_VER_HIGHEST_READ << ", " << (int)SER_FMT_VER_HIGHEST_READ << ", "
<< g_build_info << std::endl; << 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"); g_settings_path = cmd_args.get("config");
} else { } else {
std::vector<std::string> filenames; 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 // Legacy configuration file location
filenames.push_back(porting::path_user + 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 #if RUN_IN_PLACE
// Try also from a lower level (to aid having the same configuration // Try also from a lower level (to aid having the same configuration
// for many RUN_IN_PLACE installs) // for many RUN_IN_PLACE installs)
filenames.push_back(porting::path_user + 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 #endif
for (const std::string &filename : filenames) { for (const std::string &filename : filenames) {
@ -778,7 +778,7 @@ static bool determine_subgame(GameParams *game_params)
if (game_params->game_spec.isValid()) { if (game_params->game_spec.isValid()) {
gamespec = game_params->game_spec; gamespec = game_params->game_spec;
infostream << "Using commanded gameid [" << gamespec.id << "]" << std::endl; 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")); gamespec = findSubgame(g_settings->get("default_game"));
infostream << "Using default gameid [" << gamespec.id << "]" << std::endl; infostream << "Using default gameid [" << gamespec.id << "]" << std::endl;
if (!gamespec.isValid()) { if (!gamespec.isValid()) {
@ -869,7 +869,7 @@ static bool run_dedicated_server(const GameParams &game_params, const Settings &
if (!name_ok) { if (!name_ok) {
if (admin_nick.empty()) { if (admin_nick.empty()) {
errorstream << "No name given for admin. " 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." << "contains a 'name = ' to your main admin account."
<< std::endl; << std::endl;
} else { } else {

View File

@ -629,6 +629,13 @@ MapgenBasic::MapgenBasic(int mapgenid, MapgenParams *params, EmergeManager *emer
// Lava falls back to water as both are suitable as cave liquids. // Lava falls back to water as both are suitable as cave liquids.
if (c_lava_source == CONTENT_IGNORE) if (c_lava_source == CONTENT_IGNORE)
c_lava_source = c_water_source; 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;
} }

View File

@ -132,6 +132,21 @@ MapgenV6::MapgenV6(MapgenV6Params *params, EmergeManager *emerge)
c_stair_cobble = c_cobble; c_stair_cobble = c_cobble;
if (c_stair_desert_stone == CONTENT_IGNORE) if (c_stair_desert_stone == CONTENT_IGNORE)
c_stair_desert_stone = c_desert_stone; 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;
} }

View File

@ -44,6 +44,12 @@ void make_tree(MMVManip &vmanip, v3s16 p0, bool is_apple_tree,
MapNode treenode(ndef->getId("mapgen_tree")); MapNode treenode(ndef->getId("mapgen_tree"));
MapNode leavesnode(ndef->getId("mapgen_leaves")); MapNode leavesnode(ndef->getId("mapgen_leaves"));
MapNode applenode(ndef->getId("mapgen_apple")); 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); PseudoRandom pr(seed);
s16 trunk_h = pr.range(4, 5); 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) const NodeDefManager *ndef, TreeDef tree_definition)
{ {
MapNode dirtnode(ndef->getId("mapgen_dirt")); MapNode dirtnode(ndef->getId("mapgen_dirt"));
if (dirtnode == CONTENT_IGNORE)
errorstream << "Treegen (make_ltree): Mapgen alias 'mapgen_dirt' is invalid!" << std::endl;
s32 seed; s32 seed;
if (tree_definition.explicit_seed) if (tree_definition.explicit_seed)
seed = tree_definition.seed + 14002; 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"); c_tree = ndef->getId("mapgen_tree");
if (c_leaves == CONTENT_IGNORE) if (c_leaves == CONTENT_IGNORE)
c_leaves = ndef->getId("mapgen_leaves"); 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 treenode(c_tree);
MapNode leavesnode(c_leaves); 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"); c_leaves = ndef->getId("mapgen_leaves");
if (c_snow == CONTENT_IGNORE) if (c_snow == CONTENT_IGNORE)
c_snow = CONTENT_AIR; 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 treenode(c_tree);
MapNode leavesnode(c_leaves); MapNode leavesnode(c_leaves);

View File

@ -935,6 +935,8 @@ enum ToServerCommand
u8 reserved u8 reserved
u16 len u16 len
u8[len] full_version_string u8[len] full_version_string
u8[len] platform
u8[len] sysinfo
*/ */
TOSERVER_FIRST_SRP = 0x50, TOSERVER_FIRST_SRP = 0x50,

View File

@ -173,6 +173,16 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
return; 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); m_clients.setPlayerName(pkt->getPeerId(), playername);
//TODO (later) case insensitivity //TODO (later) case insensitivity
@ -593,7 +603,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
<< std::endl; << std::endl;
std::istringstream is(datastring, std::ios_base::binary); std::istringstream is(datastring, std::ios_base::binary);
// Create an action // Create an action
InventoryAction *a = InventoryAction::deSerialize(is); std::unique_ptr<InventoryAction> a(InventoryAction::deSerialize(is));
if (!a) { if (!a) {
infostream << "TOSERVER_INVENTORY_ACTION: " infostream << "TOSERVER_INVENTORY_ACTION: "
<< "InventoryAction::deSerialize() returned NULL" << "InventoryAction::deSerialize() returned NULL"
@ -610,11 +620,29 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
where the client made a bad prediction. 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 Handle restrictions and special cases of the move action
*/ */
if (a->getType() == IAction::Move) { if (a->getType() == IAction::Move) {
IMoveAction *ma = (IMoveAction*)a; IMoveAction *ma = (IMoveAction*)a.get();
ma->from_inv.applyCurrentPlayer(player->getName()); ma->from_inv.applyCurrentPlayer(player->getName());
ma->to_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) if (ma->from_inv != ma->to_inv)
setInventoryModified(ma->to_inv); setInventoryModified(ma->to_inv);
bool from_inv_is_current_player = if (!check_inv_access(ma->from_inv) ||
(ma->from_inv.type == InventoryLocation::PLAYER) && !check_inv_access(ma->to_inv))
(ma->from_inv.name == player->getName()); return;
bool to_inv_is_current_player = InventoryLocation *remote = ma->from_inv.type == InventoryLocation::PLAYER ?
(ma->to_inv.type == InventoryLocation::PLAYER) &&
(ma->to_inv.name == player->getName());
InventoryLocation *remote = from_inv_is_current_player ?
&ma->to_inv : &ma->from_inv; &ma->to_inv : &ma->from_inv;
// Check for out-of-range interaction // Check for out-of-range interaction
@ -651,7 +675,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
<< (ma->from_inv.dump()) << ":" << ma->from_list << (ma->from_inv.dump()) << ":" << ma->from_list
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list << " to " << (ma->to_inv.dump()) << ":" << ma->to_list
<< " because src is " << ma->from_list << std::endl; << " because src is " << ma->from_list << std::endl;
delete a;
return; return;
} }
@ -663,18 +686,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
<< (ma->from_inv.dump()) << ":" << ma->from_list << (ma->from_inv.dump()) << ":" << ma->from_list
<< " to " << (ma->to_inv.dump()) << ":" << ma->to_list << " to " << (ma->to_inv.dump()) << ":" << ma->to_list
<< " because dst is " << ma->to_list << std::endl; << " 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; return;
} }
} }
@ -682,7 +693,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
Handle restrictions and special cases of the drop action Handle restrictions and special cases of the drop action
*/ */
else if (a->getType() == IAction::Drop) { else if (a->getType() == IAction::Drop) {
IDropAction *da = (IDropAction*)a; IDropAction *da = (IDropAction*)a.get();
da->from_inv.applyCurrentPlayer(player->getName()); da->from_inv.applyCurrentPlayer(player->getName());
@ -695,13 +706,11 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
infostream << "Ignoring IDropAction from " infostream << "Ignoring IDropAction from "
<< (da->from_inv.dump()) << ":" << da->from_list << (da->from_inv.dump()) << ":" << da->from_list
<< " because src is " << da->from_list << std::endl; << " because src is " << da->from_list << std::endl;
delete a;
return; return;
} }
// Disallow dropping items if not allowed to interact // Disallow dropping items if not allowed to interact
if (!checkPriv(player->getName(), "interact")) { if (!player_has_interact || !check_inv_access(da->from_inv)) {
delete a;
return; return;
} }
@ -710,7 +719,6 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
infostream << "Ignoring IDropAction from " infostream << "Ignoring IDropAction from "
<< (da->from_inv.dump()) << ":" << da->from_list << (da->from_inv.dump()) << ":" << da->from_list
<< " because player is dead." << std::endl; << " because player is dead." << std::endl;
delete a;
return; return;
} }
} }
@ -718,29 +726,28 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
Handle restrictions and special cases of the craft action Handle restrictions and special cases of the craft action
*/ */
else if (a->getType() == IAction::Craft) { else if (a->getType() == IAction::Craft) {
ICraftAction *ca = (ICraftAction*)a; ICraftAction *ca = (ICraftAction*)a.get();
ca->craft_inv.applyCurrentPlayer(player->getName()); ca->craft_inv.applyCurrentPlayer(player->getName());
setInventoryModified(ca->craft_inv); 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 // Disallow crafting if not allowed to interact
if (!checkPriv(player->getName(), "interact")) { if (!player_has_interact) {
infostream << "Cannot craft: " infostream << "Cannot craft: "
<< "No interact privilege" << std::endl; << "No interact privilege" << std::endl;
delete a;
return; return;
} }
if (!check_inv_access(ca->craft_inv))
return;
} else {
// Unknown action. Ignored.
return;
} }
// Do the action // Do the action
a->apply(this, playersao, this); a->apply(this, playersao, this);
// Eat the action
delete a;
} }
void Server::handleCommand_ChatMessage(NetworkPacket* pkt) void Server::handleCommand_ChatMessage(NetworkPacket* pkt)

View File

@ -317,6 +317,18 @@ ContentFeatures::ContentFeatures()
reset(); 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() void ContentFeatures::reset()
{ {
/* /*
@ -653,7 +665,7 @@ static void fillTileAttribs(ITextureSource *tsrc, TileLayer *layer,
} else { } else {
std::ostringstream os(std::ios::binary); std::ostringstream os(std::ios::binary);
if (!layer->frames) { if (!layer->frames) {
layer->frames = std::make_shared<std::vector<FrameSpec>>(); layer->frames = new std::vector<FrameSpec>();
} }
layer->frames->resize(frame_count); layer->frames->resize(frame_count);

View File

@ -404,7 +404,7 @@ struct ContentFeatures
*/ */
ContentFeatures(); ContentFeatures();
~ContentFeatures() = default; ~ContentFeatures();
void reset(); void reset();
void serialize(std::ostream &os, u16 protocol_version) const; void serialize(std::ostream &os, u16 protocol_version) const;
void deSerialize(std::istream &is); void deSerialize(std::istream &is);

View File

@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
extern char **environ;
#elif defined(_WIN32) #elif defined(_WIN32)
#include <windows.h> #include <windows.h>
#include <wincrypt.h> #include <wincrypt.h>
@ -390,11 +391,11 @@ bool setSystemPaths()
path_share += DIR_DELIM ".."; 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)); DWORD len = GetEnvironmentVariable("APPDATA", buf, sizeof(buf));
FATAL_ERROR_IF(len == 0 || len > sizeof(buf), "Failed to get APPDATA"); 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; return true;
} }
@ -426,7 +427,7 @@ bool setSystemPaths()
trylist.push_back(static_sharedir); trylist.push_back(static_sharedir);
trylist.push_back(bindir + DIR_DELIM ".." DIR_DELIM "share" 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 ".."); trylist.push_back(bindir + DIR_DELIM "..");
#ifdef __ANDROID__ #ifdef __ANDROID__
@ -455,7 +456,7 @@ bool setSystemPaths()
#ifndef __ANDROID__ #ifndef __ANDROID__
path_user = std::string(getHomeOrFail()) + DIR_DELIM "." path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
+ PROJECT_NAME; + PROJECT_NAME + std::to_string(VERSION_MAJOR);
#endif #endif
return true; return true;
@ -480,7 +481,7 @@ bool setSystemPaths()
path_user = std::string(getHomeOrFail()) path_user = std::string(getHomeOrFail())
+ "/Library/Application Support/" + "/Library/Application Support/"
+ PROJECT_NAME; + PROJECT_NAME + std::to_string(VERSION_MAJOR);
return true; return true;
} }
@ -491,7 +492,7 @@ bool setSystemPaths()
{ {
path_share = STATIC_SHAREDIR; path_share = STATIC_SHAREDIR;
path_user = std::string(getHomeOrFail()) + DIR_DELIM "." path_user = std::string(getHomeOrFail()) + DIR_DELIM "."
+ lowercase(PROJECT_NAME); + lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR);
return true; return true;
} }
@ -573,15 +574,15 @@ void initializePaths()
path_cache = path_user + DIR_DELIM + "cache"; path_cache = path_user + DIR_DELIM + "cache";
# else # else
// Initialize path_cache // 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 *cache_dir = getenv("XDG_CACHE_HOME");
const char *home_dir = getenv("HOME"); const char *home_dir = getenv("HOME");
if (cache_dir) { 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) { } 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" path_cache = std::string(home_dir) + DIR_DELIM + ".cache"
+ DIR_DELIM + PROJECT_NAME; + DIR_DELIM + lowercase(PROJECT_NAME) + std::to_string(VERSION_MAJOR);
} else { } else {
// If neither works, use $PATH_USER/cache // If neither works, use $PATH_USER/cache
path_cache = path_user + DIR_DELIM + "cache"; path_cache = path_user + DIR_DELIM + "cache";
@ -598,18 +599,18 @@ void initializePaths()
#if USE_GETTEXT #if USE_GETTEXT
bool found_localedir = false; bool found_localedir = false;
# ifdef STATIC_LOCALEDIR # ifdef STATIC_LOCALEDIR
if (STATIC_LOCALEDIR[0] && fs::PathExists(STATIC_LOCALEDIR)) { /* 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." << std::endl;
} else if (STATIC_LOCALEDIR[0] && fs::PathExists(STATIC_LOCALEDIR)) {
found_localedir = true; found_localedir = true;
path_locale = STATIC_LOCALEDIR; path_locale = STATIC_LOCALEDIR;
infostream << "Using locale directory " << STATIC_LOCALEDIR << std::endl; infostream << "Using static locale directory " << STATIC_LOCALEDIR
} else { << std::endl;
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;
}
} }
# else # else
path_locale = getDataPath("locale"); path_locale = getDataPath("locale");

View File

@ -139,9 +139,9 @@ extern std::string path_share;
/* /*
Directory for storing user data. Examples: Directory for storing user data. Examples:
Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME>" Windows: "C:\Documents and Settings\user\Application Data\<PROJECT_NAME VERSION_MAJOR>"
Linux: "~/.<PROJECT_NAME>" Linux: "~/.<PROJECT_NAME VERSION_MAJOR>"
Mac: "~/Library/Application Support/<PROJECT_NAME>" Mac: "~/Library/Application Support/<PROJECT_NAME VERSION_MAJOR>"
*/ */
extern std::string path_user; extern std::string path_user;
@ -234,21 +234,21 @@ inline u64 getTimeMs()
{ {
struct timespec ts; struct timespec ts;
os_get_clock(&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() inline u64 getTimeUs()
{ {
struct timespec ts; struct timespec ts;
os_get_clock(&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() inline u64 getTimeNs()
{ {
struct timespec ts; struct timespec ts;
os_get_clock(&ts); os_get_clock(&ts);
return ts.tv_sec * 1000000000 + ts.tv_nsec; return ((u64) ts.tv_sec) * 1000000000LL + ((u64) ts.tv_nsec);
} }
#endif #endif

View File

@ -48,7 +48,7 @@ void android_main(android_app *app)
try { try {
app_dummy(); 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); main(ARRLEN(argv) - 1, argv);
free(argv[0]); free(argv[0]);
} catch (std::exception &e) { } catch (std::exception &e) {

View File

@ -28,7 +28,7 @@ extern "C" {
#include "common/c_converter.h" #include "common/c_converter.h"
#include "common/c_internal.h" #include "common/c_internal.h"
#include "constants.h" #include "constants.h"
#include <cmath>
#define CHECK_TYPE(index, name, type) { \ #define CHECK_TYPE(index, name, type) { \
int t = lua_type(L, (index)); \ 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_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER)
#define CHECK_FLOAT_RANGE(value, name) \ #define CHECK_FLOAT_RANGE(value, name) \
if (value < F1000_MIN || value > F1000_MAX) { \ if (value < F1000_MIN || value > F1000_MAX || std::isnan(value) || std::isinf(value) ) { \
std::ostringstream error_text; \ warningstream << "Invalid float vector dimension range or null value given '" name "' " << \
error_text << "Invalid float vector dimension range '" name "' " << \
"(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \ "(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
" got " << value << ")." << std::endl; \ " got " << value << "). restarted to max / min" << std::endl; \
throw LuaError(error_text.str()); \ if (value < F1000_MIN) \
value = F1000_MIN; \
else \
value = F1000_MAX; \
} }
#define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE) #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"); lua_getfield(L, index, "x");
CHECK_POS_COORD("x"); CHECK_POS_COORD("x");
p.X = lua_tonumber(L, -1); p.X = lua_tonumber(L, -1);
CHECK_FLOAT_RANGE(p.X, "x")
lua_pop(L, 1); lua_pop(L, 1);
lua_getfield(L, index, "y"); lua_getfield(L, index, "y");
CHECK_POS_COORD("y"); CHECK_POS_COORD("y");
p.Y = lua_tonumber(L, -1); p.Y = lua_tonumber(L, -1);
CHECK_FLOAT_RANGE(p.Y, "x")
lua_pop(L, 1); lua_pop(L, 1);
return p; return p;
} }

View File

@ -31,6 +31,7 @@ extern "C" {
#include <lauxlib.h> #include <lauxlib.h>
} }
#include "config.h"
#include "common/c_types.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_CURRENT_MOD_NAME (CUSTOM_RIDX_BASE + 2)
#define CUSTOM_RIDX_BACKTRACE (CUSTOM_RIDX_BASE + 3) #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 // Pushes the error handler onto the stack and returns its index
#define PUSH_ERROR_HANDLER(L) \ #define PUSH_ERROR_HANDLER(L) \
(lua_rawgeti((L), LUA_REGISTRYINDEX, CUSTOM_RIDX_BACKTRACE), lua_gettop((L))) (lua_rawgeti((L), LUA_REGISTRYINDEX, CUSTOM_RIDX_BACKTRACE), lua_gettop((L)))

View File

@ -90,7 +90,11 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
luaL_openlibs(m_luastack); luaL_openlibs(m_luastack);
// Make the ScriptApiBase* accessible to ModApiBase // Make the ScriptApiBase* accessible to ModApiBase
#if INDIRECT_SCRIPTAPI_RIDX
*(void **)(lua_newuserdata(m_luastack, sizeof(void *))) = this;
#else
lua_pushlightuserdata(m_luastack, this); lua_pushlightuserdata(m_luastack, this);
#endif
lua_rawseti(m_luastack, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI); lua_rawseti(m_luastack, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
// Add and save an error handler // Add and save an error handler

View File

@ -480,7 +480,7 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path,
cur_path = fs::RemoveLastPathComponent(cur_path, &component); cur_path = fs::RemoveLastPathComponent(cur_path, &component);
if (component == "..") { if (component == "..") {
// Parent components can't be allowed or we could allow something like // 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 // 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 // able to remove them so that things like worlds/foo/noexist/../auth.txt
// could be allowed, but those paths will be interpreted as nonexistent // 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 // Get server from registry
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI); 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); lua_pop(L, 1);
const IGameDef *gamedef = script->getGameDef(); const IGameDef *gamedef = script->getGameDef();
if (!gamedef) if (!gamedef)

View File

@ -30,7 +30,12 @@ ScriptApiBase *ModApiBase::getScriptApiBase(lua_State *L)
{ {
// Get server from registry // Get server from registry
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI); 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); lua_pop(L, 1);
return sapi_ptr; return sapi_ptr;
} }

View File

@ -162,7 +162,9 @@ int ModApiServer::l_get_player_information(lua_State *L)
u32 uptime; u32 uptime;
u16 prot_vers; u16 prot_vers;
u8 ser_vers,major,minor,patch; u8 ser_vers,major,minor,patch;
std::string vers_string; std::string version_string;
std::string platform;
std::string sysinfo;
#define ERET(code) \ #define ERET(code) \
if (!(code)) { \ if (!(code)) { \
@ -182,7 +184,7 @@ int ModApiServer::l_get_player_information(lua_State *L)
&avg_jitter)) &avg_jitter))
ERET(getServer(L)->getClientInfo(player->getPeerId(), &state, &uptime, &ser_vers, 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); lua_newtable(L);
int table = lua_gettop(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_pushnumber(L, player->formspec_version);
lua_settable(L, table); lua_settable(L, table);
#ifndef NDEBUG
lua_pushstring(L,"serialization_version"); lua_pushstring(L,"serialization_version");
lua_pushnumber(L, ser_vers); lua_pushnumber(L, ser_vers);
lua_settable(L, table); lua_settable(L, table);
@ -255,13 +256,20 @@ int ModApiServer::l_get_player_information(lua_State *L)
lua_settable(L, table); lua_settable(L, table);
lua_pushstring(L,"version_string"); 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_settable(L, table);
lua_pushstring(L,"state"); lua_pushstring(L,"state");
lua_pushstring(L,ClientInterface::state2Name(state).c_str()); lua_pushstring(L,ClientInterface::state2Name(state).c_str());
lua_settable(L, table); lua_settable(L, table);
#endif
#undef ERET #undef ERET
return 1; return 1;

View File

@ -432,7 +432,7 @@ int ModApiUtil::l_get_version(lua_State *L)
lua_createtable(L, 0, 3); lua_createtable(L, 0, 3);
int table = lua_gettop(L); int table = lua_gettop(L);
lua_pushstring(L, PROJECT_NAME_C); lua_pushstring(L, PROJECT_NAME);
lua_setfield(L, table, "project"); lua_setfield(L, table, "project");
lua_pushstring(L, g_version_string); lua_pushstring(L, g_version_string);

View File

@ -1263,7 +1263,9 @@ bool Server::getClientInfo(
u8* major, u8* major,
u8* minor, u8* minor,
u8* patch, u8* patch,
std::string* vers_string std::string* version_string,
std::string* platform,
std::string* sysinfo
) )
{ {
*state = m_clients.getClientState(peer_id); *state = m_clients.getClientState(peer_id);
@ -1282,7 +1284,9 @@ bool Server::getClientInfo(
*major = client->getMajor(); *major = client->getMajor();
*minor = client->getMinor(); *minor = client->getMinor();
*patch = client->getPatch(); *patch = client->getPatch();
*vers_string = client->getFull(); *version_string = client->getFull();
*platform = client->getPlatform();
*sysinfo = client->getSysInfo();
m_clients.unlock(); m_clients.unlock();

View File

@ -335,7 +335,7 @@ public:
bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval); bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
bool getClientInfo(session_t peer_id, ClientState *state, u32 *uptime, bool getClientInfo(session_t peer_id, ClientState *state, u32 *uptime,
u8* ser_vers, u16* prot_vers, u8* major, u8* minor, u8* patch, 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); void printToConsoleOnly(const std::string &text);

View File

@ -444,14 +444,14 @@ ServerEnvironment::ServerEnvironment(ServerMap *map,
warningstream << "/!\\ You are using old player file backend. " warningstream << "/!\\ You are using old player file backend. "
<< "This backend is deprecated and will be removed in a future release /!\\" << "This backend is deprecated and will be removed in a future release /!\\"
<< std::endl << "Switching to SQLite3 or PostgreSQL is advised, " << 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") { if (auth_backend_name == "files") {
warningstream << "/!\\ You are using old auth file backend. " warningstream << "/!\\ You are using old auth file backend. "
<< "This backend is deprecated and will be removed in a future release /!\\" << "This backend is deprecated and will be removed in a future release /!\\"
<< std::endl << "Switching to SQLite3 is advised, " << 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); m_player_database = openPlayerDatabase(player_backend_name, path_world, conf);

View File

@ -389,8 +389,9 @@ void TerminalChatConsole::step(int ch)
// draw title // draw title
move(0, 0); move(0, 0);
clrtoeol(); clrtoeol();
addstr(PROJECT_NAME_C); addstr(PROJECT_NAME);
addstr(" "); // addstr(std::tostring(VERSION_MAJOR));
addstr(" VenenuX ");
addstr(g_version_hash); addstr(g_version_hash);
u32 minutes = m_time_of_day % 1000; u32 minutes = m_time_of_day % 1000;