summaryrefslogtreecommitdiff
path: root/src/util
Commit message (Collapse)AuthorAge
* Fix incorrect distance computation for visible blocks (#4765)Rogier-52016-11-11
| | | | | | | | The client would not compute the distance from the camera to to a mapblock correctly. The result was that blocks that were in view (i.e. not beyond the fog limit) would not be rendered. With the improved distance computation, a range adjustment that existed in clientiface.cpp is no longer required.
* Ensure std::unordered_ be used on MSVC 2010 too (#4600)SmallJoker2016-10-09
|
* Ensure std::unordered_ will be used on supported MSVC compilersgregorycu2016-10-08
|
* use unordered containers where possible (patch 4 on X)Loic Blot2016-10-06
| | | | Also remove some unused parameters/functions
* Use more unordered_maps to improve performance in c++11 buildsLoic Blot2016-10-06
|
* Use the standard to_string() functions for C++11 (#4279)Rogier-52016-08-11
| | | | | | | | | | | | If compiling according to a C++ version before C++11, then define std::to_string ourselves. Add a to_wstring version as well As std::to_string() for floating point types uses %.6f as floating point format converter, instead of %G, it needs special care. To preserve ftos() behavior (which is expected to use the %G format converter), it no longer uses to_string().
* couple of memory leaks fixes.David Carlier2016-08-10
|
* Permit usage of std::unordered_map & std::unorderered_set on c++11 compilers ↵Ner'zhul2016-08-10
| | | | | | | | | (#4430) This fallback to std::map & std::set for older compilers Use UNORDERED_SET as an example in decoration and ore biome sets Use UNORDERED_MAP as an example in nameidmapping
* Random misc. warning fixes and cleanupskwolekr2016-06-11
| | | | | | - Fix unused c_sand member warning in Valleys Mapgen - Fix some code style - Make some std::string params const ref
* Add colored text (not only colored chat).Ekdohibs2016-05-31
| | | | | Add documentation, move files to a proper place and avoid memory leaks. Make it work with most kind of texts, and allow backgrounds too.
* Colored chat working as expected for both freetype and non-freetype builds. ↵TriBlade92016-05-31
| | | | @nerzhul improvements * Add unit tests * Fix coding style * move guiChatConsole.hpp to client/
* Add minetest.check_password_entry callbackest312016-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Gives a convenient way to check a player's password. This entirely bypasses the SRP protocol, so should be used with great care. This function is not intended to be used in-game, but solely by external protocols, where no authentication of the minetest engine is provided, and also only for protocols, in which the user already gives the server the plaintext password. Examples for good use are the classical http form, or irc, an example for a bad use is a password change dialog inside formspec. Users should be aware that they lose the advantages of the SRP protocol if they enter their passwords for servers outside the normal entry box, like in in-game formspec menus, or through irc /msg s, This patch also fixes an auth.h mistake which has mixed up the order of params inside the decode_srp_verifier_and_salt function. Zeno-: Added errorstream message for invalid format when I committed
* Escape more strings: formspecs, item descriptions, infotexts...Ekdohibs2016-04-24
| | | | | | 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.
* Update CSRP-GMP to commit deaa11a7c29a73008est312016-04-10
| | | | | | | Backports 10 commits, with 8 commits actually affecting source code: https://github.com/est31/csrp-gmp/compare/695822e45d9ca48b75b4ec1af1b4eea19139f8b1...deaa11a7c29a730087380da231e785909ad21630
* Clean up StrfndShadowNinja2016-03-19
| | | | | | | | | | | Changes: * Fix indentation. * Pass strings by const reference. * Merge Strfnd and WStrfnd into one class instead of copying them. * Remove trailing spaces. * Fix variable names. * Move to util. * Other miscellaneous style fixes.
* Remove chat escape sequences from chat messages, for future colored chat.Ekdohibs2016-03-15
|
* Much better API for auth.{cpp, h}est312016-03-15
| | | | | | | | * No function overloading * Adhere coding style and with method names following lowercase_underscore_style * Use std::string in external API, handling these is much more fun
* Add AreaStore custom ID APIShadowNinja2016-03-07
|
* Implement AreaStore serializationShadowNinja2016-03-07
|
* Fix SpatialAreaStore not freeing removed areasShadowNinja2016-03-07
|
* Add basic AreaStore method documentationShadowNinja2016-03-07
|
* Sort AreaStore headerShadowNinja2016-03-07
|
* Clean up VectorAreaStoreShadowNinja2016-03-07
|
* Move AreaStore container selection logic into getOptimalImplementationShadowNinja2016-03-07
|
* Move AreaStore to utilShadowNinja2016-03-07
|
* Add minetest.register_lbm() to run code on block load onlyest312016-03-07
|
* HOTFIX: fix too agressive block cullingRealBadAngel2016-02-18
|
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
| | | | | * Sky: rename Box => m_box and inline getBoundingBox * Uniformize aabbox3d<f32> to aabb3f
* Add macos/freebsd missing endian.h include and add win endianness infoqiukeren2015-12-29
|
* Fix misc. MinGW and Valgrind warningskwolekr2015-11-08
|
* Don't compile pcgrandom on Windowsest312015-11-08
| | | | There it isn't needed.
* Add server side ncurses terminalest312015-11-06
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Silence 'unused typedef' warning for STATIC_ASSERT()kwolekr2015-11-03
|
* Rename and move basicmacros.h to util/basic_macros.hest312015-11-02
|
* Move basic, non-numeric macros from util/numeric.h to basicmacros.hkwolekr2015-10-27
|
* Add BufReader and vector-based serialization methodskwolekr2015-10-15
|
* Rename macros with two leading underscoresShadowNinja2015-10-14
| | | | These names are reserved for the compiler/library implementations.
* Always use errorstream for DEBUG_EXCEPTION_HANDLERShadowNinja2015-10-14
|
* Fix some SRP issuesest312015-09-30
| | | | | -> Remove memory allocation bugs -> Merge changes from upstream, enabling customizeable memory allocation
* Clean up threadingShadowNinja2015-08-23
| | | | | | | | | | | | | | | | | | | | * 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.
* Fix indianred and indigo of color-stringRui2015-08-19
|
* Android: bypass broken wide_to_utf8 with wide_to_narrow (again)est312015-08-19
| | | | | | | | | This bypass had to be re-enabled as some users reported issues, even after the iconv build fix. While utf8_to_wide works well, wide_to_utf8 is quite broken on android, for some reason, and some devices (unrelated from build configuration).
* Fix BufferedPacket race condition (fixes #2983)kwolekr2015-08-06
| | | | | This was caused by the use the non-threadsafe SharedBuffer in a threaded context.
* Initialize random for verification key generation tooest312015-08-06
|
* src/util/numeric.{cpp,h}: Fix FacePositionCache data raceBřetislav Štec2015-08-02
|
* Improve accuracy and safety of float serializationkwolekr2015-08-01
| | | | | | | | | Multiplying by a factor of 1/1000.f (rather than dividing by 1000.f) directly introduces an error of 1 ULP. With this patch, an exact comparison of a floating point literal with the deserialized F1000 form representing it is now guaranteed to be successful. In addition, the maxmium and minimum safely representible floating point numbers are now well-defined as constants.
* Clean up util/serialization.{cpp,h} and add unit testskwolekr2015-08-01
|
* Android: fix horrible libiconv buildest312015-07-29
| | | | | | | | | | | | | | | | | | | Before, our libiconv build was a joke. We first called configure for our own build host system, then called make, before we executed a Android.mk script we provided as patch. The first "native make" always failed, and the LIBICONV_LIB file setting in our Makefile didn't match the built one, resulting in an always-rebuild of iconv. This commit cleans up this total mess, removes the double-build, and the Android.mk, and properly calls ./configure with the according target platform, and uses a built toolchain. As we have to deal with the android bug "NDK: Support for prebuild libs with full sonames" https://code.google.com/p/android/issues/detail?id=55868 as the 2013 patch https://lists.gnu.org/archive/html/libtool-patches/2013-06/msg00002.html by Google's David Turner wasn't inside the 2011 libtool, we pass -avoid-version to libtool. Thanks to the proper build, wide_to_utf8 works for android now, removing us of the need to disable it.
* Add AreaStore data structureest312015-07-27
|
* Check output of mpz_set_str and fix leak on error conditionest312015-07-24
| | | | Also add static identifier as upstream did