Commit Graph

697 Commits

Author SHA1 Message Date
Loïc Blot 111f1dc9c5 Revert "Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)"
This reverts commit 01cd63bd3b.
2019-02-26 08:53:53 +01:00
Paramat 01cd63bd3b
Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)
Reverts 5dab742645
"[CSM] Add functions to create particles and particlespawners."
2019-02-26 04:26:25 +00:00
rubenwardy a8311ad57f Fix extract zip writing lowercase files (#8221) 2019-02-14 20:03:45 +00:00
SmallJoker ffb17f1c9a Consistent HP and damage types (#8167)
Remove deprecated HUDs and chat message handling.
Remove unused m_damage variable (compat break).
HP: s32 for setter/calculations, u16 for getter.
2019-02-10 23:03:26 +00:00
rubenwardy 572ba83b30 Content store: Fix storage leak by storing screenshots in cache (#8137) 2019-01-31 16:35:55 +00:00
Paul Ouellette ded522b2ee Fix pkgmgr game install with RUN_IN_PLACE=0 (#8113) 2019-01-26 14:12:20 +01:00
SmallJoker a122ba0ef4 Fix various bugs (Anticheat, Lua helpers) (#8013)
* Fix various bugs (Anticheat, Lua helpers)

Anticheat: Use camera position instead of player position for shoot line calculations
Lua helpers: Increase 'i' to not overwrite earlier added table values

* Remove lag compensation

* * 1.5 for larger selection boxes
2019-01-06 10:24:44 +01:00
HybridDog c6f784f43b Add minetest.load_area (#8023) 2018-12-31 00:32:54 +00:00
Loïc Blot a5197eaebc
CSM: add requested CSM_RF_READ_PLAYERINFO (#8007)
* CSM: add requested CSM_RF_READ_PLAYERINFO

This new CSM limit permit to limit PLAYERINFO read from server.

It affects get_player_names call
2018-12-24 10:51:10 +01:00
SmallJoker 2a69f874da reportMetadataChange; Silence clang warnings 2018-12-21 19:05:29 +01:00
rubenwardy f318366c20 Fix ContentDB packages timing out by using download_file instead (#7891) 2018-12-11 04:43:14 +00:00
SmallJoker 3d66622772
Send only changed node metadata to clients instead of whole mapblock (#5268)
Includes newer style changes and fixes by est31

Improve the block position de-serialization
Add type NodeMetadataMap
2018-12-04 20:37:48 +01:00
Quentin Bazin 5f1cd555cd Move client-specific files to 'src/client' (#7902)
Update Android.mk
Remove 'src/client' from include_directories
2018-11-28 20:01:49 +01:00
CoderForTheBetter faa358e797 Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
2018-11-28 09:38:50 +01:00
rubenwardy b1112f663b Content store: Add setting to filter non-free packages (#7766)
Defaulting to hiding in order to help with Debian/etc distribution.
This could be changed at a later date.
2018-11-08 21:59:56 +00:00
Paramat 622e2235ee
clear_craft: Return false if recipe not found, don't throw error (#7804) 2018-10-24 15:03:21 +01:00
SmallJoker 0a5e77132a
Add core.remove_detached_inventory (#7684)
Breaks backwards compatibility for good
Bump protocol version
2018-10-10 20:48:58 +02:00
SmallJoker 81c06dea9b markAliasDeprecated: Fix MSVC build 2018-09-11 19:32:10 +02:00
Paramat 766fb7b46e
Particles: Make collision with objects optional (#7682)
Also set it to false for node dig particles, as they are often created
and high in number.

Improve particle documentation.
2018-09-08 00:38:35 +01:00
Dániel Juhász 325bf68041 Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates.
* Clarify 'intersection_point' documentation
2018-08-16 20:10:08 +02:00
Ben Deutsch 153fb211ac Replace auth.txt with SQLite auth database (#7279)
* Replace auth.txt with SQLite auth database
2018-08-05 13:13:38 +02:00
HybridDog 741e3efaf5 LuaVoxelManip: Throw warning or error instead of silently doing nothing (#7567)
Error on missing parameter.
Warning when using a method on the incorrect type of LuaVoxelManip.
2018-08-02 19:54:44 +01:00
rubenwardy 14011bdc7a
Add protocol_version and supported package types to ContentDB urls 2018-07-29 00:26:03 +01:00
Loïc Blot a61e1a4dbc
Lua templating reading (part 4): s16, v2s16, v2f (#7512) 2018-07-08 23:06:33 +02:00
SmallJoker 49509d2f74
Log deprecated Lua function calls (#7491) 2018-07-01 12:31:49 +02:00
Loïc Blot eef62c82a2
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance

Implement the boolean reader
Implement the string reader
Also remove unused & unimplemented script_error_handler
Add a reader with default value
2018-06-30 17:11:38 +02:00
red-001 227c71eb76 Fix memory leaks in mod storage (#7500) 2018-06-30 17:11:04 +02:00
Vitaliy 9f19b7d936 Fix world deletion (#7494)
* Fix world deletion
2018-06-30 15:13:53 +02:00
Loic Blot d7f873bc8d
Fix a memleak before assertion in l_get_mod_storage 2018-06-30 10:32:02 +02:00
red-001 e36af6f969 Fix mod channels crash (#7481) 2018-06-27 17:45:40 +02:00
SmallJoker db42542e27 Rename CSM flavours to restrictions
& Satisfy LINT
2018-06-26 15:38:42 +02:00
rubenwardy ca502fc274
Update to new ContentDB API 2018-06-18 20:47:38 +01:00
number Zero 2c0d8b25dd Fix narrow/utf8 difference in incoming/outcoming messages 2018-06-10 10:33:53 +02:00
Loïc Blot 180e551c56
Modernize lua read (part 1): C++ templating insurance (#7394)
* Modernize lua read (part 1): C++ templating assurance

Implement the float reader
2018-06-04 22:38:07 +02:00
Loïc Blot 162ffd7fba
Fix isNan on setYaw Lua call (#7380)
* Fix isNan on setYaw Lua call
2018-05-31 22:52:08 +02:00
you 22df02d25b Fix missing ignore textures (#7326) 2018-05-20 14:51:50 +02:00
rubenwardy 122eed7a34
Add screenshots to online content browser 2018-05-20 00:25:17 +01:00
rubenwardy 3eb363f813
Add updating to online content browser 2018-05-16 21:52:12 +01:00
SmallJoker ba91624d8c
Allow damage for attached objects, add attach/detach callbacks (#6786)
* Allow right-clicking on attached LuaEntities
2018-04-30 18:43:49 +02:00
rubenwardy 0b5b32b026 MetaDataRef: Add contains() and get() (#7214) 2018-04-30 18:42:51 +02:00
rubenwardy 87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
Paramat 746ca41f58
Biome API / dungeons: Add biome-defined dungeon nodes
Add new biome fields 'node_dungeon', 'node_dungeon_alt', 'node_dungeon_stair'.
If 'node_dungeon' is not defined dungeons fall back to classic behaviour.

Remove messy and imprecise dungeon material code from 'generateBiomes()'.
Code deciding dungeon materials is now in 'generateDungeons()' and uses the
biome at mapchunk centre for more precision.

Remove hardcoded 'MG_STONE' types as long intended.
2018-04-07 22:09:54 +01:00
rubenwardy 91615f9588 Add player:get_meta(), deprecate player attributes (#7202)
* Add player:get_meta(), deprecate player attributes
2018-04-06 10:52:29 +02:00
Paramat 32d456bd2d
Biome API / cavegen: Add definable cave liquid for a biome (#7192)
Add 'node_cave_liquid' as a new field in biome registration.
If field is absent cave liquids fall back to classic behaviour.
2018-04-05 17:21:41 +01:00
Loic Blot 05fe3b06c8
Fix last clang-tidy reported problems for performance-type-promotion-in-math-fn
Based on https://travis-ci.org/minetest/minetest/jobs/361810382 output

Also fix 2 missing copyright notices
2018-04-03 23:05:22 +02:00
Loïc Blot 2481ea27ce
Fix many issues reported by clang-tidy (#7189)
* Fix many issues reported by clang-tidy

We have many issues in code related to some performance to float <-> double.
Clang-tidy reported it in performance-type-promotion-in-math-fn

I fixed many of them. It's not ready for a promote to blocking

Also fix some value which should be const-ref
2018-04-02 23:51:08 +02:00
you 93eb0794d6 ObjectRef: Add add_velocity() (#3208)
Allow changing the velocity of objects relatively to their current velocity
2018-03-31 14:50:17 +02:00
Andrew Ward 71b2570f09
Load dependencies and description from mod.conf 2018-03-28 22:14:16 +01:00
Andrew Ward dfc8198349
Add reasons to on_dieplayer and on_hpchange 2018-03-28 16:05:18 +01:00
Andrew Ward 2323842dd3
Add formspec theming using prepended strings 2018-03-28 16:04:41 +01:00
Paramat 2f280cc672
Mapgen: Remove unused mgv7 code and some unused biometypes 2018-03-26 04:59:49 +01:00
Loïc Blot 4fd9715876
Cleanup sound manager class (#7158)
* Cleanup sound manager client

* Use some const refs
* Use auto on iterators
* Drop unused parameters
* Move sound_openal.* to client folder
* Move sound.cpp + OnDemandSoundFetcher to client/ folder + reorganize includes properly
2018-03-24 15:45:25 +01:00
paramat 7ad6cdd09b Biome API: Add 'get_biome_name(biome_id)' API
Change name of default biome to a more suitable lowercase 'default'.
2018-03-11 23:06:17 +00:00
paramat 644d0ab2bb Spawn level: Add 'get_spawn_level(x, z)' API
Returns a suitable player spawn y co-ordinate for unmodified terrain.
2018-03-10 03:38:27 +00:00
paramat cbb9301bea Biomes: Add 'min_pos'/'max_pos' xyz biome limits
'y_min' and 'y_max' are still accepted for compatibility.
2018-03-09 03:16:25 +00:00
Loic Blot c7c03ad7a6 Cleanup & bugfix
* ObjectRef::set_local_animation: fix wrong lua return (should push a boolean, currently returns nil)
* ObjectRef::set_eye_offset: fix wrong lua return (should push a boolean, currently returns nil)
* Fix various Server functions which depends on RemotePlayer objet and return true/false when player object is nil whereas it's a caller implementation error. Change those bool functions to void and add sanitize_check call instead. Current callers are always checking player object validity
* Optimize Server::setClouds : use CloudParams object ref instead of attribute deserialization from structure & perform RemotePlayer::setCloudParams directly in server class like many other calls
* Optimize Server::SendCloudParams: use CloudParams object ref instead of deserialized attributes
2018-03-08 23:00:17 +01:00
Loic Blot c7656edaa5 Cleanup: drop Server::hudGetHotbarSelectedImage()
Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
2018-03-08 23:00:17 +01:00
Loic Blot 4be46aeeb1 Cleanup: drop Server::hudGetHotbarImage()
Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
2018-03-08 23:00:17 +01:00
Loic Blot 373f1bfb4a Cleanup: drop Server::hudGetHotbarItemcount()
Call directly accessible RemotePlayer::getHotbarItemcount() from server api
2018-03-08 23:00:17 +01:00
paramat 48493a979b Gennotify: Add 'minetest.get_decoration_id' API
Returns the decoration ID for the provided decoration name string.
For use with gennotify, to know the decoration IDs for use in
'minetest.set_gen_notify'.
2018-03-03 23:00:08 +00:00
paramat c610643c4c Place schematic (on vmanip): Enable use of 'place center' flags
For 'place schematic' and 'place schematic on vmanip' APIs.
Fix 'place center' code to properly centre schematics.
Fix some comments.
2018-02-27 19:39:05 +00:00
paramat 673f7196a2 Find nodes in area (under air): Raise volume limit and document it 2018-02-21 15:54:06 +00:00
sfan5 3f2e0c1206 Check argument types inside MetaDataRef Lua API (#7045) 2018-02-18 10:40:45 +01:00
Dániel Juhász 3face01a20 Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
Loïc Blot 584d00a01c
Add minetest.bulk_set_node call + optimize Environment::set_node call (#6958)
* Add minetest.bulk_set_node call + experimental mod unittest

* Optimize set_node function to prevent triple lookup on contentfeatures

Do only one lookup for old, and try to merge old and new lookup if node is same than previous node

* Add benchmark function + optimize vector population to have real results
2018-01-30 00:30:02 +01:00
red-001 0425c6b8c8 CSM: Remove screenshot API
Reverted from commit 19960e26c6
(* [CSM] add screenshot api lua)
2018-01-23 05:27:38 +00:00
red-001 5dab742645 [CSM] Add functions to create particles and particlespawners. (#6072) 2018-01-20 23:31:53 +01:00
red-001 9649e47214 [CSM] Add basic HUD manipulation. (#6067)
* [CSM] Add basic HUD manipulation.

Workaround for on_connect not working right now.
2018-01-20 14:09:58 +01:00
paramat d45e5da8ca Biomes: Add 'get heat', 'get humidity', 'get biome data' APIs
'get biome data' returns biome id, heat and humidity.
Clean up nearby lines in lua_api.txt.
2018-01-16 08:47:07 +00:00
Pedro Gimeno 63f4ee21b0 Fix buffer parameter not working in LuaPerlinNoiseMap::l_getMapSlice() 2018-01-08 20:32:15 +00:00
rubenwardy 0a83c42dfd
Fix naming conventions of noise userdata 2018-01-07 01:06:18 +00:00
Paramat 549cfd9db8 Biomes: Add vertical biome blend (#6853)
Add 'vertical blend' parameter to biome registration that defines how
many nodes above the biome's 'y max' limit the blend will extend.
2018-01-05 00:10:55 +01:00
Hybrid Dog 345e1041a2 Tool.cpp/.h, lua_api/l_util.cpp: Tidy up code and remove dead code 2018-01-03 04:01:15 +00:00
Dániel Juhász 2153965cf9 Line_of_sight: Improve using VoxelLineIterator
This commit rewrites line_of_sight with VoxelLineIterator.
Stepsize is no longer needed, the results will be always accurate.
2017-12-26 21:51:32 +00:00
Jordan Irwin 18b921015a Allow 'default' parameter in 'settings:get_bool' function
Default value is used when the setting key is not found in the config
file. If default value is not set, 'nil' is returned.

#6188
2017-12-17 15:27:37 +00:00
paramat 912ba1e47f Clearobjects: Send progress messages to terminal using actionstream
Change default mode to 'quick' as 'full' can lock up a server for a
long time.
2017-11-24 05:38:53 +00:00
paramat 4b553ece09 Stratum ore: Add option for a constant thickness stratum
Add a 'stratum thickness' integer parameter, as an alternative
to providing a 2nd noise parameter for thickness variation.
2017-11-19 00:25:39 +00:00
number Zero 05d93c7fa1 Load files from subfolders in texturepacks
Updated and rebased version of a PR by red-001
2017-11-17 19:23:08 +00:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
sfan5 b692454f70 Add minetest.safe_write_file() to script API 2017-11-08 16:14:05 +01:00
Rob Blanckaert 65c5539035 Add sha1 to lua utils. (#6563) 2017-10-30 08:18:18 +01:00
lisacvuk c252ed506e CSM: Add a way to get current locale from CSM 2017-10-29 12:05:16 +00:00
raymoo a637107a4e Allow overriding tool capabilities through itemstack metadata
This makes it possible to modify the tool capabilities of individual
itemstacks by calling a method on itemstack metadata references.
2017-10-29 11:57:38 +00:00
Muhammad Rifqi Priyo Susanto a1e1a19ac3 Improvements/fixes for noise parameter input in advanced settings
Formspec input for each individual noise parameter and flag.
Allow noise flags to be set in advanced settings, previously only settable
in minetest.conf.

Standardise 'group format' for noise parameters set in minetest.conf, as
only these support noise flags. However the older 'single line' format is
still accepted to support existing minetest.conf files.
Therefore auto-generate minetest.conf.example with noise parameters in
'group format'.

Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or
'noise_params_3D', the dimension number is displayed in the advanced
settings edit page.
2017-10-23 01:28:13 +01:00
paramat 9a41a3d0f1 Simple decorations: Make 'place_offset_y' usable with simple decorations
Necessary for placing the base cube of 'plantlike_rooted' drawtype in the
seabed instead of on it.
Useful for placing decorations sunk into, or buried in, the ground.
2017-10-10 19:57:28 +01:00
paramat 0c9ca27ffc Simple decorations: Add 'param2_max' parameter for random param2
If 'param2_max' is not used, parameter 'param2' works as before for
compatibility.
If 'param2_max' is used, 'param2' and 'param2_max' become the lower
and upper bounds of a per-decoration random param2.
2017-10-09 18:27:17 +01:00
paramat e2afcf85ce Stratum ore: Allow use with no noise for simple horizontal strata
If either of the 2 noise parameters are omitted the ore will occur from y_min
to y_max in a simple horizontal stratum. As this does not compute noise
performance improves, and is ideal for placing many layers.

Clean up some nearby ore documentation.
2017-10-01 22:31:44 +01:00
Loïc Blot be10c0893e Make Player::peer_id server-side only and add getters and setters (#6478)
* Make Player::peer_id server-side only and add getters and setters

Player::peer_id has no sense client side, move it to server, make it private and add setter and getter
Also add some PEER_ID_INEXISTENT instead of harcoded 0
2017-09-30 12:00:05 +02:00
Loïc Blot 50423d8c72 Update JsonCPP to 1.8.3 (#6466)
* Update JsonCPP to 1.8.3

* Fix deprecated functions

Json::FastWriter, Json::StyledWriter and Json::Reader are marked deprecated since 1.1 and are deprecated in 0.8 but not shown at compilation time.

Use new methods to serialize/deserialize
2017-09-26 20:30:14 +02:00
Loïc Blot 6f1c907204 Implement mod communication channels (#6351)
Implement network communication for channels

* Implement ModChannel manager server side to route incoming messages from clients to other clients
* Add signal handler switch on client & ModChannelMgr on client to handle channels
* Add Lua API bindings + client packet sending + unittests
* Implement server message sending
* Add callback from received message handler to Lua API using registration method
2017-09-26 00:11:20 +02:00
DTA7 5a3b8e34b3 Set placer to nil instead of a non-functional one in item_OnPlace (#6449)
* Set placer to nil instead of a non-functional one

This requires nil checks in core.rotate_node and core.rotate_and_place.
2017-09-21 21:52:52 +02:00
sfan5 04839f233f ServerEnv: Clean up object lifecycle handling (#6414)
* ServerEnv: Clean up object lifecycle handling
2017-09-15 12:19:01 +02:00
SmallJoker ee9a442ecc Network: Remove large parts of deprecated legacy code (#6404)
Also remove the setting 'send_pre_v25_init'
Keep old enum entries for obsolete commands
2017-09-12 19:48:09 +02:00
Kahrl 17fd5fe935 Make INodeDefManager::getIds return a vector, not a set 2017-09-12 19:31:46 +02:00
paramat 51002b1629 Schematic decorations: Add 'place_offset_y' placement parameter
For precise control of schematic vertical position relative to the
'place_on' node.
Avoids workarounds that add empty nodes to a schematic and therefore
reduce performance.

Also remove long-unused decoration cutoff code.
2017-09-10 01:31:30 +01:00
Paramat 9f6d90aa81 Ores: Add stratum ore (#6352)
Creates a single undulating ore stratum that is continuous across mapchunk
borders and horizontally spans the world.
Due to being continuous is ideal for creating bands of alternative stone
type running through cliffs and mountains, or underground layers.

Add missing documentation of 'ore_param2' parameter.
2017-09-03 22:32:21 +02:00
sapier bf403b923a Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)
* Fix animation frame_speed and blend loosing precision due to incorrect data type
Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
2017-09-01 11:15:12 +02:00
Loïc Blot 5f38fe33f8 Clientevent refactor (#6320)
* Refactor clientevent structure

* Move structure outside of client header

* Create client events on heap not stack, this remove the ClientEvent object copy

* Use clientEventHandler to route events
2017-08-28 20:02:23 +02:00
you e09c7fceaa core.get_objects_inside_radius: Omit removed objects (#6318)
Fixes #6294
2017-08-27 18:38:50 +02:00
SmallJoker f7d50a8078 Respect object property hp_max field for players (#6287)
* Respect object property hp_max field for players
This allows modders to configure the maximal HP per player

* Statbars: Downscale bar to full 20 HP when exceeding this value
Add default max HP for players and breath constants to builtin
Document the constants

* Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-23 22:32:10 +02:00
paramat 7657fe7a50 Minimap: Add new HUD flag for minimap radar mode
Flag default is true to not change default behaviour.
The existing minimap HUD flag remains the master control for minimap.
2017-08-20 23:58:15 +01:00
Loïc Blot ae9b5e0098 Modernize code: very last fixes (#6290)
Last modernization fixes
2017-08-20 19:37:29 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
Loïc Blot 88b436e6a9 Code modernization: subfolders (#6283)
* Code modernization: subfolders

Modernize various code on subfolders client, network, script, threading, unittests, util

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Make connection.cpp readable in a pointed place + typo
2017-08-19 22:23:47 +02:00
Loïc Blot fd3afbced5 Optimize headers (part 2) (#6272)
* Optimize headers (part 2)

* less debug.h in headers
* less remoteplayer.h for everybody

* Cleanup (part 2)

* camera.h: mesh.h
* mapgen.h: mapnode.h
* serverenvironment.h: mapblock.h
* nodedef.h: shader.h
2017-08-18 19:25:07 +02:00
Loïc Blot 921151d97a C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
2017-08-17 22:19:39 +02:00
Loic Blot 3e80bf933f
l_server, clientenvironment, clientiface: code modernization
* use range-based for loops
* use refs on some exceptions & one setter
2017-08-17 08:11:39 +02:00
Loïc Blot 85511a642f Cleanup various headers to reduce compilation times (#6255)
* Cleanup various headers to reduce compilation times
2017-08-16 22:11:45 +02:00
Ben Deutsch c50a57c070 Clouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164) 2017-07-24 18:04:00 +02:00
Loïc Blot 79f19b8369 [CSM] Add flavour limits controlled by server (#5930)
* [CSM] Add flavour limits controlled by server

Server send flavour limits to client permitting to disable or limit some Lua calls

* Add limits for reading nodedefs and itemdefs

* flavour: Add lookup node limits

* Merge get_node_or_nil into get_node.

Sending fake node doesn't make sense in CSM, just return nil if node is not available for any reason

* Add node range customization when noderange flavour is enabled (default 8 nodes)

* Limit nodes range & disable chat message sending by default

* Bump protocol version
2017-07-18 21:39:55 +02:00
Loïc Blot 7ddf67aa14 Chat protocol rewrite (#5117)
* New TOCLIENT_CHAT_MESSAGE packet

* Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat
* Handle TOCLIENT_CHAT_MESSAGE new structure client side
* Client chat queue should use a specific object
* SendChatMessage: use the right packet depending on protocol version (not complete yet)
* Add chatmessage(type) objects and handle them client side (partially)
* Use ChatMessage instead of std::wstring server side

* Update with timestamp support
2017-07-16 10:47:31 +02:00
Loic Blot 84aa845911
Revert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""
This reverts commit bdac12761c.
2017-07-15 09:28:10 +02:00
rubenwardy bdac12761c CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"
Original PR: #5747.
This reverts commit 39f4a2f607.
2017-07-15 01:35:18 +01:00
Elijah Duffy dc3ca09e0e Remove remaining modstore code (#6120) 2017-07-14 20:37:58 +02:00
Dániel Juhász 3caad3f3c9 Expose getPointedThing to Lua
This commit introduces Raycast, a Lua user object, which can be
used to perform a raycast on the map. The ray is continuable, so one can
also get hidden nodes (for example to see trough glass).
2017-07-07 22:28:23 +01:00
Elijah Duffy 66c4108581 Main Menu: Allow copying directories from non-Minetest locations (#6095)
Allow `core.copy_dir` (main menu API) to copy directories from a
non-Minetest location. The check to disallow copying to non-Minetest
locations is retained.
2017-07-04 09:27:29 +02:00
red-001 f3ad75691a Create a filesystem abstraction layer for CSM and only allow accessing files that are scanned into it. (#5965)
* Load client-side mods into memory before executing them.

This removes the remaining filesystem access that client-sided mods had and it will hopefully make then more secure.

* Lua Virtual filesystem: don't load the files into memory just scan the filenames into memory.

* Fix the issues with backtrace

* fix most of the issues

* fix code style.

* add a comment
2017-06-30 20:14:39 +02:00
Loïc Blot b3a36f7378 Isolate irrlicht references and use a singleton (#6041)
* Add Device3D class which will contain IrrlichtDevice interface

move getSupportedVideoDrivers to Device3D

Add Device3D singleton & use it in various places

Rename Device3D to Rendering engine & add helper functions to various device pointers

More singleton work

RenderingEngine owns draw_load_screen

move draw functions to RenderingEngine

Reduce IrrlichtDevice exposure and guienvironment

RenderingEngine: Expose get_timer_time() to remove device from guiEngine

Make irrlichtdevice & scene manager less exposed

* Code style fixes

* Move porting::getVideoDriverName, getVideoDriverFriendlyName, getDisplayDensity, getDisplaySize to RenderingEngine

Fix XORG_USED macro -> RenderingEngine + create_engine_device from RenderingEngine constructor directly

* enum paralax => enum parallax
2017-06-26 20:11:17 +02:00
red-001 8b9f40d12f Fix CSM crash caused by move to C++11. (#6027) 2017-06-22 13:18:58 +02:00
Dániel Juhász 0fcaf9fb1b Automatic item and node colorization (#5640)
* Automatic item and node colorization

Now nodes with a palette yield colored item stacks, and colored items
place colored nodes by default. The client predicts the colorization.

* Backwards compatibility

* Use nil

* Style fixes

* Fix code style

* Document changes
2017-06-20 11:19:56 +02:00
Loic Blot b32f36bf34
Fix 2 warnings reported by GCC
* ClientEnvironment::m_irr is not used anymore since a recent cleanup
* l_vmanip constructor ordering
2017-06-20 00:04:18 +02:00
Vincent Glize 4a5e8ad343 C++11 cleanup on constructors (#6000)
* C++11 cleanup on constructors dir script
2017-06-19 23:54:58 +02:00
SmallJoker 6eb03c135f find_nodes_in_area: Extend maximal count to U32_MAX (#5277)
Extend documentation, limit area volume
Remove u16 count limitation

* Prevent integer overflow, replace minp/maxp with pos1/pos2
2017-06-19 16:30:26 +02:00
Loic Blot 8f2e60a961
Client::makeScreenshot: remove device param
We already have the device param as class member
2017-06-19 00:00:55 +02:00
Rui ff73c7a5da Sound: Add pitch option (#5960)
* Sound: Add pitch option
2017-06-11 13:58:26 +02:00
red-001 26e2eb019a Improve the path select GUI (#5852)
- Allow lua to chose whatever directories or files can be selected
- Fix selecting directories
- Rename dialog to `guiPathSelectMenu` from `guiFileSelectMenu`
- Rename lua function for opening the menu from `show_file_open_dialog` to `show_path_select_dialog`
- Remove duplicate code and fix code style.

Related changes
- fix `clang-format` whitelist.
- Regenerate minetest.conf.example
2017-06-11 09:43:31 +02:00
red-001 c91a8c7061 [CSM] Add function to get player privileges (#5933)
* [CSM] Add function to get player privileges + move related help functions to common

* Added @Zeno- const
2017-06-07 09:09:06 +02:00
Elijah Duffy fee5171298 Main Menu: Add get_clientmodpath API (#5912)
Add `core.get_clientmodpath` to main menu API (also possible in async calls).
2017-06-06 14:34:31 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
Loic Blot bf6569b570 Minetest for C++11 (CMakeLists + Travis)
* Move GCC to GCC 6 & GCC 7
* Move Clang to Clang 3.6 & Clang 4.0
* LINT moves from Clang 3.9 to Clang 4.0
* Move XCode 7.3 to 8.0
* Use more travis tricks to install compilers instead of adding complexity to our build script
* Clang format fixes on checked files (compat Cpp11 instead of Cpp03)
* Mingw GCC update from 4.8.4 to 5.3 (Ubuntu Xenial)
* Drop mingw cmake generated files and add them to gitignore
2017-06-04 09:57:08 +02:00
Loïc Blot 4d5ce8478c Enhance ABM performance a little bit by removing two std::set copy (#5815)
* Enhance ABM performance a little bit by removing two std::set copy

* ActiveBlockModifier::getTriggerContents now returns a const ref
* ActiveBlockModifier::getRequiredNeighbors now returns a const ref
* ActiveBlockModifier::getRequiredNeighbors is now purely virtual

* Little code style fix
2017-05-25 16:43:55 +02:00
Loic Blot c445a3d958
Fix wrong return value in get_sky Lua call since ad9fcf859e
Fix #5803
2017-05-23 19:59:47 +02:00
Loic Blot 05309229b8
LINT fix & check all files with clang-format
Seems the diff mode doesn't work well, PR are detected as working whereas in master it's shown it's problematic (and really problematic). Use same check everywhere
2017-05-22 07:28:35 +02:00
Pierre-Adrien Langrognet 39f4a2f607 [CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)
* [CSM] Add send_chat_message and run_server_chatcommand API functions

* Add client-side chat message rate limiting

* Limit out chat queue size

* [CSM] Add minetest.clear_out_chat_queue API function and .clear_chat_queue chatcommand

* Last fixes/cleanups before merge
2017-05-21 23:06:51 +02:00
Loic Blot de840fe271
Fix LINT broken by dfa0c15ce0 2017-05-21 17:30:00 +02:00
bigfoot547 dfa0c15ce0 [CSM] Add function to get the definition of items (#5732)
Add node def and item def documentation.

Please be ready for merge!
2017-05-21 14:40:55 +02:00
SmallJoker af2f02552f [CSM] Correct the log destination of print() (#5784) 2017-05-20 16:46:12 +02:00
sfan5 071e114ffa Private nodemeta (#5702)
* Private node metadata that isn't sent to the client
2017-05-10 15:29:21 +02:00
Loïc Blot c07c642ab0 read_schematic_replacements: ensure fields are strings (#5726)
* read_schematic_replacements: ensure fields are strings

add a type check before reading strings on read_schematic_replacements deserializer

* throw LuaError instead of asserting the whole client
2017-05-08 20:43:03 +02:00
Loïc Blot c1b3ed4180 Player attrs: permits to remove an attribute by setting value to nil (#5716)
* Player attrs: permits to remove an attribute by setting value to nil

When doing player:set_attribute("attr", nil) remove attribute

Also remove a useless check on C++ API part (already done by checkplayer)

Fix #5709
2017-05-07 12:13:15 +02:00
Loic Blot 0d7c37943b
LINT fix since d067894816 2017-05-07 11:07:17 +02:00
T0ny2 d067894816 Replace occurrence of luaL_reg in l_camera.cpp
Related to commit 41c5483. Replace an occurrence of luaL_reg in
src/script/lua_api/l_camera.cpp (added by commit de028fc).
2017-05-07 06:09:30 +01:00
ShadowNinja 77597c4ff3 Clean up numeric.h and split FacePositionCache from it
I also optiized FacePositionCache a bit: I removed a map
lookup and vector copy from both branches of getFacePosition.
2017-05-06 16:09:45 -04:00
ShadowNinja 43d1f375d1 Use a settings object for the main settings
This unifies the settings APIs.

This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
2017-05-06 15:33:19 -04:00
Loic Blot a024042bf5
Fix codestyle since CSM Camera API 2017-05-06 21:30:27 +02:00
bigfoot547 de028fc056 [CSM] Add camera API (#5609)
* [CSM] Add camera API
roper rebase & squash

* Address nerzhul's review
2017-05-05 22:07:36 +02:00
red-001 d6cf5450a8 Add option to also check the center to `find_node_near` (#5255)
* Add option to also check the center to `find_node_near`
2017-05-04 22:52:58 +02:00
red-001 ae0d8f74d7 Add function to get server info. 2017-05-04 04:25:45 +01:00
paramat ad9fcf859e Set sky API: Add bool for clouds in front of custom skybox
Default true.
Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API.
Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of
'm_visible' (whether normal sky is visible).
2017-05-02 20:42:35 -07:00
SmallJoker f9fdb48dc8 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +01:00