aboutsummaryrefslogtreecommitdiff
path: root/src/remoteplayer.h
AgeCommit message (Collapse)Author
2022-03-26Add API to control shadow intensity from the game/mod (#11944)x2048
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-02-17Clean up ClientReady packet handlingsfan5
fixes #12073
2022-01-22Allow resetting celestial vault elements by leaving its arguments empty (#11922)Zughy
2021-09-27Various code improvementsSmallJoker
* Camera: Fix division by 0 after view bobbing * Remove ignored constness * Connection: Improve window size range limits
2021-01-29Settings: Proper priority hierarchySmallJoker
Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
2021-01-29RemotePlayer: Remove Settings writer to Files databaseSmallJoker
2020-03-05Fix code style to make clang-format happysfan5
2020-03-05set_sky improvements, set_sun, set_moon and set_starsJordach
2019-09-14Formspecs: Introduce formspec_version to modsSmallJoker
2019-08-24Inventory: Send dirty lists where appropriate (#8742)SmallJoker
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time. Raises protocol version to 38 to ensure correct backwards-compatible code.
2019-01-04Fix on_successful_save -> onSuccessfulSaveLoïc Blot
2019-01-04Fix various player save issues (performance penalty on sql backends + bugs)Loïc Blot
* PostgreSQL & SQLite3 doesn't setModified(false) on RemotePlayer, then player is saved on each server save call. This results in heavy useless writes. * PostgreSQL & SQLite3 ack engine meta write whereas db commit hasn't been performed. If commit failed write has failed. We mustn't notify engine write is done. * serializing player meta must not setModified(false) because it didn't ensure write has been done * add RemotePlayer::on_successfull_save callback to do the flag update on a successful save
2018-03-08Cleanup: drop Server::hudGetHotbarImage()Loic Blot
Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
2017-10-29Fix day_night_ratio_do_override not being initialised server-siderubenwardy
Causes get_day_night_ratio() to return unpredictable results.
2017-09-30Make Player::peer_id server-side only and add getters and setters (#6478)Loïc Blot
* Make Player::peer_id server-side only and add getters and setters Player::peer_id has no sense client side, move it to server, make it private and add setter and getter Also add some PEER_ID_INEXISTENT instead of harcoded 0
2017-08-19Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
2017-08-17C++ modernize: Pragma once (#6264)Loïc Blot
* Migrate cpp headers to pragma once
2017-06-18Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot
2017-05-04LINT fix since cloud API mergeLoic Blot
2017-05-02Set sky API: Add bool for clouds in front of custom skyboxparamat
Default true. Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API. Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of 'm_visible' (whether normal sky is visible).
2017-04-30Add clouds APIBen Deutsch
2017-04-23Fix lint since recent player to db mergeLoic Blot
2017-04-23Player data to Database (#5475)Loïc Blot
* 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
2017-04-07Clang-format: fix some header files and remove them from whitelistLoic Blot
2017-01-27Implement player attribute backend (#4155)Loïc Blot
* This backend permit mods to store extra players attributes to a common interface. * Add the obj:set_attribute(attr, value) Lua call * Add the obj:get_attribute(attr) Lua call Examples: * player:set_attribute("home:home", "10,25,-78") * player:get_attribute("default:mana") Attributes are saved as a json in the player file in extended_attributes key They are saved only if a modification on the attributes occurs and loaded when emergePlayer is called (they are attached to PlayerSAO).
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-09Environment cleanupLoic Blot
* 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.
2016-10-08Move RemotePlayer code to its own cpp/headerLoic Blot