aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
AgeCommit message (Collapse)Author
2017-03-13[CSM] storage + fixesLoic Blot
2017-03-13[CSM] Client side moddingLoic Blot
* rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
2017-02-08Add ModMetadata API (#5131)Loïc Blot
* mod can create a ModMetadata object where store its values and retrieve it. * Modmetadata object can only be fetched at mod loading * Save when modified using same time as map interval or at server stop * add helper function to get mod storage path * ModMetadata has exactly same calls than all every other Metadata
2017-01-27Implement player attribute backend (#4155)Loïc Blot
* This backend permit mods to store extra players attributes to a common interface. * Add the obj:set_attribute(attr, value) Lua call * Add the obj:get_attribute(attr) Lua call Examples: * player:set_attribute("home:home", "10,25,-78") * player:get_attribute("default:mana") Attributes are saved as a json in the player file in extended_attributes key They are saved only if a modification on the attributes occurs and loaded when emergePlayer is called (they are attached to PlayerSAO).
2017-01-18Add particle animation, glowsfan5
This is implemented by reusing and extending the TileAnimation code for the methods used by particles.
2017-01-09Environment & IGameDef code refactoring (#4985)Ner'zhul
* Environment code refactoring * Cleanup includes & class declarations in client & server environment to improve build speed * ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts. * Cleanup IGameDef * Move ITextureSource* IGameDef::getTextureSource() to Client only. * Also move ITextureSource *IGameDef::tsrc() helper * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call * drop unused emerge() call * cleanup server unused functions (mentionned before) * Drop one unused parameter from ContentFeatures::updateTextures * move checkLocalPrivilege to Client * Remove some unnecessary casts * create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it * Fix some comments * Change required IGameDef to Server/Client pointers * Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects * Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu * drop ClientMap::sectorWasDrawn which is unused
2017-01-08Move ServerEnvironment to dedicated cpp/header filesLoic Blot
* also cleanup some unneeded inclusions
2017-01-01Breath cheat fix: server sideLoic Blot
Breath is now handled server side. Changing this behaviour required some modifications to core: * Ignore TOSERVER_BREATH package, marking it as obsolete * Clients doesn't send the breath to server anymore * Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain) * drop a useless static_cast in emergePlayer
2016-12-24Move PP() and PP2() macros to basic_macros.hRogier
Instead of redefining them everywhere.
2016-12-20Mod security: Allow read-only access to all mod pathsShadowNinja
2016-11-28Allow restricting detached inventories to one playersfan5
This combats the problem of sending the hundreds of "creative" / "armor" or whatever detached invs that exist on popular servers to each and every player on join or on change of said invs.
2016-11-14Revert "Adding particle blend, glow and animation (#4705)"sfan5
This reverts commit 93e3555eae2deaeca69ee252cfa9cc9c3e0e49ef.
2016-11-15Adding particle blend, glow and animation (#4705)Foghrye4
2016-11-12Add control information to player interacts (#4685)raymoo
2016-11-02Add minetest.get_server_uptime() function to Lua API (#4702)Brandon
Add minetest.get_server_uptime() function to Lua API
2016-10-13Attached particle spawnersraymoo
2016-10-08Move RemotePlayer code to its own cpp/headerLoic Blot
2016-10-08RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) ↵Loic Blot
(patch 3 of X) * remove IGameDef from Player class, only LocalPlayer has it now * move many attributes/functions only used by LocalPlayer from Player to LocalPlayer * move many attributes/functions only used by RemotePlayer from Player to RemotePlayer * make some functions const * hudGetHotbarSelectedImage now returns const ref * RemotePlayer getHotbarSelectedImage now returns const ref * various code style fixes
2016-10-08Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)Loic Blot
* Server/Client Environments now have an helper to cast Player object in the right type to use it * Server: use RemotePlayer everywhere and remove previous added casts * Client: use LocalPlayer where needed * Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
2016-10-08Remove some unused attributes/class functions in server.cpp/hLoic Blot
2016-10-08Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)Loic Blot
* LocalPlayer take ownership of maxHudId as it's the only caller * RemotePlayer take ownership of day night ratio as it's the only user * Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call) * getPlayerSAO is now only RemotePlayer call * get/setHotbarItemCount is now RemotePlayer owned * Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type * PlayerSAO now uses RemotePlayer instead of Player because it's only server side * ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
2016-10-06use unordered containers where possible (patch 4 on X)Loic Blot
Also remove some unused parameters/functions
2016-10-05Chat: new settings to prevent spamLoic Blot
Added the following chat coreside features * Chat messages length limit * Message rate limiting * Message rate kicking Note: * handleChat now takes RemotePlayer pointer instead of u16 to remove useless lookups
2016-05-28Particles: Add option to remove particles on collisionAuke Kok
Adds the particle option `collision_removal = bool` Some particles are hard to use right now since they either go through solid blocks (without collision detection), and with collision detection enabled they (e.g. raindrops) would just stop dead on the floor and sit there until they expire, or worse, scrape along a wall or ceiling. We can solve the problem by adding a boolean flag that tells the particle to be removed if it ever collides with something. This will make it easier to add rain that doesn't fall through your roof or stick on the top of it. Or clouds and smoke that don't go through trees. Particles that collide with this flag are marked expired unconditionally, causing them to be treated like normal expired particles and cleaned up normally. Documentation is adjusted accordingly. An added bonus of this patch is that particles can potentially collide many times with nodes, and this reduces the amount of collisions to 1 (max), which may end up reducing particle load on the client.
2016-04-28Handle particle spawners in env and delete expired idsobneq
Rebased by Zeno (2016-04-2016)
2015-11-13Only allow players with shout to chatest31
Fix regression of commit 5e507c9829942c434a6f1ae7a4f3a488c7e50bef "Add server side ncurses terminal" which allowed all players, even those without a shout priv, to chat. Fixes #3362.
2015-11-09Put ChatEvent handler into own functionest31
Comply with line limit.
2015-11-06Add server side ncurses terminalest31
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.
2015-11-03Time: Remove serverside getter, and use atomic operationsest31
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.
2015-11-02Add callback parameter for core.emerge_area()kwolekr
2015-10-27Add DISABLE_CLASS_COPY macro (and use it)kwolekr
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.
2015-10-27Environment: Time of day fixes and add serverside getterest31
-> 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
2015-08-23Clean up threadingShadowNinja
* 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-07-25Cleanup server addparticle(spawner) by merge two identical functions.Loic Blot
2015-07-24Fix documentation of dedicated_server_loopest31
2015-07-23Optional reconnect functionalityest31
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-10Fix damage flash when damage disabledkwolekr
2015-07-02Fix code style from recent commits and add misc. optimizationskwolekr
2015-05-28Add some missing getter functions to the lua APITeTpaAka
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
2015-05-16Add mod securityShadowNinja
Due to compatibility concerns, this is temporarily disabled.
2015-05-11Make early protocol auth mechanism generic, and add SRPest31
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.
2015-04-22Protocol 25: wstring -> string for custom access denial reasonsest31
Also fix std::logic_error when server::DenyAccess() is used with only two arguments.
2015-04-16Biomes: Remove referenced biomes from Decorations on clearkwolekr
2015-04-03Fix players spawned at (0,0,0) in some rare cases instead of ↵Loic Blot
static_spawnpoint, if set Approved by: @kwoelkr
2015-03-31Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.Loic Blot
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
2015-03-24Don't send an InventoryAction at each setInventoryModified, we only need one ↵Loic Blot
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
2015-03-17Fix a little regression on SendActiveObjectMessages which send all ↵Loic Blot
TOCLIENT_ACTIVE_OBJECT_MESSAGES as reliable
2015-03-16Move TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD and TOCLIENT_ACTIVE_OBJECT_MESSAGES ↵Loic Blot
to private functions
2015-03-13Prepare Protocol v25 init & authentication.Loic Blot
* TOSERVER_INIT and TOCLIENT_INIT renamed to _LEGACY * TOSERVER_PASSWORD merged from dev-0.5, can use protocol v24 and v25 * TOCLIENT_ACCESS_DENIED merged from dev-0.5, can use protocol v24 and v25, with normalized strings an a custom id for custom errors * new TOSERVER_INIT packet only send MT version, supported compressions, protocols and serialization, this permit to rework everything later without break the _INIT packet * new TOSERVER_AUTH packet which auth the client * new TOCLIENT_HELLO packet which send server serialization version atm * new TOCLIENT_AUTH_ACCEPTED which is send when TOCLIENT_AUTH was okay. After this packet, the client load datas from servers, like after TOCLIENT_INIT_LEGACY packet
2015-03-13Rename some packet and handlers to <packet>_Legacy name for compat layer ↵Loic Blot
between new network changes and old network clients