| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ABM's are hardcoded to run every 1.0s, NodeTimers are hard coded to
run at every 1.0s. Block mgmt is running every 2.0sec.
However, these timers can be better tuned for both higher and lower
values by server owners. Some server owners want to, and have the
resources to send more packets per second to clients, and so they
may wish to send smaller updates sooner. Right now all ABM's are
coalesced into 1.0 second intervals, resulting in large send queues
to all clients. By reducing the amount of possible timers, one can
get a far better response rate and lower the perception of lag.
On the other side of the camp, some servers may want to increase
these values, which again isn't easily doable.
The global settings abm_interval and nodetimer_interval are set to
current values by default. I've tested with 0.2/0.5 type values
and noticed a greatly improved response and better scattering of
nodetimers, as well as enjoying not faceplanting into doors with
pressure plates anymore.
|
|
|
|
|
| |
We can just test for the presence of these settings nicely here,
no need to use a try / catch construct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've written several experimental bits of code that revolve around the
need for a consistent calendar, but implementing one is extremely hard
in mods due to time changes and mods overriding core.get_timeofday(),
which will conflict.
The second part of the problem is that doing this from a mod requires
constant maintenance of a settings file.
An implementation in core is trivial, however, and solves all of
these problems at virtually no cost: No extra branches in server
steps, and a single branch when minetest.set_time_of_day(), which is
entirely reasonable.
We store the day_count value in env_meta.txt.
The use case is obvious: This change allows mods to create an actual
virtual calendar, or properly account for seasonal changes, etc..
We add a "/days" chatcommand that displays the current day count. No
permissions are needed. It can only retrieve the day count, not
modify it.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Before, time progressed wrongly. This was due to a mistake in how m_time_of_day_f was calculated,
and a regression of the last two commits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Atomic implementation was only partially correct, and was very complex.
Use locks for sake of simplicity, following KISS principle.
Only remaining atomic operation use is time of day speed, because that
really is only read + written.
Also fixes a bug with m_time_conversion_skew only being decremented, never
incremented (Regresion from previous commit).
atomic.h changes:
* Add GenericAtomic<T> class for non-integral types like floats.
* Remove some last remainders from atomic.h of the volatile use.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
-> 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
|
|
|
|
|
| |
Default is true for backwards compatibility
Update lua_api.txt
|
|
|
|
| |
These names are reserved for the compiler/library implementations.
|
|
|
|
| |
Remove DTIME macro and its uses, too
|
|
|
|
|
|
| |
Why doing things simple ? Use pointer instead of strings to save players and remove them.
Saving players by name does a lookup to find pointer we already have ! Idem with removePlayer
Also remove unused removePlayer(peer_id), it's never called
|
|
|
|
|
| |
Use std::queue instead of std::set, we don't need such a heavy container.
Don't convert position to int to convert it back to float in the next function.
|
|
|
|
|
| |
Borders have to be converted into BS format in order to be accurately comparable to
object positions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Entity positions are serialized as F1000. Disallow placing
entities outside safe borders with the minetest.add_entity
call.
Note that this patch only enforces those boundaries for
placing entities, moving entities that move outside boundaries
aren't affected.
Thanks to @nanepiwo for pointing this out.
|
|
|
|
|
| |
As indicated in its name, m_client_event_queue should be a queue.
Change std::list to std::queue to improve the queue's performance.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
|
|
|
| |
always evaluate to true.
|
|
|
|
|
|
| |
Enable the server to request the client to reconnect.
This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
|
| |
|
|
|
|
| |
stack exception
|
|
|
|
| |
Improve TOCLIENT_ACTIVE_OBJECT_MESSAGES robustness for handling invalid data
|
|
|
|
|
|
|
|
| |
* Use enum for GENERIC_CMD_*
* Rename m_attachements to attachement_parent_ids (public member and clearer name)
* Rename GENERIC_CMD_SET_ATTACHMENT to GENERIC_CMD_ATTACH_TO
* USHRT_MAX + 1 buffer sizes to prevent overflows as @kahrl suggested
* Remove unneccessary m_id from GenericCAO (shadowing protected superclass member for no reason) as @kahrl suggested
|
| |
|
|
|
|
|
| |
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
|
|
|
|
| |
but not rename the container. Approved-By est31
|
|
|
|
|
|
|
|
| |
instead of std::list. Also rename to m_active_object_messages_queue"
This reverts commit 972d17baea81ffe6d508b291ef97207a4822e1da.
The commit being reverted was unauthorized. There had been no discussion,
review, or sign-off prior to submittal to upstream.
|
|
|
|
| |
std::list. Also rename to m_active_object_messages_queue
|
|
|
|
|
| |
We are only iterating sequentially, we don't need a set here
Also use a vector reference instead of a copy
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move debug streams to log.cpp|h
Move GUI-related globals to clientlauncher
Move g_settings and g_settings_path to settings.cpp|h
Move g_menuclouds to clouds.cpp|h
Move g_profiler to profiler.cpp|h
|
|
|
|
|
|
| |
Also fix a memory leak
Fix overloaded virtual warning in Player::move()
Remove some trailing whitespace
|
| |
|
|
|
|
| |
E.g. spawning or teleporting into lava to become invinsible
|
| |
|
|
|
|
| |
NDEBUG is defined), replace those usages with persistent alternatives
|
|
|
|
|
|
|
| |
std::vector on Environment.cpp
* Also change some std::list to std::vector for ClientMap::renderMap
* Remove disabled code in ClientMap::renderMap, disabled since a long time
|
|
|
|
|
|
| |
request_media, Server::getModNames, Environment::m_simple_objects.
* Also remove unused Server::m_modspaths
|
| |
|
|
|
|
| |
MutexedMap::getValues()
|
|
|
|
|
|
| |
std::list to std::vector
* Also remove dead code Map::unloadUnusedData which is dead since a long time
|
|
|
|
|
| |
* setTimeOfDaySpeed already lock a mutex when modify the value, we don't need to lock all environment.
* add a fine grain lock for getTimeOfDay and setTimeOfDay to solve environment multithread modifications on this value
|
|
|
|
|
|
| |
and ActiveBlockList::update
This improve looping performances.
|
|
|
|
|
|
| |
ServerMap::listAllLoadedBlocks and their database backends.
This adds a speedup on database migration and /clearobjects command
|
| |
|
| |
|