aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
AgeCommit message (Collapse)Author
2020-04-25Add server side translations capability (#9733)EvidenceB Kidscode
* Add server side translations capability
2020-04-16Optimize get_objects_inside_radius calls (#9671)Loïc Blot
* Optimize getObjectsInsideRadius calls our previous implementation calls the ActiveObjectMgr to return ids and then lookup those ids in the same map and test each object Instead now we call the global map to return the pointers directly and we ask filtering when building the list using lamba. This drop double looping over ranges of active objects (and then filtered one) and drop x lookups on the map regarding the first call results
2020-04-14scriptapi: Some small optimizations to value pushing (#9669)sfan5
2020-04-11Reduce ServerEnvironment propagation (#9642)Loïc Blot
ServerEnvironment is a huge class with many accessors. In various places it's not needed Remove it to reduce the ServerEnvironment view. Idea here is to reduce size of some of our objects to transport lightweight managers and permit easier testing Pathfinder is now tied to a generic map, not a ServerMap, it can be ported to client
2020-04-11Drop content_sao.{cpp,h}Loic Blot
Move LuaEntitySAO to a new dedicated file Drop TestSAO (useless object) Drop the old static startup initialized SAO factory, which was pretty useless. This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
2020-04-11Move PlayerSAO to dedicated filesLoic Blot
2020-04-11scriptapi: Sort out ServerEnvironment / Environment distinction properlysfan5
The API implementation is shared between CSM and SSM. Functions should retrieve a plain env when they do not need any server-specific functions.
2020-03-10minetest,get_connected_players: Return empty table at load time (#9493)sfan5
2020-03-05Fix pathfinder bugs: returning nil frequently, broken A*, jump through solid ↵Wuzzy
nodes (#9339) * Fix pathfinder fail when startpos is over air * Note down pathfinder restrictions * Implement real A* search * Pathfinder: Implement buildPath non-recursively * Update find_path documentation * Pathfinder: Check if jump path is unobstructed * Pathfinder: Fix drop check first checking upwards * Pathfinder: Return nil if source or dest are solid * Pathfinder: Use priority queue for open list
2020-03-03Fix core.get_player_by_name() returning unusable ObjectRefsfan5
Followup to the previous commit.
2020-03-03Fix core.get_connected_players() returning unusable ObjectRefssfan5
This bug is only exposed by 91eef646a59575bd9ae792e257bb6ad12fafc0b1 independent of the move of get_connected_players from Lua to C++. Previously, there would be a small time window where the SAO had its peer ID set to PEER_ID_INEXISTENT but the RemotePlayer was still linked to the SAO, resulting in an ObjectRef that crashed on certain function calls (#9387).
2020-02-25Fix potential problem with core.get_connected_players()sfan5
2020-02-23Move core.get_connected_players() implementation to C++sfan5
Keeping the ObjectRefs around in a table isn't ideal and this allows removing the somewhat nonsensical is_player_connected() added in 86ef7147.
2019-11-11[CSM] Expose more env functionssfan5
2019-11-11Refactor CSM restriction code a bitsfan5
This also fixes find_node_near restrictions being ineffective.
2019-11-09[CSM] Remove non-functional minetest.get_day_count()sfan5
2019-09-24Fix some reference counters (memleak) (#8981)SmallJoker
Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
2019-08-10Merge pull request #8776 from osjc/FixGetNodeJozef Behran
Finish getNode cleanup
2018-12-31Add minetest.load_area (#8023)HybridDog
2018-11-28Move client-specific files to 'src/client' (#7902)Quentin Bazin
Update Android.mk Remove 'src/client' from include_directories
2018-08-16Raycast: export exact pointing location (#6304)Dániel Juhász
* Return intersection point in node coordinates. * Clarify 'intersection_point' documentation
2018-06-30Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot
* 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-26Rename CSM flavours to restrictionsSmallJoker
& Satisfy LINT
2018-06-04Modernize lua read (part 1): C++ templating insurance (#7394)Loïc Blot
* Modernize lua read (part 1): C++ templating assurance Implement the float reader
2018-02-21Find nodes in area (under air): Raise volume limit and document itparamat
2018-02-10Node definition manager refactor (#7016)Dániel Juhász
* 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-01-30Add minetest.bulk_set_node call + optimize Environment::set_node call (#6958)Loïc Blot
* 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
2017-12-26Line_of_sight: Improve using VoxelLineIteratorDániel Juhász
This commit rewrites line_of_sight with VoxelLineIterator. Stepsize is no longer needed, the results will be always accurate.
2017-11-24Clearobjects: Send progress messages to terminal using actionstreamparamat
Change default mode to 'quick' as 'full' can lock up a server for a long time.
2017-11-08Move files to subdirectories (#6599)Vitaliy
* Move files around
2017-09-21Set placer to nil instead of a non-functional one in item_OnPlace (#6449)DTA7
* 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-15ServerEnv: Clean up object lifecycle handling (#6414)sfan5
* ServerEnv: Clean up object lifecycle handling
2017-09-12Make INodeDefManager::getIds return a vector, not a setKahrl
2017-08-27core.get_objects_inside_radius: Omit removed objects (#6318)you
Fixes #6294
2017-08-20Modernize source code: last part (#6285)Loïc Blot
* 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-19Code modernization: subfolders (#6283)Loïc Blot
* 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-18Optimize headers (part 2) (#6272)Loïc Blot
* 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-16Cleanup various headers to reduce compilation times (#6255)Loïc Blot
* Cleanup various headers to reduce compilation times
2017-07-18[CSM] Add flavour limits controlled by server (#5930)Loïc Blot
* [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-07Expose getPointedThing to LuaDániel Juhász
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-06-19find_nodes_in_area: Extend maximal count to U32_MAX (#5277)SmallJoker
Extend documentation, limit area volume Remove u16 count limitation * Prevent integer overflow, replace minp/maxp with pos1/pos2
2017-05-06Clean up numeric.h and split FacePositionCache from itShadowNinja
I also optiized FacePositionCache a bit: I removed a map lookup and vector copy from both branches of getFacePosition.
2017-05-04Add option to also check the center to `find_node_near` (#5255)red-001
* Add option to also check the center to `find_node_near`
2017-04-25Rename Scripting API files for consistencyShadowNinja
2017-04-25Fix various points reported by cppcheck (#5656)Loïc Blot
* Fix various performance issues reported by cppcheck + code style (CI) * Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function * Fix various iterator post-increment reported by cppcheck
2017-04-20Light update for map blocksDániel Juhász
This is not really different from the light update of a voxel manipulator. This update does not assume that the lighting was correct before, therefore it is useful for correction. Also expose this function to the Lua API for light correction, and allow voxel manipulators not to update the light.
2017-03-17[CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)Loïc Blot
* [CSM] Add core.get_timeofday & core.get_day_count env calls * [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
2017-03-13Add `get_wielded_item`red-001
2017-03-13[CSM] Client side moddingLoic Blot
* rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
2017-02-04Add ItemStack key-value meta storagerubenwardy