summaryrefslogtreecommitdiff
path: root/src/server.cpp
Commit message (Collapse)AuthorAge
* Update HUD flags on server like on clientest312015-11-22
| | | | | | | | | | | | | Fixes bug for which commit 6c37e89f08f962eaba788a31f5d3c798ceaa65e6 "Fix old client showing duplicated health bar on new server" by @sapier laid the groundwork, where the server has updated its copy of the hud flags without respecting the mask. Fixes #3395.
* Only allow players with shout to chatest312015-11-13
| | | | | | | | | | Fix regression of commit 5e507c9829942c434a6f1ae7a4f3a488c7e50bef "Add server side ncurses terminal" which allowed all players, even those without a shout priv, to chat. Fixes #3362.
* Put ChatEvent handler into own functionest312015-11-09
| | | | Comply with line limit.
* Write new line character sequence at end of print()est312015-11-08
| | | | | | | | | | | Fix regression of commit 5e507c9829942c434a6f1ae7a4f3a488c7e50bef "Add server side ncurses terminal" where no line termination character was printed after a lua print outside of terminal mode. Fixes #3350.
* 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.
* Time: Remove serverside getter, and use atomic operationsest312015-11-03
| | | | | | | | 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.
* Fix server crashing on Lua errorsShadowNinja2015-10-31
| | | | | | | | 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.
* findSpawnPos: Add setting for max height above water levelparamat2015-10-29
| | | | | | | | 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
* Environment: Time of day fixes and add serverside getterest312015-10-27
| | | | | | | | -> 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
* 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
|
* Use warningstream for log messages with WARNINGShadowNinja2015-10-14
| | | | Remove DTIME macro and its uses, too
* Define and use limit constants for Irrlicht fixed-width typeskwolekr2015-10-04
|
* Some map border related fixesest312015-09-29
| | | | | | | | | | | | | 1. Check for entity addition success in spawn_item implementation 2. Check for success in item_drop callback, so that the player doesn't lose the item if they are outside bounds and try to drop it. 3. When existing player joins game, check that their position is inside map bounds. If not, set their position to the return value of findSpawnPos(). 4. Make findSpawnPos() respect the border 2 fixes a lua crash if a player drops an item outside map bounds. 3 fixes an assertion crash if a player leaves when being outside map bounds, and then rejoins.
* Little optimization on getAdded/Removed activeobjects per player loop.Loic Blot2015-09-19
| | | | | 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.
* Send proper block to old clients for swap_node callsest312015-09-17
| | | | | | | | | | | The legacy code added in commit d879a539cd19ddd1ee34afec2512fb2238de2822 - "Add minetest.swap_node" for sending the whole mapblock to older clients on the case of a node modification with swap_node, had the problem that the block chosen to be sent to the client was referenced with node coordinates and not with block coordinates, resulting in getting the wrong block sent to the client.
* Change i++ to ++iDavid Jones2015-08-25
|
* 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.
* Add count based unload limit for mapblocksest312015-08-13
|
* Fix segfaults caused by the Environment not being initialized yetrubenwardy2015-08-09
|
* Prepend "Lua: " before lua exceptionsBřetislav Štec2015-08-02
| | | | | src/server.cpp src/emerge.cpp
* Small SendableMediaAnnouncement cleanupLoic Blot2015-07-31
| | | | | | -> Remove the SendableMediaAnnouncement struct -> Forge the packet directly in the m_media loop, spare one loop and the construction of a vector -> Use preincrement to spare iterator copies
* Cleanup server addparticle(spawner) by merge two identical functions.Loic Blot2015-07-25
|
* Optional reconnect functionalityest312015-07-23
| | | | | | Enable the server to request the client to reconnect. This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
* Server kicks: make messages configurable, cache wstringest312015-07-17
|
* Kick players when shutting down server and there is a crash due to a Lua ↵nerzhul2015-07-16
| | | | stack exception
* Fix damage flash when damage disabledkwolekr2015-07-10
|
* Use UTF-8 instead of narrowest312015-07-08
| | | | | Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places. Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
* Fix code style from recent commits and add misc. optimizationskwolekr2015-07-02
|
* Add Lua errors to error dialogrubenwardy2015-06-29
|
* Return to ignoreest312015-06-24
|
* Fix bug when craft input isn't replacedTeTpaAka2015-06-22
|
* Add some missing getter functions to the lua APITeTpaAka2015-05-28
| | | | | | | | | | | | | | | | | | | | | | | ObjectRef: get_properties get_armor_groups get_animation get_attach get_bone_position Players: get_physics_override hud_get_hotbar_itemcount hud_get_hotbar_image hud_get_hotbar_selected_image get_sky get_day_night_ratio get_local_animation get_eye_offset Global: minetest.get_gen_notify minetest.get_noiseparams
* Add texture overridingrubenwardy2015-05-19
|
* Lower log level for unexpected behaviourest312015-05-19
| | | | | Its a possible mistake to log in to a server with twice the same name. Before, it triggered a server wide error message, now it logs to actionstream.
* Add mod securityShadowNinja2015-05-16
| | | | Due to compatibility concerns, this is temporarily disabled.
* Make early protocol auth mechanism generic, and add SRPest312015-05-11
| | | | | | | Adds everything needed for SRP (and everything works too), but still deactivated, as protocol v25 init packets aren't final yet. Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25 inside networkprotocol.h.
* Gracefully handle PacketErrorsest312015-05-08
|
* Protocol 25: wstring -> string for custom access denial reasonsest312015-04-22
| | | | Also fix std::logic_error when server::DenyAccess() is used with only two arguments.
* Schematics: Refactor NodeResolver and add NodeResolveMethodkwolekr2015-04-16
| | | | | | | | | NodeResolver name lists now belong to the NodeResolver object instead of the associated NodeDefManager. In addition to minimizing unnecessary abstraction and overhead, this move permits NodeResolvers to look up nodes that they had previously set pending for resolution. So far, this functionality has been used in the case of schematics for serialization/deserialization.
* Fix a rare crash case un SendPlayerHPNer'zhul2015-04-11
| | | If the player is disconnected while Lua API is doing a l_punch call, for example, the playersao is NULL and the server crash. Fix it.
* TOCLIENT_ACTIVE_OBJECT_MESSAGES: channel must be 1 for unreliable messageLoic Blot2015-04-07
|
* TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD can be unreliable, catch PacketError ↵Loic Blot2015-04-05
| | | | | | exception. Also set the packet size at creation not when pushing rawString, no functional change
* Crafting speedupest312015-04-05
| | | | | | | | | | | | | | | This greatly increases crafting performance, especially in worlds with many mods. Approved by @kwolekr. Introduces a hash-type-layered fall-through mechanism, where every layer specifies one hash algorithm, and the "deeper the fall", the more collisions to expect for the algorithm. One Craft definition only resides at one layer, which improves speed for lower layers (and a complete fail), due to most craft definitions residing at high layers. Due to the fall-through design, the undocumented behaviour that later craft recipes override older ones had to be weaked up a bit, but craft recipes with the same hash and layer will still override.
* Fix players spawned at (0,0,0) in some rare cases instead of ↵Loic Blot2015-04-03
| | | | | | static_spawnpoint, if set Approved by: @kwoelkr
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
| | | | | | | | | | | | 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
* Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.Loic Blot2015-03-31
| | | | | | | Because we get a Buffer<u8> from ConnectionEvent, don't convert it to SharedBuffer<u8> and return it to Server/Client::Receive which will convert it to NetworkPacket Instead, put the Buffer<u8> directly to NetworkPacket and return it to packet processing This remove a long existing memory copy Also check the packet size directly into Connection::Receive instead of packet processing
* Clean up and tweak build systemShadowNinja2015-03-27
| | | | | | | | | | | | | | | | * Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
* Don't send an InventoryAction at each setInventoryModified, we only need one ↵Loic Blot2015-03-24
| | | | | | | | SendInventory per inventory modification Client doesn't like to receive multiples SendInventory for one action, this can trigger glitches on clients (sometimes due to incorrect UDP packet ordering due to UDP protocol) This fix issue #2544
* Fix game minetest.conf default settingsest312015-03-18
| | | | This was a regression introduced by f6e4c5d9cf459e8278a76a2beaee59732e841458 .