aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
AgeCommit message (Collapse)Author
2015-03-16Move TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD and TOCLIENT_ACTIVE_OBJECT_MESSAGES ↵Loic Blot
to private functions
2015-03-15SendPlayerHPOrDie everytime at client connection, damage enabled or not, ↵Loic Blot
this will fix the player which stay dead at connection
2015-03-13Replace NetworkPacket pointers to referencesLoic Blot
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
2015-03-13Use the new Player::isDead function when it's the caseLoic Blot
2015-03-07Respect game mapgen flags and save world noise paramsngosang
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-03-05Server.cpp Use std::list instead of std::vector for playSound, ↵Loic Blot
fillMediaCache, sendRequestedMedia, sendMediaAnnouncement and related functions
2015-03-05Server::AsyncRunStep: buffered_messages now uses std::vector instead of ↵Loic Blot
std::list. * sendRemoveNode and sendAddNodes are also converted as a side effect
2015-03-05Performance improvement: Use std::list instead of std::vector for ↵Loic Blot
request_media, Server::getModNames, Environment::m_simple_objects. * Also remove unused Server::m_modspaths
2015-03-05Remove Queue class which uses std::list and use native std::queueLoic Blot
2015-03-04ClientInterface::getClientIDs doesn't need a std::list. Use a std::vector ↵Loic Blot
for better perfs
2015-03-04We always know playerSAO when calling SendInventory. Using it instead of ↵Loic Blot
searching it via peer_id
2015-03-04Send Position packet on event, don't check it at each AsyncRunStep.Loic Blot
* This permit to cleanup the player checking loop
2015-03-04ASyncRunStep doesn't need to lock when do setTimeOfDaySpeed.Loic Blot
* 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-04Send Inventory packet on event, don't check it at each AsyncRunStep.Loic Blot
* 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
2015-03-03Remove unused m_wielded_item_not_sentLoic Blot
2015-03-03Send Breath packet on event, don't check it at each AsyncRunStepLoic Blot
2015-03-03Send Player HP when setHP (or a setHP caller) is called instead of looping ↵Loic Blot
and testing the state change.
2015-02-21Fix some memory leaks on packet sending.Loic Blot
2015-02-21Move hex.h to util/Loic Blot
2015-02-21Move sha1.hpp and base64.hpp to util/Loic Blot
2015-02-18Fix unused (and so, broken) enable_rollback_recording. This option must be ↵Loic Blot
reloaded at server loop but loaded when server starts, for data consistency (not a hot load variable) ok @ShadowNinja
2015-02-16[Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot
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
2015-02-10Replace getPlayer(playername) by getPlayer(peer_id) in some possible cases. ↵Loic Blot
ok @Zeno-
2015-02-10Network Layer 7 rework (Packet handling)Loic Blot
* 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
2015-02-05Give full breath after deathSmallJoker
2015-01-27Fix a crash (assert) when client set serial version < 24 in INITLoic Blot
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
2015-01-24Fix uninitialized variable Server::m_next_sound_idKahrl
2015-01-23Send real port to server listShadowNinja
2015-01-13Performance fixes.onkrot
2015-01-04NodeResolver: Perform callback immediately if node registration phase finishedkwolekr
Also add NodeResolver callbacks on the client
2014-12-30Fix map parameter load orderkwolekr
2014-12-29Expose mapgen parameters on scripting initkwolekr
Add minetest.get_mapgen_params() Deprecate minetest.register_on_mapgen_init()
2014-12-29Fix -Wtype-limits warnings and remove disabling of -Wtype-limitsCraig Robbins
2014-12-27Redefine NodeResolver interface and replace with callback mechanismkwolekr
2014-12-12Use std::string::empty() instead of size() where applicableAnton
2014-12-12Fix typo in mapblock.hCraig Robbins
2014-12-07Add space between client names in status text (client)Muhammad Rifqi Priyo Susanto
Before: Server: version=0.4.10, uptime=190.5, max_lag=0.001, clients={user1,user2,user3,user4,user5,foobar,userplayedminetestthismorning} After: Server: version=0.4.10, uptime=190.5, max_lag=0.001, clients={user1, user2, user3, user4, user5, foobar, userplayedminetestthismorning}
2014-11-19Clean up rollbackShadowNinja
2014-11-14Remove most exceptions from getNode() (and variants)Craig Robbins
2014-11-10Serverlist: announce mg_name from map_meta.txt instead of minetest.confKahrl
2014-11-08Replace setting unlimited_player_transfer_distance with player_transfer_distanceSmallJoker
2014-11-01Split up mapgen.cppkwolekr
2014-10-26Add NodeResolver and clean up node name -> content ID resolution systemkwolekr
2014-10-21Recalculate normals for cached meshes.RealBadAngel
Check if mesh is here before adding to meshcollector. Fix deleting the meshes.
2014-10-01Make players check inventory modification properlyShadowNinja
2014-10-01Simplify player modification checksShadowNinja
2014-09-21Fix locking bugs and make inventory deserialization errors more specificShadowNinja