Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
Server Class Reference

#include <server.h>

+ Inheritance diagram for Server:
+ Collaboration diagram for Server:

Classes

struct  DynamicMediaArgs
 
class  EnvAutoLock
 
struct  PendingDynamicMediaCallback
 
struct  SBCHash
 
struct  ShutdownState
 
struct  StepSettings
 

Public Member Functions

 Server (const std::string &path_world, const SubgameSpec &gamespec, bool simple_singleplayer_mode, Address bind_addr, bool dedicated, ChatInterface *iface=nullptr, std::string *shutdown_errmsg=nullptr)
 
 ~Server ()
 
 DISABLE_CLASS_COPY (Server)
 
void start ()
 
void stop ()
 
void step ()
 
void AsyncRunStep (float dtime, bool initial_step=false)
 
void Receive (float timeout)
 
void yieldToOtherThreads (float dtime)
 
PlayerSAOStageTwoClientInit (session_t peer_id)
 
void handleCommand (NetworkPacket *pkt)
 
void handleCommand_Null (NetworkPacket *pkt)
 
void handleCommand_Deprecated (NetworkPacket *pkt)
 
void handleCommand_Init (NetworkPacket *pkt)
 
void handleCommand_Init2 (NetworkPacket *pkt)
 
void handleCommand_ModChannelJoin (NetworkPacket *pkt)
 
void handleCommand_ModChannelLeave (NetworkPacket *pkt)
 
void handleCommand_ModChannelMsg (NetworkPacket *pkt)
 
void handleCommand_RequestMedia (NetworkPacket *pkt)
 
void handleCommand_ClientReady (NetworkPacket *pkt)
 
void handleCommand_GotBlocks (NetworkPacket *pkt)
 
void handleCommand_PlayerPos (NetworkPacket *pkt)
 
void handleCommand_DeletedBlocks (NetworkPacket *pkt)
 
void handleCommand_InventoryAction (NetworkPacket *pkt)
 
void handleCommand_ChatMessage (NetworkPacket *pkt)
 
void handleCommand_Damage (NetworkPacket *pkt)
 
void handleCommand_PlayerItem (NetworkPacket *pkt)
 
void handleCommand_Interact (NetworkPacket *pkt)
 
void handleCommand_RemovedSounds (NetworkPacket *pkt)
 
void handleCommand_NodeMetaFields (NetworkPacket *pkt)
 
void handleCommand_InventoryFields (NetworkPacket *pkt)
 
void handleCommand_FirstSrp (NetworkPacket *pkt)
 
void handleCommand_SrpBytesA (NetworkPacket *pkt)
 
void handleCommand_SrpBytesM (NetworkPacket *pkt)
 
void handleCommand_HaveMedia (NetworkPacket *pkt)
 
void handleCommand_UpdateClientInfo (NetworkPacket *pkt)
 
void ProcessData (NetworkPacket *pkt)
 
void Send (NetworkPacket *pkt)
 
void Send (session_t peer_id, NetworkPacket *pkt)
 
void process_PlayerPos (RemotePlayer *player, PlayerSAO *playersao, NetworkPacket *pkt)
 
void setTimeOfDay (u32 time)
 
void onMapEditEvent (const MapEditEvent &event)
 
std::string getStatusString ()
 
double getUptime () const
 
bool isShutdownRequested () const
 
void requestShutdown (const std::string &msg, bool reconnect, float delay=0.0f)
 
s32 playSound (ServerPlayingSound &params, bool ephemeral=false)
 
void stopSound (s32 handle)
 
void fadeSound (s32 handle, float step, float gain)
 
std::set< std::string > getPlayerEffectivePrivs (const std::string &name)
 
bool checkPriv (const std::string &name, const std::string &priv)
 
void reportPrivsModified (const std::string &name="")
 
void reportInventoryFormspecModified (const std::string &name)
 
void reportFormspecPrependModified (const std::string &name)
 
void setIpBanned (const std::string &ip, const std::string &name)
 
void unsetIpBanned (const std::string &ip_or_name)
 
std::string getBanDescription (const std::string &ip_or_name)
 
bool denyIfBanned (session_t peer_id)
 
void notifyPlayer (const char *name, const std::wstring &msg)
 
void notifyPlayers (const std::wstring &msg)
 
void spawnParticle (const std::string &playername, const ParticleParameters &p)
 
u32 addParticleSpawner (const ParticleSpawnerParameters &p, ServerActiveObject *attached, const std::string &playername)
 
void deleteParticleSpawner (const std::string &playername, u32 id)
 
bool dynamicAddMedia (const DynamicMediaArgs &args)
 
ServerInventoryManagergetInventoryMgr () const
 
void sendDetachedInventory (Inventory *inventory, const std::string &name, session_t peer_id)
 
ServerScriptinggetScriptIface ()
 
bool rollbackRevertActions (const std::list< RollbackAction > &actions, std::list< std::string > *log)
 
virtual IItemDefManagergetItemDefManager ()
 
virtual const NodeDefManagergetNodeDefManager ()
 
virtual ICraftDefManagergetCraftDefManager ()
 
virtual u16 allocateUnknownNodeId (const std::string &name)
 
IRollbackManagergetRollbackManager ()
 
virtual EmergeManagergetEmergeManager ()
 
virtual ModStorageDatabasegetModStorageDatabase ()
 
IWritableItemDefManagergetWritableItemDefManager ()
 
NodeDefManagergetWritableNodeDefManager ()
 
IWritableCraftDefManagergetWritableCraftDefManager ()
 
virtual const std::vector< ModSpec > & getMods () const
 
virtual const ModSpecgetModSpec (const std::string &modname) const
 
virtual const SubgameSpecgetGameSpec () const
 
virtual std::string getWorldPath () const
 
virtual std::string getModDataPath () const
 
bool isSingleplayer () const
 
void setStepSettings (StepSettings spdata)
 
StepSettings getStepSettings ()
 
void setAsyncFatalError (const std::string &error)
 
void setAsyncFatalError (const LuaError &e)
 
void addShutdownError (const ModError &e)
 
bool showFormspec (const char *name, const std::string &formspec, const std::string &formname)
 
MapgetMap ()
 
ServerEnvironmentgetEnv ()
 
v3f findSpawnPos ()
 
u32 hudAdd (RemotePlayer *player, HudElement *element)
 
bool hudRemove (RemotePlayer *player, u32 id)
 
bool hudChange (RemotePlayer *player, u32 id, HudElementStat stat, void *value)
 
bool hudSetFlags (RemotePlayer *player, u32 flags, u32 mask)
 
bool hudSetHotbarItemcount (RemotePlayer *player, s32 hotbar_itemcount)
 
void hudSetHotbarImage (RemotePlayer *player, const std::string &name)
 
void hudSetHotbarSelectedImage (RemotePlayer *player, const std::string &name)
 
Address getPeerAddress (session_t peer_id)
 
void setLocalPlayerAnimations (RemotePlayer *player, v2s32 animation_frames[4], f32 frame_speed)
 
void setPlayerEyeOffset (RemotePlayer *player, v3f first, v3f third, v3f third_front)
 
void setSky (RemotePlayer *player, const SkyboxParams &params)
 
void setSun (RemotePlayer *player, const SunParams &params)
 
void setMoon (RemotePlayer *player, const MoonParams &params)
 
void setStars (RemotePlayer *player, const StarParams &params)
 
void setClouds (RemotePlayer *player, const CloudParams &params)
 
void overrideDayNightRatio (RemotePlayer *player, bool do_override, float brightness)
 
void setLighting (RemotePlayer *player, const Lighting &lighting)
 
void peerAdded (con::IPeer *peer)
 
void deletingPeer (con::IPeer *peer, bool timeout)
 
void DenySudoAccess (session_t peer_id)
 
void DenyAccess (session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason="", bool reconnect=false)
 
void kickAllPlayers (AccessDeniedCode reason, const std::string &str_reason, bool reconnect)
 
void acceptAuth (session_t peer_id, bool forSudoMode)
 
void DisconnectPeer (session_t peer_id)
 
bool getClientConInfo (session_t peer_id, con::rtt_stat_type type, float *retval)
 
bool getClientInfo (session_t peer_id, ClientInfo &ret)
 
const ClientDynamicInfogetClientDynamicInfo (session_t peer_id)
 
void printToConsoleOnly (const std::string &text)
 
void HandlePlayerHPChange (PlayerSAO *sao, const PlayerHPChangeReason &reason)
 
void SendPlayerHP (PlayerSAO *sao, bool effect)
 
void SendPlayerBreath (PlayerSAO *sao)
 
void SendInventory (RemotePlayer *player, bool incremental)
 
void SendMovePlayer (PlayerSAO *sao)
 
void SendMovePlayerRel (session_t peer_id, const v3f &added_pos)
 
void SendPlayerSpeed (session_t peer_id, const v3f &added_vel)
 
void SendPlayerFov (session_t peer_id)
 
void SendMinimapModes (session_t peer_id, std::vector< MinimapMode > &modes, size_t wanted_mode)
 
void sendDetachedInventories (session_t peer_id, bool incremental)
 
bool joinModChannel (const std::string &channel)
 
bool leaveModChannel (const std::string &channel)
 
bool sendModChannelMessage (const std::string &channel, const std::string &message)
 
ModChannelgetModChannel (const std::string &channel)
 
bool SendBlock (session_t peer_id, const v3s16 &blockpos)
 
TranslationsgetTranslationLanguage (const std::string &lang_code)
 
std::unordered_map< std::string, std::string > getMediaList ()
 
- Public Member Functions inherited from con::PeerHandler
 PeerHandler ()=default
 
virtual ~PeerHandler ()=default
 
- Public Member Functions inherited from IGameDef
IItemDefManageridef ()
 
const NodeDefManagerndef ()
 
ICraftDefManagercdef ()
 
IRollbackManagerrollback ()
 

Static Public Member Functions

static std::string getBuiltinLuaPath ()
 
static ModStorageDatabaseopenModStorageDatabase (const std::string &world_path)
 
static ModStorageDatabaseopenModStorageDatabase (const std::string &backend, const std::string &world_path, const Settings &world_mt)
 
static bool migrateModStorageDatabase (const GameParams &game_params, const Settings &cmd_args)
 
static u16 getProtocolVersionMin ()
 
static u16 getProtocolVersionMax ()
 

Public Attributes

std::vector< std::pair< std::string, std::string > > m_async_init_files
 
std::vector< std::pair< std::string, std::string > > m_mapgen_init_files
 
std::unique_ptr< PackedValuem_lua_globals_data
 
Address m_bind_addr
 

Protected Attributes

std::unique_ptr< ServerScriptingm_script
 
std::unique_ptr< ServerModManagerm_modmgr
 

Private Types

typedef std::unordered_map< std::pair< v3s16, u16 >, std::string, SBCHashSerializedBlockCache
 

Private Member Functions

void init ()
 
void SendMovement (session_t peer_id)
 
void SendHP (session_t peer_id, u16 hp, bool effect)
 
void SendBreath (session_t peer_id, u16 breath)
 
void SendAccessDenied (session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason, bool reconnect=false)
 
void SendItemDef (session_t peer_id, IItemDefManager *itemdef, u16 protocol_version)
 
void SendNodeDef (session_t peer_id, const NodeDefManager *nodedef, u16 protocol_version)
 
virtual void SendChatMessage (session_t peer_id, const ChatMessage &message)
 
void SendTimeOfDay (session_t peer_id, u16 time, f32 time_speed)
 
void SendLocalPlayerAnimations (session_t peer_id, v2s32 animation_frames[4], f32 animation_speed)
 
void SendEyeOffset (session_t peer_id, v3f first, v3f third, v3f third_front)
 
void SendPlayerPrivileges (session_t peer_id)
 
void SendPlayerInventoryFormspec (session_t peer_id)
 
void SendPlayerFormspecPrepend (session_t peer_id)
 
void SendShowFormspecMessage (session_t peer_id, const std::string &formspec, const std::string &formname)
 
void SendHUDAdd (session_t peer_id, u32 id, HudElement *form)
 
void SendHUDRemove (session_t peer_id, u32 id)
 
void SendHUDChange (session_t peer_id, u32 id, HudElementStat stat, void *value)
 
void SendHUDSetFlags (session_t peer_id, u32 flags, u32 mask)
 
void SendHUDSetParam (session_t peer_id, u16 param, std::string_view value)
 
void SendSetSky (session_t peer_id, const SkyboxParams &params)
 
void SendSetSun (session_t peer_id, const SunParams &params)
 
void SendSetMoon (session_t peer_id, const MoonParams &params)
 
void SendSetStars (session_t peer_id, const StarParams &params)
 
void SendCloudParams (session_t peer_id, const CloudParams &params)
 
void SendOverrideDayNightRatio (session_t peer_id, bool do_override, float ratio)
 
void SendSetLighting (session_t peer_id, const Lighting &lighting)
 
void broadcastModChannelMessage (const std::string &channel, const std::string &message, session_t from_peer)
 
void sendRemoveNode (v3s16 p, std::unordered_set< u16 > *far_players=nullptr, float far_d_nodes=100)
 
void sendAddNode (v3s16 p, MapNode n, std::unordered_set< u16 > *far_players=nullptr, float far_d_nodes=100, bool remove_metadata=true)
 
void sendNodeChangePkt (NetworkPacket &pkt, v3s16 block_pos, v3f p, float far_d_nodes, std::unordered_set< u16 > *far_players)
 
void sendMetadataChanged (const std::unordered_set< v3s16 > &positions, float far_d_nodes=100)
 
void SendBlockNoLock (session_t peer_id, MapBlock *block, u8 ver, u16 net_proto_version, SerializedBlockCache *cache=nullptr)
 
void SendBlocks (float dtime)
 
bool addMediaFile (const std::string &filename, const std::string &filepath, std::string *filedata=nullptr, std::string *digest=nullptr)
 
void fillMediaCache ()
 
void sendMediaAnnouncement (session_t peer_id, const std::string &lang_code)
 
void sendRequestedMedia (session_t peer_id, const std::unordered_set< std::string > &tosend)
 
void stepPendingDynMediaCallbacks (float dtime)
 
void SendAddParticleSpawner (session_t peer_id, u16 protocol_version, const ParticleSpawnerParameters &p, u16 attached_id, u32 id)
 
void SendDeleteParticleSpawner (session_t peer_id, u32 id)
 
void SendSpawnParticle (session_t peer_id, u16 protocol_version, const ParticleParameters &p)
 
void SendActiveObjectRemoveAdd (RemoteClient *client, PlayerSAO *playersao)
 
void SendActiveObjectMessages (session_t peer_id, const std::string &datas, bool reliable=true)
 
void SendCSMRestrictionFlags (session_t peer_id)
 
void HandlePlayerDeath (PlayerSAO *sao, const PlayerHPChangeReason &reason)
 
void DeleteClient (session_t peer_id, ClientDeletionReason reason)
 
void UpdateCrafting (RemotePlayer *player)
 
bool checkInteractDistance (RemotePlayer *player, const f32 d, const std::string &what)
 
void handleChatInterfaceEvent (ChatEvent *evt)
 
std::wstring handleChat (const std::string &name, std::wstring wmessage_input, bool check_shout_priv=false, RemotePlayer *player=nullptr)
 
void handleAdminChat (const ChatEventChat *evt)
 
RemoteClientgetClient (session_t peer_id, ClientState state_min=CS_Active)
 
RemoteClientgetClientNoEx (session_t peer_id, ClientState state_min=CS_Active)
 
std::string getPlayerName (session_t peer_id)
 
PlayerSAOgetPlayerSAO (session_t peer_id)
 
PlayerSAOemergePlayer (const char *name, session_t peer_id, u16 proto_version)
 
s32 nextSoundId ()
 

Private Attributes

ordered_mutex m_env_mutex
 
std::string m_path_world
 
std::string m_path_mod_data
 
SubgameSpec m_gamespec
 
bool m_simple_singleplayer_mode
 
u16 m_max_chatmessage_length
 
bool m_dedicated
 
Settingsm_game_settings = nullptr
 
MutexedVariable< std::string > m_async_fatal_error
 
float m_time_of_day_send_timer = 0.0f
 
float m_liquid_transform_timer = 0.0f
 
float m_liquid_transform_every = 1.0f
 
float m_masterserver_timer = 0.0f
 
float m_emergethread_trigger_timer = 0.0f
 
float m_savemap_timer = 0.0f
 
IntervalLimiter m_map_timer_and_unload_interval
 
IntervalLimiter m_max_lag_decrease
 
ServerEnvironmentm_env = nullptr
 
std::shared_ptr< con::IConnectionm_con
 
BanManagerm_banmanager = nullptr
 
IRollbackManagerm_rollback = nullptr
 
std::unique_ptr< EmergeManagerm_emerge
 
IWritableItemDefManagerm_itemdef
 
NodeDefManagerm_nodedef
 
IWritableCraftDefManagerm_craftdef
 
std::unordered_map< std::string, Translationsserver_translations
 
std::atomic< StepSettingsm_step_settings {{0.1f, false}}
 
ServerThreadm_thread = nullptr
 
ClientInterface m_clients
 
std::unordered_map< session_t, std::string > m_formspec_state_data
 
ShutdownState m_shutdown_state
 
ChatInterfacem_admin_chat
 
std::string m_admin_nick
 
std::string *const m_shutdown_errmsg
 
std::queue< MapEditEvent * > m_unsent_map_edit_queue
 
VoxelArea m_ignore_map_edit_events_area
 
std::unordered_map< std::string, MediaInfom_media
 
std::unordered_map< u32, PendingDynamicMediaCallbackm_pending_dyn_media
 
float m_step_pending_dyn_media_timer = 0.0f
 
std::unordered_map< s32, ServerPlayingSoundm_playing_sounds
 
s32 m_playing_sounds_id_last_used = 0
 
ModStorageDatabasem_mod_storage_database = nullptr
 
float m_mod_storage_save_timer = 10.0f
 
u64 m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE
 
u32 m_csm_restriction_noderange = 8
 
std::unique_ptr< ModChannelMgrm_modchannel_mgr
 
std::unique_ptr< ServerInventoryManagerm_inventory_mgr
 
std::unique_ptr< MetricsBackendm_metrics_backend
 
MetricCounterPtr m_uptime_counter
 
MetricGaugePtr m_player_gauge
 
MetricGaugePtr m_timeofday_gauge
 
MetricGaugePtr m_lag_gauge
 
MetricCounterPtr m_aom_buffer_counter [2]
 
MetricCounterPtr m_packet_recv_counter
 
MetricCounterPtr m_packet_recv_processed_counter
 
MetricCounterPtr m_map_edit_event_counter
 

Friends

class EmergeThread
 
class RemoteClient
 
class TestServerShutdownState
 
class TestMoveAction
 

Member Typedef Documentation

◆ SerializedBlockCache

typedef std::unordered_map<std::pair<v3s16, u16>, std::string, SBCHash> Server::SerializedBlockCache
private

Constructor & Destructor Documentation

◆ Server()

Server::Server ( const std::string & path_world,
const SubgameSpec & gamespec,
bool simple_singleplayer_mode,
Address bind_addr,
bool dedicated,
ChatInterface * iface = nullptr,
std::string * shutdown_errmsg = nullptr )

◆ ~Server()

Member Function Documentation

◆ acceptAuth()

void Server::acceptAuth ( session_t peer_id,
bool forSudoMode )

References AUTH_MECHANISM_FIRST_SRP, CS_Invalid, CSE_AuthAccept, CSE_SudoSuccess, ClientInterface::event(), g_settings, getClient(), Settings::getFloat(), ServerMap::getSeed(), ServerEnvironment::getServerMap(), m_clients, m_env, Send(), TOCLIENT_ACCEPT_SUDO_MODE, and TOCLIENT_AUTH_ACCEPT.

Referenced by handleCommand_FirstSrp(), and handleCommand_SrpBytesM().

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

◆ addMediaFile()

bool Server::addMediaFile ( const std::string & filename,
const std::string & filepath,
std::string * filedata = nullptr,
std::string * digest = nullptr )
private

References SHA1::addBytes(), base64_encode(), errorstream, SHA1::getDigest(), hex_encode(), infostream, m_media, fs::ReadFile(), removeStringEnd(), string_allowed(), TEXTURENAME_ALLOWED_CHARS, verbosestream, and warningstream.

Referenced by dynamicAddMedia(), and fillMediaCache().

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

◆ addParticleSpawner()

u32 Server::addParticleSpawner ( const ParticleSpawnerParameters & p,
ServerActiveObject * attached,
const std::string & playername )

References ServerEnvironment::addParticleSpawner(), ActiveObject::getId(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, p(), PEER_ID_INEXISTENT, RemotePlayer::protocol_version, and SendAddParticleSpawner().

Referenced by ModApiParticles::l_add_particlespawner().

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

◆ addShutdownError()

void Server::addShutdownError ( const ModError & e)

References errorstream, fmtgettext(), m_shutdown_errmsg, strgettext(), and BaseException::what().

Referenced by ~Server().

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

◆ allocateUnknownNodeId()

u16 Server::allocateUnknownNodeId ( const std::string & name)
virtual

Implements IGameDef.

References NodeDefManager::allocateDummy(), and m_nodedef.

+ Here is the call graph for this function:

◆ AsyncRunStep()

void Server::AsyncRunStep ( float dtime,
bool initial_step = false )

References ServerList::AA_START, ServerList::AA_UPDATE, Profiler::add(), AO_CMD_UPDATE_POSITION, Database::beginSave(), ChatInterface::command_queue, CS_DefinitionsSent, ActiveObjectMessage::datastring, MetricGauge::decrement(), Map::dispatchEvent(), MutexedQueue< T >::empty(), Database::endSave(), g_profiler, g_settings, MetricCounter::get(), MetricGauge::get(), ServerEnvironment::getActiveObject(), ServerEnvironment::getActiveObjectMessage(), Map::getBlockNoCreateNoEx(), Settings::getBool(), getClient(), ClientInterface::getClientList(), Settings::getFloat(), ServerEnvironment::getGameTime(), ActiveObject::getId(), ServerEnvironment::getMap(), Mapgen::getMapgenName(), ServerEnvironment::getMaxLagEstimate(), ServerModManager::getMods(), getNodeBlockPos(), ServerActiveObject::getParent(), ServerEnvironment::getPlayer(), ClientInterface::getPlayerNames(), getPlayerSAO(), Address::getPort(), ServerEnvironment::getServerMap(), getStepSettings(), Environment::getTimeOfDay(), handleChatInterfaceEvent(), ActiveObjectMessage::id, SubgameSpec::id, MetricCounter::increment(), MetricGauge::increment(), infostream, ServerEnvironment::invalidateActiveObjectObserverCaches(), BanManager::isModified(), isSingleplayer(), m_admin_chat, m_aom_buffer_counter, m_banmanager, m_bind_addr, m_clients, m_dedicated, m_emerge, m_emergethread_trigger_timer, m_env, m_gamespec, m_lag_gauge, m_liquid_transform_every, m_liquid_transform_timer, m_map_edit_event_counter, m_map_timer_and_unload_interval, m_masterserver_timer, m_max_lag_decrease, m_mod_storage_database, m_mod_storage_save_timer, m_modmgr, m_player_gauge, m_savemap_timer, m_shutdown_state, m_step_pending_dyn_media_timer, m_time_of_day_send_timer, m_timeofday_gauge, m_unsent_map_edit_queue, m_uptime_counter, ClientInterface::markBlocksNotSent(), MEET_ADDNODE, MEET_BLOCK_NODE_METADATA_CHANGED, MEET_OTHER, MEET_REMOVENODE, MEET_SWAPNODE, EmergeManager::mgparams, MapgenParams::mgtype, MOD_REASON_REPORT_META_CHANGE, MOD_STATE_WRITE_NEEDED, ChatInterface::outgoing_queue, PEER_ID_INEXISTENT, MutexedQueue< T >::pop_frontNoEx(), Profiler::print(), MutexedQueue< T >::push_back(), ActiveObjectMessage::reliable, ServerEnvironment::reportMaxLagEstimate(), BanManager::save(), Map::save(), ServerEnvironment::saveLoadedPlayers(), ServerEnvironment::saveMeta(), SendActiveObjectMessages(), SendActiveObjectRemoveAdd(), sendAddNode(), ServerList::sendAnnounce(), SendBlocks(), sendMetadataChanged(), sendRemoveNode(), SendTimeOfDay(), serializeString16(), MetricGauge::set(), Environment::setTimeOfDaySpeed(), SPT_AVG, FrameMarker::started(), EmergeManager::startThreads(), ClientInterface::step(), IntervalLimiter::step(), ServerEnvironment::step(), ServerMap::step(), Server::StepSettings::steplen, stepPendingDynMediaCallbacks(), Server::ShutdownState::tick(), Map::timerUpdate(), ServerMap::transformLiquids(), MapEditEvent::type, verbosestream, warningstream, writeU16(), and ZoneScoped.

Referenced by ServerThread::run().

+ Here is the caller graph for this function:

◆ broadcastModChannelMessage()

void Server::broadcastModChannelMessage ( const std::string & channel,
const std::string & message,
session_t from_peer )
private

References ModChannelMgr::getChannelPeers(), getPlayerName(), m_modchannel_mgr, m_script, ScriptApiModChannels::on_modchannel_message(), PEER_ID_SERVER, Send(), STRING_MAX_LEN, TOCLIENT_MODCHANNEL_MSG, and warningstream.

Referenced by handleCommand_ModChannelMsg(), and sendModChannelMessage().

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

◆ checkInteractDistance()

bool Server::checkInteractDistance ( RemotePlayer * player,
const f32 d,
const std::string & what )
private

References actionstream, BS, Player::getName(), RemotePlayer::getPlayerSAO(), getToolRange(), Player::getWieldedItem(), m_itemdef, m_script, and ScriptApiPlayer::on_cheat().

Referenced by handleCommand_Interact(), and handleCommand_InventoryAction().

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

◆ checkPriv()

bool Server::checkPriv ( const std::string & name,
const std::string & priv )

References getPlayerEffectivePrivs().

Referenced by handleChat(), handleCommand_Interact(), and handleCommand_InventoryAction().

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

◆ DeleteClient()

void Server::DeleteClient ( session_t peer_id,
ClientDeletionReason reason )
private

References actionstream, CDR_DENY, CDR_TIMEOUT, CET_NICK_REMOVE, CHATMESSAGE_TYPE_ANNOUNCE, ServerPlayingSound::clients, ClientInterface::DeleteClient(), PlayerSAO::disconnected(), ClientInterface::getClientIDs(), Player::getName(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), m_admin_chat, m_clients, m_env, m_formspec_state_data, m_playing_sounds, m_script, ScriptApiPlayer::on_leaveplayer(), ChatInterface::outgoing_queue, PEER_ID_INEXISTENT, PLAYER_LIST_REMOVE, MutexedQueue< T >::push_back(), SendChatMessage(), ClientInterface::sendToAll(), and TOCLIENT_UPDATE_PLAYER_LIST.

Referenced by deletingPeer().

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

◆ deleteParticleSpawner()

void Server::deleteParticleSpawner ( const std::string & playername,
u32 id )

References ServerEnvironment::deleteParticleSpawner(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, PEER_ID_INEXISTENT, and SendDeleteParticleSpawner().

Referenced by ModApiParticles::l_delete_particlespawner().

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

◆ deletingPeer()

void Server::deletingPeer ( con::IPeer * peer,
bool timeout )
virtual

Implements con::PeerHandler.

References CDR_LEAVE, CDR_TIMEOUT, CSE_Disconnect, DeleteClient(), ClientInterface::event(), con::IPeer::id, m_clients, and verbosestream.

+ Here is the call graph for this function:

◆ DenyAccess()

void Server::DenyAccess ( session_t peer_id,
AccessDeniedCode reason,
std::string_view custom_reason = "",
bool reconnect = false )

References CSE_SetDenied, DisconnectPeer(), ClientInterface::event(), m_clients, and SendAccessDenied().

Referenced by denyIfBanned(), handleChat(), handleCommand_FirstSrp(), handleCommand_Init(), handleCommand_SrpBytesA(), handleCommand_SrpBytesM(), kickAllPlayers(), Receive(), and StageTwoClientInit().

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

◆ denyIfBanned()

bool Server::denyIfBanned ( session_t peer_id)

References actionstream, DenyAccess(), BanManager::getBanName(), getPeerAddress(), BanManager::isIpBanned(), m_banmanager, Address::serializeString(), and SERVER_ACCESSDENIED_CUSTOM_STRING.

Referenced by handleCommand_Init(), and setIpBanned().

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

◆ DenySudoAccess()

void Server::DenySudoAccess ( session_t peer_id)

References Send(), and TOCLIENT_DENY_SUDO_MODE.

Referenced by handleCommand_SrpBytesA(), and handleCommand_SrpBytesM().

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

◆ DISABLE_CLASS_COPY()

Server::DISABLE_CLASS_COPY ( Server )

◆ DisconnectPeer()

void Server::DisconnectPeer ( session_t peer_id)

References con::IConnection::DisconnectPeer(), ModChannelMgr::leaveAllChannels(), m_con, and m_modchannel_mgr.

Referenced by DenyAccess(), handleCommand_ChatMessage(), handleCommand_ClientReady(), handleCommand_Damage(), handleCommand_Interact(), handleCommand_InventoryAction(), handleCommand_InventoryFields(), handleCommand_NodeMetaFields(), handleCommand_PlayerItem(), and handleCommand_PlayerPos().

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

◆ dynamicAddMedia()

◆ emergePlayer()

PlayerSAO * Server::emergePlayer ( const char * name,
session_t peer_id,
u16 proto_version )
private

References PlayerSAO::finalize(), Player::getName(), ServerEnvironment::getPlayer(), getPlayerEffectivePrivs(), IGameDef::idef(), infostream, isSingleplayer(), ServerEnvironment::loadPlayer(), m_env, m_script, ScriptApiPlayer::on_newplayer(), and RemotePlayer::protocol_version.

Referenced by StageTwoClientInit().

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

◆ fadeSound()

void Server::fadeSound ( s32 handle,
float step,
float gain )

References ServerPlayingSound::clients, ServerPlayingSound::gain, m_playing_sounds, Send(), step(), and TOCLIENT_FADE_SOUND.

Referenced by ModApiServer::l_sound_fade().

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

◆ fillMediaCache()

void Server::fillMediaCache ( )
private

References addMediaFile(), DIR_DELIM, getBuiltinLuaPath(), fs::GetDirListing(), ServerModManager::getModsMediaPaths(), fs::GetRecursiveDirs(), infostream, m_gamespec, m_media, m_modmgr, SubgameSpec::path, and porting::path_user.

Referenced by init().

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

◆ findSpawnPos()

v3f Server::findSpawnPos ( )

References BS, CONTENT_IGNORE, ContentFeatures::drawtype, ServerMap::emergeBlock(), g_settings, NodeDefManager::get(), MapNode::getContent(), ServerMap::getMapgenParams(), Map::getNode(), getNodeBlockPos(), ServerEnvironment::getServerMap(), EmergeManager::getSpawnLevelAtPoint(), MapgenParams::getSpawnRangeMax(), Settings::getV3FNoEx(), intToFloat(), m_emerge, m_env, m_nodedef, MAX_MAP_GENERATION_LIMIT, MYMIN, myrand_range(), NDT_AIRLIKE, and objectpos_over_limit().

Referenced by ServerEnvironment::loadPlayer(), and PlayerSAO::respawn().

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

◆ getBanDescription()

std::string Server::getBanDescription ( const std::string & ip_or_name)

References BanManager::getBanDescription(), and m_banmanager.

+ Here is the call graph for this function:

◆ getBuiltinLuaPath()

std::string Server::getBuiltinLuaPath ( )
static

References DIR_DELIM, and porting::path_share.

Referenced by fillMediaCache(), EmergeThread::initScripting(), ServerScripting::loadBuiltin(), AsyncEngine::prepareEnvironment(), and TestMoveAction::runTests().

+ Here is the caller graph for this function:

◆ getClient()

RemoteClient * Server::getClient ( session_t peer_id,
ClientState state_min = CS_Active )
private

References getClientNoEx().

Referenced by acceptAuth(), AsyncRunStep(), getPeerAddress(), handleCommand_DeletedBlocks(), handleCommand_FirstSrp(), handleCommand_Init(), handleCommand_Init2(), handleCommand_Interact(), handleCommand_SrpBytesA(), handleCommand_SrpBytesM(), handleCommand_UpdateClientInfo(), ProcessData(), sendDetachedInventories(), and sendRequestedMedia().

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

◆ getClientConInfo()

bool Server::getClientConInfo ( session_t peer_id,
con::rtt_stat_type type,
float * retval )

References con::IConnection::getPeerStat(), and m_con.

+ Here is the call graph for this function:

◆ getClientDynamicInfo()

const ClientDynamicInfo * Server::getClientDynamicInfo ( session_t peer_id)

References CS_Invalid, ClientInterface::lockedGetClientNoEx(), and m_clients.

+ Here is the call graph for this function:

◆ getClientInfo()

bool Server::getClientInfo ( session_t peer_id,
ClientInfo & ret )

References ClientInfo::addr, CS_Invalid, ClientInfo::lang_code, ClientInterface::lockedGetClientNoEx(), m_clients, ClientInfo::major, ClientInfo::minor, ClientInfo::patch, ClientInfo::prot_vers, ClientInfo::ser_vers, ClientInfo::state, ClientInfo::uptime, and ClientInfo::vers_string.

+ Here is the call graph for this function:

◆ getClientNoEx()

RemoteClient * Server::getClientNoEx ( session_t peer_id,
ClientState state_min = CS_Active )
private

References ClientInterface::getClientNoEx(), and m_clients.

Referenced by getClient().

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

◆ getCraftDefManager()

ICraftDefManager * Server::getCraftDefManager ( )
virtual

Implements IGameDef.

References m_craftdef.

◆ getEmergeManager()

◆ getEnv()

ServerEnvironment & Server::getEnv ( )
inline

References m_env.

◆ getGameSpec()

virtual const SubgameSpec * Server::getGameSpec ( ) const
inlinevirtual

Reimplemented from IGameDef.

References m_gamespec.

◆ getInventoryMgr()

ServerInventoryManager * Server::getInventoryMgr ( ) const
inline

References m_inventory_mgr.

Referenced by ModApiBase::getServerInventoryMgr(), and handleCommand_InventoryAction().

+ Here is the caller graph for this function:

◆ getItemDefManager()

IItemDefManager * Server::getItemDefManager ( )
virtual

Implements IGameDef.

References m_itemdef.

◆ getMap()

Map & Server::getMap ( )
inline

References ServerEnvironment::getMap(), and m_env.

+ Here is the call graph for this function:

◆ getMediaList()

std::unordered_map< std::string, std::string > Server::getMediaList ( )

References base64_decode(), and m_media.

+ Here is the call graph for this function:

◆ getModChannel()

ModChannel * Server::getModChannel ( const std::string & channel)
virtual

Implements IGameDef.

References ModChannelMgr::getModChannel(), and m_modchannel_mgr.

+ Here is the call graph for this function:

◆ getModDataPath()

virtual std::string Server::getModDataPath ( ) const
inlinevirtual

Reimplemented from IGameDef.

References m_path_mod_data.

Referenced by ModApiServer::l_get_mod_data_path().

+ Here is the caller graph for this function:

◆ getMods()

const std::vector< ModSpec > & Server::getMods ( ) const
virtual

Implements IGameDef.

References ServerModManager::getMods(), and m_modmgr.

+ Here is the call graph for this function:

◆ getModSpec()

const ModSpec * Server::getModSpec ( const std::string & modname) const
virtual

Implements IGameDef.

References ServerModManager::getModSpec(), and m_modmgr.

Referenced by ModApiBase::getCurrentModPath().

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

◆ getModStorageDatabase()

virtual ModStorageDatabase * Server::getModStorageDatabase ( )
inlinevirtual

Implements IGameDef.

References m_mod_storage_database.

◆ getNodeDefManager()

const NodeDefManager * Server::getNodeDefManager ( )
virtual

Implements IGameDef.

References m_nodedef.

Referenced by EmergeManager::EmergeManager(), ModApiMapgen::l_create_schematic(), ModApiMapgen::l_register_biome(), ModApiMapgen::l_register_decoration(), and ModApiMapgen::l_register_ore().

+ Here is the caller graph for this function:

◆ getPeerAddress()

Address Server::getPeerAddress ( session_t peer_id)

References CS_Invalid, RemoteClient::getAddress(), and getClient().

Referenced by denyIfBanned(), handleCommand_FirstSrp(), handleCommand_SrpBytesA(), and StageTwoClientInit().

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

◆ getPlayerEffectivePrivs()

std::set< std::string > Server::getPlayerEffectivePrivs ( const std::string & name)

References ScriptApiServer::getAuth(), and m_script.

Referenced by checkPriv(), emergePlayer(), and reportPrivsModified().

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

◆ getPlayerName()

std::string Server::getPlayerName ( session_t peer_id)
private

References Player::getName(), ServerEnvironment::getPlayer(), itos(), and m_env.

Referenced by broadcastModChannelMessage(), dynamicAddMedia(), handleCommand_Init2(), and handleCommand_RequestMedia().

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

◆ getPlayerSAO()

PlayerSAO * Server::getPlayerSAO ( session_t peer_id)
private

References ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), and m_env.

Referenced by AsyncRunStep(), handleCommand_Init2(), and sendMetadataChanged().

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

◆ getProtocolVersionMax()

u16 Server::getProtocolVersionMax ( )
static

References g_settings, Settings::getBool(), LATEST_PROTOCOL_VERSION, and SERVER_PROTOCOL_VERSION_MAX.

Referenced by handleCommand_Init(), and ServerList::sendAnnounce().

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

◆ getProtocolVersionMin()

u16 Server::getProtocolVersionMin ( )
static

References g_settings, Settings::getBool(), Settings::getU16(), LATEST_PROTOCOL_VERSION, rangelim, SERVER_PROTOCOL_VERSION_MAX, and SERVER_PROTOCOL_VERSION_MIN.

Referenced by handleCommand_Init(), and ServerList::sendAnnounce().

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

◆ getRollbackManager()

IRollbackManager * Server::getRollbackManager ( )
inlinevirtual

Reimplemented from IGameDef.

References m_rollback.

◆ getScriptIface()

ServerScripting * Server::getScriptIface ( )
inline

References m_script.

Referenced by dynamicAddMedia(), EmergeThread::finishGen(), handleCommand_HaveMedia(), ModApiEnv::l_emerge_area(), and stepPendingDynMediaCallbacks().

+ Here is the caller graph for this function:

◆ getStatusString()

std::string Server::getStatusString ( )

References duration_to_string(), g_settings, g_version_string, MetricCounter::get(), Settings::get(), ServerEnvironment::getMap(), ServerEnvironment::getMaxLagEstimate(), ClientInterface::getPlayerNames(), SubgameSpec::id, m_clients, m_env, m_gamespec, m_uptime_counter, and SubgameSpec::title.

+ Here is the call graph for this function:

◆ getStepSettings()

StepSettings Server::getStepSettings ( )
inline

References m_step_settings.

Referenced by AsyncRunStep(), and ServerThread::run().

+ Here is the caller graph for this function:

◆ getTranslationLanguage()

Translations * Server::getTranslationLanguage ( const std::string & lang_code)

References m_media, fs::ReadFile(), server_translations, and str_ends_with().

Referenced by ModApiEnv::l_get_translated_string().

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

◆ getUptime()

double Server::getUptime ( ) const
inline

References MetricCounter::get(), and m_uptime_counter.

+ Here is the call graph for this function:

◆ getWorldPath()

virtual std::string Server::getWorldPath ( ) const
inlinevirtual

Reimplemented from IGameDef.

References m_path_world.

Referenced by ServerEnvironment::init(), ModApiServer::l_get_worldpath(), ServerEnvironment::loadMeta(), and ServerEnvironment::saveMeta().

+ Here is the caller graph for this function:

◆ getWritableCraftDefManager()

IWritableCraftDefManager * Server::getWritableCraftDefManager ( )

References m_craftdef.

Referenced by ModApiCraft::l_clear_craft(), and ModApiCraft::l_register_craft().

+ Here is the caller graph for this function:

◆ getWritableItemDefManager()

IWritableItemDefManager * Server::getWritableItemDefManager ( )

References m_itemdef.

Referenced by ModApiItem::l_register_alias_raw(), ModApiItem::l_register_item_raw(), and ModApiItem::l_unregister_item_raw().

+ Here is the caller graph for this function:

◆ getWritableNodeDefManager()

NodeDefManager * Server::getWritableNodeDefManager ( )

References m_nodedef.

Referenced by ModApiItem::l_register_item_raw(), and ModApiItem::l_unregister_item_raw().

+ Here is the caller graph for this function:

◆ handleAdminChat()

void Server::handleAdminChat ( const ChatEventChat * evt)
private

References ChatEventChat::evt_msg, handleChat(), m_admin_chat, ChatEventChat::nick, ChatInterface::outgoing_queue, and MutexedQueue< T >::push_back().

Referenced by handleChatInterfaceEvent().

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

◆ handleChat()

std::wstring Server::handleChat ( const std::string & name,
std::wstring wmessage_input,
bool check_shout_priv = false,
RemotePlayer * player = nullptr )
private

References actionstream, RemotePlayer::canSendChatMessage(), checkPriv(), DenyAccess(), FATAL_ERROR, ScriptApiServer::formatChatMessage(), g_settings, Settings::getBool(), ClientInterface::getClientIDs(), Settings::getFloat(), RemotePlayer::getPeerId(), m_clients, m_max_chatmessage_length, m_rollback, m_script, ScriptApiServer::on_chat_message(), RPLAYER_CHATRESULT_FLOODING, RPLAYER_CHATRESULT_KICK, RPLAYER_CHATRESULT_OK, SendChatMessage(), SERVER_ACCESSDENIED_CUSTOM_STRING, trim(), unescape_enriched(), utf8_to_wide(), and wide_to_utf8().

Referenced by handleAdminChat(), and handleCommand_ChatMessage().

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

◆ handleChatInterfaceEvent()

void Server::handleChatInterfaceEvent ( ChatEvent * evt)
private

References CET_CHAT, CET_NICK_ADD, errorstream, ScriptApiServer::getAuth(), handleAdminChat(), m_admin_nick, m_script, and ChatEvent::type.

Referenced by AsyncRunStep().

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

◆ handleCommand()

void Server::handleCommand ( NetworkPacket * pkt)
inline

References NetworkPacket::getCommand(), ToServerCommandHandler::handler, and toServerCommandTable.

Referenced by ProcessData().

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

◆ handleCommand_ChatMessage()

void Server::handleCommand_ChatMessage ( NetworkPacket * pkt)

References CHATMESSAGE_TYPE_SYSTEM, DisconnectPeer(), errorstream, Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), handleChat(), m_env, and SendChatMessage().

+ Here is the call graph for this function:

◆ handleCommand_ClientReady()

◆ handleCommand_Damage()

void Server::handleCommand_Damage ( NetworkPacket * pkt)

◆ handleCommand_DeletedBlocks()

void Server::handleCommand_DeletedBlocks ( NetworkPacket * pkt)

References getClient(), NetworkPacket::getPeerId(), NetworkPacket::getSize(), and p().

+ Here is the call graph for this function:

◆ handleCommand_Deprecated()

void Server::handleCommand_Deprecated ( NetworkPacket * pkt)

References NetworkPacket::getCommand(), infostream, ToServerCommandHandler::name, and toServerCommandTable.

+ Here is the call graph for this function:

◆ handleCommand_FirstSrp()

◆ handleCommand_GotBlocks()

void Server::handleCommand_GotBlocks ( NetworkPacket * pkt)

References NetworkPacket::getPeerId(), NetworkPacket::getSize(), ClientInterface::lockedGetClientNoEx(), m_clients, and p().

+ Here is the call graph for this function:

◆ handleCommand_HaveMedia()

void Server::handleCommand_HaveMedia ( NetworkPacket * pkt)

References NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), getScriptIface(), m_env, m_pending_dyn_media, and ScriptApiServer::on_dynamic_media_added().

+ Here is the call graph for this function:

◆ handleCommand_Init()

void Server::handleCommand_Init ( NetworkPacket * pkt)

References actionstream, AUTH_MECHANISM_FIRST_SRP, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_NONE, AUTH_MECHANISM_SRP, base64_is_valid(), ScriptApiPlayer::can_bypass_userlimit(), CS_Created, CSE_Hello, DenyAccess(), denyIfBanned(), ClientInterface::event(), g_settings, Settings::get(), get_encoded_srp_verifier(), ScriptApiServer::getAuth(), getClient(), ClientInterface::getClientIDs(), con::IConnection::GetPeerAddress(), NetworkPacket::getPeerId(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), getProtocolVersionMax(), getProtocolVersionMin(), NetworkPacket::getSize(), Settings::getU16(), infostream, isSingleplayer(), ClientInterface::isUserLimitReached(), m_clients, m_con, m_env, m_script, m_simple_singleplayer_mode, ScriptApiPlayer::on_prejoinplayer(), PEER_ID_INEXISTENT, PLAYERNAME_ALLOWED_CHARS, PLAYERNAME_SIZE, Send(), SER_FMT_VER_HIGHEST_READ, SER_FMT_VER_INVALID, SER_FMT_VER_LOWEST_READ, Address::serializeString(), SERVER_ACCESSDENIED_ALREADY_CONNECTED, SERVER_ACCESSDENIED_CUSTOM_STRING, SERVER_ACCESSDENIED_SERVER_FAIL, SERVER_ACCESSDENIED_SINGLEPLAYER, SERVER_ACCESSDENIED_TOO_MANY_USERS, SERVER_ACCESSDENIED_WRONG_CHARS_IN_NAME, SERVER_ACCESSDENIED_WRONG_NAME, SERVER_ACCESSDENIED_WRONG_VERSION, SERVER_PROTOCOL_VERSION_MAX, SERVER_PROTOCOL_VERSION_MIN, ClientInterface::setPlayerName(), str_split(), string_allowed(), TOCLIENT_HELLO, and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_Init2()

◆ handleCommand_Interact()

void Server::handleCommand_Interact ( NetworkPacket * pkt)

References actionstream, ItemStack::addWear(), BS, checkInteractDistance(), checkPriv(), CONTENT_AIR, CONTENT_IGNORE, PointedThing::deSerialize(), dir(), DisconnectPeer(), PointedThing::dump(), EmergeManager::enqueueBlockEmerge(), errorstream, g_settings, NodeDefManager::get(), ServerEnvironment::getActiveObject(), ServerActiveObject::getBasePosition(), Settings::getBool(), getClient(), MapNode::getContent(), ServerActiveObject::getDescription(), getDigParams(), PlayerSAO::getDigPool(), PlayerSAO::getEyeOffset(), PlayerSAO::getEyePosition(), ActiveObject::getId(), PlayerSAO::getLastGoodPosition(), ServerEnvironment::getMap(), Player::getMaxHotbarItemcount(), Player::getName(), PlayerSAO::getNoCheatDigPos(), PlayerSAO::getNoCheatDigTime(), Map::getNode(), getNodeBlockPos(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), ItemStack::getToolCapabilities(), getWieldedItem(), Player::getWieldedItem(), PlayerSAO::getWieldedItem(), LagPool::grab(), ContentFeatures::groups, infostream, INTERACT_ACTIVATE, INTERACT_DIGGING_COMPLETED, INTERACT_PLACE, INTERACT_START_DIGGING, INTERACT_STOP_DIGGING, INTERACT_USE, intToFloat(), UnitSAO::isDead(), ServerActiveObject::isGone(), isSingleplayer(), ITEM_NODE, ScriptApiItem::item_OnPlace(), ScriptApiItem::item_OnSecondaryUse(), ScriptApiItem::item_OnUse(), m_emerge, m_env, m_itemdef, m_nodedef, m_rollback, m_script, RemoteClient::m_time_from_building, PlayerSAO::noCheatDigEnd(), PlayerSAO::noCheatDigStart(), PointedThing::node_abovesurface, ScriptApiNode::node_on_dig(), ScriptApiNode::node_on_punch(), PointedThing::node_undersurface, PointedThing::object_id, ScriptApiPlayer::on_cheat(), params, POINTEDTHING_NODE, POINTEDTHING_NOTHING, POINTEDTHING_OBJECT, process_PlayerPos(), ServerActiveObject::punch(), NetworkPacket::readLongString(), PlayerSAO::resetTimeFromLastPunch(), ServerActiveObject::rightClick(), SendInventory(), PlayerSAO::setWieldedItem(), Player::setWieldIndex(), PointedThing::type, verbosestream, warningstream, and ItemStack::wear.

◆ handleCommand_InventoryAction()

◆ handleCommand_InventoryFields()

void Server::handleCommand_InventoryFields ( NetworkPacket * pkt)

References actionstream, DisconnectPeer(), errorstream, Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), m_env, m_formspec_state_data, m_script, ScriptApiPlayer::on_playerReceiveFields(), pkt_read_formspec_fields(), and warningstream.

+ Here is the call graph for this function:

◆ handleCommand_ModChannelJoin()

void Server::handleCommand_ModChannelJoin ( NetworkPacket * pkt)

References g_settings, Settings::getBool(), NetworkPacket::getPeerId(), infostream, ModChannelMgr::joinChannel(), m_modchannel_mgr, MODCHANNEL_SIGNAL_JOIN_FAILURE, MODCHANNEL_SIGNAL_JOIN_OK, Send(), and TOCLIENT_MODCHANNEL_SIGNAL.

+ Here is the call graph for this function:

◆ handleCommand_ModChannelLeave()

void Server::handleCommand_ModChannelLeave ( NetworkPacket * pkt)

References g_settings, Settings::getBool(), NetworkPacket::getPeerId(), infostream, ModChannelMgr::leaveChannel(), m_modchannel_mgr, MODCHANNEL_SIGNAL_LEAVE_FAILURE, MODCHANNEL_SIGNAL_LEAVE_OK, Send(), and TOCLIENT_MODCHANNEL_SIGNAL.

+ Here is the call graph for this function:

◆ handleCommand_ModChannelMsg()

void Server::handleCommand_ModChannelMsg ( NetworkPacket * pkt)

References broadcastModChannelMessage(), ModChannelMgr::channelRegistered(), g_settings, Settings::getBool(), NetworkPacket::getPeerId(), m_modchannel_mgr, MODCHANNEL_SIGNAL_CHANNEL_NOT_REGISTERED, Send(), TOCLIENT_MODCHANNEL_SIGNAL, and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_NodeMetaFields()

void Server::handleCommand_NodeMetaFields ( NetworkPacket * pkt)

◆ handleCommand_Null()

void Server::handleCommand_Null ( NetworkPacket * pkt)
inline

◆ handleCommand_PlayerItem()

void Server::handleCommand_PlayerItem ( NetworkPacket * pkt)

References actionstream, DisconnectPeer(), errorstream, Player::getMaxHotbarItemcount(), Player::getName(), NetworkPacket::getPeerId(), PlayerSAO::getPlayer(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), NetworkPacket::getSize(), m_env, and Player::setWieldIndex().

+ Here is the call graph for this function:

◆ handleCommand_PlayerPos()

void Server::handleCommand_PlayerPos ( NetworkPacket * pkt)

References DisconnectPeer(), errorstream, Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), UnitSAO::isDead(), m_env, process_PlayerPos(), and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_RemovedSounds()

void Server::handleCommand_RemovedSounds ( NetworkPacket * pkt)

References ServerPlayingSound::clients, NetworkPacket::getPeerId(), and m_playing_sounds.

+ Here is the call graph for this function:

◆ handleCommand_RequestMedia()

void Server::handleCommand_RequestMedia ( NetworkPacket * pkt)

References NetworkPacket::getPeerId(), getPlayerName(), sendRequestedMedia(), and verbosestream.

+ Here is the call graph for this function:

◆ handleCommand_SrpBytesA()

◆ handleCommand_SrpBytesM()

◆ handleCommand_UpdateClientInfo()

void Server::handleCommand_UpdateClientInfo ( NetworkPacket * pkt)

References CS_Invalid, getClient(), NetworkPacket::getPeerId(), ClientDynamicInfo::max_fs_size, ClientDynamicInfo::real_gui_scaling, ClientDynamicInfo::real_hud_scaling, ClientDynamicInfo::render_target_size, and ClientDynamicInfo::touch_controls.

+ Here is the call graph for this function:

◆ HandlePlayerDeath()

void Server::HandlePlayerDeath ( PlayerSAO * sao,
const PlayerHPChangeReason & reason )
private

References ActiveObject::clearParentAttachment(), Player::getName(), PlayerSAO::getPlayer(), infostream, m_script, and ScriptApiPlayer::on_dieplayer().

Referenced by HandlePlayerHPChange().

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

◆ HandlePlayerHPChange()

void Server::HandlePlayerHPChange ( PlayerSAO * sao,
const PlayerHPChangeReason & reason )

References HandlePlayerDeath(), UnitSAO::isDead(), m_script, ScriptApiEnv::player_event(), SendPlayerHP(), UnitSAO::sendPunchCommand(), PlayerHPChangeReason::SET_HP_MAX, and PlayerHPChangeReason::type.

Referenced by PlayerSAO::setHP().

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

◆ hudAdd()

u32 Server::hudAdd ( RemotePlayer * player,
HudElement * element )

References Player::addHud(), RemotePlayer::getPeerId(), and SendHUDAdd().

Referenced by ObjectRef::l_hud_add().

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

◆ hudChange()

bool Server::hudChange ( RemotePlayer * player,
u32 id,
HudElementStat stat,
void * value )

References RemotePlayer::getPeerId(), and SendHUDChange().

Referenced by ObjectRef::l_hud_change().

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

◆ hudRemove()

bool Server::hudRemove ( RemotePlayer * player,
u32 id )

References RemotePlayer::getPeerId(), Player::removeHud(), and SendHUDRemove().

+ Here is the call graph for this function:

◆ hudSetFlags()

bool Server::hudSetFlags ( RemotePlayer * player,
u32 flags,
u32 mask )

References RemotePlayer::getPeerId(), RemotePlayer::getPlayerSAO(), Player::hud_flags, m_script, ScriptApiEnv::player_event(), and SendHUDSetFlags().

+ Here is the call graph for this function:

◆ hudSetHotbarImage()

void Server::hudSetHotbarImage ( RemotePlayer * player,
const std::string & name )

References RemotePlayer::getHotbarImage(), RemotePlayer::getPeerId(), HUD_PARAM_HOTBAR_IMAGE, SendHUDSetParam(), and RemotePlayer::setHotbarImage().

Referenced by ObjectRef::l_hud_set_hotbar_image().

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

◆ hudSetHotbarItemcount()

bool Server::hudSetHotbarItemcount ( RemotePlayer * player,
s32 hotbar_itemcount )

References RemotePlayer::getHotbarItemcount(), RemotePlayer::getPeerId(), HUD_HOTBAR_ITEMCOUNT_MAX, HUD_PARAM_HOTBAR_ITEMCOUNT, SendHUDSetParam(), RemotePlayer::setHotbarItemcount(), and writeS32().

+ Here is the call graph for this function:

◆ hudSetHotbarSelectedImage()

void Server::hudSetHotbarSelectedImage ( RemotePlayer * player,
const std::string & name )

References RemotePlayer::getHotbarSelectedImage(), RemotePlayer::getPeerId(), HUD_PARAM_HOTBAR_SELECTED_IMAGE, SendHUDSetParam(), and RemotePlayer::setHotbarSelectedImage().

Referenced by ObjectRef::l_hud_set_hotbar_selected_image().

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

◆ init()

void Server::init ( )
private

References IWritableItemDefManager::applyTextureOverrides(), NodeDefManager::applyTextureOverrides(), Database::beginSave(), SubgameSpec::checkAndLog(), Settings::createLayer(), DIR_DELIM, FATAL_ERROR, fillMediaCache(), g_settings, Settings::get(), Settings::getBool(), fs::GetFilenameFromPath(), Settings::getFloat(), TextureOverrideSource::getItemTextureOverrides(), TextureOverrideSource::getNodeTileOverrides(), fs::GetRecursiveDirs(), ServerEnvironment::getServerMap(), Settings::getU16(), Settings::getU32(), Settings::getU64(), ServerModManager::getUnsatisfiedModsError(), SubgameSpec::id, infostream, ServerEnvironment::init(), ServerScripting::initAsync(), IWritableCraftDefManager::initHashes(), ScriptApiEnv::initializeEnvironment(), EmergeManager::initMapgens(), ServerModManager::isConsistent(), ServerScripting::loadBuiltin(), loadGameConfAndInitWorld(), ServerEnvironment::loadMeta(), ServerModManager::loadMods(), m_banmanager, m_clients, m_craftdef, m_csm_restriction_flags, m_csm_restriction_noderange, m_emerge, m_env, m_game_settings, m_gamespec, m_inventory_mgr, m_itemdef, m_liquid_transform_every, m_max_chatmessage_length, m_metrics_backend, m_mod_storage_database, m_modmgr, m_nodedef, m_path_world, m_rollback, m_script, m_simple_singleplayer_mode, openModStorageDatabase(), SubgameSpec::path, NodeDefManager::resolveCrossrefs(), NodeDefManager::runNodeResolveCallbacks(), ServerScripting::saveGlobals(), ClientInterface::setEnv(), ServerInventoryManager::setEnv(), NodeDefManager::setNodeRegistrationStatus(), SL_GAME, NodeDefManager::updateAliases(), and BaseException::what().

Referenced by start().

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

◆ isShutdownRequested()

bool Server::isShutdownRequested ( ) const
inline

References Server::ShutdownState::is_requested, and m_shutdown_state.

Referenced by ~Server().

+ Here is the caller graph for this function:

◆ isSingleplayer()

bool Server::isSingleplayer ( ) const
inline

References m_simple_singleplayer_mode.

Referenced by AsyncRunStep(), emergePlayer(), handleCommand_FirstSrp(), handleCommand_Init(), handleCommand_Interact(), ModApiServer::l_is_singleplayer(), and reportPrivsModified().

+ Here is the caller graph for this function:

◆ joinModChannel()

bool Server::joinModChannel ( const std::string & channel)
virtual

Implements IGameDef.

References ModChannelMgr::joinChannel(), m_modchannel_mgr, MODCHANNEL_STATE_READ_WRITE, PEER_ID_SERVER, and ModChannelMgr::setChannelState().

+ Here is the call graph for this function:

◆ kickAllPlayers()

void Server::kickAllPlayers ( AccessDeniedCode reason,
const std::string & str_reason,
bool reconnect )

References DenyAccess(), ClientInterface::getClientIDs(), and m_clients.

Referenced by ~Server(), and step().

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

◆ leaveModChannel()

bool Server::leaveModChannel ( const std::string & channel)
virtual

Implements IGameDef.

References ModChannelMgr::leaveChannel(), m_modchannel_mgr, and PEER_ID_SERVER.

+ Here is the call graph for this function:

◆ migrateModStorageDatabase()

bool Server::migrateModStorageDatabase ( const GameParams & game_params,
const Settings & cmd_args )
static

References actionstream, Database::beginSave(), DIR_DELIM, Database::endSave(), errorstream, Settings::exists(), Settings::get(), ModStorageDatabase::getModEntries(), ModStorageDatabase::listMods(), openModStorageDatabase(), Settings::readConfigFile(), fs::Rename(), Settings::set(), ModStorageDatabase::setModEntry(), Settings::updateConfigFile(), warningstream, BaseException::what(), and GameParams::world_path.

Referenced by run_dedicated_server().

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

◆ nextSoundId()

s32 Server::nextSoundId ( )
inlineprivate

References m_playing_sounds, and m_playing_sounds_id_last_used.

Referenced by playSound().

+ Here is the caller graph for this function:

◆ notifyPlayer()

void Server::notifyPlayer ( const char * name,
const std::wstring & msg )

References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_admin_chat, m_admin_nick, m_env, ChatInterface::outgoing_queue, MutexedQueue< T >::push_back(), and SendChatMessage().

+ Here is the call graph for this function:

◆ notifyPlayers()

void Server::notifyPlayers ( const std::wstring & msg)

References PEER_ID_INEXISTENT, and SendChatMessage().

+ Here is the call graph for this function:

◆ onMapEditEvent()

void Server::onMapEditEvent ( const MapEditEvent & event)
virtual

Implements MapEventReceiver.

References VoxelArea::contains(), MapEditEvent::getArea(), m_ignore_map_edit_events_area, and m_unsent_map_edit_queue.

+ Here is the call graph for this function:

◆ openModStorageDatabase() [1/2]

ModStorageDatabase * Server::openModStorageDatabase ( const std::string & backend,
const std::string & world_path,
const Settings & world_mt )
static

References Settings::getNoEx().

+ Here is the call graph for this function:

◆ openModStorageDatabase() [2/2]

ModStorageDatabase * Server::openModStorageDatabase ( const std::string & world_path)
static

References DIR_DELIM, Settings::exists(), Settings::get(), openModStorageDatabase(), Settings::readConfigFile(), and warningstream.

Referenced by init(), migrateModStorageDatabase(), and openModStorageDatabase().

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

◆ overrideDayNightRatio()

void Server::overrideDayNightRatio ( RemotePlayer * player,
bool do_override,
float brightness )

References RemotePlayer::getPeerId(), RemotePlayer::overrideDayNightRatio(), sanity_check, and SendOverrideDayNightRatio().

Referenced by ObjectRef::l_override_day_night_ratio().

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

◆ peerAdded()

void Server::peerAdded ( con::IPeer * peer)
virtual

Implements con::PeerHandler.

References ClientInterface::CreateClient(), con::IPeer::id, m_clients, and verbosestream.

+ Here is the call graph for this function:

◆ playSound()

s32 Server::playSound ( ServerPlayingSound & params,
bool ephemeral = false )

References ServerActiveObject::getBasePosition(), ClientInterface::getClientIDs(), Player::getName(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), infostream, Local, m_clients, m_env, m_playing_sounds, nextSoundId(), params, ClientInterface::sendCustom(), and TOCLIENT_PLAY_SOUND.

Referenced by ModApiServer::l_sound_play().

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

◆ printToConsoleOnly()

void Server::printToConsoleOnly ( const std::string & text)

References m_admin_chat, ChatInterface::outgoing_queue, MutexedQueue< T >::push_back(), and utf8_to_wide().

Referenced by ModApiServer::l_print().

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

◆ process_PlayerPos()

void Server::process_PlayerPos ( RemotePlayer * player,
PlayerSAO * playersao,
NetworkPacket * pkt )

References PlayerSAO::checkMovementCheat(), Player::control, NetworkPacket::getRemainingBytes(), UnitSAO::isAttached(), m_script, modulo360f(), ScriptApiPlayer::on_cheat(), SendMovePlayer(), PlayerSAO::setBasePosition(), PlayerSAO::setCameraInverted(), PlayerSAO::setFov(), PlayerSAO::setLookPitch(), PlayerSAO::setPlayerYaw(), Player::setSpeed(), PlayerSAO::setWantedRange(), PlayerControl::unpackKeysPressed(), and wrapDegrees_0_360().

Referenced by handleCommand_Interact(), and handleCommand_PlayerPos().

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

◆ ProcessData()

void Server::ProcessData ( NetworkPacket * pkt)

References actionstream, CS_Active, CS_InitDone, errorstream, g_profiler, getClient(), ClientInterface::getClientState(), NetworkPacket::getCommand(), NetworkPacket::getPeerId(), handleCommand(), infostream, m_clients, SER_FMT_VER_INVALID, RemoteClient::serialization_version, TOSERVER_NUM_MSG_TYPES, TOSERVER_PLAYERPOS, TOSERVER_STATE_NOT_CONNECTED, TOSERVER_STATE_STARTUP, toServerCommandTable, and BaseException::what().

Referenced by Receive().

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

◆ Receive()

void Server::Receive ( float timeout)

References NetworkPacket::clear(), DenyAccess(), errorstream, NetworkPacket::getPeerId(), porting::getTimeUs(), MetricCounter::increment(), infostream, m_con, m_packet_recv_counter, m_packet_recv_processed_counter, ProcessData(), con::IConnection::ReceiveTimeoutMs(), SERVER_ACCESSDENIED_UNEXPECTED_DATA, FrameMarker::started(), BaseException::what(), and ZoneScoped.

Referenced by ServerThread::run().

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

◆ reportFormspecPrependModified()

void Server::reportFormspecPrependModified ( const std::string & name)

References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendPlayerFormspecPrepend().

Referenced by ObjectRef::l_set_formspec_prepend().

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

◆ reportInventoryFormspecModified()

void Server::reportInventoryFormspecModified ( const std::string & name)

References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendPlayerInventoryFormspec().

Referenced by ObjectRef::l_set_inventory_formspec().

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

◆ reportPrivsModified()

void Server::reportPrivsModified ( const std::string & name = "")

References ClientInterface::getClientIDs(), Player::getName(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), getPlayerEffectivePrivs(), RemotePlayer::getPlayerSAO(), isSingleplayer(), m_clients, m_env, reportPrivsModified(), SendPlayerPrivileges(), and PlayerSAO::updatePrivileges().

Referenced by ModApiServer::l_notify_authentication_modified(), and reportPrivsModified().

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

◆ requestShutdown()

void Server::requestShutdown ( const std::string & msg,
bool reconnect,
float delay = 0.0f )

References duration_to_string(), infostream, Server::ShutdownState::is_requested, Server::ShutdownState::isTimerRunning(), m_shutdown_state, myround(), PEER_ID_INEXISTENT, Server::ShutdownState::reset(), SendChatMessage(), Server::ShutdownState::trigger(), and utf8_to_wide().

Referenced by ModApiServer::l_request_shutdown().

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

◆ rollbackRevertActions()

bool Server::rollbackRevertActions ( const std::list< RollbackAction > & actions,
std::list< std::string > * log )

References ServerEnvironment::getServerMap(), infostream, m_env, and m_inventory_mgr.

+ Here is the call graph for this function:

◆ Send() [1/2]

◆ Send() [2/2]

void Server::Send ( session_t peer_id,
NetworkPacket * pkt )

References m_clients, and ClientInterface::send().

+ Here is the call graph for this function:

◆ SendAccessDenied()

void Server::SendAccessDenied ( session_t peer_id,
AccessDeniedCode reason,
std::string_view custom_reason,
bool reconnect = false )
private

References Send(), SERVER_ACCESSDENIED_MAX, and TOCLIENT_ACCESS_DENIED.

Referenced by DenyAccess().

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

◆ SendActiveObjectMessages()

void Server::SendActiveObjectMessages ( session_t peer_id,
const std::string & datas,
bool reliable = true )
private

References clientCommandFactoryTable, NetworkPacket::getCommand(), NetworkPacket::getPeerId(), m_clients, NetworkPacket::putRawString(), ClientInterface::sendCustom(), and TOCLIENT_ACTIVE_OBJECT_MESSAGES.

Referenced by AsyncRunStep().

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

◆ SendActiveObjectRemoveAdd()

void Server::SendActiveObjectRemoveAdd ( RemoteClient * client,
PlayerSAO * playersao )
private

References Settings::exists(), FUNCTION_NAME, g_settings, ServerEnvironment::getActiveObject(), ServerEnvironment::getAddedActiveObjects(), Settings::getBool(), ServerActiveObject::getClientInitializationData(), ServerEnvironment::getRemovedActiveObjects(), Settings::getS16(), ServerActiveObject::getSendType(), NetworkPacket::getSize(), PlayerSAO::getWantedRange(), m_env, ServerActiveObject::m_known_by_count, MAP_BLOCKSIZE, MYMIN, NetworkPacket::putLongString(), Send(), TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD, verbosestream, and warningstream.

Referenced by AsyncRunStep(), and handleCommand_Init2().

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

◆ sendAddNode()

void Server::sendAddNode ( v3s16 p,
MapNode n,
std::unordered_set< u16 > * far_players = nullptr,
float far_d_nodes = 100,
bool remove_metadata = true )
private

References BS, getNodeBlockPos(), intToFloat(), p(), MapNode::param0, MapNode::param1, MapNode::param2, sendNodeChangePkt(), and TOCLIENT_ADDNODE.

Referenced by AsyncRunStep().

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

◆ SendAddParticleSpawner()

void Server::SendAddParticleSpawner ( session_t peer_id,
u16 protocol_version,
const ParticleSpawnerParameters & p,
u16 attached_id,
u32 id )
private

References BS, g_settings, ServerActiveObject::getBasePosition(), ClientInterface::getClientIDs(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), Settings::getS16(), m_clients, m_env, MAP_BLOCKSIZE, ParticleParamTypes::none, p(), PEER_ID_INEXISTENT, ParticleParamTypes::point, RemotePlayer::protocol_version, NetworkPacket::putLongString(), NetworkPacket::putRawString(), Send(), SendAddParticleSpawner(), ParticleParamTypes::serializeParameterValue(), TOCLIENT_ADD_PARTICLESPAWNER, writeU16(), and writeU8().

Referenced by addParticleSpawner(), and SendAddParticleSpawner().

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

◆ SendBlock()

bool Server::SendBlock ( session_t peer_id,
const v3s16 & blockpos )

References CS_Active, Map::getBlockNoCreateNoEx(), ServerEnvironment::getMap(), ClientInterface::lockedGetClientNoEx(), m_clients, m_env, and SendBlockNoLock().

Referenced by PlayerSAO::addPos(), ObjectRef::l_send_mapblock(), and PlayerSAO::setPos().

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

◆ SendBlockNoLock()

void Server::SendBlockNoLock ( session_t peer_id,
MapBlock * block,
u8 ver,
u16 net_proto_version,
SerializedBlockCache * cache = nullptr )
private

References g_settings, MapBlock::getPos(), Settings::getS16(), NetworkPacket::putRawString(), rangelim, Send(), MapBlock::serialize(), MapBlock::serializeNetworkSpecific(), and TOCLIENT_BLOCKDATA.

Referenced by SendBlock(), and SendBlocks().

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

◆ SendBlocks()

void Server::SendBlocks ( float dtime)
private

References CS_Active, g_profiler, g_settings, Map::getBlockNoCreateNoEx(), ClientInterface::getClientIDs(), ServerEnvironment::getMap(), ServerEnvironment::getPlayerCount(), Settings::getU32(), ClientInterface::lockedGetClientNoEx(), m_clients, m_emerge, m_env, and SendBlockNoLock().

Referenced by AsyncRunStep().

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

◆ SendBreath()

void Server::SendBreath ( session_t peer_id,
u16 breath )
private

References Send(), and TOCLIENT_BREATH.

Referenced by SendPlayerBreath().

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

◆ SendChatMessage()

void Server::SendChatMessage ( session_t peer_id,
const ChatMessage & message )
privatevirtual

Reimplemented in MockServer.

References ServerEnvironment::getPlayer(), m_clients, m_env, ChatMessage::message, PEER_ID_INEXISTENT, Send(), ChatMessage::sender, ClientInterface::sendToAll(), ChatMessage::timestamp, TOCLIENT_CHAT_MESSAGE, and ChatMessage::type.

Referenced by ~Server(), DeleteClient(), handleChat(), handleCommand_ChatMessage(), handleCommand_ClientReady(), handleCommand_FirstSrp(), handleCommand_Init2(), notifyPlayer(), notifyPlayers(), and requestShutdown().

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

◆ SendCloudParams()

void Server::SendCloudParams ( session_t peer_id,
const CloudParams & params )
private

References params, Send(), and TOCLIENT_CLOUD_PARAMS.

Referenced by setClouds().

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

◆ SendCSMRestrictionFlags()

void Server::SendCSMRestrictionFlags ( session_t peer_id)
private

References m_csm_restriction_flags, m_csm_restriction_noderange, Send(), and TOCLIENT_CSM_RESTRICTION_FLAGS.

Referenced by handleCommand_Init2().

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

◆ SendDeleteParticleSpawner()

void Server::SendDeleteParticleSpawner ( session_t peer_id,
u32 id )
private

References m_clients, PEER_ID_INEXISTENT, Send(), ClientInterface::sendToAll(), and TOCLIENT_DELETE_PARTICLESPAWNER.

Referenced by deleteParticleSpawner().

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

◆ sendDetachedInventories()

void Server::sendDetachedInventories ( session_t peer_id,
bool incremental )

References CS_Created, getClient(), RemoteClient::getName(), m_inventory_mgr, PEER_ID_INEXISTENT, ServerInventoryManager::sendDetachedInventories(), and sendDetachedInventory().

Referenced by handleCommand_Init2(), and ServerEnvironment::step().

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

◆ sendDetachedInventory()

void Server::sendDetachedInventory ( Inventory * inventory,
const std::string & name,
session_t peer_id )

References m_clients, PEER_ID_INEXISTENT, NetworkPacket::putRawString(), Send(), ClientInterface::sendToAll(), Inventory::serialize(), Inventory::setModified(), and TOCLIENT_DETACHED_INVENTORY.

Referenced by ServerInventoryManager::createDetachedInventory(), ServerInventoryManager::removeDetachedInventory(), and sendDetachedInventories().

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

◆ SendEyeOffset()

void Server::SendEyeOffset ( session_t peer_id,
v3f first,
v3f third,
v3f third_front )
private

References Send(), and TOCLIENT_EYE_OFFSET.

Referenced by setPlayerEyeOffset().

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

◆ SendHP()

void Server::SendHP ( session_t peer_id,
u16 hp,
bool effect )
private

References Send(), and TOCLIENT_HP.

Referenced by SendPlayerHP().

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

◆ SendHUDAdd()

void Server::SendHUDAdd ( session_t peer_id,
u32 id,
HudElement * form )
private

References HudElement::align, HudElement::dir, HudElement::item, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, HudElement::scale, Send(), HudElement::size, HudElement::style, HudElement::text, HudElement::text2, TOCLIENT_HUDADD, HudElement::type, HudElement::world_pos, and HudElement::z_index.

Referenced by hudAdd().

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

◆ SendHUDChange()

void Server::SendHUDChange ( session_t peer_id,
u32 id,
HudElementStat stat,
void * value )
private

References HUD_STAT_ALIGN, HUD_STAT_NAME, HUD_STAT_OFFSET, HUD_STAT_POS, HUD_STAT_SCALE, HUD_STAT_SIZE, HUD_STAT_TEXT, HUD_STAT_TEXT2, HUD_STAT_WORLD_POS, Send(), and TOCLIENT_HUDCHANGE.

Referenced by hudChange().

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

◆ SendHUDRemove()

void Server::SendHUDRemove ( session_t peer_id,
u32 id )
private

References Send(), and TOCLIENT_HUDRM.

Referenced by hudRemove().

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

◆ SendHUDSetFlags()

void Server::SendHUDSetFlags ( session_t peer_id,
u32 flags,
u32 mask )
private

References Send(), and TOCLIENT_HUD_SET_FLAGS.

Referenced by hudSetFlags().

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

◆ SendHUDSetParam()

void Server::SendHUDSetParam ( session_t peer_id,
u16 param,
std::string_view value )
private

References Send(), and TOCLIENT_HUD_SET_PARAM.

Referenced by hudSetHotbarImage(), hudSetHotbarItemcount(), and hudSetHotbarSelectedImage().

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

◆ SendInventory()

void Server::SendInventory ( RemotePlayer * player,
bool incremental )

References RemotePlayer::getPeerId(), Player::inventory, RemotePlayer::protocol_version, NetworkPacket::putRawString(), Send(), Inventory::serialize(), Inventory::setModified(), RemotePlayer::setModified(), TOCLIENT_INVENTORY, and UpdateCrafting().

Referenced by handleCommand_Interact(), ObjectRef::l_set_wielded_item(), StageTwoClientInit(), and ServerEnvironment::step().

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

◆ SendItemDef()

void Server::SendItemDef ( session_t peer_id,
IItemDefManager * itemdef,
u16 protocol_version )
private

References compressZlib(), NetworkPacket::getSize(), NetworkPacket::putLongString(), Send(), IItemDefManager::serialize(), TOCLIENT_ITEMDEF, and verbosestream.

Referenced by handleCommand_Init2().

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

◆ SendLocalPlayerAnimations()

void Server::SendLocalPlayerAnimations ( session_t peer_id,
v2s32 animation_frames[4],
f32 animation_speed )
private

References Send(), and TOCLIENT_LOCAL_PLAYER_ANIMATIONS.

Referenced by setLocalPlayerAnimations().

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

◆ sendMediaAnnouncement()

void Server::sendMediaAnnouncement ( session_t peer_id,
const std::string & lang_code )
private

References g_settings, Settings::get(), NetworkPacket::getSize(), m_media, Send(), str_ends_with(), TOCLIENT_ANNOUNCE_MEDIA, and verbosestream.

Referenced by handleCommand_Init2().

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

◆ sendMetadataChanged()

void Server::sendMetadataChanged ( const std::unordered_set< v3s16 > & positions,
float far_d_nodes = 100 )
private

References BS, NodeMetadataList::clear(), compressZlib(), floatToInt(), ServerActiveObject::getBasePosition(), ClientInterface::getClientIDs(), ServerEnvironment::getMap(), getNodeBlockPos(), Map::getNodeMetadata(), getPlayerSAO(), ClientInterface::lockedGetClientNoEx(), m_clients, m_env, NetworkPacket::putLongString(), Send(), NodeMetadataList::serialize(), NodeMetadataList::set(), NodeMetadataList::size(), and TOCLIENT_NODEMETA_CHANGED.

Referenced by AsyncRunStep().

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

◆ SendMinimapModes()

void Server::SendMinimapModes ( session_t peer_id,
std::vector< MinimapMode > & modes,
size_t wanted_mode )

References ServerEnvironment::getPlayer(), m_env, Send(), and TOCLIENT_MINIMAP_MODES.

Referenced by ObjectRef::l_set_minimap_modes().

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

◆ sendModChannelMessage()

bool Server::sendModChannelMessage ( const std::string & channel,
const std::string & message )
virtual

Implements IGameDef.

References broadcastModChannelMessage(), ModChannelMgr::canWriteOnChannel(), m_modchannel_mgr, and PEER_ID_SERVER.

+ Here is the call graph for this function:

◆ SendMovement()

void Server::SendMovement ( session_t peer_id)
private

References g_settings, Settings::getFloat(), Send(), and TOCLIENT_MOVEMENT.

Referenced by handleCommand_Init2().

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

◆ SendMovePlayer()

void Server::SendMovePlayer ( PlayerSAO * sao)

References ServerActiveObject::getBasePosition(), PlayerSAO::getLookPitch(), PlayerSAO::getPeerID(), UnitSAO::getRotation(), Send(), UnitSAO::sendOutdatedData(), TOCLIENT_MOVE_PLAYER, and verbosestream.

Referenced by PlayerSAO::moveTo(), process_PlayerPos(), PlayerSAO::setLookPitchAndSend(), PlayerSAO::setPlayerYawAndSend(), PlayerSAO::setPos(), and StageTwoClientInit().

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

◆ SendMovePlayerRel()

void Server::SendMovePlayerRel ( session_t peer_id,
const v3f & added_pos )

References Send(), and TOCLIENT_MOVE_PLAYER_REL.

Referenced by PlayerSAO::addPos().

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

◆ sendNodeChangePkt()

void Server::sendNodeChangePkt ( NetworkPacket & pkt,
v3s16 block_pos,
v3f p,
float far_d_nodes,
std::unordered_set< u16 > * far_players )
private

References BS, ServerActiveObject::getBasePosition(), ClientInterface::getClientIDs(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), ClientInterface::lockedGetClientNoEx(), m_clients, m_env, p(), and Send().

Referenced by sendAddNode(), and sendRemoveNode().

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

◆ SendNodeDef()

void Server::SendNodeDef ( session_t peer_id,
const NodeDefManager * nodedef,
u16 protocol_version )
private

References compressZlib(), NetworkPacket::getSize(), NetworkPacket::putLongString(), Send(), NodeDefManager::serialize(), TOCLIENT_NODEDEF, and verbosestream.

Referenced by handleCommand_Init2().

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

◆ SendOverrideDayNightRatio()

void Server::SendOverrideDayNightRatio ( session_t peer_id,
bool do_override,
float ratio )
private

References Send(), and TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO.

Referenced by overrideDayNightRatio().

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

◆ SendPlayerBreath()

void Server::SendPlayerBreath ( PlayerSAO * sao)

References PlayerSAO::getBreath(), PlayerSAO::getPeerID(), m_script, ScriptApiEnv::player_event(), and SendBreath().

Referenced by PlayerSAO::setBreath(), and StageTwoClientInit().

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

◆ SendPlayerFormspecPrepend()

void Server::SendPlayerFormspecPrepend ( session_t peer_id)
private

References Player::formspec_prepend, ServerEnvironment::getPlayer(), m_env, Send(), and TOCLIENT_FORMSPEC_PREPEND.

Referenced by reportFormspecPrependModified().

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

◆ SendPlayerFov()

void Server::SendPlayerFov ( session_t peer_id)

References PlayerFovSpec::fov, Player::getFov(), ServerEnvironment::getPlayer(), PlayerFovSpec::is_multiplier, m_env, Send(), TOCLIENT_FOV, and PlayerFovSpec::transition_time.

Referenced by ObjectRef::l_set_fov().

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

◆ SendPlayerHP()

void Server::SendPlayerHP ( PlayerSAO * sao,
bool effect )

References UnitSAO::getHP(), PlayerSAO::getPeerID(), and SendHP().

Referenced by HandlePlayerHPChange(), PlayerSAO::setHP(), and StageTwoClientInit().

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

◆ SendPlayerInventoryFormspec()

void Server::SendPlayerInventoryFormspec ( session_t peer_id)
private

References ServerEnvironment::getPlayer(), Player::inventory_formspec, m_env, NetworkPacket::putLongString(), Send(), and TOCLIENT_INVENTORY_FORMSPEC.

Referenced by reportInventoryFormspecModified(), and StageTwoClientInit().

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

◆ SendPlayerPrivileges()

void Server::SendPlayerPrivileges ( session_t peer_id)
private

References ScriptApiServer::getAuth(), Player::getName(), ServerEnvironment::getPlayer(), m_env, m_script, Send(), and TOCLIENT_PRIVILEGES.

Referenced by reportPrivsModified(), and StageTwoClientInit().

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

◆ SendPlayerSpeed()

void Server::SendPlayerSpeed ( session_t peer_id,
const v3f & added_vel )

References Send(), and TOCLIENT_PLAYER_SPEED.

Referenced by ObjectRef::l_add_velocity().

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

◆ sendRemoveNode()

void Server::sendRemoveNode ( v3s16 p,
std::unordered_set< u16 > * far_players = nullptr,
float far_d_nodes = 100 )
private

References BS, getNodeBlockPos(), intToFloat(), p(), sendNodeChangePkt(), and TOCLIENT_REMOVENODE.

Referenced by AsyncRunStep().

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

◆ sendRequestedMedia()

void Server::sendRequestedMedia ( session_t peer_id,
const std::unordered_set< std::string > & tosend )
private

References CS_DefinitionsSent, errorstream, getClient(), NetworkPacket::getSize(), infostream, m_media, NetworkPacket::putLongString(), fs::ReadFile(), Send(), TOCLIENT_MEDIA, and verbosestream.

Referenced by handleCommand_RequestMedia().

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

◆ SendSetLighting()

void Server::SendSetLighting ( session_t peer_id,
const Lighting & lighting )
private

References AutoExposure::center_weight_power, Lighting::exposure, AutoExposure::exposure_correction, AutoExposure::luminance_max, AutoExposure::luminance_min, Lighting::saturation, Send(), Lighting::shadow_intensity, Lighting::shadow_tint, AutoExposure::speed_bright_dark, AutoExposure::speed_dark_bright, TOCLIENT_SET_LIGHTING, and Lighting::volumetric_light_strength.

Referenced by setLighting().

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

◆ SendSetMoon()

void Server::SendSetMoon ( session_t peer_id,
const MoonParams & params )
private

References params, Send(), and TOCLIENT_SET_MOON.

Referenced by setMoon().

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

◆ SendSetSky()

void Server::SendSetSky ( session_t peer_id,
const SkyboxParams & params )
private

References ClientInterface::getProtocolVersion(), m_clients, params, Send(), and TOCLIENT_SET_SKY.

Referenced by setSky().

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

◆ SendSetStars()

void Server::SendSetStars ( session_t peer_id,
const StarParams & params )
private

References params, Send(), and TOCLIENT_SET_STARS.

Referenced by setStars().

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

◆ SendSetSun()

void Server::SendSetSun ( session_t peer_id,
const SunParams & params )
private

References params, Send(), and TOCLIENT_SET_SUN.

Referenced by setSun().

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

◆ SendShowFormspecMessage()

void Server::SendShowFormspecMessage ( session_t peer_id,
const std::string & formspec,
const std::string & formname )
private

References m_formspec_state_data, NetworkPacket::putLongString(), Send(), and TOCLIENT_SHOW_FORMSPEC.

Referenced by showFormspec().

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

◆ SendSpawnParticle()

void Server::SendSpawnParticle ( session_t peer_id,
u16 protocol_version,
const ParticleParameters & p )
private

References BS, g_settings, ServerActiveObject::getBasePosition(), ClientInterface::getClientIDs(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), Settings::getS16(), m_clients, m_env, MAP_BLOCKSIZE, p(), PEER_ID_INEXISTENT, RemotePlayer::protocol_version, NetworkPacket::putRawString(), Send(), SendSpawnParticle(), and TOCLIENT_SPAWN_PARTICLE.

Referenced by SendSpawnParticle(), and spawnParticle().

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

◆ SendTimeOfDay()

void Server::SendTimeOfDay ( session_t peer_id,
u16 time,
f32 time_speed )
private

References m_clients, PEER_ID_INEXISTENT, Send(), ClientInterface::sendToAll(), and TOCLIENT_TIME_OF_DAY.

Referenced by AsyncRunStep(), and handleCommand_Init2().

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

◆ setAsyncFatalError() [1/2]

void Server::setAsyncFatalError ( const LuaError & e)
inline

References setAsyncFatalError(), and BaseException::what().

+ Here is the call graph for this function:

◆ setAsyncFatalError() [2/2]

void Server::setAsyncFatalError ( const std::string & error)
inline

References m_async_fatal_error, and MutexedVariable< T >::set().

Referenced by EmergeThread::finishGen(), EmergeThread::initScripting(), AsyncWorkerThread::run(), EmergeThread::run(), ServerThread::run(), and setAsyncFatalError().

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

◆ setClouds()

void Server::setClouds ( RemotePlayer * player,
const CloudParams & params )

References RemotePlayer::getPeerId(), params, sanity_check, SendCloudParams(), and RemotePlayer::setCloudParams().

Referenced by ObjectRef::l_set_clouds().

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

◆ setIpBanned()

void Server::setIpBanned ( const std::string & ip,
const std::string & name )

References BanManager::add(), CS_Created, denyIfBanned(), ClientInterface::getClientIDs(), m_banmanager, and m_clients.

+ Here is the call graph for this function:

◆ setLighting()

void Server::setLighting ( RemotePlayer * player,
const Lighting & lighting )

References RemotePlayer::getPeerId(), sanity_check, SendSetLighting(), and RemotePlayer::setLighting().

Referenced by ObjectRef::l_set_lighting().

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

◆ setLocalPlayerAnimations()

void Server::setLocalPlayerAnimations ( RemotePlayer * player,
v2s32 animation_frames[4],
f32 frame_speed )

References RemotePlayer::getPeerId(), sanity_check, SendLocalPlayerAnimations(), and RemotePlayer::setLocalAnimations().

Referenced by ObjectRef::l_set_local_animation().

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

◆ setMoon()

void Server::setMoon ( RemotePlayer * player,
const MoonParams & params )

References RemotePlayer::getPeerId(), params, sanity_check, SendSetMoon(), and RemotePlayer::setMoon().

Referenced by ObjectRef::l_set_moon(), and ObjectRef::l_set_sky().

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

◆ setPlayerEyeOffset()

void Server::setPlayerEyeOffset ( RemotePlayer * player,
v3f first,
v3f third,
v3f third_front )

References Player::eye_offset_first, Player::eye_offset_third, Player::eye_offset_third_front, RemotePlayer::getPeerId(), sanity_check, and SendEyeOffset().

Referenced by ObjectRef::l_set_eye_offset().

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

◆ setSky()

void Server::setSky ( RemotePlayer * player,
const SkyboxParams & params )

References RemotePlayer::getPeerId(), params, sanity_check, SendSetSky(), and RemotePlayer::setSky().

Referenced by ObjectRef::l_set_sky().

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

◆ setStars()

void Server::setStars ( RemotePlayer * player,
const StarParams & params )

References RemotePlayer::getPeerId(), params, sanity_check, SendSetStars(), and RemotePlayer::setStars().

Referenced by ObjectRef::l_set_sky(), and ObjectRef::l_set_stars().

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

◆ setStepSettings()

void Server::setStepSettings ( StepSettings spdata)
inline

References m_step_settings.

◆ setSun()

void Server::setSun ( RemotePlayer * player,
const SunParams & params )

References RemotePlayer::getPeerId(), params, sanity_check, SendSetSun(), and RemotePlayer::setSun().

Referenced by ObjectRef::l_set_sky(), and ObjectRef::l_set_sun().

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

◆ setTimeOfDay()

void Server::setTimeOfDay ( u32 time)

References m_env, m_time_of_day_send_timer, and Environment::setTimeOfDay().

Referenced by ModApiEnv::l_set_timeofday().

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

◆ showFormspec()

bool Server::showFormspec ( const char * name,
const std::string & formspec,
const std::string & formname )

References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendShowFormspecMessage().

+ Here is the call graph for this function:

◆ spawnParticle()

void Server::spawnParticle ( const std::string & playername,
const ParticleParameters & p )

References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, p(), PEER_ID_INEXISTENT, RemotePlayer::protocol_version, and SendSpawnParticle().

Referenced by ModApiParticles::l_add_particle().

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

◆ StageTwoClientInit()

PlayerSAO * Server::StageTwoClientInit ( session_t peer_id)

◆ start()

void Server::start ( )

References actionstream, SubgameSpec::id, infostream, init(), m_admin_chat, m_bind_addr, m_con, m_gamespec, m_path_world, m_thread, Address::print(), Address::serializeString(), con::IConnection::Serve(), Thread::start(), and Thread::stop().

+ Here is the call graph for this function:

◆ step()

void Server::step ( )

References g_settings, MutexedVariable< T >::get(), Settings::get(), Settings::getBool(), kickAllPlayers(), m_async_fatal_error, m_simple_singleplayer_mode, and SERVER_ACCESSDENIED_CRASH.

Referenced by fadeSound().

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

◆ stepPendingDynMediaCallbacks()

void Server::stepPendingDynMediaCallbacks ( float dtime)
private

References fs::DeleteSingleFileOrEmptyDirectory(), ScriptApiServer::freeDynamicMediaCallback(), getScriptIface(), m_media, m_pending_dyn_media, and sanity_check.

Referenced by AsyncRunStep().

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

◆ stop()

void Server::stop ( )

References infostream, m_thread, Thread::stop(), and Thread::wait().

Referenced by ~Server().

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

◆ stopSound()

void Server::stopSound ( s32 handle)

References ServerPlayingSound::clients, m_playing_sounds, Send(), and TOCLIENT_STOP_SOUND.

Referenced by ModApiServer::l_sound_stop().

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

◆ unsetIpBanned()

void Server::unsetIpBanned ( const std::string & ip_or_name)

References m_banmanager, and BanManager::remove().

Referenced by ModApiServer::l_unban_player_or_ip().

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

◆ UpdateCrafting()

void Server::UpdateCrafting ( RemotePlayer * player)
private

References InventoryList::changeItem(), InventoryList::checkModified(), getCraftingResult(), Inventory::getList(), Player::getName(), RemotePlayer::getPlayerSAO(), ServerEnvironment::getScriptIface(), InventoryList::getSize(), Player::inventory, ScriptApiItem::item_CraftPredict(), m_env, and InventoryLocation::setPlayer().

Referenced by SendInventory().

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

◆ yieldToOtherThreads()

void Server::yieldToOtherThreads ( float dtime)

References Profiler::avg(), g_profiler, EmergeManager::getQueueSize(), m_emerge, sleep_ms, and SPT_AVG.

Referenced by ServerThread::run().

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

Friends And Related Symbol Documentation

◆ EmergeThread

friend class EmergeThread
friend

◆ RemoteClient

friend class RemoteClient
friend

◆ TestMoveAction

friend class TestMoveAction
friend

◆ TestServerShutdownState

friend class TestServerShutdownState
friend

Member Data Documentation

◆ m_admin_chat

◆ m_admin_nick

std::string Server::m_admin_nick
private

◆ m_aom_buffer_counter

MetricCounterPtr Server::m_aom_buffer_counter[2]
private

Referenced by Server(), and AsyncRunStep().

◆ m_async_fatal_error

MutexedVariable<std::string> Server::m_async_fatal_error
private

Referenced by setAsyncFatalError(), and step().

◆ m_async_init_files

std::vector<std::pair<std::string, std::string> > Server::m_async_init_files

◆ m_banmanager

BanManager* Server::m_banmanager = nullptr
private

◆ m_bind_addr

Address Server::m_bind_addr

Referenced by AsyncRunStep(), and start().

◆ m_clients

◆ m_con

std::shared_ptr<con::IConnection> Server::m_con
private

◆ m_craftdef

◆ m_csm_restriction_flags

u64 Server::m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE
private

Referenced by init(), and SendCSMRestrictionFlags().

◆ m_csm_restriction_noderange

u32 Server::m_csm_restriction_noderange = 8
private

Referenced by init(), and SendCSMRestrictionFlags().

◆ m_dedicated

bool Server::m_dedicated
private

Referenced by AsyncRunStep().

◆ m_emerge

◆ m_emergethread_trigger_timer

float Server::m_emergethread_trigger_timer = 0.0f
private

Referenced by AsyncRunStep().

◆ m_env

◆ m_env_mutex

ordered_mutex Server::m_env_mutex
private

◆ m_formspec_state_data

std::unordered_map<session_t, std::string> Server::m_formspec_state_data
private

◆ m_game_settings

Settings* Server::m_game_settings = nullptr
private

Referenced by ~Server(), and init().

◆ m_gamespec

SubgameSpec Server::m_gamespec
private

◆ m_ignore_map_edit_events_area

VoxelArea Server::m_ignore_map_edit_events_area
private

◆ m_inventory_mgr

◆ m_itemdef

◆ m_lag_gauge

MetricGaugePtr Server::m_lag_gauge
private

Referenced by Server(), and AsyncRunStep().

◆ m_liquid_transform_every

float Server::m_liquid_transform_every = 1.0f
private

Referenced by AsyncRunStep(), and init().

◆ m_liquid_transform_timer

float Server::m_liquid_transform_timer = 0.0f
private

Referenced by AsyncRunStep().

◆ m_lua_globals_data

◆ m_map_edit_event_counter

MetricCounterPtr Server::m_map_edit_event_counter
private

Referenced by Server(), and AsyncRunStep().

◆ m_map_timer_and_unload_interval

IntervalLimiter Server::m_map_timer_and_unload_interval
private

Referenced by AsyncRunStep().

◆ m_mapgen_init_files

std::vector<std::pair<std::string, std::string> > Server::m_mapgen_init_files

◆ m_masterserver_timer

float Server::m_masterserver_timer = 0.0f
private

Referenced by AsyncRunStep().

◆ m_max_chatmessage_length

u16 Server::m_max_chatmessage_length
private

Referenced by handleChat(), and init().

◆ m_max_lag_decrease

IntervalLimiter Server::m_max_lag_decrease
private

Referenced by AsyncRunStep().

◆ m_media

◆ m_metrics_backend

std::unique_ptr<MetricsBackend> Server::m_metrics_backend
private

Referenced by Server(), and init().

◆ m_mod_storage_database

ModStorageDatabase* Server::m_mod_storage_database = nullptr
private

◆ m_mod_storage_save_timer

float Server::m_mod_storage_save_timer = 10.0f
private

Referenced by AsyncRunStep().

◆ m_modchannel_mgr

◆ m_modmgr

std::unique_ptr<ServerModManager> Server::m_modmgr
protected

◆ m_nodedef

◆ m_packet_recv_counter

MetricCounterPtr Server::m_packet_recv_counter
private

Referenced by Server(), and Receive().

◆ m_packet_recv_processed_counter

MetricCounterPtr Server::m_packet_recv_processed_counter
private

Referenced by Server(), and Receive().

◆ m_path_mod_data

std::string Server::m_path_mod_data
private

Referenced by Server(), and getModDataPath().

◆ m_path_world

std::string Server::m_path_world
private

Referenced by Server(), getWorldPath(), init(), and start().

◆ m_pending_dyn_media

std::unordered_map<u32, PendingDynamicMediaCallback> Server::m_pending_dyn_media
private

◆ m_player_gauge

MetricGaugePtr Server::m_player_gauge
private

Referenced by Server(), and AsyncRunStep().

◆ m_playing_sounds

std::unordered_map<s32, ServerPlayingSound> Server::m_playing_sounds
private

◆ m_playing_sounds_id_last_used

s32 Server::m_playing_sounds_id_last_used = 0
private

Referenced by nextSoundId().

◆ m_rollback

◆ m_savemap_timer

float Server::m_savemap_timer = 0.0f
private

Referenced by AsyncRunStep().

◆ m_script

◆ m_shutdown_errmsg

std::string* const Server::m_shutdown_errmsg
private

Referenced by addShutdownError().

◆ m_shutdown_state

◆ m_simple_singleplayer_mode

bool Server::m_simple_singleplayer_mode
private

◆ m_step_pending_dyn_media_timer

float Server::m_step_pending_dyn_media_timer = 0.0f
private

Referenced by AsyncRunStep().

◆ m_step_settings

std::atomic<StepSettings> Server::m_step_settings {{0.1f, false}}
private

Referenced by getStepSettings(), and setStepSettings().

◆ m_thread

ServerThread* Server::m_thread = nullptr
private

Referenced by ~Server(), start(), and stop().

◆ m_time_of_day_send_timer

float Server::m_time_of_day_send_timer = 0.0f
private

Referenced by AsyncRunStep(), and setTimeOfDay().

◆ m_timeofday_gauge

MetricGaugePtr Server::m_timeofday_gauge
private

Referenced by Server(), and AsyncRunStep().

◆ m_unsent_map_edit_queue

std::queue<MapEditEvent*> Server::m_unsent_map_edit_queue
private

◆ m_uptime_counter

MetricCounterPtr Server::m_uptime_counter
private

◆ server_translations

std::unordered_map<std::string, Translations> Server::server_translations
private

Referenced by getTranslationLanguage().


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