#include <clientenvironment.h>
|
| ClientEnvironment (ClientMap *map, ITextureSource *texturesource, Client *client) |
|
| ~ClientEnvironment () |
|
Map & | getMap () |
|
ClientMap & | getClientMap () |
|
Client * | getGameDef () |
|
void | setScript (ClientScripting *script) |
|
void | step (f32 dtime) |
|
virtual void | setLocalPlayer (LocalPlayer *player) |
|
LocalPlayer * | getLocalPlayer () const |
|
void | addSimpleObject (ClientSimpleObject *simple) |
|
GenericCAO * | getGenericCAO (u16 id) |
|
ClientActiveObject * | getActiveObject (u16 id) |
|
u16 | addActiveObject (ClientActiveObject *object) |
|
void | addActiveObject (u16 id, u8 type, const std::string &init_data) |
|
void | removeActiveObject (u16 id) |
|
void | processActiveObjectMessage (u16 id, const std::string &data) |
|
void | damageLocalPlayer (u16 damage, bool handle_hp=true) |
|
void | getActiveObjects (const v3f &origin, f32 max_d, std::vector< DistanceSortedActiveObject > &dest) |
|
bool | hasClientEnvEvents () const |
|
ClientEnvEvent | getClientEnvEvent () |
|
virtual void | getSelectedActiveObjects (const core::line3d< f32 > &shootline_on_map, std::vector< PointedThing > &objects) |
|
const std::list< std::string > & | getPlayerNames () |
|
void | addPlayerName (const std::string &name) |
|
void | removePlayerName (const std::string &name) |
|
void | updateCameraOffset (const v3s16 &camera_offset) |
|
v3s16 | getCameraOffset () const |
|
| 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 () |
|
◆ ClientEnvironment()
◆ ~ClientEnvironment()
ClientEnvironment::~ClientEnvironment |
( |
| ) |
|
◆ addActiveObject() [1/2]
◆ addActiveObject() [2/2]
void ClientEnvironment::addActiveObject |
( |
u16 |
id, |
|
|
u8 |
type, |
|
|
const std::string & |
init_data |
|
) |
| |
References addActiveObject(), ClientActiveObject::create(), errorstream, getActiveObject(), ClientActiveObject::getAttachmentChildIds(), infostream, ClientActiveObject::initialize(), m_client, serializeJsonString(), ActiveObject::setId(), and BaseException::what().
◆ addPlayerName()
void ClientEnvironment::addPlayerName |
( |
const std::string & |
name | ) |
|
|
inline |
◆ addSimpleObject()
◆ damageLocalPlayer()
void ClientEnvironment::damageLocalPlayer |
( |
u16 |
damage, |
|
|
bool |
handle_hp = true |
|
) |
| |
◆ getActiveObject()
References ActiveObjectMgr< T >::getActiveObject(), and m_ao_manager.
Referenced by addActiveObject(), GenericCAO::clearChildAttachments(), getGenericCAO(), GenericCAO::getParent(), Client::handleCommand_PlaySound(), processActiveObjectMessage(), removeActiveObject(), GenericCAO::setAttachment(), Client::step(), GenericCAO::step(), and ParticleSpawner::step().
◆ getActiveObjects()
◆ getCameraOffset()
v3s16 ClientEnvironment::getCameraOffset |
( |
| ) |
const |
|
inline |
◆ getClientEnvEvent()
◆ getClientMap()
ClientMap & ClientEnvironment::getClientMap |
( |
| ) |
|
◆ getGameDef()
Client* ClientEnvironment::getGameDef |
( |
| ) |
|
|
inline |
◆ getGenericCAO()
GenericCAO * ClientEnvironment::getGenericCAO |
( |
u16 |
id | ) |
|
◆ getLocalPlayer()
LocalPlayer* ClientEnvironment::getLocalPlayer |
( |
| ) |
const |
|
inline |
References m_local_player.
Referenced by Client::afterContentReceived(), collisionMoveSimple(), Client::CSMClampPos(), Client::CSMClampRadius(), Client::CSMGetNode(), damageLocalPlayer(), PlayerInventoryFormSource::getForm(), Client::getFormspecPrepend(), Client::getHP(), Client::getInventory(), Client::getPlayerName(), Client::handleCommand_AuthAccept(), Client::handleCommand_Breath(), Client::handleCommand_EyeOffset(), Client::handleCommand_FormspecPrepend(), Client::handleCommand_Fov(), Client::handleCommand_HP(), Client::handleCommand_HudSetFlags(), Client::handleCommand_HudSetParam(), Client::handleCommand_Inventory(), Client::handleCommand_InventoryFormSpec(), Client::handleCommand_LocalPlayerAnimations(), Client::handleCommand_Movement(), Client::handleCommand_MovePlayer(), Client::handleCommand_PlayerSpeed(), GenericCAO::initialize(), Client::interact(), LuaCamera::l_get_look_horizontal(), LuaCamera::l_get_look_vertical(), LuaCamera::l_get_offset(), LuaCamera::l_set_camera_mode(), Client::loadMods(), Camera::notifyFovChange(), GameGlobalShaderConstantSetter::onSetConstants(), GenericCAO::processMessage(), Client::sendChangePassword(), Client::sendPlayerPos(), Client::setPlayerControl(), Client::setPlayerItem(), step(), Client::step(), GenericCAO::step(), and Client::updateWieldedItem().
◆ getMap()
Map & ClientEnvironment::getMap |
( |
| ) |
|
|
virtual |
Implements Environment.
References m_map.
Referenced by SmokePuffCSO::SmokePuffCSO(), Client::addNode(), Client::addUpdateMeshTask(), Client::CSMGetNode(), Client::getInventory(), Client::handleCommand_BlockData(), Client::handleCommand_NodemetaChanged(), Client::removeNode(), Client::step(), GenericCAO::step(), and GenericCAO::updateLight().
◆ getPlayerNames()
const std::list<std::string>& ClientEnvironment::getPlayerNames |
( |
| ) |
|
|
inline |
◆ getSelectedActiveObjects()
void ClientEnvironment::getSelectedActiveObjects |
( |
const core::line3d< f32 > & |
shootline_on_map, |
|
|
std::vector< PointedThing > & |
objects |
|
) |
| |
|
virtual |
◆ hasClientEnvEvents()
bool ClientEnvironment::hasClientEnvEvents |
( |
| ) |
const |
|
inline |
◆ processActiveObjectMessage()
void ClientEnvironment::processActiveObjectMessage |
( |
u16 |
id, |
|
|
const std::string & |
data |
|
) |
| |
◆ removeActiveObject()
void ClientEnvironment::removeActiveObject |
( |
u16 |
id | ) |
|
◆ removePlayerName()
void ClientEnvironment::removePlayerName |
( |
const std::string & |
name | ) |
|
|
inline |
◆ setLocalPlayer()
void ClientEnvironment::setLocalPlayer |
( |
LocalPlayer * |
player | ) |
|
|
virtual |
◆ setScript()
◆ step()
void ClientEnvironment::step |
( |
f32 |
dtime | ) |
|
|
virtual |
Implements Environment.
References LocalPlayer::applyControl(), Profiler::avg(), BS, Client::checkLocalPrivilege(), COLLISION_NODE, CONTENT_AIR, damageLocalPlayer(), ScriptApiClient::environment_step(), final_color_blend(), g_profiler, g_settings, Settings::getBool(), LocalPlayer::getCAO(), Environment::getDayNightRatio(), Client::getEventManager(), getInteriorLight(), LocalPlayer::getLightPosition(), getLocalPlayer(), Map::getNode(), Player::getSpeed(), ContentFeatures::groups, LocalPlayer::in_liquid, LocalPlayer::in_liquid_stable, LocalPlayer::is_climbing, GenericCAO::isImmortal(), itemgroup_get(), LocalPlayer::light_color, LocalPlayer::liquid_viscosity, m_active_object_light_update_interval, m_ao_manager, m_client, m_map, m_script, m_simple_objects, ClientSimpleObject::m_to_be_removed, Client::modsLoaded(), LocalPlayer::move(), Player::movement_gravity, Player::movement_liquid_fluidity, Player::movement_liquid_fluidity_smooth, Player::movement_liquid_sink, MYMIN, IGameDef::ndef(), p(), LocalPlayer::physics_override_gravity, MtEvent::PLAYER_FALLING_DAMAGE, MtEventManager::put(), Player::setSpeed(), ClientSimpleObject::step(), client::ActiveObjectMgr::step(), IntervalLimiter::step(), Environment::stepTimeOfDay(), LocalPlayer::swimming_pitch, LocalPlayer::swimming_vertical, and U16_MAX.
Referenced by Client::step().
◆ updateCameraOffset()
void ClientEnvironment::updateCameraOffset |
( |
const v3s16 & |
camera_offset | ) |
|
|
inline |
◆ m_active_object_light_update_interval
◆ m_ao_manager
◆ m_camera_offset
v3s16 ClientEnvironment::m_camera_offset |
|
private |
◆ m_client
Client* ClientEnvironment::m_client |
|
private |
◆ m_client_event_queue
◆ m_local_player
LocalPlayer* ClientEnvironment::m_local_player = nullptr |
|
private |
◆ m_map
◆ m_player_names
std::list<std::string> ClientEnvironment::m_player_names |
|
private |
◆ m_script
◆ m_simple_objects
◆ m_texturesource
The documentation for this class was generated from the following files: