Commit Graph

327 Commits

Author SHA1 Message Date
rubenwardy f2aa2c6a98 Add ItemStack key-value meta storage 2017-02-04 22:07:55 +00:00
rubenwardy bbdd869d72 Derive NodeMetadata from Metadata 2017-02-04 22:07:55 +00:00
red-001 0dada51a55 Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072) 2017-01-20 23:19:41 +01:00
Loic Blot 98e36d7d68 Move ServerEnvironment to dedicated cpp/header files
* also cleanup some unneeded inclusions
2017-01-08 12:16:06 +01:00
Loic Blot eb2c19bbed Move ClientEnvironment to dedicated cpp/header files 2017-01-08 12:16:06 +01:00
Dániel Juhász 3f8261830e Improve getPointedThing() (#4346)
* Improved getPointedThing()

The new algorithm checks every node exactly once.
Now the point and normal vector of the collision is also returned in the
PointedThing (currently they are not used outside of the function).
Now the CNodeDefManager keeps the union of all possible nodeboxes, so
the raycast won't miss any nodes. Also if there are only small
nodeboxes, getPointedThing() is exceptionally fast.
Also adds unit test for VoxelLineIterator.

* Cleanup, code move

This commit moves getPointedThing() and
Client::getSelectedActiveObject() to ClientEnvironment.
The map nodes now can decide which neighbors they are connecting to
(MapNode::getNeighbors()).
2017-01-04 19:18:40 +01:00
sfan5 523f0e8c5b Move TileAnimation code to seperate file 2017-01-02 15:28:06 +01:00
est31 ba52a34f94 Don't ship with broken languages (#4940) 2016-12-21 14:15:48 +01:00
MillersMan 9714cdcf4b Liquids: Update flow on block load
When loading a block add liquid-nodes that might flow away or spread to
neighbours to the transforming_liquid queue.
2016-12-07 04:06:00 +00:00
adrido 295232667e Windows: Add manifest file and set "High DPI Aware" true
This resolves washy font and incorrect mouse handling on Windows if
a screen with high DPI is used.
2016-11-07 21:55:01 +00:00
SmallJoker ad4bf2ccf9 MSVC: Generate debug information for release builds (#4674)
Replace parameters with the equivalent /Ox
2016-11-06 11:14:36 -05:00
Rogier a4a9ee94f3 Disable cmake message concerning WIN32 on non-windows systems 2016-10-11 07:29:04 +02:00
Loic Blot 569b89b36f Move RemotePlayer code to its own cpp/header 2016-10-08 22:27:44 +02:00
sfan5 45a9145a4b Only include keycode unittests in client build (fixes #4559) 2016-09-29 16:31:31 +02:00
sfan5 af4c2107e0 Don't use ZLIB_WINAPI if the required DLL is not provided to CMake
This allows you to use an stdcall zlib (zlib1.dll instead of zlibwapi.dll)
when building Minetest for win32.
2016-09-21 20:16:31 +02:00
Eric Mountain 9dd22aebc7 Fix "unknown CMake command "check_library_exists" (#4517)
Adds CMakeLists.txt include to fix this issue:

$ cmake . -DBUILD_SERVER=TRUE -DBUILD_CLIENT=FALSE \
   -DCMAKE_BUILD_TYPE=Release -DENABLE_CURL=TRUE -DENABLE_CURSES=FALSE \
   -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=FALSE \
   -DENABLE_POSTGRESQL=FALSE -DENABLE_SOUND=FALSE -DENABLE_LUAJIT=TRUE \
   -DIRRLICHT_SOURCE_DIR=$HOME/irrlicht-1.8.4 -LH
...
CMake Error at src/CMakeLists.txt:339 (check_library_exists):
  Unknown CMake command "check_library_exists".
...
2016-09-13 23:05:21 -04:00
kwolekr 3c63c3044d Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
  instead of the EmergeManager.
- New Script API functions added:
    core.get_mapgen_setting
    core.get_mapgen_setting_noiseparams,
    core.set_mapgen_setting, and
    core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
  rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
2016-07-03 15:38:36 -04:00
David Carlier b6eef1c0c2 openbsd's port fix for non Linux systems w/o libRT
X11 headers are not always in expected locations, add them to include list.

Modifications by est31: indentation fixes, commit message improved
2016-07-03 13:01:49 +02:00
Ekdohibs 14ef2b445a Add colored text (not only colored chat).
Add documentation, move files to a proper place and avoid memory leaks.
Make it work with most kind of texts, and allow backgrounds too.
2016-05-31 17:34:29 +02:00
Loic Blot ce42ff9cf7 Implement a PostgreSQL backend 2016-05-22 11:34:47 +02:00
ShadowNinja 0079887b64 Move AreaStore to util 2016-03-07 16:33:20 -05:00
Duane Robertson 3c6b2ffb10 Add Valleys mapgen. 2016-01-14 05:04:29 +00:00
Ferdinand Thiessen 70ece71ee4 Improve LuaJIT detection
On openSUSE luajit is not detected correctly.
This is because openSUSE is using a lua version suffix, like other Linux distributions do it also.
So the include directory is:
include/luajit-5_1-2.0
2015-12-05 23:31:09 +01:00
paramat 76c9abe4c8 Mapgen: Add flat mapgen in hidden form 2015-11-11 09:37:54 +00:00
est31 5e507c9829 Add server side ncurses terminal
This adds a chat console the server owner can use for administration
or to talk with players.
It runs in its own thread, which makes the user interface immune to
the server's lag, behaving just like a client, except timeout.
As it uses the same console code as the f10 console, things like nick
completion or a scroll buffer basically come for free.
The terminal itself is written in a general way so that adding a
client version later on is just about implementing an interface.

Fatal errors are printed after the console exists and the ncurses
terminal buffer gets cleaned up with endwin(), so that the error still
remains visible.

The server owner can chose their username their entered text will
have in chat and where players can send PMs to.
Once the username is secured with a password to prevent anybody to
take over the server, the owner can execute admin tasks over the
console.

This change includes a contribution by @kahrl who has improved ncurses
library detection.
2015-11-06 08:51:14 +01:00
paramat e62eac49d5 Mapgen: Add 4D fractal mapgen 2015-10-06 06:43:04 +01:00
ShadowNinja e511282d78 Warn when building without cURL 2015-09-01 14:43:59 -04:00
ShadowNinja 7419504079 Enable server build when no builds are enabled 2015-09-01 14:43:59 -04:00
ShadowNinja e4bff8be94 Clean up threading
* Rename everything.
    * Strip J prefix.
    * Change UpperCamelCase functions to lowerCamelCase.
  * Remove global (!) semaphore count mutex on OSX.
  * Remove semaphore count getter (unused, unsafe, depended on internal
    API functions on Windows, and used a hack on OSX).
  * Add `Atomic<type>`.
  * Make `Thread` handle thread names.
  * Add support for C++11 multi-threading.
  * Combine pthread and win32 sources.
  * Remove `ThreadStarted` (unused, unneeded).
  * Move some includes from the headers to the sources.
  * Move all of `Event` into its header (allows inlining with no new includes).
  * Make `Event` use `Semaphore` (except on Windows).
  * Move some porting functions into `Thread`.
  * Integrate logging with `Thread`.
  * Add threading test.
2015-08-23 22:04:06 -04:00
est31 c30a2d6854 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
kwolekr 4e28c8d3c8 Fix *BSD build with GNU iconv 2015-06-29 12:32:01 +02:00
RealBadAngel ffd16e3fec Add minimap feature 2015-06-27 03:42:01 +02:00
est31 572990dcd3 Add utf-8 conversion utilities and re-add intlGUIEditBox 2015-06-13 19:49:55 +02:00
kwolekr 6c5a6967ec Split ObjDef/ObjDefManager out to objdef.cpp 2015-05-18 22:30:25 -04:00
kwolekr 11a96e4901 Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler warnings 2015-05-16 20:15:03 -04:00
est31 181f7baa45 Add LibGMP
Uses system provided libgmp if found, if not it falls back to mini-gmp.
2015-05-11 17:48:33 +02:00
ShadowNinja 1be2d32fd5 Make Git version detection use VERSION_STRING instead of tags
This fixes the problem where 0.4.12-dev versions were erroneously shown as
0.4.11-dev because the tag was added on a separate branch.  It also fixes a
similar issue when builders didn't fetch new tags when updating.

This also removes the number-of-commits-since-tag field, since it's
incompatible with this.  Said field doesn't seem to be useful anyway if you
have the commit hash.
2015-05-05 17:13:05 +02:00
sfan5 4ea5a96fff Revert the upper-case PROJECT_NAME nonsense that was part of #2402 2015-04-27 16:24:49 +02:00
kwolekr 7220ca906d Tests: Modularize unit testing
Split unit tests into separate files under src/unittest/
Give better unittest diagnostics
Clean up some code
2015-04-26 15:08:54 -04:00
kwolekr c758fd73ff Link against shlwapi.lib and unify linker input sources for Windows 2015-04-08 12:56:53 -04:00
Dmitry Marakasov d2fc98e4a6 Fix freetype detection
Don't reinvent freetype detection, use working one from cmake.
2015-04-08 00:37:27 -04:00
Craig Robbins 9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
Aaron Suen 6d61375cc7 Clean scaling pre-filter for formspec/HUD. 2015-04-01 00:01:05 -04:00
ShadowNinja 93fcab952b Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -04:00
Pavel Puchkin ca5df44edb Standalone bundle for OSX (w/ dependencies!) 2015-03-17 15:37:23 +01:00
Loic Blot 0d1eedcccc Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
Loic Blot 3998a1f8f9 Move sha1.hpp and base64.hpp to util/ 2015-02-21 14:03:27 +01:00
Loic Blot cf4045ff0f Use proper CMakeLists.txt for network and client directories 2015-02-21 11:51:12 +01:00
Loic Blot b3aeba684b Unit tests must be done at integration process.
* Remove --enable-unittests and --disable-unittests and add --do-unittests function
* --do-unittests function will exit 0 on success.
* minetest and minetestserver binaries are launched with --do-unittests in travis build.
2015-02-21 11:04:19 +01:00
Loic Blot ed04e8e9e4 [Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
  * Reliability
  * Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)

PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).

Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)

Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)

ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)

Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll

Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets

Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes

ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-02-16 11:00:55 +01:00