- Nov 03, 2015
-
-
est31 authored
It isn't possible to use atomic operations for floats, so don't use them there. Having a lock is good out of other reasons too, because this way the float time and the integer time both match, and can't get different values in a race, e.g. when two setTimeofDay() get executed simultaneously.
-
est31 authored
Cleanup: * Remove volatile keyword, it is of no use at all. [1] * Remove the enable_if stuff. It had no use either. The most likely explanation why the enable_if stuff was there is that it was used as something like a STATIC_ASSERT to verify that sizeof(T) is not larger than sizeof(void *). This check however is not just misplaced in a place where we already use a lock, it isn't needed at all, as gcc will just generate a call to to the runtime if it compiles for platforms that don't support atomic instructions. The runtime will then most likely use locks. Code style fixes: * Prefix name of the mutex * Line everything up nicely, where it makes things look nice * Filling \ continuations with spaces is code style rule Added operations on the atomic var: * Compare and swap * Swap The second point of the cleanup also fixes the Android build of the next commit. [1]: http://stackoverflow.com/q/2484980
-
est31 authored
-
kwolekr authored
-
kwolekr authored
-
- Nov 02, 2015
-
-
gregorycu authored
On Windows Release x64 bit build this changes: ProfilerGraph::put 1.68% -> 0.061% ProfilerGraph::draw 12% -> 17.% So yes, there is a tradeoff between saving profiling data (executed always) and drawing the profiler graph (executed very rarely). But usually you don't have the profiler graph open.
-
est31 authored
-
Kahrl authored
-
- Nov 01, 2015
-
-
Perttu Ahola authored
Using logging for these just makes them bloated and hard to read and overally just not neat at all.
-
kwolekr authored
For several years now, the lua script lock has been completely broken. This commit fixes the main issue (creation of a temporary rather than scoped object), and fixes a subsequent deadlock issue caused by nested script API calls by adding support for recursive mutexes.
-
kwolekr authored
When compiled with optimizations, the most recent versions of clang seem to 'optimize' out a crucial "and %reg, 0x7FFFFFFF" instruction in noise2d(), probably because it somehow assumed the variable n would never become greater than that amount. Indeed, signed integer underflow is undefined behavior in C and C++, so while this optimization is "correct" in that sense, it breaks lots of existing code. Solved by changing n to an unsigned type, making behavior well-defined.
-
- Oct 31, 2015
-
-
ShadowNinja authored
Previously, the server called FATAL_ERROR when a Lua error occured. This caused a (mostly useless) core dump. The server now simply throws an exception, which is caught and printed before exiting with a non-zero return value. This also fixes a number of instances where errors were logged multiple times.
-
ShadowNinja authored
-
kwolekr authored
-
Rui914 authored
-
- Oct 29, 2015
-
-
Duane Robertson authored
This allows the player to toggle continuous forward with a key (F by default), so we don't have to hold down the forward key endlessly.
-
paramat authored
Increase default from 6 to 16 to help with mgv7 and mgfractal Large-scale or alternative mapgens can result in a lowland spawn point not being found, causing a spawn at (0, 0, 0) possibly buried underground The max height is now settable to allow correct player spawn in any mapgen or when using custom noise parameters
-
paramat authored
-
- Oct 28, 2015
-
-
kwolekr authored
-
kwolekr authored
Use this macro to disallow copying of an object using the assignment operator or copy constructor. This catches otherwise silent-but-deadly mistakes such as "ServerMap map = env->getMap();" at compile time. If so desired, it is still possible to copy a class, but it now requires an explicit call to memcpy or std::copy.
-
- Oct 27, 2015
-
-
est31 authored
-> Put access to time variables under the time lock. -> Merge both time locks, there is no point to have two locks. -> Fix the lock being released too early in Environment::setTimeOfDay -> Add serverside getter so that you don't have to get the environment if you only have the server
-
PilzAdam authored
-
kwolekr authored
-
- Oct 26, 2015
-
-
BlockMen authored
-
BlockMen authored
-
kwolekr authored
Also fix a potential seed truncation issue on platforms where the range of ptrdiff_t (the underlying type of lua_Integer) is too small.
-
kwolekr authored
-
est31 authored
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
-
kwolekr authored
-
kwolekr authored
-
est31 authored
Remove outdated loglevel list from a l_util.cpp comment, and rather point to the updated code.
-
- Oct 25, 2015
-
-
PilzAdam authored
-
BlockMen authored
Fixes #3280
-
Rui authored
-
BlockMen authored
- Disabled by default (except players) - Fixes #2984
-
PilzAdam authored
-
est31 authored
Previously, the invocation of Logger::addOutput(ILogOutput *out) led to an out of bounds write of the m_outputs vector, resulting in the m_silenced_levels array being modified. Fortunately, the only caller of that method was android system logging, and only since a few commits ago.
-
- Oct 24, 2015