#include <clientiface.h>
Collaboration diagram for ClientInterface:Classes | |
| class | AutoLock |
Public Member Functions | |
| ClientInterface (const std::shared_ptr< con::IConnection > &con) | |
| ~ClientInterface () | |
| void | step (float dtime) |
| std::vector< session_t > | getClientIDs (ClientState min_state=CS_Active) |
| void | markBlocksNotSent (const std::vector< v3s16 > &positions) |
| bool | isUserLimitReached () |
| const std::vector< std::string > & | getPlayerNames () const |
| void | send (session_t peer_id, NetworkPacket *pkt) |
| void | sendCustom (session_t peer_id, u8 channel, NetworkPacket *pkt, bool reliable) |
| void | sendToAll (NetworkPacket *pkt, ClientState state_min=CS_Active) |
| void | DeleteClient (session_t peer_id) |
| void | CreateClient (session_t peer_id) |
| RemoteClient * | getClientNoEx (session_t peer_id, ClientState state_min=CS_Active) |
| RemoteClient * | lockedGetClientNoEx (session_t peer_id, ClientState state_min=CS_Active) |
| ClientState | getClientState (session_t peer_id) |
| u16 | getProtocolVersion (session_t peer_id) |
| void | event (session_t peer_id, ClientStateEvent event) |
| void | setEnv (ServerEnvironment *env) |
Static Public Member Functions | |
| static const char * | state2Name (ClientState state) |
Protected Member Functions | |
| RemoteClientMap & | getClientList () |
Private Member Functions | |
| void | UpdatePlayerList () |
Private Attributes | |
| std::shared_ptr< con::IConnection > | m_con |
| std::recursive_mutex | m_clients_mutex |
| RemoteClientMap | m_clients |
| std::vector< std::string > | m_clients_names |
| ServerEnvironment * | m_env = nullptr |
| float | m_print_info_timer = 0 |
| float | m_check_linger_timer = 0 |
Static Private Attributes | |
| static const char * | statenames [] |
| static constexpr int | LINGER_TIMEOUT = 12 |
Friends | |
| class | Server |
| ClientInterface::ClientInterface | ( | const std::shared_ptr< con::IConnection > & | con | ) |
| ClientInterface::~ClientInterface | ( | ) |
References m_clients, and m_clients_mutex.
| void ClientInterface::CreateClient | ( | session_t | peer_id | ) |
References m_clients, and m_clients_mutex.
Referenced by Server::peerAdded().
Here is the caller graph for this function:| void ClientInterface::DeleteClient | ( | session_t | peer_id | ) |
References ServerEnvironment::getActiveObject(), m_clients, m_clients_mutex, m_env, and ServerActiveObject::m_known_by_count.
Referenced by Server::DeleteClient().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientInterface::event | ( | session_t | peer_id, |
| ClientStateEvent | event ) |
References CSE_Disconnect, CSE_SetClientReady, CSE_SetDenied, event(), m_clients, m_clients_mutex, and UpdatePlayerList().
Referenced by Server::acceptAuth(), Server::deletingPeer(), Server::DenyAccess(), event(), Server::handleCommand_ClientReady(), Server::handleCommand_FirstSrp(), Server::handleCommand_Init(), and Server::handleCommand_Init2().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< session_t > ClientInterface::getClientIDs | ( | ClientState | min_state = CS_Active | ) |
References m_clients, and m_clients_mutex.
Referenced by Server::DeleteClient(), Server::handleCommand_Init(), isUserLimitReached(), Server::kickAllPlayers(), Server::playSound(), Server::reportPrivsModified(), Server::SendAddParticleSpawner(), Server::SendBlocks(), Server::sendMetadataChanged(), Server::sendNodeChangePkt(), Server::setIpBanned(), and UpdatePlayerList().
Here is the caller graph for this function:
|
inlineprotected |
References m_clients.
Referenced by Server::AsyncRunStep(), and Server::dynamicAddMedia().
Here is the caller graph for this function:| RemoteClient * ClientInterface::getClientNoEx | ( | session_t | peer_id, |
| ClientState | state_min = CS_Active ) |
References lockedGetClientNoEx(), and m_clients_mutex.
Referenced by Server::getClientNoEx(), Server::SendItemDef(), Server::sendMediaAnnouncement(), and Server::SendNodeDef().
Here is the call graph for this function:
Here is the caller graph for this function:| ClientState ClientInterface::getClientState | ( | session_t | peer_id | ) |
References CS_Invalid, m_clients, and m_clients_mutex.
Referenced by Server::ProcessData().
Here is the caller graph for this function:
|
inline |
References m_clients_names.
Referenced by Server::AsyncRunStep(), Server::getStatusString(), Server::handleCommand_ClientReady(), and Server::StageTwoClientInit().
Here is the caller graph for this function:| u16 ClientInterface::getProtocolVersion | ( | session_t | peer_id | ) |
References m_clients, and m_clients_mutex.
Referenced by Server::handleCommand_Init2(), Server::SendLocalPlayerAnimations(), and Server::SendSetSky().
Here is the caller graph for this function:| bool ClientInterface::isUserLimitReached | ( | ) |
References g_settings, getClientIDs(), and Settings::getU16().
Referenced by Server::checkUserLimit().
Here is the call graph for this function:
Here is the caller graph for this function:| RemoteClient * ClientInterface::lockedGetClientNoEx | ( | session_t | peer_id, |
| ClientState | state_min = CS_Active ) |
References m_clients.
Referenced by Server::getClientDynamicInfo(), Server::getClientInfo(), getClientNoEx(), Server::handleCommand_DeletedBlocks(), Server::handleCommand_GotBlocks(), Server::SendBlock(), Server::SendBlocks(), Server::sendMetadataChanged(), Server::sendNodeChangePkt(), Server::StageTwoClientInit(), and UpdatePlayerList().
Here is the caller graph for this function:| void ClientInterface::markBlocksNotSent | ( | const std::vector< v3s16 > & | positions | ) |
References CS_Active, m_clients, and m_clients_mutex.
Referenced by Server::AsyncRunStep().
Here is the caller graph for this function:| void ClientInterface::send | ( | session_t | peer_id, |
| NetworkPacket * | pkt ) |
References clientCommandFactoryTable, FATAL_ERROR_IF, NetworkPacket::getCommand(), m_con, and con::IConnection::Send().
Referenced by Server::Send().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientInterface::sendCustom | ( | session_t | peer_id, |
| u8 | channel, | ||
| NetworkPacket * | pkt, | ||
| bool | reliable ) |
References clientCommandFactoryTable, FATAL_ERROR_IF, NetworkPacket::getCommand(), m_con, ClientCommandFactory::name, and con::IConnection::Send().
Referenced by Server::dynamicAddMedia(), Server::playSound(), and Server::SendActiveObjectMessages().
Here is the call graph for this function:
Here is the caller graph for this function:| void ClientInterface::sendToAll | ( | NetworkPacket * | pkt, |
| ClientState | state_min = CS_Active ) |
References clientCommandFactoryTable, FATAL_ERROR_IF, NetworkPacket::getCommand(), m_clients, m_clients_mutex, m_con, and con::IConnection::Send().
Referenced by Server::DeleteClient(), Server::SendChatMessage(), Server::SendDeleteParticleSpawner(), Server::sendDetachedInventory(), Server::SendTimeOfDay(), and Server::StageTwoClientInit().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
static |
References statenames.
Referenced by ModApiServer::l_get_player_information(), and step().
Here is the caller graph for this function:| void ClientInterface::step | ( | float | dtime | ) |
References CS_Denied, CS_Disconnecting, CS_InitDone, con::IConnection::DisconnectPeer(), con::IConnection::GetPeerAddress(), infostream, LINGER_TIMEOUT, m_check_linger_timer, m_clients, m_clients_mutex, m_con, m_print_info_timer, Address::serializeString(), state2Name(), UpdatePlayerList(), and warningstream.
Referenced by Server::AsyncRunStep().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References getClientIDs(), Player::getName(), ServerEnvironment::getPlayer(), infostream, lockedGetClientNoEx(), m_clients_mutex, m_clients_names, and m_env.
Referenced by event(), and step().
Here is the call graph for this function:
Here is the caller graph for this function:
|
friend |
|
staticconstexprprivate |
Referenced by step().
|
private |
Referenced by step().
|
private |
|
private |
|
private |
Referenced by getPlayerNames(), and UpdatePlayerList().
|
private |
Referenced by send(), sendCustom(), sendToAll(), and step().
|
private |
Referenced by DeleteClient(), setEnv(), and UpdatePlayerList().
|
private |
Referenced by step().
|
staticprivate |
Referenced by state2Name().