Luanti 5.18.0-dev
Loading...
Searching...
No Matches
RemoteClient Class Reference

#include <clientiface.h>

Collaboration diagram for RemoteClient:

Public Member Functions

void resetChosenMech ()
bool isMechAllowed (AuthMechanism mech)
void setEncryptedPassword (const std::string &pwd)
 RemoteClient ()
 ~RemoteClient ()=default
void GetNextBlocks (ServerEnvironment *env, EmergeManager *emerge, float dtime, std::vector< PrioritySortedBlockTransfer > &dest)
void GotBlock (v3s16 p)
void SentBlock (v3s16 p)
void SetBlockNotSent (v3s16 p, bool low_priority=false)
void SetBlocksNotSent (const std::vector< v3s16 > &blocks, bool low_priority=false)
void fixupNodePrediction (InteractAction action, const PointedThing &pointed, bool prediction_success)
 Trigger block sending to undo client-side predicted node changes.
u32 getSendingCount () const
bool isBlockSent (v3s16 p) const
bool markMediaSent (const std::string &name)
void PrintInfo (std::ostream &o)
ClientState getState () const
const std::string & getName () const
void setName (const std::string &name)
void notifyEvent (ClientStateEvent event)
void setPendingSerializationVersion (u8 version)
void confirmSerializationVersion ()
u64 uptime () const
void setVersionInfo (u8 major, u8 minor, u8 patch, const std::string &full)
u8 getMajor () const
u8 getMinor () const
u8 getPatch () const
const std::string & getFullVer () const
void setLangCode (const std::string &code)
const std::string & getLangCode () const
void setCachedAddress (const Address &addr)
const Address & getAddress () const
void setDynamicInfo (const ClientDynamicInfo &info)
const ClientDynamicInfo & getDynamicInfo () const

Public Attributes

session_t peer_id = PEER_ID_INEXISTENT
u8 serialization_version
u16 net_proto_version = 0
std::string enc_pwd = ""
bool create_player_on_auth_success = false
AuthMechanism chosen_mech = AUTH_MECHANISM_NONE
void * auth_data = nullptr
u32 allowed_auth_mechs = 0
float m_time_from_building = 9999
std::set< u16 > m_known_objects

Private Attributes

u8 m_pending_serialization_version
ClientState m_state = CS_Created
Address m_addr
std::string m_lang_code
ClientDynamicInfo m_dynamic_info {}
std::unordered_set< v3s16 > m_blocks_sent
std::unordered_set< v3s16 > m_blocks_occ
s16 m_nearest_unsent_d = 0
v3s16 m_last_center
v3f m_last_camera_dir
const u16 m_max_simul_sends
const float m_min_time_from_building
const s16 m_max_send_distance
const s16 m_block_optimize_distance
const s16 m_block_cull_optimize_distance
const s16 m_max_gen_distance
const bool m_occ_cull
std::unordered_set< std::string > m_media_sent
std::unordered_set< v3s16 > m_blocks_sending
u32 m_excess_gotblocks = 0
float m_nothing_to_send_pause_timer = 0.0f
float m_map_send_completion_timer = 0.0f
std::string m_name = ""
u8 m_version_major = 0
u8 m_version_minor = 0
u8 m_version_patch = 0
std::string m_full_version = "unknown"
const u64 m_connection_time

Constructor & Destructor Documentation

◆ RemoteClient()

◆ ~RemoteClient()

RemoteClient::~RemoteClient ( )
default

References p().

Here is the call graph for this function:

Member Function Documentation

◆ confirmSerializationVersion()

void RemoteClient::confirmSerializationVersion ( )
inline

References m_pending_serialization_version, and serialization_version.

Referenced by notifyEvent().

Here is the caller graph for this function:

◆ fixupNodePrediction()

void RemoteClient::fixupNodePrediction ( InteractAction action,
const PointedThing & pointed,
bool prediction_success )

Trigger block sending to undo client-side predicted node changes.

Parameters
actionThe interact action to determine which predictions the client could have made
pointedThe pointed thing
prediction_successIf true, assume that the client has made a correct prediction and send the mapblock only if an outdated mapblock is currently "on wire", which can erroneously override the prediction

References getNodeBlockPos(), INTERACT_DIGGING_COMPLETED, INTERACT_PLACE, m_blocks_sending, PointedThing::node_abovesurface, PointedThing::node_undersurface, POINTEDTHING_NODE, SetBlockNotSent(), and PointedThing::type.

Referenced by Server::handleCommand_Interact().

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

◆ getAddress()

const Address & RemoteClient::getAddress ( ) const
inline

References m_addr.

Referenced by Server::getPeerAddress().

Here is the caller graph for this function:

◆ getDynamicInfo()

const ClientDynamicInfo & RemoteClient::getDynamicInfo ( ) const
inline

References m_dynamic_info.

◆ getFullVer()

const std::string & RemoteClient::getFullVer ( ) const
inline

References m_full_version.

◆ getLangCode()

const std::string & RemoteClient::getLangCode ( ) const
inline

References m_lang_code.

◆ getMajor()

u8 RemoteClient::getMajor ( ) const
inline

References m_version_major.

◆ getMinor()

u8 RemoteClient::getMinor ( ) const
inline

References m_version_minor.

◆ getName()

const std::string & RemoteClient::getName ( ) const
inline

References m_name.

Referenced by Server::sendDetachedInventories().

Here is the caller graph for this function:

◆ GetNextBlocks()

void RemoteClient::GetNextBlocks ( ServerEnvironment * env,
EmergeManager * emerge,
float dtime,
std::vector< PrioritySortedBlockTransfer > & dest )

◆ getPatch()

u8 RemoteClient::getPatch ( ) const
inline

References m_version_patch.

◆ getSendingCount()

u32 RemoteClient::getSendingCount ( ) const
inline

References m_blocks_sending.

◆ getState()

ClientState RemoteClient::getState ( ) const
inline

References m_state.

◆ GotBlock()

void RemoteClient::GotBlock ( v3s16 p)

References m_blocks_sending, m_blocks_sent, m_excess_gotblocks, and p().

Here is the call graph for this function:

◆ isBlockSent()

bool RemoteClient::isBlockSent ( v3s16 p) const
inline

References m_blocks_sent, and p().

Here is the call graph for this function:

◆ isMechAllowed()

bool RemoteClient::isMechAllowed ( AuthMechanism mech)
inline

References allowed_auth_mechs.

◆ markMediaSent()

bool RemoteClient::markMediaSent ( const std::string & name)
inline

References m_media_sent.

◆ notifyEvent()

void RemoteClient::notifyEvent ( ClientStateEvent event)

◆ PrintInfo()

void RemoteClient::PrintInfo ( std::ostream & o)
inline

◆ resetChosenMech()

void RemoteClient::resetChosenMech ( )

References auth_data, AUTH_MECHANISM_NONE, chosen_mech, and srp_verifier_delete().

Referenced by notifyEvent().

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

◆ SentBlock()

void RemoteClient::SentBlock ( v3s16 p)

References infostream, m_blocks_sending, and p().

Here is the call graph for this function:

◆ SetBlockNotSent()

void RemoteClient::SetBlockNotSent ( v3s16 p,
bool low_priority = false )

References m_block_cull_optimize_distance, m_blocks_sending, m_blocks_sent, m_last_center, m_nearest_unsent_d, m_nothing_to_send_pause_timer, and p().

Referenced by fixupNodePrediction(), and SetBlocksNotSent().

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

◆ SetBlocksNotSent()

void RemoteClient::SetBlocksNotSent ( const std::vector< v3s16 > & blocks,
bool low_priority = false )

References p(), and SetBlockNotSent().

Here is the call graph for this function:

◆ setCachedAddress()

void RemoteClient::setCachedAddress ( const Address & addr)
inline

References m_addr.

◆ setDynamicInfo()

void RemoteClient::setDynamicInfo ( const ClientDynamicInfo & info)
inline

References m_dynamic_info.

◆ setEncryptedPassword()

void RemoteClient::setEncryptedPassword ( const std::string & pwd)

References allowed_auth_mechs, AUTH_MECHANISM_SRP, enc_pwd, FATAL_ERROR_IF, and str_starts_with().

Here is the call graph for this function:

◆ setLangCode()

void RemoteClient::setLangCode ( const std::string & code)

References m_lang_code, and string_sanitize_ascii().

Here is the call graph for this function:

◆ setName()

void RemoteClient::setName ( const std::string & name)
inline

References m_name.

◆ setPendingSerializationVersion()

void RemoteClient::setPendingSerializationVersion ( u8 version)
inline

◆ setVersionInfo()

void RemoteClient::setVersionInfo ( u8 major,
u8 minor,
u8 patch,
const std::string & full )

References m_full_version, m_version_major, m_version_minor, m_version_patch, and string_sanitize_ascii().

Here is the call graph for this function:

◆ uptime()

u64 RemoteClient::uptime ( ) const

References porting::getTimeS(), and m_connection_time.

Here is the call graph for this function:

Member Data Documentation

◆ allowed_auth_mechs

u32 RemoteClient::allowed_auth_mechs = 0

◆ auth_data

void* RemoteClient::auth_data = nullptr

Referenced by resetChosenMech().

◆ chosen_mech

AuthMechanism RemoteClient::chosen_mech = AUTH_MECHANISM_NONE

Referenced by resetChosenMech().

◆ create_player_on_auth_success

bool RemoteClient::create_player_on_auth_success = false

◆ enc_pwd

std::string RemoteClient::enc_pwd = ""

Referenced by setEncryptedPassword().

◆ m_addr

Address RemoteClient::m_addr
private

Referenced by getAddress(), and setCachedAddress().

◆ m_block_cull_optimize_distance

const s16 RemoteClient::m_block_cull_optimize_distance
private

◆ m_block_optimize_distance

const s16 RemoteClient::m_block_optimize_distance
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_blocks_occ

std::unordered_set<v3s16> RemoteClient::m_blocks_occ
private

Referenced by GetNextBlocks().

◆ m_blocks_sending

std::unordered_set<v3s16> RemoteClient::m_blocks_sending
private

◆ m_blocks_sent

std::unordered_set<v3s16> RemoteClient::m_blocks_sent
private

◆ m_connection_time

const u64 RemoteClient::m_connection_time
private

Referenced by RemoteClient(), and uptime().

◆ m_dynamic_info

ClientDynamicInfo RemoteClient::m_dynamic_info {}
private

Referenced by getDynamicInfo(), and setDynamicInfo().

◆ m_excess_gotblocks

u32 RemoteClient::m_excess_gotblocks = 0
private

Referenced by GotBlock(), and PrintInfo().

◆ m_full_version

std::string RemoteClient::m_full_version = "unknown"
private

Referenced by getFullVer(), and setVersionInfo().

◆ m_known_objects

std::set<u16> RemoteClient::m_known_objects

◆ m_lang_code

std::string RemoteClient::m_lang_code
private

Referenced by getLangCode(), and setLangCode().

◆ m_last_camera_dir

v3f RemoteClient::m_last_camera_dir
private

Referenced by GetNextBlocks().

◆ m_last_center

v3s16 RemoteClient::m_last_center
private

Referenced by GetNextBlocks(), and SetBlockNotSent().

◆ m_map_send_completion_timer

float RemoteClient::m_map_send_completion_timer = 0.0f
private

Referenced by GetNextBlocks(), and PrintInfo().

◆ m_max_gen_distance

const s16 RemoteClient::m_max_gen_distance
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_max_send_distance

const s16 RemoteClient::m_max_send_distance
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_max_simul_sends

const u16 RemoteClient::m_max_simul_sends
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_media_sent

std::unordered_set<std::string> RemoteClient::m_media_sent
private

Referenced by markMediaSent().

◆ m_min_time_from_building

const float RemoteClient::m_min_time_from_building
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_name

std::string RemoteClient::m_name = ""
private

Referenced by getName(), GetNextBlocks(), and setName().

◆ m_nearest_unsent_d

s16 RemoteClient::m_nearest_unsent_d = 0
private

◆ m_nothing_to_send_pause_timer

float RemoteClient::m_nothing_to_send_pause_timer = 0.0f
private

Referenced by GetNextBlocks(), and SetBlockNotSent().

◆ m_occ_cull

const bool RemoteClient::m_occ_cull
private

Referenced by RemoteClient(), and GetNextBlocks().

◆ m_pending_serialization_version

u8 RemoteClient::m_pending_serialization_version
private

◆ m_state

ClientState RemoteClient::m_state = CS_Created
private

Referenced by getState(), and notifyEvent().

◆ m_time_from_building

float RemoteClient::m_time_from_building = 9999

◆ m_version_major

u8 RemoteClient::m_version_major = 0
private

Referenced by getMajor(), and setVersionInfo().

◆ m_version_minor

u8 RemoteClient::m_version_minor = 0
private

Referenced by getMinor(), and setVersionInfo().

◆ m_version_patch

u8 RemoteClient::m_version_patch = 0
private

Referenced by getPatch(), and setVersionInfo().

◆ net_proto_version

u16 RemoteClient::net_proto_version = 0

◆ peer_id

session_t RemoteClient::peer_id = PEER_ID_INEXISTENT

Referenced by GetNextBlocks(), and PrintInfo().

◆ serialization_version

u8 RemoteClient::serialization_version

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