317 Commits

Author SHA1 Message Date
paramat
d21809ec2e ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
2015-10-18 16:42:59 +01:00
ShadowNinja
85dbe50ec1 Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
2015-10-14 02:39:37 -04:00
ShadowNinja
29e8adeadc Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
Loic Blot
5bd2c138d6 Save and remove player by pointer
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
2015-09-23 19:37:05 +02:00
Loic Blot
d81f15c1e9 Little optimization on getAdded/Removed activeobjects per player loop.
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.
2015-09-19 20:57:07 +02:00
est31
e7b604a029 Fix object position border checking
Borders have to be converted into BS format in order to be accurately comparable to
object positions.
2015-09-16 17:39:49 +02:00
est31
5c3e2175ff Disallow placing entities outside safe boundaries
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.
2015-09-15 19:45:17 +02:00
Loic Blot
a7d7d7d146 Change m_client_event_queue's type to std::queue
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.
2015-09-08 21:23:09 +02:00
David Jones
9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
ShadowNinja
098d28aa5e Clean up threading
* 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.
2015-08-23 22:04:06 -04:00
kwolekr
09ce485271 SEnv: Remove static_exists from ActiveObjects in deleted blocks 2015-08-16 15:55:07 -04:00
Maksim Gamarnik
9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
Břetislav Štec
1a8e4c834b src/environment.cpp: Fix NULL pointer dereference 2015-08-01 20:44:18 +02:00
Loic Blot
107e649c3d Remove some old dead code. Fix some Clang warnings in SRP (ng->N... will
always evaluate to true.
2015-07-24 21:48:02 +02:00
est31
713002778f Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00
est31
f70bc8a3b7 Server kicks: make messages configurable, cache wstring 2015-07-17 06:37:16 +02:00
nerzhul
8be24d9e38 Kick players when shutting down server and there is a crash due to a Lua stack exception 2015-07-16 20:27:42 +02:00
kwolekr
fb9a752a18 Remove raw message output on AOM deserialization failure
Improve TOCLIENT_ACTIVE_OBJECT_MESSAGES robustness for handling invalid data
2015-07-13 23:29:29 -04:00
est31
6ddde110e2 Generic CAO cleanups and renames for clarification
* 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
2015-06-20 03:37:30 +02:00
est31
daa69a349d Make attached objects visible in 3rd person view 2015-06-20 02:59:53 +02:00
kwolekr
8b8b11d1a3 Record MapBlock modification reasons as flags instead of strings
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
2015-05-31 23:20:51 +10:00
kwolekr
d013e12e5a Record MapBlock modification reasons as flags instead of strings
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
2015-05-17 22:14:26 -04:00
OttoLidenbrock
45c0ebe585 Fix swimming bug 2015-05-17 00:30:22 +10:00
OttoLidenbrock
a46f320ca2 Let player sink if they are not moving 2015-05-05 17:34:55 +10:00
OttoLidenbrock
06f26a301e Change how swimming works. NEEDS TESTING! 2015-05-02 22:07:15 +10:00
nerzhul
041d3d3c15 Re-apply 972d17baea81ffe6d508b291ef97207a4822e1da...
but not rename the container. Approved-By est31
2015-04-26 16:46:07 +10:00
nerzhul
a653a59a83 Re-apply 972d17baea81ffe6d508b291ef97207a4822e1da...
but not rename the container. Approved-By est31
2015-04-22 11:47:22 +02:00
kwolekr
4cc9722bb3 Revert "m_active_object_messages is used like a queue. Use std::queue 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.
2015-04-21 18:12:01 -04:00
Loic Blot
e614c53869 m_active_object_messages is used like a queue. Use std::queue instead of std::list. Also rename to m_active_object_messages_queue 2015-04-21 23:28:13 +02:00
Loic Blot
ba8ec92a6e Use std::vector instead of std::set for Environment::getObjectsInsideRadius
We are only iterating sequentially, we don't need a set here
Also use a vector reference instead of a copy
2015-04-16 18:37:29 +02:00
Craig Robbins
0731f9ed2a Move globals from main.cpp to more sane locations
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
2015-04-01 23:04:25 +10:00
kwolekr
2236ae8884 Fix usage of destroyed mutex
Also fix a memory leak
Fix overloaded virtual warning in Player::move()
Remove some trailing whitespace
2015-03-31 23:50:38 -04:00
Craig Robbins
5d7eee12f6 Minor bug fix (lag between damage flash and hearts updating) 2015-03-17 17:39:59 +10:00
Craig Robbins
00b2c232e7 Fix various damage related bugs (client-side)
E.g. spawning or teleporting into lava to become invinsible
2015-03-17 17:08:00 +10:00
Loic Blot
8e2ec156dc Use the new Player::isDead function when it's the case 2015-03-13 08:57:58 +01:00
Craig Robbins
27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Loic Blot
5e4c5bfb4f Fix issue #2441: crash on respawn, since a conversion std::list to 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
2015-03-05 15:36:20 +01:00
Loic Blot
b6a8f1e7c4 Performance improvement: Use std::list instead of std::vector for request_media, Server::getModNames, Environment::m_simple_objects.
* Also remove unused Server::m_modspaths
2015-03-05 10:44:48 +01:00
Loic Blot
1186245881 Remove Queue class which uses std::list and use native std::queue 2015-03-05 16:49:51 +10:00
Loic Blot
fce90c5a92 Use std::vector instead of std::list in StaticObjectList and MutexedMap::getValues() 2015-03-04 17:22:37 +01:00
Loic Blot
bf4504a459 ABMHandler and player_collisions use sequential read/write. Switch from std::list to std::vector
* Also remove dead code Map::unloadUnusedData which is dead since a long time
2015-03-04 17:02:36 +01:00
Loic Blot
705390e1f4 ASyncRunStep doesn't need to lock when do setTimeOfDaySpeed.
* 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
2015-03-04 11:46:31 +01:00
Loic Blot
13ff792b19 Change many useless std::list into Environment class (m_players), ABMHandler and ActiveBlockList::update
This improve looping performances.
2015-02-17 16:50:03 +01:00
Loic Blot
5abc50f077 Replace std::list by std::vector into ServerMap::listAllLoadableBlocks ServerMap::listAllLoadedBlocks and their database backends.
This adds a speedup on database migration and /clearobjects command
2015-02-17 14:35:44 +01:00
Loic Blot
bde70b6d78 SAO: re-add old ActiveObjectTypes for a future migration layer 2015-02-17 11:37:55 +01:00
gregorycu
447f57a41b Fix dying of lava causes repeated death This is a bugfix for issue #81 2015-02-05 17:32:35 +10:00
Anton
420b5ec08c Use std::string::empty() instead of size() where applicable 2014-12-12 15:16:24 -05:00
Craig Robbins
0be778ad52 Performance of main client loop up to 2x faster In places, up to 3 times faster
NOTE 1: This does not mean a 2x increase in framerate. Increase in fps may be up to 1-2fps
NOTE 2: This local 'caching' of settings is not optimal and an alternative solution will be worked on after 0.4.11 is released
2014-12-07 00:51:01 +10:00
Craig Robbins
aacc3cba46 Remove most exceptions from getNode() (and variants) 2014-11-14 18:05:34 +10:00
Kahrl
c33891174d Implement WieldMeshSceneNode which improves wield mesh rendering
- Don't create and cache an extruded mesh for every (non-node) item.
  Instead use a single one per image resolution.

- For cubic nodes reuse a single wield mesh too

- Improve lighting of the wielded item

- Increase far value of wield mesh scene camera, fixes #1770

- Also includes some minor refactorings of Camera and GenericCAO.
2014-11-08 23:11:57 +01:00