summaryrefslogtreecommitdiff
path: root/src/client.cpp
Commit message (Collapse)AuthorAge
* Add function to get server info.red-0012017-05-04
|
* Sound API: Add fading soundsBrandon2017-05-03
|
* Client & ClientEnvirnment: don't create fake events (#5676)Loïc Blot2017-04-29
| | | | | | | Instead of create fake events on the stack on each loop call (Game::run), verify is queue is empty or not and handle event directly if there is. This prevents fake ClientEvent creation & memory allocations Same fix is also applied on ClientEnvironment, & rename getClientEvent to getClientEnvEvent to match ClientEnvEvent object
* Fix Travis/unittest broken since b662a45SmallJoker2017-04-29
|
* Clean up getTime helpersShadowNinja2017-04-28
| | | | | | This increases size of the getTime return values to 64 bits. It also removes the TimeGetter classes since the getTime functions are now very precise.
* Fix #5655 (#5658)red-0012017-04-26
| | | | Client: Don't send `TOSERVER_RECEIVED_MEDIA` since it's not used anymore Server: Handle `TOSERVER_RECEIVED_MEDIA` using `Server::handleCommand_Deprecated`
* Rename Scripting API files for consistencyShadowNinja2017-04-25
|
* Player data to Database (#5475)Loïc Blot2017-04-23
| | | | | | | | | | | | * Player data to Database Add player data into databases (SQLite3 & PG only) PostgreSQL & SQLite: better POO Design for databases Add --migrate-players argument to server + deprecation warning * Remove players directory if empty
* Soft node overlay (#5186)Dániel Juhász2017-04-21
| | | | This commit adds node overlays, which are tiles that are drawn on top of other tiles.
* Fix various variables passed by copy instead of const ref (#5610)Loïc Blot2017-04-19
| | | Pointed by cppcheck
* MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock ↵Perttu Ahola2017-04-17
| | | | | | | | | | | | | | | | | | | | | copying done in the main thread Cache size is configurable by the meshgen_block_cache_size (default 20 MB). New profiler stats: - MeshUpdateQueue MapBlock cache hit % - MeshUpdateQueue MapBlock cache size kB Removes one type of stutter that was seen on the client when received MapBlocks were being handled. (the "MeshMakeData::fill" stutter) Kind of related to at least #5239 Originally preceded by these commits, now includes them: - Move the mesh generator thread into src/mesh_generator_thread.{cpp,h} - mesh_generator_thread.cpp: Update code style - MeshUpdateThread: Modify interface to house a different implementation: Actual functionality will be changed by next commits. - MeshMakeData: Add fillBlockData() interface (so that caller can fill in stuff from eg. a MapBlock cache)
* Android progressbar fix (#5601)Loïc Blot2017-04-16
| | | | | | | | | | | | | | | | | * Fix progressbar for Android Fixes #5599 Fixed #5403 * draw_load_screen: use texturesource this permits to unify texture loading code * scale progress bar * Add gl version check for GL_OES_texture_npot. This fixed the texture on loading screen * Remove two sanity checks pointed by @celeron55 * sfan5 comments + android ratio fixes
* LocalPlayer api luaVincent Glize2017-04-08
|
* [CSM] Add event on_connect player API lua (#5540)Vincent Glize2017-04-08
| | | | * Add event on_connect player API lua
* [CSM] Add function and chat command to disconnect from server. (#5487)red-0012017-04-01
|
* Add mesh generation delaynumber Zero2017-03-26
|
* Refactor Game class (part 2) (#5422)Loïc Blot2017-03-19
| | | | | | | | | | | | | | * showPauseMenu is now part of game * remove many flags parameters passed to game functions, use the member. * rename VolatileRunFlags to GameUIFlags (this will permit to share structure with client and CSM * updatePointedThing: remove pointer ref, we already have the pointer in rundata * move some attributes outside of VolatileRunFlags after renaming, to game class * rename statustext to m_statustext * make some const variables static * All those changes permit to reduce a little bit function class cost and will permit to interface CSM with some interesting Game flags * Expose GameUIFlags to client * Client now have GameUIFlags parameter and setters for other classes * Fix minimap show/hide in Lua because we now have access to the real flag
* [CSM] Fix minimap problems (#5405)Loïc Blot2017-03-17
| | | This fixes issue #5404
* [CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)Loïc Blot2017-03-17
| | | | | | * [CSM] Add core.get_timeofday & core.get_day_count env calls * [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
* [CSM] Add minimap API modifiers (#5399)Loïc Blot2017-03-16
| | | | | | | | * Rename Mapper (too generic) to Minimap * Add lua functions to get/set position, angle, mode for minimap * Client: rename m_mapper to m_minimap * Add minimap to core.ui namespace (core.ui.minimap) * Add various functions to manage minimap (show, hide, toggle_shape) * Cleanup trivial declaration in client
* Add ModStorageAPI to client side modding (#5396)Loïc Blot2017-03-16
| | | mod storage is located into user_path / client / mod_storage
* [CSM] Add enable_client_modding param (default: false)nerzhul2017-03-13
|
* [CSM] Add `get_node` and `get_node_or_nil`red-0012017-03-13
|
* [CSM] implement client side mod loading (#5123)Loïc Blot2017-03-13
| | | | | | | | | * client side mods are located in clientmods/ * move builtin/preview.lua to clientmods/preview/init.lua as a preview mod * refactor ModConfiguration class to work properly with client and server using child objects * move some Server constructor mod load code to ModConfiguration to reduce code duplication between client and server * remove mods.{cpp,h} unused functions * use UNORDERED_SET instead of std::set in some modspec storages
* [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)Loïc Blot2017-03-13
| | | | | | | | | | * squashed: CSM: Implement register_globalstep * Re-use fatal error mechanism from server to disconnect client on CSM error * Little client functions cleanups * squashed: CSM: add core.after function * core.after is shared code between client & server * ModApiUtil get_us_time feature enabled for client
* [CSM] Add client-sided chat commands (#5092)red-0012017-03-13
|
* [CSM] Add method that display chat to client-sided lua. (#5089) (#5091)red-0012017-03-13
| | | | * squashed: [Client-sided scripting] Don't register functions that don't work. (#5091)
* [CSM] Client side moddingLoic Blot2017-03-13
| | | | | | | | | | * rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
* Remove client-side chat prediction. (#5055)red-0012017-01-17
| | | Network lag isn't really a big issue with chat and chat prediction makes writing mods harder.
* Environment & IGameDef code refactoring (#4985)Ner'zhul2017-01-09
| | | | | | | | | | | | | | | | | | | | | * Environment code refactoring * Cleanup includes & class declarations in client & server environment to improve build speed * ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts. * Cleanup IGameDef * Move ITextureSource* IGameDef::getTextureSource() to Client only. * Also move ITextureSource *IGameDef::tsrc() helper * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call * drop unused emerge() call * cleanup server unused functions (mentionned before) * Drop one unused parameter from ContentFeatures::updateTextures * move checkLocalPrivilege to Client * Remove some unnecessary casts * create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it * Fix some comments * Change required IGameDef to Server/Client pointers * Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects * Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu * drop ClientMap::sectorWasDrawn which is unused
* Improve getPointedThing() (#4346)Dániel Juhász2017-01-04
| | | | | | | | | | | | | | | | | | | * Improved getPointedThing() The new algorithm checks every node exactly once. Now the point and normal vector of the collision is also returned in the PointedThing (currently they are not used outside of the function). Now the CNodeDefManager keeps the union of all possible nodeboxes, so the raycast won't miss any nodes. Also if there are only small nodeboxes, getPointedThing() is exceptionally fast. Also adds unit test for VoxelLineIterator. * Cleanup, code move This commit moves getPointedThing() and Client::getSelectedActiveObject() to ClientEnvironment. The map nodes now can decide which neighbors they are connecting to (MapNode::getNeighbors()).
* Breath cheat fix: server sideLoic Blot2017-01-01
| | | | | | | | | Breath is now handled server side. Changing this behaviour required some modifications to core: * Ignore TOSERVER_BREATH package, marking it as obsolete * Clients doesn't send the breath to server anymore * Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain) * drop a useless static_cast in emergePlayer
* View range: Set maximum to 4000 nodesRogier2016-12-12
| | | | The network protocol does not support larger than 255 mapblocks.
* Fix computation of viewing range (in blocks) sent to server (#4882)Rogier-52016-12-11
| | | | | | | | Fixes #4878 Also remove an artificial viewing range reduction that (presumably) was added to compensate for miscomputed viewing ranges, and that doesn't seem to be needed any more (thanks to lhofhansl).
* Optimize block sent: Fix rendering issueLars Hofhansl2016-12-03
|
* Optimize/adjust blocks/ActiveObjects sent at the server based on client ↵lhofhansl2016-11-30
| | | | | | | settings. (#4811) Optimize/adjust blocks and active blocks sent at the server based on client settings.
* Add control information to player interacts (#4685)raymoo2016-11-12
|
* Environment cleanupLoic Blot2016-10-09
| | | | | | | | | | | | | * Move client list to ServerEnvironment and use RemotePlayer members instead of Player * ClientEnvironment only use setLocalPlayer to specify the current player * Remove ClientEnvironment dead code on player list (in fact other players are CAO not Player objects) * Drop LocalPlayer::getPlayer(xxx) functions which aren't used. * Improve a little bit performance by using const ref list for ClientEnvironment::getPlayerNames() & Client::getConnectedPlayerNames() * Drop isLocal() function from (Local)Player which is not needed anymore because of previous changes This change permits to cleanup shared client list which is very old code. ClientEnvironment doesn't use player list anymore, it only contains the local player, as addPlayer is only called from Client constructor client side. Clients are only CAO on client side, this cleanup permit to remove confusion about player list.
* More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)Loic Blot2016-10-08
| | | | | | | * 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
* Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)Loic Blot2016-10-08
| | | | | | | * Server/Client Environments now have an helper to cast Player object in the right type to use it * Server: use RemotePlayer everywhere and remove previous added casts * Client: use LocalPlayer where needed * Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
* Use more unordered_maps to improve performance in c++11 buildsLoic Blot2016-10-06
|
* Replace various std::map with UNORDERED_MAP + various cleanupsLoic Blot2016-10-05
| | | | | | | | | | | | 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
* Use the standard to_string() functions for C++11 (#4279)Rogier-52016-08-11
| | | | | | | | | | | | If compiling according to a C++ version before C++11, then define std::to_string ourselves. Add a to_wstring version as well As std::to_string() for floating point types uses %.6f as floating point format converter, instead of %G, it needs special care. To preserve ftos() behavior (which is expected to use the %G format converter), it no longer uses to_string().
* Hud: Cache hud_scaling, fix minor style issueskwolekr2016-04-10
|
* Add option to not send pre v25 init packetest312016-03-15
| | | | | | | | | | | | | | | | | The legacy init packet (pre v25) sends information about the client's password that a server could use to log in to other servers if the username and password are the same. All the other benefits of SRP of protocol v25 are missed if the legacy init packet is still sent during connection creation. This patch adds an option to not send the v25 init packet. Not sending the v25 packet means breaking compat with pre v25 servers, but as the option is not enabled by default, no servers are affected unless the user explicitly flips the switch. More than 90% of the servers on the serverlist support post v25 protocols. The patch also fixes a bug with greying out of non compliant servers being done wrongly, the min and max params were mixed.
* Much better API for auth.{cpp, h}est312016-03-15
| | | | | | | | * No function overloading * Adhere coding style and with method names following lowercase_underscore_style * Use std::string in external API, handling these is much more fun
* Add options for screenshot format and qualityDiego Martinez2016-03-12
|
* Remove preload_item_visuals codeRealBadAngel2016-02-21
| | | | Closes #3748
* Move object nametags to cameraRealBadAngel2016-02-18
|
* Use vertices with tangents only when its needed.RealBadAngel2016-02-15
|