summaryrefslogtreecommitdiff
path: root/src/server.cpp
Commit message (Collapse)AuthorAge
* 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 .
* Server::step throw is never catched in minetestserverLoic Blot2015-03-17
| | | | | | | | | | Replace it with an errorstream + assert for server This throw can be trigger by LuaError exception or ConnectionBindFailed exception in the following functions: * EmergeThread::Thread() * ScriptApiEnv::environment_Step() * ScriptApiEnv::player_event() * ServerThread::Thread()
* Fix a little regression on SendActiveObjectMessages which send all ↵Loic Blot2015-03-17
| | | | TOCLIENT_ACTIVE_OBJECT_MESSAGES as reliable
* Revert "Server::step throw is never catched. Replace it with an errorstream ↵kwolekr2015-03-16
| | | | | | + assert" This reverts commit 5f8e48c63baf12930430d5d8fc07495021599e61.
* Server::step throw is never catched. Replace it with an errorstream + assertLoic Blot2015-03-16
| | | | | | | | This throw can be trigger by LuaError exception or ConnectionBindFailed exception in the following functions: * EmergeThread::Thread() * ScriptApiEnv::environment_Step() * ScriptApiEnv::player_event() * ServerThread::Thread()
* Move TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD and TOCLIENT_ACTIVE_OBJECT_MESSAGES ↵Loic Blot2015-03-16
| | | | to private functions
* SendPlayerHPOrDie everytime at client connection, damage enabled or not, ↵Loic Blot2015-03-15
| | | | this will fix the player which stay dead at connection
* Replace NetworkPacket pointers to referencesLoic Blot2015-03-13
|
* 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
* Use the new Player::isDead function when it's the caseLoic Blot2015-03-13
|
* Respect game mapgen flags and save world noise paramsngosang2015-03-07
|
* For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins2015-03-07
| | | | NDEBUG is defined), replace those usages with persistent alternatives
* 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
|
* ClientInterface::getClientIDs doesn't need a std::list. Use a std::vector ↵Loic Blot2015-03-04
| | | | for better perfs
* 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
* ASyncRunStep doesn't need to lock when do setTimeOfDaySpeed.Loic Blot2015-03-04
| | | | | * 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
* 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
* Remove unused m_wielded_item_not_sentLoic Blot2015-03-03
|
* 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.
* Fix some memory leaks on packet sending.Loic Blot2015-02-21
|
* Move hex.h to util/Loic Blot2015-02-21
|
* Move sha1.hpp and base64.hpp to util/Loic Blot2015-02-21
|
* Fix unused (and so, broken) enable_rollback_recording. This option must be ↵Loic Blot2015-02-18
| | | | | | reloaded at server loop but loaded when server starts, for data consistency (not a hot load variable) ok @ShadowNinja
* [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
* Replace getPlayer(playername) by getPlayer(peer_id) in some possible cases. ↵Loic Blot2015-02-10
| | | | ok @Zeno-
* 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
* Give full breath after deathSmallJoker2015-02-05
|
* Fix a crash (assert) when client set serial version < 24 in INITLoic Blot2015-01-27
| | | | | | | | | When SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM To resolve the problem: * Create a different CLIENT_MIN_VERSION to handle this problem * Remove the exception * Use an assert in case of bad developer code
* Fix uninitialized variable Server::m_next_sound_idKahrl2015-01-24
|
* Send real port to server listShadowNinja2015-01-23
|
* Performance fixes.onkrot2015-01-13
|
* NodeResolver: Perform callback immediately if node registration phase finishedkwolekr2015-01-04
| | | | Also add NodeResolver callbacks on the client
* Fix map parameter load orderkwolekr2014-12-30
|
* Expose mapgen parameters on scripting initkwolekr2014-12-29
| | | | | Add minetest.get_mapgen_params() Deprecate minetest.register_on_mapgen_init()
* Fix -Wtype-limits warnings and remove disabling of -Wtype-limitsCraig Robbins2014-12-29
|
* Redefine NodeResolver interface and replace with callback mechanismkwolekr2014-12-27
|
* Use std::string::empty() instead of size() where applicableAnton2014-12-12
|
* Fix typo in mapblock.hCraig Robbins2014-12-12
|