21#include <unordered_map>
22#include <unordered_set>
249 float dtime, std::vector<PrioritySortedBlockTransfer> &dest);
275 return insert_result.second;
280 o<<
"RemoteClient "<<
peer_id<<
": "
317 void setVersionInfo(u8 major, u8 minor, u8 patch,
const std::string &full);
452 void step(
float dtime);
498 const std::string &full);
506 assert(
m_env == NULL);
527 std::shared_ptr<con::IConnection>
m_con;
Definition clientiface.h:512
RecursiveMutexAutoLock m_lock
Definition clientiface.h:517
AutoLock(ClientInterface &iface)
Definition clientiface.h:514
Definition clientiface.h:443
float m_check_linger_timer
Definition clientiface.h:537
RemoteClientMap & getClientList()
Definition clientiface.h:520
~ClientInterface()
Definition clientiface.cpp:644
std::shared_ptr< con::IConnection > m_con
Definition clientiface.h:527
void CreateClient(session_t peer_id)
Definition clientiface.cpp:869
ClientState getClientState(session_t peer_id)
Definition clientiface.cpp:817
std::vector< std::string > m_clients_names
Definition clientiface.h:531
void send(session_t peer_id, NetworkPacket *pkt)
Definition clientiface.cpp:757
static std::string state2Name(ClientState state)
Definition clientiface.cpp:48
RemoteClient * getClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition clientiface.cpp:788
void sendToAll(NetworkPacket *pkt)
Definition clientiface.cpp:774
void event(session_t peer_id, ClientStateEvent event)
Definition clientiface.cpp:884
void markBlocksNotSent(const std::vector< v3s16 > &positions)
Definition clientiface.cpp:672
const std::vector< std::string > & getPlayerNames() const
Definition clientiface.h:464
std::vector< session_t > getClientIDs(ClientState min_state=CS_Active)
Definition clientiface.cpp:659
u16 getProtocolVersion(session_t peer_id)
Definition clientiface.cpp:906
void setEnv(ServerEnvironment *env)
Definition clientiface.h:504
ServerEnvironment * m_env
Definition clientiface.h:534
std::recursive_mutex m_clients_mutex
Definition clientiface.h:528
float m_print_info_timer
Definition clientiface.h:536
RemoteClient * lockedGetClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition clientiface.cpp:803
void setClientVersion(session_t peer_id, u8 major, u8 minor, u8 patch, const std::string &full)
Definition clientiface.cpp:920
void DeleteClient(session_t peer_id)
Definition clientiface.cpp:839
bool isUserLimitReached()
Verify if user limit was reached.
Definition clientiface.cpp:686
static constexpr int LINGER_TIMEOUT
Definition clientiface.h:541
void setPlayerName(session_t peer_id, const std::string &name)
Definition clientiface.cpp:829
void step(float dtime)
Definition clientiface.cpp:691
void UpdatePlayerList()
Definition clientiface.cpp:728
void sendCustom(session_t peer_id, u8 channel, NetworkPacket *pkt, bool reliable)
Definition clientiface.cpp:765
ClientInterface(const std::shared_ptr< con::IConnection > &con)
Definition clientiface.cpp:636
RemoteClientMap m_clients
Definition clientiface.h:530
static const char * statenames[]
Definition clientiface.h:35
Definition networkpacket.h:14
Definition clientiface.h:214
void confirmSerializationVersion()
Definition clientiface.h:310
const Address & getAddress() const
Definition clientiface.h:329
bool isMechAllowed(AuthMechanism mech)
Definition clientiface.h:235
u8 getMinor() const
Definition clientiface.h:321
void setPendingSerializationVersion(u8 version)
Definition clientiface.h:307
const s16 m_block_optimize_distance
Definition clientiface.h:375
u8 m_version_major
Definition clientiface.h:429
void GetNextBlocks(ServerEnvironment *env, EmergeManager *emerge, float dtime, std::vector< PrioritySortedBlockTransfer > &dest)
Definition clientiface.cpp:82
void setDynamicInfo(const ClientDynamicInfo &info)
Definition clientiface.h:331
const s16 m_max_gen_distance
Definition clientiface.h:377
void SetBlockNotSent(v3s16 p)
Definition clientiface.cpp:435
u8 getMajor() const
Definition clientiface.h:320
void PrintInfo(std::ostream &o)
Definition clientiface.h:278
u32 getSendingCount() const
Definition clientiface.h:266
std::string enc_pwd
Definition clientiface.h:227
std::string m_full_version
Definition clientiface.h:433
const s16 m_block_cull_optimize_distance
Definition clientiface.h:376
ClientState m_state
Definition clientiface.h:339
void SetBlocksNotSent(const std::vector< v3s16 > &blocks)
Definition clientiface.cpp:445
ClientDynamicInfo m_dynamic_info
Definition clientiface.h:348
v3s16 m_last_center
Definition clientiface.h:369
const std::string & getName() const
Definition clientiface.h:299
u32 allowed_auth_mechs
Definition clientiface.h:231
const s16 m_max_send_distance
Definition clientiface.h:374
std::unordered_set< v3s16 > m_blocks_occ
Definition clientiface.h:366
void ResendBlockIfOnWire(v3s16 p)
tell client about this block being modified right now.
Definition clientiface.cpp:65
s16 m_nearest_unsent_d
Definition clientiface.h:368
void setName(const std::string &name)
Definition clientiface.h:301
void setCachedAddress(const Address &addr)
Definition clientiface.h:328
std::string m_lang_code
Definition clientiface.h:345
void setVersionInfo(u8 major, u8 minor, u8 patch, const std::string &full)
Definition clientiface.cpp:623
void * auth_data
Definition clientiface.h:230
bool create_player_on_auth_success
Definition clientiface.h:228
u8 m_version_minor
Definition clientiface.h:430
u8 m_version_patch
Definition clientiface.h:431
const ClientDynamicInfo & getDynamicInfo() const
Definition clientiface.h:332
float m_map_send_completion_timer
Definition clientiface.h:419
const float m_min_time_from_building
Definition clientiface.h:373
u32 m_excess_gotblocks
Definition clientiface.h:413
bool markMediaSent(const std::string &name)
Definition clientiface.h:273
RemoteClient()
Definition clientiface.cpp:53
const u64 m_connection_time
Definition clientiface.h:438
const std::string & getLangCode() const
Definition clientiface.h:326
u8 m_pending_serialization_version
Definition clientiface.h:336
float m_time_from_building
Definition clientiface.h:290
session_t peer_id
Definition clientiface.h:220
void SentBlock(v3s16 p)
Definition clientiface.cpp:426
u16 net_proto_version
Definition clientiface.h:224
std::unordered_set< v3s16 > m_blocks_modified
Definition clientiface.h:404
ClientState getState() const
Definition clientiface.h:297
std::unordered_set< v3s16 > m_blocks_sent
Definition clientiface.h:359
void resetChosenMech()
Definition clientiface.cpp:606
void setEncryptedPassword(const std::string &pwd)
Definition clientiface.cpp:615
u8 serialization_version
Definition clientiface.h:222
const std::string & getFullVer() const
Definition clientiface.h:323
bool isBlockSent(v3s16 p) const
Definition clientiface.h:268
std::set< u16 > m_known_objects
Definition clientiface.h:295
Address m_addr
Definition clientiface.h:342
v3f m_last_camera_dir
Definition clientiface.h:370
u8 getPatch() const
Definition clientiface.h:322
void GotBlock(v3s16 p)
Definition clientiface.cpp:414
void setLangCode(const std::string &code)
Definition clientiface.cpp:631
std::string m_name
Definition clientiface.h:424
void notifyEvent(ClientStateEvent event)
Definition clientiface.cpp:457
const u16 m_max_simul_sends
Definition clientiface.h:372
u64 uptime() const
Definition clientiface.h:314
std::unordered_map< v3s16, float > m_blocks_sending
Definition clientiface.h:394
std::unordered_set< std::string > m_media_sent
Definition clientiface.h:384
const bool m_occ_cull
Definition clientiface.h:378
AuthMechanism chosen_mech
Definition clientiface.h:229
float m_nothing_to_send_pause_timer
Definition clientiface.h:416
Definition serverenvironment.h:219
ClientState
Definition clientiface.h:165
@ CS_HelloSent
Definition clientiface.h:170
@ CS_Disconnecting
Definition clientiface.h:167
@ CS_Denied
Definition clientiface.h:168
@ CS_Active
Definition clientiface.h:174
@ CS_DefinitionsSent
Definition clientiface.h:173
@ CS_AwaitingInit2
Definition clientiface.h:171
@ CS_Created
Definition clientiface.h:169
@ CS_SudoMode
Definition clientiface.h:175
@ CS_InitDone
Definition clientiface.h:172
@ CS_Invalid
Definition clientiface.h:166
ClientStateEvent
Definition clientiface.h:179
@ CSE_SetClientReady
Definition clientiface.h:185
@ CSE_AuthAccept
Definition clientiface.h:181
@ CSE_SetDefinitionsSent
Definition clientiface.h:184
@ CSE_Hello
Definition clientiface.h:180
@ CSE_GotInit2
Definition clientiface.h:182
@ CSE_SudoLeave
Definition clientiface.h:187
@ CSE_SudoSuccess
Definition clientiface.h:186
@ CSE_Disconnect
Definition clientiface.h:188
@ CSE_SetDenied
Definition clientiface.h:183
std::unordered_map< u16, RemoteClient * > RemoteClientMap
Definition clientiface.h:441
#define PEER_ID_INEXISTENT
Definition constants.h:19
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
std::lock_guard< std::recursive_mutex > RecursiveMutexAutoLock
Definition mutex_auto_lock.h:33
u64 getTimeS()
Definition porting.h:168
AuthMechanism
Definition networkprotocol.h:888
@ AUTH_MECHANISM_NONE
Definition networkprotocol.h:890
u16 session_t
Definition networkprotocol.h:22
#define SER_FMT_VER_INVALID
Definition serialization.h:54
Definition clientdynamicinfo.h:12
Definition clientiface.h:197
bool operator<(const PrioritySortedBlockTransfer &other) const
Definition clientiface.h:204
float priority
Definition clientiface.h:208
PrioritySortedBlockTransfer(float a_priority, const v3s16 &a_pos, session_t a_peer_id)
Definition clientiface.h:198
v3s16 pos
Definition clientiface.h:209
session_t peer_id
Definition clientiface.h:210
static std::string p(std::string path)
Definition test_filesys.cpp:53