aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
AgeCommit message (Collapse)Author
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-09-30Fix some SRP issuesest31
-> Remove memory allocation bugs -> Merge changes from upstream, enabling customizeable memory allocation
2015-09-01Hide minimap if it has been disabled by serverest31
2015-08-25Change i++ to ++iDavid Jones
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-08-13Add count based unload limit for mapblocksest31
2015-08-02src/client.cpp: Fix mapper memory leakBřetislav Štec
2015-07-27Fixed minimap memory leakBřetislav Štec
2015-07-27Fix srp.cpp:815 leakest31
Thanks @Zeno-
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-17Display an access denied message when client detects a server timeoutKahrl
2015-07-08Clean-up Minimap codekwolekr
- Fixed race conditions - Fixed null dereference - Fixed out-of-bounds array access - MinimapMapblock is now allocated and added to update queue only when enabled - Removed dependency on LocalPlayer - Fixed code style - Simplified expressions and program logic - Cleaned minimap object interfaces
2015-07-07Client: better m_proto_ver initialisationest31
Previously, m_proto_ver was set to the serialisation version inside the legacy init packet. Now, if the server doesn't send a protocol version (protocols < 25), we set m_proto_ver to some value < 25 and > 0.
2015-06-29Add UpdateThread and use it for minimap and mesh threadsest31
2015-06-27Add minimap featureRealBadAngel
2015-06-24Return to ignoreest31
2015-05-19Replace instances of std::map<std::string, std::string> with StringMapkwolekr
Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators
2015-05-19Add texture overridingrubenwardy
2015-05-16Finalize init packets and enable protocol v25est31
This enables srp.
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-17Refactor around translatePasswordest31
Change types for passed password from wstring to string, which removes converting back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary, closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for translatePassword passed as const reference.
2015-04-16Schematics: Refactor NodeResolver and add NodeResolveMethodkwolekr
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.
2015-04-07Make comments consistent with TOSERVER_INIT -> TOSERVER_INIT_LEGACY renameest31
2015-04-06Change screenshot filename to one likely to work on all modern filesystemsCraig Robbins
Fixes #2603
2015-04-01Move globals from main.cpp to more sane locationsCraig Robbins
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
2015-04-01Clean scaling pre-filter for formspec/HUD.Aaron Suen
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-31Change format of screenshot namesCraig Robbins
Filename screenshot_ + ISO 8601 format + [-serial] i.e. screenshot_YYYY-MM-DDTHH::MM::SS[-serial].png Serial is added if the filename + timestamp already exists and is in the range 1 to 999
2015-03-27Clean up and tweak build systemShadowNinja
* 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.
2015-03-25Change filename of screenshots to something more human readableCraig Robbins
2015-03-16Move client packet generators to dedicated functions for:Loic Blot
* TOSERVER_INIT_LEGACY * TOSERVER_DELETEDBLOCKS * TOSERVER_GOTBLOCKS * TOSERVER_REMOVED_SOUNDS Also use a std::vector instead of std::set for TOSERVER_REMOVED_SOUNDS
2015-03-15Finer progress bar updates when initializing nodesest31
The bar is only drawn when the user will notice a change, which prevents time overheads that this commit would cause, resulting from useless draws.
2015-03-13client.cpp: typo fix and break; fix to make some compilers happyLoic Blot
2015-03-13Replace NetworkPacket pointers to referencesLoic Blot
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-08Fix memleak pointed by issue #2439.Loic Blot
Also change bzero to memset. bzero doesn't work on windows
2015-03-08Fix unitialized data when creating TOSERVER_INIT packetLoic Blot
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-06Clean up database API and save the local map on an intervalShadowNinja
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-02-21Fix some memory leaks on packet sending.Loic Blot
2015-02-17Replace std::list by std::vector into timerUpdate callsLoic Blot
2015-02-17Remove old comment from Network Rework Patch 2/4Loic Blot
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-11Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" ↵Craig Robbins
setting * Increase performance (client) * Avoid changing a global value to solve a local problem
2015-02-11Revert "Remove workaround in itemdef.cpp to enable/disable/enable ↵Craig Robbins
"enable_shaders" setting" This reverts commit d25ff8fd2592f457b91e8a61240694af3902d23f.
2015-02-11Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" ↵Craig Robbins
setting * Increase performance (client) * Avoid changing a global value to solve a local problem
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-05Reduce gettext wide/narrow and string/char* conversionsShadowNinja