aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-05-27Cavegen: Merge CaveV5 and CaveV7 into CavesRandomWalkkwolekr
2016-05-27Fix MgStoneType and BiomeType enum nameskwolekr
2016-05-27Mapgen: Combine generateBiomes, dustTopNodes, and generateCaveskwolekr
This commit condenses the above methods into a single implementation used by V7, V5, Flat, Fractal, and Valleys mapgens and introduces MapgenBasic.
2016-05-27Move biome calculation to BiomeGenkwolekr
BiomeGen defines an interface that, given a set of BiomeParams, computes biomes for a given area using the algorithm implemented by that specific BiomeGen. This abstracts away the old system where each mapgen supplied the noises required for biome generation.
2016-05-26Tell irrlicht if we handle a key or not.est31
We can remove the function in MtNativeActivity now as it serves precisely that purpose: to tell irrlicht that we handled the esc key. TODO for later: * Perhaps try to find a more performant container than KeyList
2016-05-23Fix rollback.txt migrationShadowNinja
Broken by b1965ac20922e3722392114bd63a22b403dcbe98. This also prepares the begin and commit statements only once.
2016-05-24Fix irrlicht version checking macro for tooltip_height calculationCraig Robbins
2016-05-23Move updateTextures and fillTileAttribs to ContentFeaturesEkdohibs
2016-05-22Tolerate packet reordering in the early init processest31
Fixes a bug where packet reordering made the server give the client two peer ids instead of one. This in turn confused reliable packet sending and made connecting to the server fail. The client usually sends three packets at init: one "dummy" packet consisting of two 0 bytes, and the init packet as well as its legacy counterpart. The last one can be turned off since commit af30183124d40a969040d7de4b3a487feec466e4, but this is of lower relevance for the bug. The relevant part here is that network packet reorder (which is a normal occurence) can make the packets reach the server in different order. If reorder puts the dummy packet further behind, the following would happen before the patch: 1. The server will get one of the init packets on channel 1 and assign the client a peer id, as the packet will have zero as peer id. 2. The server sends a CONTROLTYPE_SET_PEER_ID packet to inform the client of the peer id. 3. The next packet from the client will contain the peer id set by the server. 4. The server sets the m_has_sent_with_id member for the client's peer structure to true. 5. Now the dummy packet arrives. It has a peer id of zero, therefore the server searches whether it already has a peer id for the address the packet was sent from. The search fails because m_has_sent_with_id was set to true and the server only searched for peers with m_has_sent_with_id set to false. 6. In a working setup, the server would assign the dummy packet to the correct peer id. However the server instead now assigns a second peer id and peer structure to the peer, and assign the packet to that new peer. 7. In order to inform the peer of its peer id, the server sends a CONTROLTYPE_SET_PEER_ID command packet, reliably, to the peer. This packet uses the new peer id. 8. The client sends an ack to that packet, not with the new peer id but with the peer id sent in 2. 9. This packet reaches the server, but it drops the ACK as the peer id does not map to any un-ACK-ed packets with that seqnum. The same time, the server still waits for an ACK with the new peer id, which of course won't come. This causes the server to periodically re-try sending that packet, and the client ACKing it each time. Steps 7-9 cause annoyances and erroneous output, but don't cause the connection failure itself. The actual mistake that causes the connection failure happens in 6: The server does not assign the dummy packet to the correct peer, but to a newly created one. Therefore, all further packets sent by the client on channel 0 are now buffered by the server as it waits for the dummy packet to reach the peer, which of course doesn't happen as the server assigned that packet to the second peer it created for the client. This makes the connection code indefinitely buffer the TOSERVER_CLIENT_READY packet, not passing it to higher level code, which stalls the continuation of the further init process indefinitely and causes the actual bug. Maybe this can be caused by reordered init packets as well, the only studied case was where network has reliably reordered the dummy packet to get sent after the init packets. The patch fixes the bug by not ignoring peers where m_has_sent_with_id has been set anymore. The other changes of the patch are just cleanups of unused methods and fields and additional explanatory comments. One could think of alternate ways to fix the bug: * The client could simply take the new peer id and continue communicating with that. This is however worse than the fix as it requires the peer id set command to be sent reliably (which currently happens, but it cant be changed anymore). Also, such a change would require both server and client to be patched in order for the bug to be fixed, as right now the client ignores peer id set commands after the peer id is different from PEER_ID_INEXISTENT and the server requires modification too to change the peer id internally. And, most importantly, right now we guarantee higher level server code that the peer id for a certain peer does not change. This guarantee would have to be broken, and it would require much larger changes to the server than this patch means. * One could stop sending the dummy packet. One may be unsure whether this is a good idea, as the meaning of the dummy packet is not known (it might be there for something important), and as it is possible that the init packets may cause this problem as well (although it may be possible too that they can't cause this). Thanks to @auouymous who had originally reported this bug and who has helped patiently in finding its cause.
2016-05-22Fix a m_camera not used warning fix pointed by clangLoic Blot
2016-05-22Implement a PostgreSQL backendLoic Blot
2016-05-21Fix tooltip height for versions of irrlicht < 1.8.2Craig Robbins
Version 1.8.2 of irrlicht changed the way that IGUIStaticText::getTextHeight() works and since that release properly deals with newlines. From irrlicht changes.txt for 1.8.2, "IGUIStaticText::getTextHeight returns now the correct height for texts with newlines even WordWrap is not set."
2016-05-17Implement DatabaseException for databasesnerzhul
2016-05-17DB::loadBlock copy removal & DB backend cleanupLoic Blot
* Remove the copy from db::loadBlock by using a pointer to the destination * cleanup db backend, the child backend doesn't have to set their functions as virtual
2016-05-11Fix typo in the info printed by --versionCraig Robbins
2016-05-11Add platform name to --version informationCraig Robbins
2016-05-10Mapgen V6: Synchronize spflags with defaultsettingskwolekr
This fixes an issue where trees are omitted from Mapgen V6 maps on configurations that explicitly defined the mgv6_spflags setting.
2016-05-09Add [resize texture modifier Resizes the texture to the given dimensions.SmallJoker
2016-05-08Defaultsettings/Android: Increase 'max block generate distance' to 3paramat
2016-05-08Fixes #4098 ce8a9ed didn't quite go far enough, and left this bug ingregorycu
2016-05-08Chat: Keep scroll position constant in ChatBuffer::deleteOldest()Kahrl
2016-05-07Optimize default settings for Android buildMaksim Gamarnik
2016-05-07Run unescape_enriched *after* unescape_string.Ekdohibs
Doing it the other way round was a mistake, since it breaks minetest.formspec_escape with escape sequences that contain special characters.
2016-05-07Make dropdowns show the string that was their argument.Ekdohibs
This makes it work even if it contains escape sequences, which didn't work before.
2016-05-06Android: Increase player_stepheight for thicker snow nodeboxMaksim Gamarnik
2016-05-05Update settings translation file and minetest.conf.exampleest31
2016-05-04Fix holding down F10 (open console) causing GUI to freezeCraig Robbins
2016-05-03Settings_translation_file: Update mapgen with cave width parameterparamat
2016-05-02Fix Windows buildCraig Robbins
Fixes the issue introduced by c1a0ebb (Fix use of uninitialised variable in class Event) causing Windows builds to fail
2016-05-01FileSelectMenu: Fix formspec parsing broken by Irrlicht file-chooserKahrl
2016-05-01find_path: consider walkable instead of CONTENT_AIRAuke Kok
The path finding code works fairly well except that it considers anythin not CONTENT_AIR to be "above the surface". This results in paths that are unwalkable for entities since e.g. plants are not walkable. The path would force them to jump on top of grass plants, etc.. The obvious solution is not to use CONTENT_AIR as a criteria, but instead distinguish between walkable and non-walkable nodes. This results in paths that properly walk through grass nodes. This was extensively tested by a flock of electric sheep. Note that for underwater purposes this changes the behaviour from "the surface is walkable" to "ignore water entirely" making the path go across the water bottom, and pathing fail likely from the water surface. This is intentional.
2016-05-01Pathfinder: improve GridNode storageest31
Before, the GridNodes were stored in vector<vector<vector<T>>>, and initialized in advance. Putting three vectors inside each other puts lots of unneccessary stress onto the allocator, costs more memory, and has worse cache locality than a flat vector<T>. For larger search distances, an the array getting initialized means essentially O(distance^3) complexity in both time and memory, which makes the current path search a joke. In order to really profit from the dijkstra/A* algorithms, other data structures need to be used for larger distances. For shorter distances, a map based GridNode storage may be slow as it requires lots of levels of indirection, which is bad for things like cache locality, and an array based storage may be faster. This commit does: 1. remove the vector<vector<vector<T>>> based GridNodes storage that is allocated and initialized in advance and for the whole possible area. 2. Add a vector<T> based GridNodes storage that is allocated and initialized in advance for the whole possible area. 3. Add a map<P,T> based GridNodes storage whose elements are allocated and initialized, when the path search code demands it. 4. Add code to decide between approach 2 and 3, based on the length of the path. 5. Remove the unused "surfaces" member of the PathGridnode class. Setting this isn't as easy anymore for the map based GridNodes storage.
2016-05-01Pathfinder: use core::aabbox3d instead of own typeest31
There is no need to reinvent the wheel here, we have great classes from irrlicht.
2016-05-01Pathfinder: Fix styleest31
* Fix naming style for methods and classes: Use camelCase for methods and PascalCase for classes as code style demands it. And use sneak_case for methods that are not member of a class. * Replace "* " with " *" for Pointers * Same for references * Put function body opening braces on new line * Other misc minor non functional style improvements
2016-05-01Move pathfinder classes to cpp fileest31
There is no need to put them into the header, they are solely used inside the pathfinder. Another advantage of this change is that only the pathfinder.cpp has to be compiled if PATHFINDER_DEBUG gets defined or undefined, not all files including the .h. This commit moves the pathfinder classes to the cpp file without modifications. Also, the PATHFINDER_DEBUG macro gets moved to the cpp file and the PATHFINDER_CALC_TIME macro gets moved to a plce where it actually does work.
2016-05-01Fix use of uninitialised variable in class EventCraig Robbins
2016-05-01Use MoveFileEx to rename files on Windows (not rename)gregorycu
2016-04-30Fix POSIX C++11 buildShadowNinja
I broke this in 46fd114e9a4e05b74576dce682e24357363298e7.
2016-04-30Fix prepreprocessor error in thread.h (related to C++11 threads)Craig Robbins
2016-04-28Mapgen: Make 3D noise tunnels' width settableparamat
Correct parameter names mg_valleys to mgvalleys Remove biome NoiseParams from MapgenValleysParams Improve format of parameter code
2016-04-28Fix race on thread creationShadowNinja
This often broke the threading tests on OSX.
2016-04-28Mainmenu: Standardize the menu button order and sizesSmallJoker
2016-04-28Handle particle spawners in env and delete expired idsobneq
Rebased by Zeno (2016-04-2016)
2016-04-26Inventory: Make ItemStack with different metadata not stackableXunto
2016-04-25tile.cpp: Automatically upscale lower resolution textureSmallJoker
2016-04-24Make GUIEngine use pause_fps_max not fps_maxgregorycu
2016-04-24Escape more strings: formspecs, item descriptions, infotexts...Ekdohibs
Also, change the escape character to the more standard \x1b Thus, it can be used in the future for translation or colored text, for example.
2016-04-23Fix bug that was leading to oversized tooltips containing multiline text ↵Xunto
when it have multiple lines
2016-04-21Make logging use a fixed-length buffer to avoid race conditions.Ekdohibs
Previously, race conditions occurred inside logging, that caused segfaults because a thread was trying to use an old pointer that was freed when the string was reallocated. Using a fixed-length buffer avoids this, at the cost of cutting too long messages over seveal lines.
2016-04-21Biomes: Make dust fallback 'ignore' to fix y = 63 lightingparamat
The shadow bug at y = 63 was caused by dark air being placed as dust, when the biome dust was unspecified it was falling back to 'air' In dustTopNodes only dust == 'ignore' will disable dust placement