Minetest  5.4.0
Client Class Reference

#include <client.h>

+ Inheritance diagram for Client:
+ Collaboration diagram for Client:

Public Member Functions

 Client (const char *playername, const std::string &password, const std::string &address_name, MapDrawControl &control, IWritableTextureSource *tsrc, IWritableShaderSource *shsrc, IWritableItemDefManager *itemdef, NodeDefManager *nodedef, ISoundManager *sound, MtEventManager *event, bool ipv6, GameUI *game_ui)
 
 ~Client ()
 
 DISABLE_CLASS_COPY (Client)
 
void scanModSubfolder (const std::string &mod_name, const std::string &mod_path, std::string mod_subpath)
 
void scanModIntoMemory (const std::string &mod_name, const std::string &mod_path)
 
void Stop ()
 
bool isShutdown ()
 
void connect (Address address, bool is_local_server)
 
void step (float dtime)
 
void handleCommand (NetworkPacket *pkt)
 
void handleCommand_Null (NetworkPacket *pkt)
 
void handleCommand_Deprecated (NetworkPacket *pkt)
 
void handleCommand_Hello (NetworkPacket *pkt)
 
void handleCommand_AuthAccept (NetworkPacket *pkt)
 
void handleCommand_AcceptSudoMode (NetworkPacket *pkt)
 
void handleCommand_DenySudoMode (NetworkPacket *pkt)
 
void handleCommand_AccessDenied (NetworkPacket *pkt)
 
void handleCommand_RemoveNode (NetworkPacket *pkt)
 
void handleCommand_AddNode (NetworkPacket *pkt)
 
void handleCommand_NodemetaChanged (NetworkPacket *pkt)
 
void handleCommand_BlockData (NetworkPacket *pkt)
 
void handleCommand_Inventory (NetworkPacket *pkt)
 
void handleCommand_TimeOfDay (NetworkPacket *pkt)
 
void handleCommand_ChatMessage (NetworkPacket *pkt)
 
void handleCommand_ActiveObjectRemoveAdd (NetworkPacket *pkt)
 
void handleCommand_ActiveObjectMessages (NetworkPacket *pkt)
 
void handleCommand_Movement (NetworkPacket *pkt)
 
void handleCommand_Fov (NetworkPacket *pkt)
 
void handleCommand_HP (NetworkPacket *pkt)
 
void handleCommand_Breath (NetworkPacket *pkt)
 
void handleCommand_MovePlayer (NetworkPacket *pkt)
 
void handleCommand_DeathScreen (NetworkPacket *pkt)
 
void handleCommand_AnnounceMedia (NetworkPacket *pkt)
 
void handleCommand_Media (NetworkPacket *pkt)
 
void handleCommand_NodeDef (NetworkPacket *pkt)
 
void handleCommand_ItemDef (NetworkPacket *pkt)
 
void handleCommand_PlaySound (NetworkPacket *pkt)
 
void handleCommand_StopSound (NetworkPacket *pkt)
 
void handleCommand_FadeSound (NetworkPacket *pkt)
 
void handleCommand_Privileges (NetworkPacket *pkt)
 
void handleCommand_InventoryFormSpec (NetworkPacket *pkt)
 
void handleCommand_DetachedInventory (NetworkPacket *pkt)
 
void handleCommand_ShowFormSpec (NetworkPacket *pkt)
 
void handleCommand_SpawnParticle (NetworkPacket *pkt)
 
void handleCommand_AddParticleSpawner (NetworkPacket *pkt)
 
void handleCommand_DeleteParticleSpawner (NetworkPacket *pkt)
 
void handleCommand_HudAdd (NetworkPacket *pkt)
 
void handleCommand_HudRemove (NetworkPacket *pkt)
 
void handleCommand_HudChange (NetworkPacket *pkt)
 
void handleCommand_HudSetFlags (NetworkPacket *pkt)
 
void handleCommand_HudSetParam (NetworkPacket *pkt)
 
void handleCommand_HudSetSky (NetworkPacket *pkt)
 
void handleCommand_HudSetSun (NetworkPacket *pkt)
 
void handleCommand_HudSetMoon (NetworkPacket *pkt)
 
void handleCommand_HudSetStars (NetworkPacket *pkt)
 
void handleCommand_CloudParams (NetworkPacket *pkt)
 
void handleCommand_OverrideDayNightRatio (NetworkPacket *pkt)
 
void handleCommand_LocalPlayerAnimations (NetworkPacket *pkt)
 
void handleCommand_EyeOffset (NetworkPacket *pkt)
 
void handleCommand_UpdatePlayerList (NetworkPacket *pkt)
 
void handleCommand_ModChannelMsg (NetworkPacket *pkt)
 
void handleCommand_ModChannelSignal (NetworkPacket *pkt)
 
void handleCommand_SrpBytesSandB (NetworkPacket *pkt)
 
void handleCommand_FormspecPrepend (NetworkPacket *pkt)
 
void handleCommand_CSMRestrictionFlags (NetworkPacket *pkt)
 
void handleCommand_PlayerSpeed (NetworkPacket *pkt)
 
void handleCommand_MediaPush (NetworkPacket *pkt)
 
void handleCommand_MinimapModes (NetworkPacket *pkt)
 
void ProcessData (NetworkPacket *pkt)
 
void Send (NetworkPacket *pkt)
 
void interact (InteractAction action, const PointedThing &pointed)
 
void sendNodemetaFields (v3s16 p, const std::string &formname, const StringMap &fields)
 
void sendInventoryFields (const std::string &formname, const StringMap &fields)
 
void sendInventoryAction (InventoryAction *a)
 
void sendChatMessage (const std::wstring &message)
 
void clearOutChatQueue ()
 
void sendChangePassword (const std::string &oldpassword, const std::string &newpassword)
 
void sendDamage (u16 damage)
 
void sendRespawn ()
 
void sendReady ()
 
ClientEnvironmentgetEnv ()
 
ITextureSourcetsrc ()
 
ISoundManagersound ()
 
const std::vector< ModSpec > & getMods () const override
 
const ModSpecgetModSpec (const std::string &modname) const override
 
void removeNode (v3s16 p)
 
MapNode CSMGetNode (v3s16 p, bool *is_valid_position)
 Helper function for Client Side Modding CSM restrictions are applied there, this should not be used for core engine. More...
 
int CSMClampRadius (v3s16 pos, int radius)
 
v3s16 CSMClampPos (v3s16 pos)
 
void addNode (v3s16 p, MapNode n, bool remove_metadata=true)
 
void setPlayerControl (PlayerControl &control)
 
bool updateWieldedItem ()
 
InventorygetInventory (const InventoryLocation &loc) override
 
void inventoryAction (InventoryAction *a) override
 
void setPlayerItem (u16 item)
 
const std::list< std::string > & getConnectedPlayerNames ()
 
float getAnimationTime ()
 
int getCrackLevel ()
 
v3s16 getCrackPos ()
 
void setCrack (int level, v3s16 pos)
 
u16 getHP ()
 
bool checkPrivilege (const std::string &priv) const
 
const std::unordered_set< std::string > & getPrivilegeList () const
 
bool getChatMessage (std::wstring &message)
 
void typeChatMessage (const std::wstring &message)
 
u64 getMapSeed ()
 
void addUpdateMeshTask (v3s16 blockpos, bool ack_to_server=false, bool urgent=false)
 
void addUpdateMeshTaskWithEdge (v3s16 blockpos, bool ack_to_server=false, bool urgent=false)
 
void addUpdateMeshTaskForNode (v3s16 nodepos, bool ack_to_server=false, bool urgent=false)
 
void updateCameraOffset (v3s16 camera_offset)
 
bool hasClientEvents () const
 
ClientEventgetClientEvent ()
 
bool accessDenied () const
 
bool reconnectRequested () const
 
void setFatalError (const std::string &reason)
 
const std::string & accessDeniedReason () const
 
const bool itemdefReceived () const
 
const bool nodedefReceived () const
 
const bool mediaReceived () const
 
const bool activeObjectsReceived () const
 
u16 getProtoVersion ()
 
void confirmRegistration ()
 
float mediaReceiveProgress ()
 
void afterContentReceived ()
 
float getRTT ()
 
float getCurRate ()
 
MinimapgetMinimap ()
 
void setCamera (Camera *camera)
 
CameragetCamera ()
 
bool shouldShowMinimap () const
 
IItemDefManagergetItemDefManager () override
 
const NodeDefManagergetNodeDefManager () override
 
ICraftDefManagergetCraftDefManager () override
 
ITextureSourcegetTextureSource ()
 
virtual IWritableShaderSourcegetShaderSource ()
 
u16 allocateUnknownNodeId (const std::string &name) override
 
virtual ISoundManagergetSoundManager ()
 
MtEventManagergetEventManager ()
 
virtual ParticleManagergetParticleManager ()
 
bool checkLocalPrivilege (const std::string &priv)
 
virtual scene::IAnimatedMesh * getMesh (const std::string &filename, bool cache=false)
 
const std::string * getModFile (std::string filename)
 
std::string getModStoragePath () const override
 
bool registerModStorage (ModMetadata *meta) override
 
void unregisterModStorage (const std::string &name) override
 
bool loadMedia (const std::string &data, const std::string &filename, bool from_media_push=false)
 
void request_media (const std::vector< std::string > &file_requests)
 
LocalClientState getState ()
 
void makeScreenshot ()
 
void pushToChatQueue (ChatMessage *cec)
 
ClientScriptinggetScript ()
 
const bool modsLoaded () const
 
void pushToEventQueue (ClientEvent *event)
 
void showMinimap (bool show=true)
 
const Address getServerAddress ()
 
const std::string & getAddressName () const
 
u64 getCSMRestrictionFlags () const
 
bool checkCSMRestrictionFlag (CSMRestrictionFlags flag) const
 
std::unordered_map< u32, u32 > & getHUDTranslationMap ()
 
bool joinModChannel (const std::string &channel) override
 
bool leaveModChannel (const std::string &channel) override
 
bool sendModChannelMessage (const std::string &channel, const std::string &message) override
 
ModChannelgetModChannel (const std::string &channel) override
 
const std::string & getFormspecPrepend () const
 
- Public Member Functions inherited from con::PeerHandler
 PeerHandler ()=default
 
virtual ~PeerHandler ()=default
 
- Public Member Functions inherited from InventoryManager
 InventoryManager ()=default
 
virtual ~InventoryManager ()=default
 
virtual void setInventoryModified (const InventoryLocation &loc)
 
- Public Member Functions inherited from IGameDef
virtual IRollbackManagergetRollbackManager ()
 
IItemDefManageridef ()
 
const NodeDefManagerndef ()
 
ICraftDefManagercdef ()
 
IRollbackManagerrollback ()
 
virtual std::string getWorldPath () const
 

Static Public Member Functions

static const std::string & getBuiltinLuaPath ()
 
static const std::string & getClientModsLuaPath ()
 

Public Attributes

bool m_is_registration_confirmation_state = false
 
bool m_simple_singleplayer_mode
 

Private Member Functions

void loadMods ()
 
void peerAdded (con::Peer *peer) override
 
void deletingPeer (con::Peer *peer, bool timeout) override
 
void initLocalMapSaving (const Address &address, const std::string &hostname, bool is_local_server)
 
void ReceiveAll ()
 
void sendPlayerPos ()
 
void deleteAuthData ()
 
void sendInit (const std::string &playerName)
 
void promptConfirmRegistration (AuthMechanism chosen_auth_mechanism)
 
void startAuth (AuthMechanism chosen_auth_mechanism)
 
void sendDeletedBlocks (std::vector< v3s16 > &blocks)
 
void sendGotBlocks (const std::vector< v3s16 > &blocks)
 
void sendRemovedSounds (std::vector< s32 > &soundList)
 
std::string getPlayerName ()
 
bool canSendChatMessage () const
 

Static Private Member Functions

static AuthMechanism choseAuthMech (const u32 mechs)
 

Private Attributes

float m_packetcounter_timer = 0.0f
 
float m_connection_reinit_timer = 0.1f
 
float m_avg_rtt_timer = 0.0f
 
float m_playerpos_send_timer = 0.0f
 
IntervalLimiter m_map_timer_and_unload_interval
 
IWritableTextureSourcem_tsrc
 
IWritableShaderSourcem_shsrc
 
IWritableItemDefManagerm_itemdef
 
NodeDefManagerm_nodedef
 
ISoundManagerm_sound
 
MtEventManagerm_event
 
MeshUpdateThread m_mesh_update_thread
 
ClientEnvironment m_env
 
ParticleManager m_particle_manager
 
std::unique_ptr< con::Connectionm_con
 
std::string m_address_name
 
Cameram_camera = nullptr
 
Minimapm_minimap = nullptr
 
bool m_minimap_disabled_by_server = false
 
u8 m_server_ser_ver
 
u16 m_proto_ver = 0
 
bool m_update_wielded_item = false
 
Inventorym_inventory_from_server = nullptr
 
float m_inventory_from_server_age = 0.0f
 
PacketCounter m_packetcounter
 
float m_animation_time = 0.0f
 
int m_crack_level = -1
 
v3s16 m_crack_pos
 
std::queue< std::wstring > m_out_chat_queue
 
u32 m_last_chat_message_sent
 
float m_chat_message_allowance = 5.0f
 
std::queue< ChatMessage * > m_chat_queue
 
u32 m_sudo_auth_methods
 
u64 m_map_seed = 0
 
std::string m_playername
 
std::string m_password
 
std::string m_new_password
 
AuthMechanism m_chosen_auth_mech
 
void * m_auth_data = nullptr
 
bool m_access_denied = false
 
bool m_access_denied_reconnect = false
 
std::string m_access_denied_reason = ""
 
std::queue< ClientEvent * > m_client_event_queue
 
bool m_itemdef_received = false
 
bool m_nodedef_received = false
 
bool m_activeobjects_received = false
 
bool m_mods_loaded = false
 
ClientMediaDownloaderm_media_downloader
 
std::unordered_set< std::string > m_media_pushed_files
 
bool m_time_of_day_set = false
 
float m_last_time_of_day_f = -1.0f
 
float m_time_of_day_update_timer = 0.0f
 
float m_recommended_send_interval = 0.1f
 
float m_removed_sounds_check_timer = 0.0f
 
std::unordered_map< s32, int > m_sounds_server_to_client
 
std::unordered_map< int, s32 > m_sounds_client_to_server
 
std::unordered_map< int, u16 > m_sounds_to_objects
 
std::unordered_map< u32, u32 > m_hud_server_to_client
 
std::unordered_set< std::string > m_privileges
 
std::unordered_map< std::string, Inventory * > m_detached_inventories
 
StringMap m_mesh_data
 
LocalClientState m_state
 
GameUIm_game_ui
 
MapDatabasem_localdb = nullptr
 
IntervalLimiter m_localdb_save_interval
 
u16 m_cache_save_interval
 
ClientScriptingm_script = nullptr
 
std::unordered_map< std::string, ModMetadata * > m_mod_storages
 
float m_mod_storage_save_timer = 10.0f
 
std::vector< ModSpecm_mods
 
StringMap m_mod_vfs
 
bool m_shutdown = false
 
u64 m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE
 
u32 m_csm_restriction_noderange = 8
 
std::unique_ptr< ModChannelMgrm_modchannel_mgr
 

Constructor & Destructor Documentation

◆ Client()

Client::Client ( const char *  playername,
const std::string &  password,
const std::string &  address_name,
MapDrawControl control,
IWritableTextureSource tsrc,
IWritableShaderSource shsrc,
IWritableItemDefManager itemdef,
NodeDefManager nodedef,
ISoundManager sound,
MtEventManager event,
bool  ipv6,
GameUI game_ui 
)

References g_settings, Settings::getBool(), Settings::getU16(), m_cache_save_interval, m_env, m_minimap, and ClientEnvironment::setLocalPlayer().

+ Here is the call graph for this function:

◆ ~Client()

Client::~Client ( )

Member Function Documentation

◆ accessDenied()

bool Client::accessDenied ( ) const
inline

References m_access_denied.

◆ accessDeniedReason()

const std::string& Client::accessDeniedReason ( ) const
inline

◆ activeObjectsReceived()

const bool Client::activeObjectsReceived ( ) const
inline

◆ addNode()

void Client::addNode ( v3s16  p,
MapNode  n,
bool  remove_metadata = true 
)

References Map::addNodeAndUpdate(), addUpdateMeshTaskWithEdge(), ClientEnvironment::getMap(), m_env, and p().

Referenced by handleCommand_AddNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUpdateMeshTask()

void Client::addUpdateMeshTask ( v3s16  blockpos,
bool  ack_to_server = false,
bool  urgent = false 
)

References Map::getBlockNoCreateNoEx(), ClientEnvironment::getMap(), m_env, m_mesh_update_thread, p(), and MeshUpdateThread::updateBlock().

Referenced by addUpdateMeshTaskForNode(), and addUpdateMeshTaskWithEdge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUpdateMeshTaskForNode()

void Client::addUpdateMeshTaskForNode ( v3s16  nodepos,
bool  ack_to_server = false,
bool  urgent = false 
)

References addUpdateMeshTask(), getNodeBlockPos(), infostream, MAP_BLOCKSIZE, and p().

Referenced by setCrack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUpdateMeshTaskWithEdge()

void Client::addUpdateMeshTaskWithEdge ( v3s16  blockpos,
bool  ack_to_server = false,
bool  urgent = false 
)

References addUpdateMeshTask(), g_6dirs, and p().

Referenced by addNode(), handleCommand_BlockData(), and removeNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterContentReceived()

◆ allocateUnknownNodeId()

u16 Client::allocateUnknownNodeId ( const std::string &  name)
overridevirtual

Implements IGameDef.

References CONTENT_IGNORE, errorstream, and FATAL_ERROR.

◆ canSendChatMessage()

bool Client::canSendChatMessage ( ) const
private

References CLIENT_CHAT_MESSAGE_LIMIT_PER_10S, m_chat_message_allowance, and m_last_chat_message_sent.

Referenced by sendChatMessage(), and step().

+ Here is the caller graph for this function:

◆ checkCSMRestrictionFlag()

bool Client::checkCSMRestrictionFlag ( CSMRestrictionFlags  flag) const
inline

References m_csm_restriction_flags.

Referenced by CSMClampPos(), CSMClampRadius(), CSMGetNode(), and loadMods().

+ Here is the caller graph for this function:

◆ checkLocalPrivilege()

bool Client::checkLocalPrivilege ( const std::string &  priv)
inline

References checkPrivilege().

Referenced by LocalPlayer::applyControl(), LocalPlayer::move(), LocalPlayer::old_move(), ClientMap::renderPostFx(), ClientEnvironment::step(), GenericCAO::step(), and Camera::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPrivilege()

bool Client::checkPrivilege ( const std::string &  priv) const
inline

References m_privileges.

Referenced by checkLocalPrivilege().

+ Here is the caller graph for this function:

◆ choseAuthMech()

AuthMechanism Client::choseAuthMech ( const u32  mechs)
staticprivate

References AUTH_MECHANISM_FIRST_SRP, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_NONE, and AUTH_MECHANISM_SRP.

Referenced by handleCommand_Hello(), and sendChangePassword().

+ Here is the caller graph for this function:

◆ clearOutChatQueue()

void Client::clearOutChatQueue ( )

References m_out_chat_queue.

Referenced by ModApiClient::l_clear_out_chat_queue().

+ Here is the caller graph for this function:

◆ confirmRegistration()

void Client::confirmRegistration ( )

References m_chosen_auth_mech, m_is_registration_confirmation_state, and startAuth().

Referenced by GUIConfirmRegistration::closeMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ connect()

void Client::connect ( Address  address,
bool  is_local_server 
)

References initLocalMapSaving(), m_address_name, and m_con.

+ Here is the call graph for this function:

◆ CSMClampPos()

v3s16 Client::CSMClampPos ( v3s16  pos)

References BS, checkCSMRestrictionFlag(), CSM_RF_LOOKUP_NODES, floatToInt(), ClientEnvironment::getLocalPlayer(), LocalPlayer::getPosition(), m_csm_restriction_noderange, and m_env.

+ Here is the call graph for this function:

◆ CSMClampRadius()

int Client::CSMClampRadius ( v3s16  pos,
int  radius 
)

References BS, checkCSMRestrictionFlag(), CSM_RF_LOOKUP_NODES, floatToInt(), ClientEnvironment::getLocalPlayer(), LocalPlayer::getPosition(), m_csm_restriction_noderange, and m_env.

+ Here is the call graph for this function:

◆ CSMGetNode()

MapNode Client::CSMGetNode ( v3s16  p,
bool *  is_valid_position 
)

Helper function for Client Side Modding CSM restrictions are applied there, this should not be used for core engine.

Parameters
p
is_valid_position
Returns

References BS, checkCSMRestrictionFlag(), CSM_RF_LOOKUP_NODES, floatToInt(), ClientEnvironment::getLocalPlayer(), ClientEnvironment::getMap(), Map::getNode(), LocalPlayer::getPosition(), m_csm_restriction_noderange, m_env, and p().

Referenced by ModApiClient::l_get_meta(), and ModApiClient::l_get_node_or_nil().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAuthData()

void Client::deleteAuthData ( )
private

References AUTH_MECHANISM_FIRST_SRP, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_NONE, AUTH_MECHANISM_SRP, m_auth_data, m_chosen_auth_mech, and srp_user_delete().

Referenced by ~Client(), handleCommand_AcceptSudoMode(), handleCommand_AuthAccept(), and handleCommand_DenySudoMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletingPeer()

void Client::deletingPeer ( con::Peer peer,
bool  timeout 
)
overrideprivatevirtual

◆ DISABLE_CLASS_COPY()

Client::DISABLE_CLASS_COPY ( Client  )

◆ getAddressName()

const std::string& Client::getAddressName ( ) const
inline

References m_address_name.

◆ getAnimationTime()

float Client::getAnimationTime ( )

References m_animation_time.

Referenced by ClientMap::renderMap().

+ Here is the caller graph for this function:

◆ getBuiltinLuaPath()

const std::string & Client::getBuiltinLuaPath ( )
static

References DIR_DELIM, and porting::path_share.

Referenced by loadMods().

+ Here is the caller graph for this function:

◆ getCamera()

Camera* Client::getCamera ( )
inline

References m_camera.

Referenced by GameGlobalShaderConstantSetter::onSetConstants(), GenericCAO::removeFromScene(), GenericCAO::setAttachment(), GenericCAO::updateMeshCulling(), and GenericCAO::updateNametag().

+ Here is the caller graph for this function:

◆ getChatMessage()

◆ getClientEvent()

ClientEvent * Client::getClientEvent ( )

◆ getClientModsLuaPath()

const std::string & Client::getClientModsLuaPath ( )
static

References DIR_DELIM, and porting::path_share.

Referenced by loadMods().

+ Here is the caller graph for this function:

◆ getConnectedPlayerNames()

const std::list<std::string>& Client::getConnectedPlayerNames ( )
inline

References ClientEnvironment::getPlayerNames(), and m_env.

Referenced by ModApiClient::l_get_player_names(), and GUIChatConsole::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCrackLevel()

int Client::getCrackLevel ( )

References m_crack_level.

Referenced by MeshUpdateQueue::addBlock(), and ClientMap::renderMap().

+ Here is the caller graph for this function:

◆ getCrackPos()

v3s16 Client::getCrackPos ( )

References m_crack_pos.

Referenced by MeshUpdateQueue::addBlock().

+ Here is the caller graph for this function:

◆ getCraftDefManager()

ICraftDefManager * Client::getCraftDefManager ( )
overridevirtual

Implements IGameDef.

◆ getCSMRestrictionFlags()

u64 Client::getCSMRestrictionFlags ( ) const
inline

References m_csm_restriction_flags.

Referenced by ModApiClient::l_get_csm_restrictions().

+ Here is the caller graph for this function:

◆ getCurRate()

float Client::getCurRate ( )

◆ getEnv()

ClientEnvironment& Client::getEnv ( )
inline

References m_env.

Referenced by PlayerInventoryFormSource::getForm(), LuaCamera::l_get_look_horizontal(), LuaCamera::l_get_look_vertical(), LuaCamera::l_get_offset(), LuaCamera::l_set_camera_mode(), Camera::notifyFovChange(), GameGlobalShaderConstantSetter::onSetConstants(), ClientMap::renderMap(), and Camera::update().

+ Here is the caller graph for this function:

◆ getEventManager()

MtEventManager * Client::getEventManager ( )

References m_event.

Referenced by LocalPlayer::applyControl(), LocalPlayer::move(), LocalPlayer::old_move(), Camera::step(), and ClientEnvironment::step().

+ Here is the caller graph for this function:

◆ getFormspecPrepend()

const std::string& Client::getFormspecPrepend ( ) const
inline

References Player::formspec_prepend, ClientEnvironment::getLocalPlayer(), and m_env.

+ Here is the call graph for this function:

◆ getHP()

u16 Client::getHP ( )

References ClientEnvironment::getLocalPlayer(), LocalPlayer::hp, and m_env.

+ Here is the call graph for this function:

◆ getHUDTranslationMap()

std::unordered_map<u32, u32>& Client::getHUDTranslationMap ( )
inline

◆ getInventory()

Inventory * Client::getInventory ( const InventoryLocation loc)
overridevirtual

Reimplemented from InventoryManager.

References InventoryLocation::CURRENT_PLAYER, InventoryLocation::DETACHED, FATAL_ERROR, NodeMetadata::getInventory(), ClientEnvironment::getLocalPlayer(), ClientEnvironment::getMap(), Player::getName(), Map::getNodeMetadata(), Player::inventory, m_detached_inventories, m_env, InventoryLocation::name, InventoryLocation::NODEMETA, InventoryLocation::p, InventoryLocation::PLAYER, InventoryLocation::type, and InventoryLocation::UNDEFINED.

Referenced by Game::openInventory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemDefManager()

IItemDefManager * Client::getItemDefManager ( )
overridevirtual

Implements IGameDef.

References m_itemdef.

◆ getMapSeed()

u64 Client::getMapSeed ( )
inline

References m_map_seed.

◆ getMesh()

scene::IAnimatedMesh * Client::getMesh ( const std::string &  filename,
bool  cache = false 
)
virtual

References errorstream, FATAL_ERROR_IF, RenderingEngine::get_filesystem(), RenderingEngine::get_mesh_cache(), RenderingEngine::get_scene_manager(), Buffer< T >::getSize(), and m_mesh_data.

Referenced by GenericCAO::addToScene(), and GUIFormSpecMenu::parseModel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMinimap()

Minimap* Client::getMinimap ( )
inline

References m_minimap.

Referenced by MapBlockMesh::MapBlockMesh(), GameGlobalShaderConstantSetter::onSetConstants(), GenericCAO::removeFromScene(), and GenericCAO::updateMarker().

+ Here is the caller graph for this function:

◆ getModChannel()

ModChannel * Client::getModChannel ( const std::string &  channel)
overridevirtual

Implements IGameDef.

References m_modchannel_mgr.

◆ getModFile()

const std::string * Client::getModFile ( std::string  filename)

References m_mod_vfs.

Referenced by ScriptApiBase::loadModFromMemory(), and ScriptApiSecurity::sl_g_loadfile().

+ Here is the caller graph for this function:

◆ getMods()

const std::vector< ModSpec > & Client::getMods ( ) const
overridevirtual

Implements IGameDef.

◆ getModSpec()

const ModSpec * Client::getModSpec ( const std::string &  modname) const
overridevirtual

Implements IGameDef.

◆ getModStoragePath()

std::string Client::getModStoragePath ( ) const
overridevirtual

Implements IGameDef.

References DIR_DELIM, and porting::path_user.

Referenced by step(), and unregisterModStorage().

+ Here is the caller graph for this function:

◆ getNodeDefManager()

const NodeDefManager * Client::getNodeDefManager ( )
overridevirtual

Implements IGameDef.

References m_nodedef.

Referenced by Minimap::Minimap().

+ Here is the caller graph for this function:

◆ getParticleManager()

ParticleManager * Client::getParticleManager ( )
virtual

References m_particle_manager.

Referenced by ModApiParticlesLocal::l_add_particlespawner().

+ Here is the caller graph for this function:

◆ getPlayerName()

std::string Client::getPlayerName ( )
inlineprivate

References ClientEnvironment::getLocalPlayer(), Player::getName(), and m_env.

Referenced by startAuth().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrivilegeList()

const std::unordered_set<std::string>& Client::getPrivilegeList ( ) const
inline

References m_privileges.

◆ getProtoVersion()

u16 Client::getProtoVersion ( )
inline

References m_proto_ver.

◆ getRTT()

float Client::getRTT ( )

References con::AVG_RTT, m_con, and PEER_ID_SERVER.

Referenced by step().

+ Here is the caller graph for this function:

◆ getScript()

ClientScripting* Client::getScript ( )
inline

References m_script.

Referenced by LocalFormspecHandler::gotText(), and Camera::successfullyCreated().

+ Here is the caller graph for this function:

◆ getServerAddress()

const Address Client::getServerAddress ( )

References m_con, and PEER_ID_SERVER.

Referenced by handleCommand_Hello().

+ Here is the caller graph for this function:

◆ getShaderSource()

IWritableShaderSource * Client::getShaderSource ( )
virtual

References m_shsrc.

Referenced by ClientEnvironment::ClientEnvironment(), Minimap::Minimap(), and GenericCAO::addToScene().

+ Here is the caller graph for this function:

◆ getSoundManager()

ISoundManager * Client::getSoundManager ( )
virtual

References m_sound.

Referenced by ModApiClient::l_sound_fade(), ModApiClient::l_sound_play(), ModApiClient::l_sound_stop(), and sound().

+ Here is the caller graph for this function:

◆ getState()

LocalClientState Client::getState ( )
inline

References m_state.

◆ getTextureSource()

ITextureSource * Client::getTextureSource ( )

References m_tsrc.

Referenced by Minimap::Minimap(), TextDrawer::TextDrawer(), TextDrawer::draw(), and tsrc().

+ Here is the caller graph for this function:

◆ handleCommand()

void Client::handleCommand ( NetworkPacket pkt)
inline

References NetworkPacket::getCommand(), ToClientCommandHandler::handler, and toClientCommandTable.

Referenced by ProcessData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleCommand_AcceptSudoMode()

void Client::handleCommand_AcceptSudoMode ( NetworkPacket pkt)

References AUTH_MECHANISM_FIRST_SRP, AUTH_MECHANISM_NONE, deleteAuthData(), m_chosen_auth_mech, m_new_password, m_password, startAuth(), and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_AccessDenied()

◆ handleCommand_ActiveObjectMessages()

void Client::handleCommand_ActiveObjectMessages ( NetworkPacket pkt)

References deSerializeString16(), errorstream, NetworkPacket::getSize(), NetworkPacket::getString(), m_env, ClientEnvironment::processActiveObjectMessage(), readU16(), and BaseException::what().

+ Here is the call graph for this function:

◆ handleCommand_ActiveObjectRemoveAdd()

void Client::handleCommand_ActiveObjectRemoveAdd ( NetworkPacket pkt)

References ClientEnvironment::addActiveObject(), infostream, m_activeobjects_received, m_env, NetworkPacket::readLongString(), ClientEnvironment::removeActiveObject(), and BaseException::what().

+ Here is the call graph for this function:

◆ handleCommand_AddNode()

void Client::handleCommand_AddNode ( NetworkPacket pkt)

References addNode(), MapNode::deSerialize(), NetworkPacket::getSize(), NetworkPacket::getU8(), NetworkPacket::getU8Ptr(), m_server_ser_ver, p(), and MapNode::serializedLength().

+ Here is the call graph for this function:

◆ handleCommand_AddParticleSpawner()

void Client::handleCommand_AddParticleSpawner ( NetworkPacket pkt)

References CE_ADD_PARTICLESPAWNER, deSerializeString32(), NetworkPacket::getSize(), NetworkPacket::getString(), m_client_event_queue, m_proto_ver, p(), readF32(), readU16(), readU32(), readU8(), and readV3F32().

+ Here is the call graph for this function:

◆ handleCommand_AnnounceMedia()

void Client::handleCommand_AnnounceMedia ( NetworkPacket pkt)

◆ handleCommand_AuthAccept()

void Client::handleCommand_AuthAccept ( NetworkPacket pkt)

References BS, deleteAuthData(), ClientEnvironment::getLocalPlayer(), infostream, LC_Init, m_env, m_map_seed, m_recommended_send_interval, m_state, m_sudo_auth_methods, Send(), LocalPlayer::setPosition(), and TOSERVER_INIT2.

+ Here is the call graph for this function:

◆ handleCommand_BlockData()

void Client::handleCommand_BlockData ( NetworkPacket pkt)

◆ handleCommand_Breath()

void Client::handleCommand_Breath ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), m_env, and LocalPlayer::setBreath().

+ Here is the call graph for this function:

◆ handleCommand_ChatMessage()

void Client::handleCommand_ChatMessage ( NetworkPacket pkt)

References CHATMESSAGE_TYPE_MAX, m_script, ChatMessage::message, modsLoaded(), ScriptApiClient::on_receiving_message(), pushToChatQueue(), ChatMessage::sender, ChatMessage::timestamp, ChatMessage::type, and wide_to_utf8().

+ Here is the call graph for this function:

◆ handleCommand_CloudParams()

void Client::handleCommand_CloudParams ( NetworkPacket pkt)

◆ handleCommand_CSMRestrictionFlags()

void Client::handleCommand_CSMRestrictionFlags ( NetworkPacket pkt)

References loadMods(), m_csm_restriction_flags, and m_csm_restriction_noderange.

+ Here is the call graph for this function:

◆ handleCommand_DeathScreen()

void Client::handleCommand_DeathScreen ( NetworkPacket pkt)

◆ handleCommand_DeleteParticleSpawner()

void Client::handleCommand_DeleteParticleSpawner ( NetworkPacket pkt)

◆ handleCommand_DenySudoMode()

void Client::handleCommand_DenySudoMode ( NetworkPacket pkt)

References CHATMESSAGE_TYPE_SYSTEM, deleteAuthData(), and pushToChatQueue().

+ Here is the call graph for this function:

◆ handleCommand_Deprecated()

void Client::handleCommand_Deprecated ( NetworkPacket pkt)

References NetworkPacket::getCommand(), NetworkPacket::getPeerId(), infostream, ToClientCommandHandler::name, and toClientCommandTable.

+ Here is the call graph for this function:

◆ handleCommand_DetachedInventory()

void Client::handleCommand_DetachedInventory ( NetworkPacket pkt)

References Inventory::deSerialize(), NetworkPacket::getRemainingBytes(), NetworkPacket::getRemainingString(), infostream, m_detached_inventories, and m_itemdef.

+ Here is the call graph for this function:

◆ handleCommand_EyeOffset()

void Client::handleCommand_EyeOffset ( NetworkPacket pkt)

References Player::eye_offset_first, Player::eye_offset_third, ClientEnvironment::getLocalPlayer(), and m_env.

+ Here is the call graph for this function:

◆ handleCommand_FadeSound()

void Client::handleCommand_FadeSound ( NetworkPacket pkt)

References ISoundManager::fadeSound(), m_sound, m_sounds_server_to_client, and step().

+ Here is the call graph for this function:

◆ handleCommand_FormspecPrepend()

void Client::handleCommand_FormspecPrepend ( NetworkPacket pkt)

References Player::formspec_prepend, ClientEnvironment::getLocalPlayer(), and m_env.

+ Here is the call graph for this function:

◆ handleCommand_Fov()

void Client::handleCommand_Fov ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), m_camera, m_env, Camera::notifyFovChange(), and Player::setFov().

+ Here is the call graph for this function:

◆ handleCommand_Hello()

◆ handleCommand_HP()

void Client::handleCommand_HP ( NetworkPacket pkt)

References CE_PLAYER_DAMAGE, ClientEnvironment::getLocalPlayer(), LocalPlayer::hp, m_client_event_queue, m_env, m_script, modsLoaded(), and ScriptApiClient::on_hp_modification().

+ Here is the call graph for this function:

◆ handleCommand_HudAdd()

void Client::handleCommand_HudAdd ( NetworkPacket pkt)

References CE_HUDADD, dir(), NetworkPacket::getSize(), NetworkPacket::getString(), and m_client_event_queue.

+ Here is the call graph for this function:

◆ handleCommand_HudChange()

◆ handleCommand_HudRemove()

void Client::handleCommand_HudRemove ( NetworkPacket pkt)

◆ handleCommand_HudSetFlags()

void Client::handleCommand_HudSetFlags ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), Minimap::getModeDef(), Minimap::getModeIndex(), HUD_FLAG_MINIMAP_RADAR_VISIBLE, HUD_FLAG_MINIMAP_VISIBLE, Player::hud_flags, m_env, m_minimap, m_minimap_disabled_by_server, MINIMAP_TYPE_RADAR, Minimap::nextMode(), Minimap::setModeIndex(), and MinimapModeDef::type.

+ Here is the call graph for this function:

◆ handleCommand_HudSetMoon()

◆ handleCommand_HudSetParam()

void Client::handleCommand_HudSetParam ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), LocalPlayer::hotbar_image, LocalPlayer::hotbar_selected_image, Player::hud_hotbar_itemcount, HUD_HOTBAR_ITEMCOUNT_MAX, HUD_PARAM_HOTBAR_IMAGE, HUD_PARAM_HOTBAR_ITEMCOUNT, HUD_PARAM_HOTBAR_SELECTED_IMAGE, m_env, and readS32().

+ Here is the call graph for this function:

◆ handleCommand_HudSetSky()

◆ handleCommand_HudSetStars()

◆ handleCommand_HudSetSun()

◆ handleCommand_Inventory()

void Client::handleCommand_Inventory ( NetworkPacket pkt)

References Inventory::deSerialize(), ClientEnvironment::getLocalPlayer(), NetworkPacket::getSize(), NetworkPacket::getString(), Player::inventory, m_env, m_inventory_from_server, m_inventory_from_server_age, and m_update_wielded_item.

+ Here is the call graph for this function:

◆ handleCommand_InventoryFormSpec()

void Client::handleCommand_InventoryFormSpec ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), Player::inventory_formspec, m_env, and NetworkPacket::readLongString().

+ Here is the call graph for this function:

◆ handleCommand_ItemDef()

void Client::handleCommand_ItemDef ( NetworkPacket pkt)

References decompressZlib(), IWritableItemDefManager::deSerialize(), NetworkPacket::getSize(), infostream, Thread::isRunning(), m_itemdef, m_itemdef_received, m_mesh_update_thread, NetworkPacket::readLongString(), and sanity_check.

+ Here is the call graph for this function:

◆ handleCommand_LocalPlayerAnimations()

void Client::handleCommand_LocalPlayerAnimations ( NetworkPacket pkt)

References ClientEnvironment::getLocalPlayer(), Player::local_animation_speed, Player::local_animations, and m_env.

+ Here is the call graph for this function:

◆ handleCommand_Media()

void Client::handleCommand_Media ( NetworkPacket pkt)

References ClientMediaDownloader::conventionalTransferDone(), errorstream, NetworkPacket::getSize(), infostream, Thread::isRunning(), ClientMediaDownloader::isStarted(), m_media_downloader, m_mesh_update_thread, NetworkPacket::readLongString(), and sanity_check.

+ Here is the call graph for this function:

◆ handleCommand_MediaPush()

void Client::handleCommand_MediaPush ( NetworkPacket pkt)

References SHA1::addBytes(), clientMediaUpdateCache(), SHA1::getDigest(), loadMedia(), m_media_pushed_files, NetworkPacket::readLongString(), string_allowed(), TEXTURENAME_ALLOWED_CHARS, and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_MinimapModes()

void Client::handleCommand_MinimapModes ( NetworkPacket pkt)

References Minimap::addMode(), Minimap::clearModes(), m_minimap, and Minimap::setModeIndex().

+ Here is the call graph for this function:

◆ handleCommand_ModChannelMsg()

void Client::handleCommand_ModChannelMsg ( NetworkPacket pkt)

References NetworkPacket::getPeerId(), m_modchannel_mgr, m_script, ScriptApiModChannels::on_modchannel_message(), and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_ModChannelSignal()

void Client::handleCommand_ModChannelSignal ( NetworkPacket pkt)

◆ handleCommand_Movement()

◆ handleCommand_MovePlayer()

void Client::handleCommand_MovePlayer ( NetworkPacket pkt)

References CE_PLAYER_FORCE_MOVE, ClientEnvironment::getLocalPlayer(), infostream, m_client_event_queue, m_env, and LocalPlayer::setPosition().

+ Here is the call graph for this function:

◆ handleCommand_NodeDef()

void Client::handleCommand_NodeDef ( NetworkPacket pkt)

References decompressZlib(), NodeDefManager::deSerialize(), NetworkPacket::getSize(), infostream, Thread::isRunning(), m_mesh_update_thread, m_nodedef, m_nodedef_received, NetworkPacket::readLongString(), and sanity_check.

+ Here is the call graph for this function:

◆ handleCommand_NodemetaChanged()

void Client::handleCommand_NodemetaChanged ( NetworkPacket pkt)

References NodeMetadataList::begin(), decompressZlib(), NodeMetadataList::deSerialize(), NodeMetadataList::end(), ClientEnvironment::getMap(), NetworkPacket::getSize(), Map::isValidPosition(), m_env, m_itemdef, NetworkPacket::readLongString(), and Map::setNodeMetadata().

+ Here is the call graph for this function:

◆ handleCommand_Null()

void Client::handleCommand_Null ( NetworkPacket pkt)
inline

◆ handleCommand_OverrideDayNightRatio()

void Client::handleCommand_OverrideDayNightRatio ( NetworkPacket pkt)

◆ handleCommand_PlayerSpeed()

void Client::handleCommand_PlayerSpeed ( NetworkPacket pkt)

References LocalPlayer::addVelocity(), ClientEnvironment::getLocalPlayer(), and m_env.

+ Here is the call graph for this function:

◆ handleCommand_PlaySound()

void Client::handleCommand_PlaySound ( NetworkPacket pkt)

References ClientEnvironment::getActiveObject(), ClientActiveObject::getPosition(), m_env, m_sound, m_sounds_client_to_server, m_sounds_server_to_client, m_sounds_to_objects, ISoundManager::playSound(), and ISoundManager::playSoundAt().

+ Here is the call graph for this function:

◆ handleCommand_Privileges()

void Client::handleCommand_Privileges ( NetworkPacket pkt)

References infostream, and m_privileges.

◆ handleCommand_RemoveNode()

void Client::handleCommand_RemoveNode ( NetworkPacket pkt)

References NetworkPacket::getSize(), p(), and removeNode().

+ Here is the call graph for this function:

◆ handleCommand_ShowFormSpec()

void Client::handleCommand_ShowFormSpec ( NetworkPacket pkt)

References CE_SHOW_FORMSPEC, m_client_event_queue, and NetworkPacket::readLongString().

+ Here is the call graph for this function:

◆ handleCommand_SpawnParticle()

void Client::handleCommand_SpawnParticle ( NetworkPacket pkt)

References CE_SPAWN_PARTICLE, NetworkPacket::getSize(), NetworkPacket::getString(), m_client_event_queue, m_proto_ver, and p().

+ Here is the call graph for this function:

◆ handleCommand_SrpBytesSandB()

void Client::handleCommand_SrpBytesSandB ( NetworkPacket pkt)

References AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_SRP, errorstream, infostream, m_auth_data, m_chosen_auth_mech, Send(), srp_user_process_challenge(), and TOSERVER_SRP_BYTES_M.

+ Here is the call graph for this function:

◆ handleCommand_StopSound()

void Client::handleCommand_StopSound ( NetworkPacket pkt)

References m_sound, m_sounds_server_to_client, and ISoundManager::stopSound().

+ Here is the call graph for this function:

◆ handleCommand_TimeOfDay()

void Client::handleCommand_TimeOfDay ( NetworkPacket pkt)

References NetworkPacket::getSize(), infostream, m_env, m_last_time_of_day_f, m_time_of_day_set, m_time_of_day_update_timer, Environment::setTimeOfDay(), and Environment::setTimeOfDaySpeed().

+ Here is the call graph for this function:

◆ handleCommand_UpdatePlayerList()

void Client::handleCommand_UpdatePlayerList ( NetworkPacket pkt)

References ClientEnvironment::addPlayerName(), m_env, PLAYER_LIST_ADD, PLAYER_LIST_INIT, PLAYER_LIST_REMOVE, and ClientEnvironment::removePlayerName().

+ Here is the call graph for this function:

◆ hasClientEvents()

bool Client::hasClientEvents ( ) const
inline

References m_client_event_queue.

◆ initLocalMapSaving()

void Client::initLocalMapSaving ( const Address address,
const std::string &  hostname,
bool  is_local_server 
)
private

References actionstream, Database::beginSave(), fs::CreateAllDirs(), g_settings, Settings::getBool(), fs::IsDir(), m_localdb, set_world_path, and str_replace().

Referenced by connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ interact()

void Client::interact ( InteractAction  action,
const PointedThing pointed 
)

References errorstream, ClientEnvironment::getClientMap(), ClientEnvironment::getLocalPlayer(), Player::getWieldIndex(), LC_Ready, m_env, m_state, NetworkPacket::putLongString(), Send(), PointedThing::serialize(), TOSERVER_INTERACT, and writePlayerPos().

+ Here is the call graph for this function:

◆ inventoryAction()

void Client::inventoryAction ( InventoryAction a)
overridevirtual

Reimplemented from InventoryManager.

References InventoryAction::clientApply(), and sendInventoryAction().

+ Here is the call graph for this function:

◆ isShutdown()

bool Client::isShutdown ( )

References Thread::isRunning(), m_mesh_update_thread, and m_shutdown.

+ Here is the call graph for this function:

◆ itemdefReceived()

const bool Client::itemdefReceived ( ) const
inline

References m_itemdef_received.

◆ joinModChannel()

bool Client::joinModChannel ( const std::string &  channel)
overridevirtual

Implements IGameDef.

References m_modchannel_mgr, Send(), and TOSERVER_MODCHANNEL_JOIN.

+ Here is the call graph for this function:

◆ leaveModChannel()

bool Client::leaveModChannel ( const std::string &  channel)
overridevirtual

Implements IGameDef.

References m_modchannel_mgr, Send(), and TOSERVER_MODCHANNEL_LEAVE.

+ Here is the call graph for this function:

◆ loadMedia()

bool Client::loadMedia ( const std::string &  data,
const std::string &  filename,
bool  from_media_push = false 
)

References errorstream, FATAL_ERROR_IF, g_client_translations, RenderingEngine::get_filesystem(), RenderingEngine::get_video_driver(), Buffer< T >::getSize(), IWritableTextureSource::insertSourceImage(), ISoundManager::loadSoundData(), Translations::loadTranslation(), m_mesh_data, m_sound, m_tsrc, removeStringEnd(), TRACESTREAM, and verbosestream.

Referenced by handleCommand_MediaPush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadMods()

◆ makeScreenshot()

void Client::makeScreenshot ( )

References CHATMESSAGE_TYPE_SYSTEM, fs::CreateDir(), DIR_DELIM, g_settings, Settings::get(), RenderingEngine::get_video_driver(), Settings::getS32(), infostream, fs::IsPathAbsolute(), itos(), MYMAX, MYMIN, porting::path_user, pushToChatQueue(), SCREENSHOT_MAX_SERIAL_TRIES, and utf8_to_wide().

Referenced by GUIFormSpecMenu::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mediaReceived()

const bool Client::mediaReceived ( ) const
inline

References m_media_downloader.

Referenced by afterContentReceived().

+ Here is the caller graph for this function:

◆ mediaReceiveProgress()

float Client::mediaReceiveProgress ( )

References ClientMediaDownloader::getProgress(), and m_media_downloader.

+ Here is the call graph for this function:

◆ modsLoaded()

const bool Client::modsLoaded ( ) const
inline

References m_mods_loaded.

Referenced by LocalFormspecHandler::gotText(), handleCommand_ChatMessage(), handleCommand_HP(), ClientEnvironment::step(), and Camera::successfullyCreated().

+ Here is the caller graph for this function:

◆ nodedefReceived()

const bool Client::nodedefReceived ( ) const
inline

References m_nodedef_received.

◆ peerAdded()

void Client::peerAdded ( con::Peer peer)
overrideprivatevirtual

Implements con::PeerHandler.

References con::Peer::id, and infostream.

◆ ProcessData()

void Client::ProcessData ( NetworkPacket pkt)

References PacketCounter::add(), g_profiler, NetworkPacket::getCommand(), NetworkPacket::getPeerId(), Profiler::graphAdd(), handleCommand(), infostream, m_packetcounter, m_server_ser_ver, PEER_ID_SERVER, SER_FMT_VER_INVALID, TOCLIENT_NUM_MSG_TYPES, TOCLIENT_STATE_NOT_CONNECTED, and toClientCommandTable.

Referenced by ReceiveAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ promptConfirmRegistration()

void Client::promptConfirmRegistration ( AuthMechanism  chosen_auth_mechanism)
private

References m_chosen_auth_mech, and m_is_registration_confirmation_state.

Referenced by handleCommand_Hello().

+ Here is the caller graph for this function:

◆ pushToChatQueue()

void Client::pushToChatQueue ( ChatMessage cec)
inline

References m_chat_queue.

Referenced by handleCommand_ChatMessage(), handleCommand_DenySudoMode(), ModApiClient::l_display_chat_message(), and makeScreenshot().

+ Here is the caller graph for this function:

◆ pushToEventQueue()

void Client::pushToEventQueue ( ClientEvent event)

References m_client_event_queue.

Referenced by ModApiParticlesLocal::l_add_particle(), ModApiParticlesLocal::l_add_particlespawner(), ModApiParticlesLocal::l_delete_particlespawner(), and ModApiClient::l_show_formspec().

+ Here is the caller graph for this function:

◆ ReceiveAll()

void Client::ReceiveAll ( )
private

References NetworkPacket::clear(), porting::getTimeMs(), infostream, m_con, ProcessData(), and BaseException::what().

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reconnectRequested()

bool Client::reconnectRequested ( ) const
inline

◆ registerModStorage()

bool Client::registerModStorage ( ModMetadata meta)
overridevirtual

Implements IGameDef.

References errorstream, ModMetadata::getModName(), and m_mod_storages.

+ Here is the call graph for this function:

◆ removeNode()

void Client::removeNode ( v3s16  p)

References addUpdateMeshTaskWithEdge(), ClientEnvironment::getMap(), m_env, p(), and Map::removeNodeAndUpdate().

Referenced by handleCommand_RemoveNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ request_media()

void Client::request_media ( const std::vector< std::string > &  file_requests)

References FATAL_ERROR_IF, infostream, Send(), TOSERVER_REQUEST_MEDIA, and writeU16().

+ Here is the call graph for this function:

◆ scanModIntoMemory()

void Client::scanModIntoMemory ( const std::string &  mod_name,
const std::string &  mod_path 
)
inline

References scanModSubfolder().

Referenced by loadMods().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scanModSubfolder()

void Client::scanModSubfolder ( const std::string &  mod_name,
const std::string &  mod_path,
std::string  mod_subpath 
)

References DIR_DELIM, DIR_DELIM_CHAR, errorstream, fs::GetDirListing(), infostream, m_mod_vfs, and fs::ReadFile().

Referenced by scanModIntoMemory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Send()

void Client::Send ( NetworkPacket pkt)

References ServerCommandFactory::channel, NetworkPacket::getCommand(), m_con, PEER_ID_SERVER, ServerCommandFactory::reliable, and serverCommandFactoryTable.

Referenced by handleCommand_AuthAccept(), handleCommand_SrpBytesSandB(), interact(), joinModChannel(), leaveModChannel(), request_media(), sendChatMessage(), sendDamage(), sendDeletedBlocks(), sendGotBlocks(), sendInit(), sendInventoryAction(), sendInventoryFields(), sendModChannelMessage(), sendNodemetaFields(), sendPlayerPos(), sendReady(), sendRemovedSounds(), sendRespawn(), setPlayerItem(), and startAuth().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendChangePassword()

void Client::sendChangePassword ( const std::string &  oldpassword,
const std::string &  newpassword 
)

References choseAuthMech(), ClientEnvironment::getLocalPlayer(), m_env, m_new_password, m_password, m_sudo_auth_methods, and startAuth().

Referenced by GUIPasswordChange::processInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendChatMessage()

void Client::sendChatMessage ( const std::wstring &  message)

References canSendChatMessage(), CLIENT_CHAT_MESSAGE_LIMIT_PER_10S, g_settings, Settings::getS16(), infostream, m_chat_message_allowance, m_last_chat_message_sent, m_out_chat_queue, Send(), and TOSERVER_CHAT_MESSAGE.

Referenced by ModApiClient::l_send_chat_message(), step(), and typeChatMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendDamage()

void Client::sendDamage ( u16  damage)

References Send(), and TOSERVER_DAMAGE.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendDeletedBlocks()

void Client::sendDeletedBlocks ( std::vector< v3s16 > &  blocks)
private

References Send(), and TOSERVER_DELETEDBLOCKS.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendGotBlocks()

void Client::sendGotBlocks ( const std::vector< v3s16 > &  blocks)
private

References Send(), and TOSERVER_GOTBLOCKS.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendInit()

void Client::sendInit ( const std::string &  playerName)
private

References CLIENT_PROTOCOL_VERSION_MAX, CLIENT_PROTOCOL_VERSION_MIN, NETPROTO_COMPRESSION_NONE, Send(), SER_FMT_VER_HIGHEST_READ, and TOSERVER_INIT.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendInventoryAction()

void Client::sendInventoryAction ( InventoryAction a)

References NetworkPacket::putRawString(), Send(), InventoryAction::serialize(), and TOSERVER_INVENTORY_ACTION.

Referenced by inventoryAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendInventoryFields()

void Client::sendInventoryFields ( const std::string &  formname,
const StringMap fields 
)

References FATAL_ERROR_IF, NetworkPacket::putLongString(), Send(), and TOSERVER_INVENTORY_FIELDS.

Referenced by TextDestPlayerInventory::gotText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendModChannelMessage()

bool Client::sendModChannelMessage ( const std::string &  channel,
const std::string &  message 
)
overridevirtual

Implements IGameDef.

References m_modchannel_mgr, Send(), STRING_MAX_LEN, TOSERVER_MODCHANNEL_MSG, and warningstream.

+ Here is the call graph for this function:

◆ sendNodemetaFields()

void Client::sendNodemetaFields ( v3s16  p,
const std::string &  formname,
const StringMap fields 
)

References FATAL_ERROR_IF, p(), NetworkPacket::putLongString(), Send(), and TOSERVER_NODEMETA_FIELDS.

Referenced by TextDestNodeMetadata::gotText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendPlayerPos()

void Client::sendPlayerPos ( )
private

References ClientMap::getCameraFov(), ClientEnvironment::getClientMap(), ClientMap::getControl(), ClientEnvironment::getLocalPlayer(), LocalPlayer::getPitch(), LocalPlayer::getPosition(), Player::getSpeed(), LocalPlayer::getYaw(), LocalPlayer::isDead(), Player::keyPressed, LocalPlayer::last_camera_fov, LocalPlayer::last_keyPressed, LocalPlayer::last_pitch, LocalPlayer::last_position, LocalPlayer::last_speed, LocalPlayer::last_wanted_range, LocalPlayer::last_yaw, m_activeobjects_received, m_env, Send(), TOSERVER_PLAYERPOS, MapDrawControl::wanted_range, and writePlayerPos().

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendReady()

void Client::sendReady ( )

References FORMSPEC_API_VERSION, g_version_hash, NetworkPacket::putRawString(), Send(), TOSERVER_CLIENT_READY, VERSION_MAJOR, VERSION_MINOR, and VERSION_PATCH.

Referenced by afterContentReceived().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendRemovedSounds()

void Client::sendRemovedSounds ( std::vector< s32 > &  soundList)
private

References Send(), and TOSERVER_REMOVED_SOUNDS.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendRespawn()

void Client::sendRespawn ( )

References Send(), and TOSERVER_RESPAWN.

Referenced by LocalFormspecHandler::gotText(), and ModApiClient::l_send_respawn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCamera()

void Client::setCamera ( Camera camera)
inline

References m_camera.

◆ setCrack()

void Client::setCrack ( int  level,
v3s16  pos 
)

References addUpdateMeshTaskForNode(), m_crack_level, and m_crack_pos.

+ Here is the call graph for this function:

◆ setFatalError()

void Client::setFatalError ( const std::string &  reason)
inline

References m_access_denied, and m_access_denied_reason.

Referenced by ScriptApiClient::environment_step().

+ Here is the caller graph for this function:

◆ setPlayerControl()

void Client::setPlayerControl ( PlayerControl control)

References Player::control, ClientEnvironment::getLocalPlayer(), and m_env.

+ Here is the call graph for this function:

◆ setPlayerItem()

void Client::setPlayerItem ( u16  item)

References ClientEnvironment::getLocalPlayer(), m_env, m_update_wielded_item, Send(), Player::setWieldIndex(), and TOSERVER_PLAYERITEM.

+ Here is the call graph for this function:

◆ shouldShowMinimap()

bool Client::shouldShowMinimap ( ) const

◆ showMinimap()

void Client::showMinimap ( bool  show = true)

References m_game_ui, and GameUI::showMinimap().

+ Here is the call graph for this function:

◆ sound()

ISoundManager* Client::sound ( )
inline

References getSoundManager().

Referenced by GenericCAO::step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startAuth()

void Client::startAuth ( AuthMechanism  chosen_auth_mechanism)
private

References AUTH_MECHANISM_FIRST_SRP, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_NONE, AUTH_MECHANISM_SRP, FATAL_ERROR_IF, generate_srp_verifier_and_salt(), getPlayerName(), lowercase(), m_auth_data, m_chosen_auth_mech, m_password, Send(), SRP_NG_2048, SRP_OK, SRP_SHA256, srp_user_new(), srp_user_start_authentication(), TOSERVER_FIRST_SRP, TOSERVER_SRP_BYTES_A, and translate_password().

Referenced by confirmRegistration(), handleCommand_AcceptSudoMode(), handleCommand_Hello(), and sendChangePassword().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void Client::step ( float  dtime)

References MeshUpdateResult::ack_block_to_server, Minimap::addBlock(), Database::beginSave(), canSendChatMessage(), CE_PLAYER_DAMAGE, CEE_PLAYER_DAMAGE, PacketCounter::clear(), MutexedQueue< T >::empty(), Database::endSave(), FATAL_ERROR_IF, g_profiler, g_settings, ClientEnvironment::getActiveObject(), Map::getBlockNoCreateNoEx(), ClientEnvironment::getClientEnvEvent(), Settings::getFloat(), ClientEnvironment::getLocalPlayer(), ClientEnvironment::getMap(), MapBlockMesh::getMesh(), getModStoragePath(), Player::getName(), ClientActiveObject::getPosition(), getRTT(), Settings::getS32(), Profiler::graphAdd(), ClientEnvironment::hasClientEnvEvents(), infostream, Player::inventory, ClientMediaDownloader::isDone(), ClientMediaDownloader::isStarted(), LC_Created, LC_Ready, m_animation_time, m_avg_rtt_timer, m_cache_save_interval, m_client_event_queue, m_connection_reinit_timer, m_env, m_inventory_from_server, m_inventory_from_server_age, m_is_registration_confirmation_state, m_localdb, m_localdb_save_interval, m_map_timer_and_unload_interval, m_media_downloader, m_mesh_update_thread, m_minimap, m_mod_storage_save_timer, m_mod_storages, m_out_chat_queue, m_packetcounter, m_packetcounter_timer, m_playerpos_send_timer, MeshUpdateThread::m_queue_out, m_recommended_send_interval, m_removed_sounds_check_timer, m_sound, m_sounds_client_to_server, m_sounds_server_to_client, m_sounds_to_objects, m_state, m_time_of_day_update_timer, m_update_wielded_item, MAX_TILE_LAYERS, MeshUpdateResult::mesh, MapBlock::mesh, MapBlockMesh::moveMinimapMapblock(), MeshUpdateResult::p, ClientEnvEvent::player_damage, MutexedQueue< T >::pop_frontNoEx(), PacketCounter::print(), ReceiveAll(), sendChatMessage(), sendDamage(), sendDeletedBlocks(), sendGotBlocks(), sendInit(), sendPlayerPos(), sendRemovedSounds(), ISoundManager::soundExists(), ClientMediaDownloader::step(), ClientEnvironment::step(), ISoundManager::step(), IntervalLimiter::step(), PacketCounter::sum(), Map::timerUpdate(), ClientEnvEvent::type, and ISoundManager::updateSoundPosition().

Referenced by handleCommand_FadeSound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stop()

void Client::Stop ( )

References Database::endSave(), infostream, m_localdb, m_mesh_update_thread, m_mods_loaded, m_script, m_shutdown, ScriptApiClient::on_shutdown(), and UpdateThread::stop().

+ Here is the call graph for this function:

◆ tsrc()

ITextureSource* Client::tsrc ( )
inline

References getTextureSource().

Referenced by SmokePuffCSO::SmokePuffCSO(), GenericCAO::step(), and GenericCAO::updateTextures().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typeChatMessage()

void Client::typeChatMessage ( const std::wstring &  message)

References m_mods_loaded, m_script, ScriptApiClient::on_sending_message(), sendChatMessage(), and wide_to_utf8().

Referenced by GUIChatConsole::OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterModStorage()

void Client::unregisterModStorage ( const std::string &  name)
overridevirtual

Implements IGameDef.

References getModStoragePath(), and m_mod_storages.

+ Here is the call graph for this function:

◆ updateCameraOffset()

void Client::updateCameraOffset ( v3s16  camera_offset)
inline

◆ updateWieldedItem()

bool Client::updateWieldedItem ( )

References Inventory::getList(), ClientEnvironment::getLocalPlayer(), Player::inventory, m_env, and m_update_wielded_item.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_access_denied

bool Client::m_access_denied = false
private

◆ m_access_denied_reason

std::string Client::m_access_denied_reason = ""
private

◆ m_access_denied_reconnect

bool Client::m_access_denied_reconnect = false
private

◆ m_activeobjects_received

bool Client::m_activeobjects_received = false
private

◆ m_address_name

std::string Client::m_address_name
private

Referenced by connect(), and getAddressName().

◆ m_animation_time

float Client::m_animation_time = 0.0f
private

Referenced by getAnimationTime(), and step().

◆ m_auth_data

void* Client::m_auth_data = nullptr
private

◆ m_avg_rtt_timer

float Client::m_avg_rtt_timer = 0.0f
private

Referenced by step().

◆ m_cache_save_interval

u16 Client::m_cache_save_interval
private

Referenced by Client(), and step().

◆ m_camera

Camera* Client::m_camera = nullptr
private

◆ m_chat_message_allowance

float Client::m_chat_message_allowance = 5.0f
private

◆ m_chat_queue

std::queue<ChatMessage *> Client::m_chat_queue
private

Referenced by getChatMessage(), and pushToChatQueue().

◆ m_chosen_auth_mech

◆ m_client_event_queue

◆ m_con

std::unique_ptr<con::Connection> Client::m_con
private

◆ m_connection_reinit_timer

float Client::m_connection_reinit_timer = 0.1f
private

Referenced by step().

◆ m_crack_level

int Client::m_crack_level = -1
private

Referenced by getCrackLevel(), and setCrack().

◆ m_crack_pos

v3s16 Client::m_crack_pos
private

Referenced by getCrackPos(), and setCrack().

◆ m_csm_restriction_flags

◆ m_csm_restriction_noderange

u32 Client::m_csm_restriction_noderange = 8
private

◆ m_detached_inventories

std::unordered_map<std::string, Inventory*> Client::m_detached_inventories
private

◆ m_env

◆ m_event

MtEventManager* Client::m_event
private

Referenced by getEventManager().

◆ m_game_ui

GameUI* Client::m_game_ui
private

Referenced by showMinimap().

◆ m_hud_server_to_client

std::unordered_map<u32, u32> Client::m_hud_server_to_client
private

◆ m_inventory_from_server

Inventory* Client::m_inventory_from_server = nullptr
private

◆ m_inventory_from_server_age

float Client::m_inventory_from_server_age = 0.0f
private

Referenced by handleCommand_Inventory(), and step().

◆ m_is_registration_confirmation_state

bool Client::m_is_registration_confirmation_state = false

◆ m_itemdef

◆ m_itemdef_received

bool Client::m_itemdef_received = false
private

◆ m_last_chat_message_sent

u32 Client::m_last_chat_message_sent
private

◆ m_last_time_of_day_f

float Client::m_last_time_of_day_f = -1.0f
private

Referenced by handleCommand_TimeOfDay().

◆ m_localdb

MapDatabase* Client::m_localdb = nullptr
private

◆ m_localdb_save_interval

IntervalLimiter Client::m_localdb_save_interval
private

Referenced by step().

◆ m_map_seed

u64 Client::m_map_seed = 0
private

◆ m_map_timer_and_unload_interval

IntervalLimiter Client::m_map_timer_and_unload_interval
private

Referenced by step().

◆ m_media_downloader

◆ m_media_pushed_files

std::unordered_set<std::string> Client::m_media_pushed_files
private

Referenced by handleCommand_MediaPush().

◆ m_mesh_data

StringMap Client::m_mesh_data
private

Referenced by getMesh(), and loadMedia().

◆ m_mesh_update_thread

◆ m_minimap

◆ m_minimap_disabled_by_server

bool Client::m_minimap_disabled_by_server = false
private

◆ m_mod_storage_save_timer

float Client::m_mod_storage_save_timer = 10.0f
private

Referenced by step().

◆ m_mod_storages

std::unordered_map<std::string, ModMetadata *> Client::m_mod_storages
private

◆ m_mod_vfs

StringMap Client::m_mod_vfs
private

Referenced by getModFile(), and scanModSubfolder().

◆ m_modchannel_mgr

◆ m_mods

std::vector<ModSpec> Client::m_mods
private

Referenced by loadMods().

◆ m_mods_loaded

bool Client::m_mods_loaded = false
private

◆ m_new_password

std::string Client::m_new_password
private

◆ m_nodedef

NodeDefManager* Client::m_nodedef
private

◆ m_nodedef_received

bool Client::m_nodedef_received = false
private

◆ m_out_chat_queue

std::queue<std::wstring> Client::m_out_chat_queue
private

◆ m_packetcounter

PacketCounter Client::m_packetcounter
private

Referenced by ProcessData(), and step().

◆ m_packetcounter_timer

float Client::m_packetcounter_timer = 0.0f
private

Referenced by step().

◆ m_particle_manager

ParticleManager Client::m_particle_manager
private

Referenced by getParticleManager().

◆ m_password

std::string Client::m_password
private

◆ m_playername

std::string Client::m_playername
private

◆ m_playerpos_send_timer

float Client::m_playerpos_send_timer = 0.0f
private

Referenced by step().

◆ m_privileges

std::unordered_set<std::string> Client::m_privileges
private

◆ m_proto_ver

◆ m_recommended_send_interval

float Client::m_recommended_send_interval = 0.1f
private

Referenced by handleCommand_AuthAccept(), and step().

◆ m_removed_sounds_check_timer

float Client::m_removed_sounds_check_timer = 0.0f
private

Referenced by step().

◆ m_script

◆ m_server_ser_ver

u8 Client::m_server_ser_ver
private

◆ m_shsrc

IWritableShaderSource* Client::m_shsrc
private

◆ m_shutdown

bool Client::m_shutdown = false
private

Referenced by ~Client(), isShutdown(), and Stop().

◆ m_simple_singleplayer_mode

bool Client::m_simple_singleplayer_mode

Referenced by handleCommand_Hello().

◆ m_sound

◆ m_sounds_client_to_server

std::unordered_map<int, s32> Client::m_sounds_client_to_server
private

Referenced by handleCommand_PlaySound(), and step().

◆ m_sounds_server_to_client

std::unordered_map<s32, int> Client::m_sounds_server_to_client
private

◆ m_sounds_to_objects

std::unordered_map<int, u16> Client::m_sounds_to_objects
private

Referenced by handleCommand_PlaySound(), and step().

◆ m_state

◆ m_sudo_auth_methods

u32 Client::m_sudo_auth_methods
private

◆ m_time_of_day_set

bool Client::m_time_of_day_set = false
private

Referenced by handleCommand_TimeOfDay().

◆ m_time_of_day_update_timer

float Client::m_time_of_day_update_timer = 0.0f
private

Referenced by handleCommand_TimeOfDay(), and step().

◆ m_tsrc

IWritableTextureSource* Client::m_tsrc
private

◆ m_update_wielded_item

bool Client::m_update_wielded_item = false
private

The documentation for this class was generated from the following files: