aboutsummaryrefslogtreecommitdiff
path: root/src/player.h
Commit message (Expand)AuthorAge
* Allow binding dig, place actions to keys; remove LMB/RMB hardcodingANAND2020-08-15
* set_fov: Add support for time-based transitions (#9705)ANAND2020-05-02
* Add support for per-player FOV overrides and multipliersAnand S2019-09-19
* Unify wield item handling (#8677)SmallJoker2019-08-07
* Extend pitch fly mode to swimming (#7943)random-geek2018-12-31
* Added pitch fly mode (#7817)Gaël C2018-12-01
* Client-side autojump. Remove Android-only stepheight autojump (#7228)Ben Deutsch2018-11-22
* Fix rtt >= 0.0f assertion and free_move crashSmallJoker2018-06-24
* PlayerSettings struct for player movement code (#7243)Ben Deutsch2018-04-18
* Add formspec theming using prepended stringsAndrew Ward2018-03-28
* Make Player::peer_id server-side only and add getters and setters (#6478)Loïc Blot2017-09-30
* Add session_t typedef + remove unused functions (#6470)Loïc Blot2017-09-27
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot2017-08-19
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* Player::getSpeed/setSpeed use const refsLoic Blot2017-08-14
* Player class: disable copyLoic Blot2017-08-14
* Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot2017-06-18
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
* Cleanup some header inclusions to improve compilation timesLoic Blot2017-01-11
* PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul2016-10-30
* Environment cleanupLoic Blot2016-10-09
* Move RemotePlayer code to its own cpp/headerLoic Blot2016-10-08
* RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) (...Loic Blot2016-10-08
* Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)Loic Blot2016-10-08
* Chat: new settings to prevent spamLoic Blot2016-10-05
* Add zoom, tweakable with zoom_fov, default key: Z (like optifine)Esteban I. Ruiz Moreno2016-08-10
* Player: New get_look, set_look APIraymoo2016-06-24
* Initial Gamepad supportest312016-06-03
* Fix player teleportation bug whilst sneakingHybridDog2016-03-14
* Player::accelerateHorizontal/Vertical should be member of LocalPlayerLoic Blot2016-02-14
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
* Get movement setting instead of hard coded valueasl972015-12-15
* Add server side ncurses terminalest312015-11-06
* Clean up threadingShadowNinja2015-08-23
* Optional reconnect functionalityest312015-07-23
* Fix code style from recent commits and add misc. optimizationskwolekr2015-07-02
* Add some missing getter functions to the lua APITeTpaAka2015-05-28
* Fix usage of destroyed mutexkwolekr2015-03-31
* Player: Fix a deadlock triggered by previous commit 0e5e49736c0a5fa29bca257ba...Loic Blot2015-03-22
* Protect Player::hud from concurrent modificationsLoic Blot2015-03-22
* handleCommand_Breath mustn't update breath is player is dead. A dead player d...Loic Blot2015-03-12
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Implement WieldMeshSceneNode which improves wield mesh renderingKahrl2014-11-08
* Make players check inventory modification properlyShadowNinja2014-10-01
* Only set player dirty flag if values changeShadowNinja2014-10-01
* Simplify player modification checksShadowNinja2014-10-01
* Only try to load from possible player filesShadowNinja2014-06-23
* Only keep players loaded while they're connectedShadowNinja2014-06-23
* Small cleanup of hud add/remove codesapier2014-05-31
* Fix all warnings reported by clangSfan52014-04-15
oiseParams(name, *value, !override_meta); return true; } bool MapSettingsManager::loadMapMeta() { std::ifstream is(m_map_meta_path.c_str(), std::ios_base::binary); if (!is.good()) { errorstream << "loadMapMeta: could not open " << m_map_meta_path << std::endl; return false; } if (!m_map_settings->parseConfigLines(is, "[end_of_params]")) { errorstream << "loadMapMeta: [end_of_params] not found!" << std::endl; return false; } return true; } bool MapSettingsManager::saveMapMeta() { // If mapgen params haven't been created yet; abort if (!mapgen_params) return false; if (!fs::CreateAllDirs(fs::RemoveLastPathComponent(m_map_meta_path))) { errorstream << "saveMapMeta: could not create dirs to " << m_map_meta_path; return false; } std::ostringstream oss(std::ios_base::binary); Settings conf; mapgen_params->MapgenParams::writeParams(&conf); mapgen_params->writeParams(&conf); conf.writeLines(oss); // NOTE: If there are ever types of map settings other than // those relating to map generation, save them here oss << "[end_of_params]\n"; if (!fs::safeWriteToFile(m_map_meta_path, oss.str())) { errorstream << "saveMapMeta: could not write " << m_map_meta_path << std::endl; return false; } return true; } MapgenParams *MapSettingsManager::makeMapgenParams() { if (mapgen_params) return mapgen_params; assert(m_user_settings != NULL); assert(m_map_settings != NULL); // At this point, we have (in order of precedence): // 1). m_mapgen_settings->m_settings containing map_meta.txt settings or // explicit overrides from scripts // 2). m_mapgen_settings->m_defaults containing script-set mgparams without // overrides // 3). g_settings->m_settings containing all user-specified config file // settings // 4). g_settings->m_defaults containing any low-priority settings from // scripts, e.g. mods using Lua as an enhanced config file) // Now, get the mapgen type so we can create the appropriate MapgenParams std::string mg_name; MapgenType mgtype = getMapSetting("mg_name", &mg_name) ? Mapgen::getMapgenType(mg_name) : MAPGEN_DEFAULT; if (mgtype == MAPGEN_INVALID) { errorstream << "EmergeManager: mapgen '" << mg_name << "' not valid; falling back to " << Mapgen::getMapgenName(MAPGEN_DEFAULT) << std::endl; mgtype = MAPGEN_DEFAULT; } // Create our MapgenParams MapgenParams *params = Mapgen::createMapgenParams(mgtype); if (params == NULL) return NULL; params->mgtype = mgtype; // Load the rest of the mapgen params from our active settings params->MapgenParams::readParams(m_user_settings); params->MapgenParams::readParams(m_map_settings); params->readParams(m_user_settings); params->readParams(m_map_settings); // Hold onto our params mapgen_params = params; return params; }