aboutsummaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
AgeCommit message (Collapse)Author
2016-12-03Optimize block sent: Fix rendering issueLars Hofhansl
2016-11-30Optimize/adjust blocks/ActiveObjects sent at the server based on client ↵lhofhansl
settings. (#4811) Optimize/adjust blocks and active blocks sent at the server based on client settings.
2016-11-11Fix incorrect distance computation for visible blocks (#4765)Rogier-5
The client would not compute the distance from the camera to to a mapblock correctly. The result was that blocks that were in view (i.e. not beyond the fog limit) would not be rendered. With the improved distance computation, a range adjustment that existed in clientiface.cpp is no longer required.
2016-11-08Retrieve mapblocks from the server in a sphere, not a cubeLars Hofhansl
Use unused range argument in 'isBlockInSight()' to limit mapblock sends to a sphere of radius 'max block send distance'.
2016-11-07Don't use reduced vertical limits for mapblock send and generationLars Hofhansl
2016-10-30Optionally disable optimization that causes underwater and cave rendering ↵lhofhansl
glitches. (#4686)
2016-10-30PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul
* Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO * Move breath to PlayerSAO & LocalPlayer * Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO * Migrate m_yaw from Player to LocalPlayer for client * Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it * Move pitch to LocalPlayer & PlayerSAO * Move m_position from Player to LocalPlayer * Move camera_barely_in_ceiling to LocalPlayer as it's used only there * use PlayerSAO::m_base_position for Server side positions * remove a unused variable * ServerActiveObject::setPos now uses const ref * use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded * Move hp from Player to LocalPlayer * Move m_hp from LuaEntitySAO to UnitSAO * Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
2016-10-08Move RemotePlayer code to its own cpp/headerLoic Blot
2016-10-08Optimize ClientIface::getPlayerNames(): return const ref instead a copy of ↵Loic Blot
all names
2016-10-08More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)Loic Blot
* ClientEnvironment now uses UNORDERED MAP for active objects * Use RemotePlayer and LocalPlayer everywhere it's possible * Minor code style fixes * Drop Client::getBreath() unused function
2016-10-05Replace various std::map with UNORDERED_MAP + various cleanupsLoic Blot
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd Other improvements: * Use the defined ItemGroupList when used * make Client::checkPrivilege const * inline some trivial functions * Add ActiveObjectMap typedef * Add SettingsEntries typedef
2016-03-12Resend blocks when modified while sending to clientJeija
2016-02-22Reset block send timer when invoking setBlock(s)NotSent()orwell96
As stated in this forum thread [1], I noticed that there is a 2 second interval in which inventory changes are shown on the client. @yyt16384 found the source of these 2 seconds: m_nothing_to_send_pause_timer is set to 2.0 every time there are no changes to make, but this timer is not reset when SetBlockNotSent or setBlocksNotSent are invoked. So in worst case, the changed block will be sent over 2 seconds too late. With this change, changed inventories are updated almost immediately, but it causes additional connection load.
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-08-31Make ClientInterface::statenames consistent with the state enum againest31
Fixes minetest.get_player_information segfault due to out of bounds access problems, when compiled as debug build.
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-02Add map limit config optionrubenwardy
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-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-03-13Replace NetworkPacket pointers to referencesLoic Blot
2015-03-04ClientInterface::getClientIDs doesn't need a std::list. Use a std::vector ↵Loic Blot
for better perfs
2015-02-16Performance Improvement: Use a cache which caches result for getFacePositions.Loic Blot
This greatly reduce the number of std::list generated by caching the result, which is always constant for each radius selected. In the callgrind map, you will see original: * 3.3M calls to std::list for 9700 calls to getFacePositions In the modified version, you will see: * 3.3K calls to std::list for 6900 call to getFacePositions Callgrind map is here: #2321 it's a huge performance improvement to l_find_node_near
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-01-18Fix all warnings and remove -Wno-unused-but-set cflagkwolekr
2014-12-12Use std::string::empty() instead of size() where applicableAnton
2014-09-21Split settings into seperate source and header filesShadowNinja
This also cleans up settings a bit
2014-08-22Fix "ghost" blocks if block update is "on wire" while player digs nodessapier
2014-06-28Add prefixes to enum values and fix style issueskwolekr
2014-04-08Cleanup client init states by bumping protocol versionsapier
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
2014-03-26Fix bug in RemoteClient::GetNextBlocksPerttu Ahola
2014-02-06Add missing headerBlockMen
2014-01-31Add propper client initializationsapier
-add client states to avoid server sending data to uninitialized clients -don't show uninitialized clients to other players -propper client disconnect handling Minor comment fixes in server Minor bugfixes in connection -improved peer id calculation -honor NDEBUG flag -improved disconnect handling -increased initial send window Remove some dead code