#include <serverenvironment.h>
Public Types | |
enum | BlockStatus { BS_UNKNOWN , BS_EMERGING , BS_LOADED , BS_ACTIVE } |
Public Member Functions | |
ServerEnvironment (std::unique_ptr< ServerMap > map, Server *server, MetricsBackend *mb) | |
~ServerEnvironment () | |
void | init () |
Map & | getMap () |
ServerMap & | getServerMap () |
ServerScripting * | getScriptIface () |
Server * | getGameDef () |
float | getSendRecommendedInterval () |
void | saveLoadedPlayers (bool force=false) |
void | savePlayer (RemotePlayer *player) |
PlayerSAO * | loadPlayer (RemotePlayer *player, bool *new_player, session_t peer_id, bool is_singleplayer) |
void | addPlayer (RemotePlayer *player) |
void | removePlayer (RemotePlayer *player) |
bool | removePlayerFromDatabase (const std::string &name) |
void | saveMeta () |
void | loadMeta () |
u32 | addParticleSpawner (float exptime) |
u32 | addParticleSpawner (float exptime, u16 attached_id) |
void | deleteParticleSpawner (u32 id, bool remove_from_object=true) |
ServerActiveObject * | getActiveObject (u16 id) |
u16 | addActiveObject (std::unique_ptr< ServerActiveObject > object) |
void | invalidateActiveObjectObserverCaches () |
void | getAddedActiveObjects (PlayerSAO *playersao, s16 radius, s16 player_radius, const std::set< u16 > ¤t_objects, std::vector< u16 > &added_objects) |
void | getRemovedActiveObjects (PlayerSAO *playersao, s16 radius, s16 player_radius, const std::set< u16 > ¤t_objects, std::vector< std::pair< bool, u16 > > &removed_objects) |
bool | getActiveObjectMessage (ActiveObjectMessage *dest) |
virtual void | getSelectedActiveObjects (const core::line3d< f32 > &shootline_on_map, std::vector< PointedThing > &objects, const std::optional< Pointabilities > &pointabilities) |
void | activateBlock (MapBlock *block, u32 additional_dtime=0) |
void | addActiveBlockModifier (ActiveBlockModifier *abm) |
void | addLoadingBlockModifierDef (LoadingBlockModifierDef *lbm) |
bool | setNode (v3s16 p, const MapNode &n) |
bool | removeNode (v3s16 p) |
bool | swapNode (v3s16 p, const MapNode &n) |
u8 | findSunlight (v3s16 pos) const |
void | getObjectsInsideRadius (std::vector< ServerActiveObject * > &objects, const v3f &pos, float radius, std::function< bool(ServerActiveObject *obj)> include_obj_cb) |
void | getObjectsInArea (std::vector< ServerActiveObject * > &objects, const aabb3f &box, std::function< bool(ServerActiveObject *obj)> include_obj_cb) |
void | clearObjects (ClearObjectsMode mode) |
void | deactivateBlocksAndObjects () |
void | step (f32 dtime) |
u32 | getGameTime () const |
void | reportMaxLagEstimate (float f) |
float | getMaxLagEstimate () const |
std::set< v3s16 > * | getForceloadedBlocks () |
BlockStatus | getBlockStatus (v3s16 blockpos) |
void | setStaticForActiveObjectsInBlock (v3s16 blockpos, bool static_exists, v3s16 static_block=v3s16(0, 0, 0)) |
RemotePlayer * | getPlayer (const session_t peer_id) |
RemotePlayer * | getPlayer (const std::string &name, bool match_invalid_peer=false) |
const std::vector< RemotePlayer * > | getPlayers () const |
u32 | getPlayerCount () const |
AuthDatabase * | getAuthDatabase () |
Public Member Functions inherited from Environment | |
Environment (IGameDef *gamedef) | |
virtual | ~Environment ()=default |
DISABLE_CLASS_COPY (Environment) | |
u32 | getDayNightRatio () |
virtual void | setTimeOfDay (u32 time) |
u32 | getTimeOfDay () |
float | getTimeOfDayF () |
void | stepTimeOfDay (float dtime) |
void | setTimeOfDaySpeed (float speed) |
void | setDayNightRatioOverride (bool enable, u32 value) |
u32 | getDayCount () |
bool | line_of_sight (v3f pos1, v3f pos2, v3s16 *p=nullptr) |
void | continueRaycast (RaycastState *state, PointedThing *result) |
IGameDef * | getGameDef () |
Static Public Member Functions | |
static bool | migratePlayersDatabase (const GameParams &game_params, const Settings &cmd_args) |
static bool | migrateAuthDatabase (const GameParams &game_params, const Settings &cmd_args) |
Private Member Functions | |
void | loadDefaultMeta () |
called if env_meta.txt doesn't exist (e.g. | |
u16 | addActiveObjectRaw (std::unique_ptr< ServerActiveObject > object, const StaticObject *from_static, u32 dtime_s) |
void | removeRemovedObjects () |
void | activateObjects (MapBlock *block, u32 dtime_s) |
void | deactivateFarObjects (bool force_delete) |
void | deleteStaticFromBlock (ServerActiveObject *obj, u16 id, u32 mod_reason, bool no_emerge) |
bool | saveStaticToBlock (v3s16 blockpos, u16 store_id, ServerActiveObject *obj, const StaticObject &s_obj, u32 mod_reason) |
void | processActiveObjectRemove (ServerActiveObject *obj) |
std::unique_ptr< ServerActiveObject > | createSAO (ActiveObjectType type, v3f pos, const std::string &data) |
Static Private Member Functions | |
static PlayerDatabase * | openPlayerDatabase (const std::string &name, const std::string &savedir, const Settings &conf) |
static AuthDatabase * | openAuthDatabase (const std::string &name, const std::string &savedir, const Settings &conf) |
Additional Inherited Members | |
Public Attributes inherited from Environment | |
u32 | m_added_objects |
Protected Attributes inherited from Environment | |
std::atomic< float > | m_time_of_day_speed |
u32 | m_time_of_day |
float | m_time_of_day_f |
float | m_time_conversion_skew = 0.0f |
bool | m_enable_day_night_ratio_override = false |
u32 | m_day_night_ratio_override = 0.0f |
std::atomic< u32 > | m_day_count |
bool | m_cache_enable_shaders |
float | m_cache_active_block_mgmt_interval |
float | m_cache_abm_interval |
float | m_cache_nodetimer_interval |
float | m_cache_abm_time_budget |
IGameDef * | m_gamedef |
ServerEnvironment::ServerEnvironment | ( | std::unique_ptr< ServerMap > | map, |
Server * | server, | ||
MetricsBackend * | mb ) |
References MetricsBackend::addCounter(), MetricsBackend::addGauge(), m_active_block_gauge, m_active_object_gauge, and m_step_time_counter.
ServerEnvironment::~ServerEnvironment | ( | ) |
References m_abms, m_active_blocks, m_auth_database, m_map, m_player_database, m_players, and ActiveBlockList::size().
void ServerEnvironment::activateBlock | ( | MapBlock * | block, |
u32 | additional_dtime = 0 ) |
References activateObjects(), LBMManager::applyLBMs(), BLOCK_TIMESTAMP_UNDEFINED, StaticObjectList::clearStored(), MapBlock::getTimestamp(), MapBlock::isOrphan(), m_game_time, m_last_clear_objects_time, m_lbm_mgr, m_script, MapBlock::m_static_objects, ScriptApiNode::node_on_timer(), p(), MapBlock::resetUsageTimer(), MapBlock::setTimestampNoChangedFlag(), and MapBlock::step().
Referenced by EmergeThread::finishGen(), step(), TestSAO::testActivate(), and TestSAO::testStaticToFalse().
|
private |
References addActiveObjectRaw(), BS, StaticObjectList::clearStored(), createSAO(), errorstream, StaticObjectList::getAllStored(), MapBlock::getPos(), MapBlock::isOrphan(), MapBlock::m_static_objects, MapBlock::onObjectsActivation(), print_hexdump(), StaticObjectList::pushStored(), and verbosestream.
Referenced by activateBlock().
void ServerEnvironment::addActiveBlockModifier | ( | ActiveBlockModifier * | abm | ) |
References m_abms.
u16 ServerEnvironment::addActiveObject | ( | std::unique_ptr< ServerActiveObject > | object | ) |
References addActiveObjectRaw(), and Environment::m_added_objects.
Referenced by add_entity(), and loadPlayer().
|
private |
References ScriptApiBase::addObjectReference(), BS, ServerMap::emergeBlock(), errorstream, floatToInt(), getNodeBlockPos(), m_ao_manager, m_map, m_script, MapBlock::m_static_objects, MOD_REASON_ADD_ACTIVE_OBJECT_RAW, MOD_STATE_WRITE_NEEDED, p(), processActiveObjectRemove(), MapBlock::raiseModified(), server::ActiveObjectMgr::registerObject(), server::ActiveObjectMgr::removeObject(), sanity_check, StaticObjectList::setActive(), and warningstream.
Referenced by activateObjects(), and addActiveObject().
void ServerEnvironment::addLoadingBlockModifierDef | ( | LoadingBlockModifierDef * | lbm | ) |
u32 ServerEnvironment::addParticleSpawner | ( | float | exptime | ) |
References m_particle_spawners, m_particle_spawners_id_last_used, and PARTICLE_SPAWNER_NO_EXPIRY.
Referenced by Server::addParticleSpawner(), and addParticleSpawner().
u32 ServerEnvironment::addParticleSpawner | ( | float | exptime, |
u16 | attached_id ) |
References addParticleSpawner(), getActiveObject(), and m_particle_spawner_attachments.
void ServerEnvironment::addPlayer | ( | RemotePlayer * | player | ) |
References FATAL_ERROR_IF, Player::getName(), RemotePlayer::getPeerId(), getPlayer(), m_players, and PEER_ID_INEXISTENT.
Referenced by loadPlayer().
void ServerEnvironment::clearObjects | ( | ClearObjectsMode | mode | ) |
References actionstream, ACTIVEOBJECT_TYPE_PLAYER, CLEAR_OBJECTS_MODE_FULL, server::ActiveObjectMgr::clearIf(), MapBlock::clearObjects(), deleteStaticFromBlock(), ServerMap::emergeBlock(), errorstream, g_settings, Map::getBlockNoCreateNoEx(), Settings::getS32(), ActiveObject::getType(), infostream, ServerMap::listAllLoadableBlocks(), ServerMap::listAllLoadedBlocks(), m_ao_manager, m_game_time, ServerActiveObject::m_known_by_count, m_last_clear_objects_time, m_map, ServerActiveObject::markForRemoval(), MOD_REASON_CLEAR_ALL_OBJECTS, MYMAX, p(), processActiveObjectRemove(), MapBlock::refDrop(), MapBlock::refGrab(), U32_MAX, and Map::unloadUnreferencedBlocks().
|
private |
References ACTIVEOBJECT_TYPE_LUAENTITY, and warningstream.
Referenced by activateObjects().
void ServerEnvironment::deactivateBlocksAndObjects | ( | ) |
References ActiveBlockList::clear(), deactivateFarObjects(), and m_active_blocks.
Referenced by Server::~Server(), and TestSAO::runTests().
|
private |
References BS, server::ActiveObjectMgr::clearIf(), ActiveBlockList::contains(), StaticObject::data, deleteStaticFromBlock(), ServerMap::emergeBlock(), floatToInt(), ServerActiveObject::getBasePosition(), Map::getBlockNoCreateNoEx(), getMap(), ServerActiveObject::getMinimumSavedMovement(), getNodeBlockPos(), ServerActiveObject::isGone(), ServerActiveObject::isStaticAllowed(), m_active_blocks, m_ao_manager, ServerActiveObject::m_known_by_count, m_map, ServerActiveObject::m_static_block, ServerActiveObject::m_static_exists, ServerActiveObject::markForDeactivation(), MOD_REASON_STATIC_DATA_ADDED, MOD_REASON_STATIC_DATA_CHANGED, MOD_REASON_STATIC_DATA_REMOVED, MOD_REASON_UNKNOWN, StaticObject::pos, processActiveObjectRemove(), saveStaticToBlock(), ServerActiveObject::shouldUnload(), verbosestream, and warningstream.
Referenced by deactivateBlocksAndObjects(), and step().
void ServerEnvironment::deleteParticleSpawner | ( | u32 | id, |
bool | remove_from_object = true ) |
References ServerActiveObject::detachParticleSpawner(), getActiveObject(), m_particle_spawner_attachments, and m_particle_spawners.
Referenced by LuaEntitySAO::~LuaEntitySAO(), Server::deleteParticleSpawner(), and PlayerSAO::removingFromEnvironment().
|
private |
References ServerMap::emergeBlock(), errorstream, Map::getBlockNoCreateNoEx(), m_map, ServerActiveObject::m_static_block, ServerActiveObject::m_static_exists, MapBlock::m_static_objects, MOD_REASON_UNKNOWN, MOD_STATE_WRITE_NEEDED, MapBlock::raiseModified(), and StaticObjectList::remove().
Referenced by clearObjects(), deactivateFarObjects(), and removeRemovedObjects().
u8 ServerEnvironment::findSunlight | ( | v3s16 | pos | ) | const |
References ServerMap::emergeBlock(), NodeDefManager::get(), MapDatabase::getBlockAsInteger(), Map::getNode(), m_map, m_server, IGameDef::ndef(), MapNode::param1, and ContentFeatures::sunlight_propagates.
|
inline |
References ActiveObjectMgr< T >::getActiveObject(), and m_ao_manager.
Referenced by addParticleSpawner(), Server::AsyncRunStep(), UnitSAO::clearChildAttachments(), ClientInterface::DeleteClient(), deleteParticleSpawner(), LuaEntitySAO::getClientInitializationData(), PlayerSAO::getClientInitializationData(), UnitSAO::getParent(), ServerPlayingSound::getPos(), getRemovedActiveObjects(), Server::handleCommand_Interact(), LuaRaycast::l_next(), Server::SendActiveObjectRemoveAdd(), UnitSAO::setAttachment(), TestSAO::testActivate(), TestSAO::testNotSaved(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), and TestSAO::testStaticToTrue().
bool ServerEnvironment::getActiveObjectMessage | ( | ActiveObjectMessage * | dest | ) |
References m_active_object_messages.
Referenced by Server::AsyncRunStep().
void ServerEnvironment::getAddedActiveObjects | ( | PlayerSAO * | playersao, |
s16 | radius, | ||
s16 | player_radius, | ||
const std::set< u16 > & | current_objects, | ||
std::vector< u16 > & | added_objects ) |
References BS, server::ActiveObjectMgr::getAddedActiveObjectsAroundPos(), ServerActiveObject::getBasePosition(), Player::getName(), PlayerSAO::getPlayer(), ServerActiveObject::isEffectivelyObservedBy(), and m_ao_manager.
Referenced by Server::SendActiveObjectRemoveAdd().
|
inline |
References m_auth_database.
Referenced by ModApiAuth::getAuthDb().
ServerEnvironment::BlockStatus ServerEnvironment::getBlockStatus | ( | v3s16 | blockpos | ) |
References BS_ACTIVE, BS_EMERGING, BS_LOADED, BS_UNKNOWN, ActiveBlockList::contains(), Map::getBlockNoCreateNoEx(), ServerMap::isBlockInQueue(), m_active_blocks, and m_map.
|
inline |
References m_active_blocks, and ActiveBlockList::m_forceloaded_list.
|
inline |
References m_server.
Referenced by ABMHandler::ABMHandler(), PlayerSAO::addPos(), ServerInventoryManager::createDetachedInventory(), NodeMetaRef::getmeta(), PlayerSAO::moveTo(), ServerInventoryManager::removeDetachedInventory(), PlayerSAO::respawn(), PlayerSAO::setBreath(), PlayerSAO::setHP(), PlayerSAO::setLookPitchAndSend(), PlayerSAO::setPlayerYawAndSend(), PlayerSAO::setPos(), LuaEntitySAO::step(), and PlayerSAO::step().
|
inline |
References m_game_time.
Referenced by Server::AsyncRunStep().
|
virtual |
Implements Environment.
References m_map.
Referenced by Server::AsyncRunStep(), NodeMetaRef::clearMeta(), deactivateFarObjects(), ServerInventoryManager::getInventory(), Server::getMap(), NodeMetaRef::getmeta(), RemoteClient::GetNextBlocks(), Server::getStatusString(), Server::handleCommand_Interact(), Server::handleCommand_NodeMetaFields(), NodeMetaRef::reportMetadataChange(), Server::SendBlock(), Server::SendBlocks(), Server::sendMetadataChanged(), ServerInventoryManager::setInventoryModified(), PlayerSAO::step(), TestSAO::testActivate(), TestSAO::testNotSaved(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), and TestSAO::testStaticToTrue().
|
inline |
References m_max_lag_estimate.
Referenced by Server::AsyncRunStep(), PlayerSAO::checkMovementCheat(), Server::getStatusString(), and PlayerSAO::step().
|
inline |
References server::ActiveObjectMgr::getObjectsInArea(), and m_ao_manager.
|
inline |
References server::ActiveObjectMgr::getObjectsInsideRadius(), and m_ao_manager.
Referenced by add_object_boxes(), and getSelectedActiveObjects().
RemotePlayer * ServerEnvironment::getPlayer | ( | const session_t | peer_id | ) |
References m_players.
Referenced by Server::addParticleSpawner(), addPlayer(), Server::AsyncRunStep(), ServerInventoryManager::createDetachedInventory(), Server::DeleteClient(), Server::deleteParticleSpawner(), Server::dynamicAddMedia(), Server::emergePlayer(), ServerInventoryManager::getInventory(), RemoteClient::GetNextBlocks(), Server::getPlayerName(), Server::getPlayerSAO(), Server::handleCommand_ChatMessage(), Server::handleCommand_Damage(), Server::handleCommand_HaveMedia(), Server::handleCommand_Init(), Server::handleCommand_Interact(), Server::handleCommand_InventoryAction(), Server::handleCommand_InventoryFields(), Server::handleCommand_NodeMetaFields(), Server::handleCommand_PlayerItem(), Server::handleCommand_PlayerPos(), ModApiServer::l_remove_player(), Server::notifyPlayer(), Server::playSound(), ServerInventoryManager::removeDetachedInventory(), Server::reportFormspecPrependModified(), Server::reportInventoryFormspecModified(), Server::reportPrivsModified(), Server::SendAddParticleSpawner(), Server::SendChatMessage(), Server::SendMinimapModes(), Server::sendNodeChangePkt(), Server::SendPlayerFormspecPrepend(), Server::SendPlayerFov(), Server::SendPlayerInventoryFormspec(), Server::SendPlayerPrivileges(), Server::SendSpawnParticle(), ServerInventoryManager::setInventoryModified(), Server::showFormspec(), Server::spawnParticle(), Server::StageTwoClientInit(), and ClientInterface::UpdatePlayerList().
RemotePlayer * ServerEnvironment::getPlayer | ( | const std::string & | name, |
bool | match_invalid_peer = false ) |
References m_players, and PEER_ID_INEXISTENT.
|
inline |
References m_players.
Referenced by ModApiEnv::l_get_connected_players(), and Server::SendBlocks().
|
inline |
References m_players.
Referenced by ModApiEnv::l_get_connected_players().
void ServerEnvironment::getRemovedActiveObjects | ( | PlayerSAO * | playersao, |
s16 | radius, | ||
s16 | player_radius, | ||
const std::set< u16 > & | current_objects, | ||
std::vector< std::pair< bool, u16 > > & | removed_objects ) |
References ACTIVEOBJECT_TYPE_PLAYER, BS, FUNCTION_NAME, getActiveObject(), ServerActiveObject::getBasePosition(), Player::getName(), PlayerSAO::getPlayer(), ServerActiveObject::isEffectivelyObservedBy(), ServerActiveObject::isGone(), and warningstream.
Referenced by Server::SendActiveObjectRemoveAdd().
|
inline |
References m_script.
Referenced by LuaEntitySAO::~LuaEntitySAO(), LuaEntitySAO::addedToEnvironment(), LuaEntitySAO::dispatchScriptDeactivate(), LuaEntitySAO::getStaticData(), UnitSAO::onAttach(), UnitSAO::onDetach(), LuaEntitySAO::punch(), PlayerSAO::punch(), PlayerSAO::respawn(), LuaEntitySAO::rightClick(), PlayerSAO::rightClick(), LuaEntitySAO::setHP(), PlayerSAO::setHP(), LuaEntitySAO::step(), PlayerSAO::step(), ServerMap::transformLiquids(), LuaABM::trigger(), LuaLBM::trigger(), and Server::UpdateCrafting().
|
virtual |
Gets the objects pointed by the shootline as pointed things. If this is a client environment, the local player won't be returned.
[in] | shootline_on_map | the shootline for the test in world coordinates |
[out] | objects | found objects |
Implements Environment.
References boxLineCollision(), BS, UnitSAO::getArmorGroups(), getObjectsInsideRadius(), UnitSAO::getTotalRotation(), ObjectProperties::pointable, POINTABLE_NOT, and ObjectProperties::rotate_selectionbox.
|
inline |
References m_recommended_send_interval.
Referenced by LuaEntitySAO::sendPosition(), PlayerSAO::step(), and step().
ServerMap & ServerEnvironment::getServerMap | ( | ) |
References m_map.
Referenced by Server::acceptAuth(), ABMHandler::apply(), Server::AsyncRunStep(), Server::findSpawnPos(), Server::init(), Server::rollbackRevertActions(), and EmergeThread::run().
void ServerEnvironment::init | ( | ) |
References Map::addEventReceiver(), DIR_DELIM, errorstream, Settings::exists(), Settings::getNoEx(), Settings::getU16NoEx(), Server::getWorldPath(), ScriptApiEnv::has_on_mapblocks_changed(), m_auth_database, m_map, m_on_mapblocks_changed_receiver, m_player_database, m_script, m_server, MAP_BLOCKSIZE, openAuthDatabase(), openPlayerDatabase(), Settings::readConfigFile(), OnMapblocksChangedReceiver::receiving, Settings::set(), Settings::updateConfigFile(), and warningstream.
Referenced by Server::init().
void ServerEnvironment::invalidateActiveObjectObserverCaches | ( | ) |
References server::ActiveObjectMgr::invalidateActiveObjectObserverCaches(), and m_ao_manager.
Referenced by Server::AsyncRunStep().
|
private |
called if env_meta.txt doesn't exist (e.g.
new world)
References LBMManager::loadIntroductionTimes(), m_game_time, m_lbm_mgr, and m_server.
Referenced by loadMeta().
void ServerEnvironment::loadMeta | ( | ) |
References DIR_DELIM, Settings::exists(), Settings::get(), Settings::getU32(), Settings::getU64(), Server::getWorldPath(), infostream, loadDefaultMeta(), LBMManager::loadIntroductionTimes(), Environment::m_day_count, m_game_time, m_last_clear_objects_time, m_lbm_mgr, m_meta_loaded, m_server, Settings::parseConfigLines(), fs::PathExists(), SANITY_CHECK, and Environment::setTimeOfDay().
Referenced by Server::init(), and TestSAO::runTests().
PlayerSAO * ServerEnvironment::loadPlayer | ( | RemotePlayer * | player, |
bool * | new_player, | ||
session_t | peer_id, | ||
bool | is_singleplayer ) |
References actionstream, addActiveObject(), addPlayer(), Player::clearHud(), Server::findSpawnPos(), Player::getName(), infostream, PlayerDatabase::loadPlayer(), m_fast_active_block_divider, m_player_database, m_server, objectpos_over_limit(), and RemotePlayer::setModified().
Referenced by Server::emergePlayer().
|
static |
References actionstream, DIR_DELIM, errorstream, Settings::exists(), Settings::get(), openAuthDatabase(), fs::PathExists(), Settings::readConfigFile(), fs::Rename(), Settings::set(), Settings::updateConfigFile(), warningstream, BaseException::what(), and GameParams::world_path.
Referenced by run_dedicated_server().
|
static |
References actionstream, fs::CreateDir(), fs::DeleteSingleFileOrEmptyDirectory(), DIR_DELIM, errorstream, Settings::exists(), PlayerSAO::finalize(), Settings::get(), PlayerDatabase::listPlayers(), PlayerDatabase::loadPlayer(), openPlayerDatabase(), Settings::readConfigFile(), fs::Rename(), PlayerDatabase::savePlayer(), Settings::set(), RemotePlayer::setPlayerSAO(), Settings::updateConfigFile(), BaseException::what(), and GameParams::world_path.
Referenced by run_dedicated_server().
|
staticprivate |
References Settings::getNoEx().
Referenced by init(), and migrateAuthDatabase().
|
staticprivate |
References DIR_DELIM, and Settings::getNoEx().
Referenced by init(), and migratePlayersDatabase().
|
private |
References ServerActiveObject::isGone(), m_script, ScriptApiBase::removeObjectReference(), and ServerActiveObject::removingFromEnvironment().
Referenced by addActiveObjectRaw(), clearObjects(), deactivateFarObjects(), and removeRemovedObjects().
bool ServerEnvironment::removeNode | ( | v3s16 | p | ) |
References NodeDefManager::get(), Map::getNode(), ContentFeatures::has_after_destruct, ContentFeatures::has_on_destruct, m_map, m_script, m_server, IGameDef::ndef(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_destruct(), p(), Map::removeNodeWithEvent(), and ServerMap::updateVManip().
void ServerEnvironment::removePlayer | ( | RemotePlayer * | player | ) |
References m_players.
Referenced by PlayerSAO::unlinkPlayerSessionAndSave().
bool ServerEnvironment::removePlayerFromDatabase | ( | const std::string & | name | ) |
References m_player_database, and PlayerDatabase::removePlayer().
Referenced by ModApiServer::l_remove_player().
|
private |
References server::ActiveObjectMgr::clearIf(), deleteStaticFromBlock(), ServerMap::emergeBlock(), g_profiler, infostream, ServerActiveObject::isGone(), ServerActiveObject::isPendingRemoval(), m_ao_manager, ServerActiveObject::m_known_by_count, m_map, ServerActiveObject::m_static_block, ServerActiveObject::m_static_exists, MOD_REASON_REMOVE_OBJECTS_REMOVE, processActiveObjectRemove(), SPT_AVG, and warningstream.
Referenced by step().
|
inline |
References m_max_lag_estimate.
Referenced by Server::AsyncRunStep().
void ServerEnvironment::saveLoadedPlayers | ( | bool | force = false | ) |
References errorstream, m_player_database, m_players, PlayerDatabase::savePlayer(), and BaseException::what().
Referenced by Server::~Server(), and Server::AsyncRunStep().
void ServerEnvironment::saveMeta | ( | ) |
References LBMManager::createIntroductionTimesString(), DIR_DELIM, Environment::getTimeOfDay(), Server::getWorldPath(), infostream, Environment::m_day_count, m_game_time, m_last_clear_objects_time, m_lbm_mgr, m_meta_loaded, m_server, fs::safeWriteToFile(), Settings::set(), Settings::setU64(), and Settings::writeLines().
Referenced by Server::~Server(), and Server::AsyncRunStep().
void ServerEnvironment::savePlayer | ( | RemotePlayer * | player | ) |
References errorstream, Player::getName(), m_player_database, PlayerDatabase::savePlayer(), and BaseException::what().
Referenced by PlayerSAO::unlinkPlayerSessionAndSave().
|
private |
References ServerMap::emergeBlock(), errorstream, m_map, ServerActiveObject::m_static_block, ServerActiveObject::m_static_exists, and MapBlock::saveStaticObject().
Referenced by deactivateFarObjects().
References Map::addNodeWithEvent(), NodeDefManager::get(), Map::getNode(), ContentFeatures::has_after_destruct, ContentFeatures::has_on_construct, ContentFeatures::has_on_destruct, m_map, m_script, m_server, IGameDef::ndef(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_construct(), ScriptApiNode::node_on_destruct(), p(), and ServerMap::updateVManip().
void ServerEnvironment::setStaticForActiveObjectsInBlock | ( | v3s16 | blockpos, |
bool | static_exists, | ||
v3s16 | static_block = v3s16(0,0,0) ) |
References errorstream, ActiveObjectMgr< T >::getActiveObject(), StaticObjectList::getAllActives(), Map::getBlockNoCreateNoEx(), m_ao_manager, m_map, ServerActiveObject::m_static_block, ServerActiveObject::m_static_exists, and MapBlock::m_static_objects.
|
virtual |
Implements Environment.
References activateBlock(), ABMHandler::apply(), Profiler::avg(), BS, deactivateFarObjects(), ScriptApiEnv::environment_Step(), g_profiler, g_settings, Map::getBlockNoCreateNoEx(), ServerMap::getBlockOrEmerge(), MapBlock::getDiskTimestamp(), Settings::getFloat(), Settings::getS16(), getSendRecommendedInterval(), TimeTaker::getTimerTime(), MapBlock::getTimestamp(), porting::getTimeUs(), MetricCounter::increment(), ActiveBlockList::m_abm_list, m_abms, m_active_block_gauge, m_active_block_modifier_interval, m_active_blocks, m_active_blocks_mgmt_interval, m_active_blocks_nodemetadata_interval, m_active_object_gauge, m_active_object_messages, m_ao_manager, Environment::m_cache_abm_interval, Environment::m_cache_abm_time_budget, Environment::m_cache_active_block_mgmt_interval, Environment::m_cache_nodetimer_interval, m_fast_active_block_divider, m_game_time, m_game_time_fraction_counter, ActiveBlockList::m_list, m_map, m_object_management_interval, m_on_mapblocks_changed_receiver, m_particle_management_interval, m_particle_spawners, m_players, m_recommended_send_interval, m_script, m_send_recommended_timer, m_server, m_step_time_counter, MOD_REASON_BLOCK_EXPIRED, MOD_STATE_WRITE_AT_UNLOAD, OnMapblocksChangedReceiver::modified_blocks, ScriptApiNode::node_on_timer(), ScriptApiEnv::on_mapblocks_changed(), p(), PARTICLE_SPAWNER_NO_EXPIRY, PEER_ID_INEXISTENT, MapBlock::raiseModified(), OnMapblocksChangedReceiver::receiving, ActiveBlockList::remove(), removeRemovedObjects(), MapBlock::resetUsageTimer(), Server::sendDetachedInventories(), Server::SendInventory(), MetricGauge::set(), MapBlock::setTimestamp(), MapBlock::setTimestampNoChangedFlag(), ActiveBlockList::size(), SPT_AVG, IntervalLimiter::step(), MapBlock::step(), server::ActiveObjectMgr::step(), ServerScripting::stepAsync(), Environment::stepTimeOfDay(), TimeTaker::stop(), ActiveBlockList::update(), and warningstream.
Referenced by Server::AsyncRunStep(), TestSAO::testActivate(), TestSAO::testNotSaved(), TestSAO::testStaticSave(), TestSAO::testStaticToFalse(), and TestSAO::testStaticToTrue().
References Map::addNodeWithEvent(), m_map, p(), and ServerMap::updateVManip().
|
private |
Referenced by ~ServerEnvironment(), addActiveBlockModifier(), and step().
|
private |
Referenced by ServerEnvironment(), and step().
|
private |
Referenced by step().
|
private |
Referenced by ~ServerEnvironment(), deactivateBlocksAndObjects(), deactivateFarObjects(), getBlockStatus(), getForceloadedBlocks(), and step().
|
private |
Referenced by step().
|
private |
Referenced by step().
|
private |
Referenced by ServerEnvironment(), and step().
|
private |
Referenced by getActiveObjectMessage(), and step().
|
private |
|
private |
Referenced by ~ServerEnvironment(), getAuthDatabase(), and init().
|
private |
Referenced by loadPlayer(), and step().
|
private |
Referenced by activateBlock(), clearObjects(), getGameTime(), loadDefaultMeta(), loadMeta(), saveMeta(), and step().
|
private |
Referenced by step().
|
private |
Referenced by activateBlock(), clearObjects(), loadMeta(), and saveMeta().
|
private |
Referenced by activateBlock(), addLoadingBlockModifierDef(), loadDefaultMeta(), loadMeta(), and saveMeta().
|
private |
Referenced by ~ServerEnvironment(), addActiveObjectRaw(), clearObjects(), deactivateFarObjects(), deleteStaticFromBlock(), findSunlight(), getBlockStatus(), getMap(), getServerMap(), init(), removeNode(), removeRemovedObjects(), saveStaticToBlock(), setNode(), setStaticForActiveObjectsInBlock(), step(), and swapNode().
|
private |
Referenced by getMaxLagEstimate(), and reportMaxLagEstimate().
|
private |
Referenced by loadMeta(), and saveMeta().
|
private |
Referenced by step().
|
private |
|
private |
Referenced by step().
|
private |
Referenced by addParticleSpawner(), and deleteParticleSpawner().
|
private |
Referenced by addParticleSpawner(), deleteParticleSpawner(), and step().
|
private |
Referenced by addParticleSpawner().
|
private |
Referenced by ~ServerEnvironment(), init(), loadPlayer(), removePlayerFromDatabase(), saveLoadedPlayers(), and savePlayer().
|
private |
Referenced by ~ServerEnvironment(), addPlayer(), getPlayer(), getPlayer(), getPlayerCount(), getPlayers(), removePlayer(), saveLoadedPlayers(), and step().
|
private |
Referenced by getSendRecommendedInterval(), and step().
|
private |
Referenced by activateBlock(), addActiveObjectRaw(), getScriptIface(), init(), processActiveObjectRemove(), removeNode(), setNode(), and step().
|
private |
Referenced by step().
|
private |
Referenced by findSunlight(), getGameDef(), init(), loadDefaultMeta(), loadMeta(), loadPlayer(), removeNode(), saveMeta(), setNode(), and step().
|
private |
Referenced by ServerEnvironment(), and step().