20#include <unordered_map>
21#include <unordered_set>
248 float dtime, std::vector<PrioritySortedBlockTransfer> &dest);
274 return insert_result.second;
279 o<<
"RemoteClient "<<
peer_id<<
": "
316 void setVersionInfo(u8 major, u8 minor, u8 patch,
const std::string &full);
451 void step(
float dtime);
497 const std::string &full);
505 assert(
m_env == NULL);
526 std::shared_ptr<con::IConnection>
m_con;
Definition clientiface.h:511
RecursiveMutexAutoLock m_lock
Definition clientiface.h:516
AutoLock(ClientInterface &iface)
Definition clientiface.h:513
Definition clientiface.h:442
float m_check_linger_timer
Definition clientiface.h:536
RemoteClientMap & getClientList()
Definition clientiface.h:519
~ClientInterface()
Definition clientiface.cpp:647
std::shared_ptr< con::IConnection > m_con
Definition clientiface.h:526
void CreateClient(session_t peer_id)
Definition clientiface.cpp:872
ClientState getClientState(session_t peer_id)
Definition clientiface.cpp:820
std::vector< std::string > m_clients_names
Definition clientiface.h:530
void send(session_t peer_id, NetworkPacket *pkt)
Definition clientiface.cpp:760
static std::string state2Name(ClientState state)
Definition clientiface.cpp:49
RemoteClient * getClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition clientiface.cpp:791
void sendToAll(NetworkPacket *pkt)
Definition clientiface.cpp:777
void event(session_t peer_id, ClientStateEvent event)
Definition clientiface.cpp:887
void markBlocksNotSent(const std::vector< v3s16 > &positions)
Definition clientiface.cpp:675
const std::vector< std::string > & getPlayerNames() const
Definition clientiface.h:463
std::vector< session_t > getClientIDs(ClientState min_state=CS_Active)
Definition clientiface.cpp:662
u16 getProtocolVersion(session_t peer_id)
Definition clientiface.cpp:909
void setEnv(ServerEnvironment *env)
Definition clientiface.h:503
ServerEnvironment * m_env
Definition clientiface.h:533
std::recursive_mutex m_clients_mutex
Definition clientiface.h:527
float m_print_info_timer
Definition clientiface.h:535
RemoteClient * lockedGetClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition clientiface.cpp:806
void setClientVersion(session_t peer_id, u8 major, u8 minor, u8 patch, const std::string &full)
Definition clientiface.cpp:923
void DeleteClient(session_t peer_id)
Definition clientiface.cpp:842
bool isUserLimitReached()
Verify if user limit was reached.
Definition clientiface.cpp:689
static constexpr int LINGER_TIMEOUT
Definition clientiface.h:540
void setPlayerName(session_t peer_id, const std::string &name)
Definition clientiface.cpp:832
void step(float dtime)
Definition clientiface.cpp:694
void UpdatePlayerList()
Definition clientiface.cpp:731
void sendCustom(session_t peer_id, u8 channel, NetworkPacket *pkt, bool reliable)
Definition clientiface.cpp:768
ClientInterface(const std::shared_ptr< con::IConnection > &con)
Definition clientiface.cpp:639
RemoteClientMap m_clients
Definition clientiface.h:529
static const char * statenames[]
Definition clientiface.h:36
Definition networkpacket.h:14
Definition clientiface.h:213
void confirmSerializationVersion()
Definition clientiface.h:309
const Address & getAddress() const
Definition clientiface.h:328
bool isMechAllowed(AuthMechanism mech)
Definition clientiface.h:234
u8 getMinor() const
Definition clientiface.h:320
void setPendingSerializationVersion(u8 version)
Definition clientiface.h:306
const s16 m_block_optimize_distance
Definition clientiface.h:374
u8 m_version_major
Definition clientiface.h:428
void GetNextBlocks(ServerEnvironment *env, EmergeManager *emerge, float dtime, std::vector< PrioritySortedBlockTransfer > &dest)
Definition clientiface.cpp:85
void setDynamicInfo(const ClientDynamicInfo &info)
Definition clientiface.h:330
const s16 m_max_gen_distance
Definition clientiface.h:376
void SetBlockNotSent(v3s16 p)
Definition clientiface.cpp:438
u8 getMajor() const
Definition clientiface.h:319
void PrintInfo(std::ostream &o)
Definition clientiface.h:277
u32 getSendingCount() const
Definition clientiface.h:265
std::string enc_pwd
Definition clientiface.h:226
std::string m_full_version
Definition clientiface.h:432
const s16 m_block_cull_optimize_distance
Definition clientiface.h:375
ClientState m_state
Definition clientiface.h:338
void SetBlocksNotSent(const std::vector< v3s16 > &blocks)
Definition clientiface.cpp:448
ClientDynamicInfo m_dynamic_info
Definition clientiface.h:347
v3s16 m_last_center
Definition clientiface.h:368
const std::string & getName() const
Definition clientiface.h:298
u32 allowed_auth_mechs
Definition clientiface.h:230
const s16 m_max_send_distance
Definition clientiface.h:373
std::unordered_set< v3s16 > m_blocks_occ
Definition clientiface.h:365
void ResendBlockIfOnWire(v3s16 p)
tell client about this block being modified right now.
Definition clientiface.cpp:68
s16 m_nearest_unsent_d
Definition clientiface.h:367
void setName(const std::string &name)
Definition clientiface.h:300
void setCachedAddress(const Address &addr)
Definition clientiface.h:327
std::string m_lang_code
Definition clientiface.h:344
void setVersionInfo(u8 major, u8 minor, u8 patch, const std::string &full)
Definition clientiface.cpp:626
void * auth_data
Definition clientiface.h:229
bool create_player_on_auth_success
Definition clientiface.h:227
u8 m_version_minor
Definition clientiface.h:429
u8 m_version_patch
Definition clientiface.h:430
const ClientDynamicInfo & getDynamicInfo() const
Definition clientiface.h:331
float m_map_send_completion_timer
Definition clientiface.h:418
const float m_min_time_from_building
Definition clientiface.h:372
u32 m_excess_gotblocks
Definition clientiface.h:412
bool markMediaSent(const std::string &name)
Definition clientiface.h:272
RemoteClient()
Definition clientiface.cpp:54
const u64 m_connection_time
Definition clientiface.h:437
const std::string & getLangCode() const
Definition clientiface.h:325
u8 m_pending_serialization_version
Definition clientiface.h:335
float m_time_from_building
Definition clientiface.h:289
session_t peer_id
Definition clientiface.h:219
void SentBlock(v3s16 p)
Definition clientiface.cpp:429
u16 net_proto_version
Definition clientiface.h:223
std::unordered_set< v3s16 > m_blocks_modified
Definition clientiface.h:403
ClientState getState() const
Definition clientiface.h:296
std::unordered_set< v3s16 > m_blocks_sent
Definition clientiface.h:358
void resetChosenMech()
Definition clientiface.cpp:609
void setEncryptedPassword(const std::string &pwd)
Definition clientiface.cpp:618
u8 serialization_version
Definition clientiface.h:221
const std::string & getFullVer() const
Definition clientiface.h:322
bool isBlockSent(v3s16 p) const
Definition clientiface.h:267
std::set< u16 > m_known_objects
Definition clientiface.h:294
Address m_addr
Definition clientiface.h:341
v3f m_last_camera_dir
Definition clientiface.h:369
u8 getPatch() const
Definition clientiface.h:321
void GotBlock(v3s16 p)
Definition clientiface.cpp:417
void setLangCode(const std::string &code)
Definition clientiface.cpp:634
std::string m_name
Definition clientiface.h:423
void notifyEvent(ClientStateEvent event)
Definition clientiface.cpp:460
const u16 m_max_simul_sends
Definition clientiface.h:371
u64 uptime() const
Definition clientiface.h:313
std::unordered_map< v3s16, float > m_blocks_sending
Definition clientiface.h:393
std::unordered_set< std::string > m_media_sent
Definition clientiface.h:383
const bool m_occ_cull
Definition clientiface.h:377
AuthMechanism chosen_mech
Definition clientiface.h:228
float m_nothing_to_send_pause_timer
Definition clientiface.h:415
Definition serverenvironment.h:219
ClientState
Definition clientiface.h:164
@ CS_HelloSent
Definition clientiface.h:169
@ CS_Disconnecting
Definition clientiface.h:166
@ CS_Denied
Definition clientiface.h:167
@ CS_Active
Definition clientiface.h:173
@ CS_DefinitionsSent
Definition clientiface.h:172
@ CS_AwaitingInit2
Definition clientiface.h:170
@ CS_Created
Definition clientiface.h:168
@ CS_SudoMode
Definition clientiface.h:174
@ CS_InitDone
Definition clientiface.h:171
@ CS_Invalid
Definition clientiface.h:165
ClientStateEvent
Definition clientiface.h:178
@ CSE_SetClientReady
Definition clientiface.h:184
@ CSE_AuthAccept
Definition clientiface.h:180
@ CSE_SetDefinitionsSent
Definition clientiface.h:183
@ CSE_Hello
Definition clientiface.h:179
@ CSE_GotInit2
Definition clientiface.h:181
@ CSE_SudoLeave
Definition clientiface.h:186
@ CSE_SudoSuccess
Definition clientiface.h:185
@ CSE_Disconnect
Definition clientiface.h:187
@ CSE_SetDenied
Definition clientiface.h:182
std::unordered_map< u16, RemoteClient * > RemoteClientMap
Definition clientiface.h:440
#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
Definition clientdynamicinfo.h:12
Definition clientiface.h:196
bool operator<(const PrioritySortedBlockTransfer &other) const
Definition clientiface.h:203
float priority
Definition clientiface.h:207
PrioritySortedBlockTransfer(float a_priority, const v3s16 &a_pos, session_t a_peer_id)
Definition clientiface.h:197
v3s16 pos
Definition clientiface.h:208
session_t peer_id
Definition clientiface.h:209
static std::string p(std::string path)
Definition test_filesys.cpp:53