summaryrefslogtreecommitdiff
path: root/src/server.h
Commit message (Collapse)AuthorAge
* 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.
* Add callback parameter for core.emerge_area()kwolekr2015-11-02
|
* Add DISABLE_CLASS_COPY macro (and use it)kwolekr2015-10-27
| | | | | | | | | 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.
* 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
* 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.
* Cleanup server addparticle(spawner) by merge two identical functions.Loic Blot2015-07-25
|
* Fix documentation of dedicated_server_loopest312015-07-24
|
* 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.
* Fix damage flash when damage disabledkwolekr2015-07-10
|
* Fix code style from recent commits and add misc. optimizationskwolekr2015-07-02
|
* 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 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.
* 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.
* Biomes: Remove referenced biomes from Decorations on clearkwolekr2015-04-16
|
* Fix players spawned at (0,0,0) in some rare cases instead of ↵Loic Blot2015-04-03
| | | | | | static_spawnpoint, if set Approved by: @kwoelkr
* 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
* 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 a little regression on SendActiveObjectMessages which send all ↵Loic Blot2015-03-17
| | | | TOCLIENT_ACTIVE_OBJECT_MESSAGES as reliable
* Move TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD and TOCLIENT_ACTIVE_OBJECT_MESSAGES ↵Loic Blot2015-03-16
| | | | to private functions
* Prepare Protocol v25 init & authentication.Loic Blot2015-03-13
| | | | | | | | | | * 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
* Rename some packet and handlers to <packet>_Legacy name for compat layer ↵Loic Blot2015-03-13
| | | | between new network changes and old network clients
* Server.cpp Use std::list instead of std::vector for playSound, ↵Loic Blot2015-03-05
| | | | fillMediaCache, sendRequestedMedia, sendMediaAnnouncement and related functions
* Server::AsyncRunStep: buffered_messages now uses std::vector instead of ↵Loic Blot2015-03-05
| | | | std::list. * sendRemoveNode and sendAddNodes are also converted as a side effect
* Performance improvement: Use std::list instead of std::vector for ↵Loic Blot2015-03-05
| | | | | | request_media, Server::getModNames, Environment::m_simple_objects. * Also remove unused Server::m_modspaths
* Remove Queue class which uses std::list and use native std::queueLoic Blot2015-03-05
|
* We always know playerSAO when calling SendInventory. Using it instead of ↵Loic Blot2015-03-04
| | | | searching it via peer_id
* Send Position packet on event, don't check it at each AsyncRunStep.Loic Blot2015-03-04
| | | | * This permit to cleanup the player checking loop
* Send Inventory packet on event, don't check it at each AsyncRunStep.Loic Blot2015-03-04
| | | | | | * Call UpdateCrafting into SendInventory because this functions is only called before SendInventory * Use Player* instead of peer_id for UpdateCrafting because SendInventory already has the Player* pointer, then don't loop for searching Player* per peer_id * m_env_mutex don't need to be used with this modification because it's already locked before the calls
* Send Breath packet on event, don't check it at each AsyncRunStepLoic Blot2015-03-03
|
* Send Player HP when setHP (or a setHP caller) is called instead of looping ↵Loic Blot2015-03-03
| | | | and testing the state change.
* [Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot2015-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkPacket.cpp: * Remove some deprecated functions, we must use streaming interface * m_data converted from u8* to std::vector<u8> * Add an exporter to forge packet to Connection object * implement operator << std::wstring. n * implement operator << std::string * dynamic resize when write packet content. * fix string writing and performances. * create ServerCommandFactory, used by client to get useful informations about packet processing (sending). * Reliability * Transmit channel * Implement putRawString for some ugly char (_INIT packet), and use it. * Many packet read and write migrated * Implement oldForgePacket to interface writing with current connection * fix U8/char/bool writing * fix string writing and performances. * add some missing functions * Use v3s16 read instead of reading x,y,z separately * Add irr::video::SColor support into packets * Add some missing handlers * Add a template function to increase offset * Throw a serialization error on packet reading (must be improved) PacketFactories: * Create ServerCommandFactory, used by client to get useful informations about packet processing (sending). * Create ClientCommandFactory, used by server to get useful informations about packet processing (sending). Client.cpp: * implement NetworkPacket ::Send interface. * Move packet handlers to a dedicated file * Remove Client::Send(SharedBuffer) Server.cpp: * implement NetworkPacket ::Send interface. * Rewrite all packets using NetworkPacket * Move packet handlers to a dedicated file * Remove Server::Send(SharedBuffer) ClientIface.cpp: * Remove sendToAll(SharedBuffer<u8>) Connection.hpp rework: * Remove duplicate include * Remove duplicate negation * Remove a useless variable * Improve code performance by using a m_peers_list instead of scanning m_peers map * Remove Connection::Send(SharedBuffer) * Fix useafterfree into NetworkPacket Sending * Remove unused Connection::sendToAll Test.cpp: * Remove dead code * Update tests to use NetworkPackets Misc: * add new wrappers to Send packets in client, using NetworkPacket * Add NetworkPacket methods for Connection * coding style fix * dead code since changes cleanup * Use v3s16 read instead of reading x,y,z separately in some packets * Use different files to handle packets received by client and server * Cleanup: Remove useless includes ok @Zeno- Tested by @Zeno- @VanessaE and @nerzhul on running servers
* Network Layer 7 rework (Packet handling)Loic Blot2015-02-10
| | | | | | | | | | | | | | * Move networkcode to a dedicated directory * Rename clientserver.h to network/networkprotocol.h (Better name) and sanitize some includes * Create object NetworkPacket * It stores command (opcode) and data separated * It also stores peer_id * Data reading can be done by using a streaming interface * Change packet routing analysis * Remove old conditional analysis * Now uses function pointed analysis and add connection state ({Client,Server}::handlers) * Connection state permit to categorize condition to handle before analyze packets * Create a handler for depreciated messages, instead of duplicating code
* Send real port to server listShadowNinja2015-01-23
|
* Fix struct vs. class in forward declarationsKahrl2014-12-08
|
* Clean up rollbackShadowNinja2014-11-19
|
* Recalculate normals for cached meshes.RealBadAngel2014-10-21
| | | | | | Check if mesh is here before adding to meshcollector. Fix deleting the meshes.
* Add prefixes to enum values and fix style issueskwolekr2014-06-28
|
* Use integers instead of float valuesBlockMen2014-04-12
|
* Add player:set_eye_offset() by @MirceaKitsune and clean upBlockMen2014-04-12
|
* Add third person viewBlockMen2014-04-12
|
* Infer ipv6_server from bind_address; fix client connect to IN(6)ADDR_ANYKahrl2014-04-10
|
* Cleanup client init states by bumping protocol versionsapier2014-04-08
| | | | | | | | | | Don't use TOSERVER_RECEIVED_MEDIA but TOSERVER_CLIENT_READY as indicatio for client ready Handle clients with protocol version < 23 (almost) same way as before Make client tell server about it's version Add client state to not send bogus player position updates prior init complete Add access to statistics information (peer connction time,rtt,version) Fix clients standing stalled in world while preloading item visuals (new clients only) Add get_player_information to read client specific information from lua
* Pass arguments by referenceSelat2014-03-12
|
* Remove "Server -!- " prefix from player messagesShadowNinja2014-02-27
|
* Add the option to bind to a specific addressShadowNinja2014-02-05
|
* Add minetest.kick_player(name, reason)sapier2014-02-03
|
* Add player:override_day_night_ratio() for arbitrarily controlling sunlight ↵Perttu Ahola2014-02-01
| | | | brightness
* Add player:set_sky() with simple skybox supportPerttu Ahola2014-02-01
|