#include <server.h>
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) |
PlayerSAO * | StageTwoClientInit (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 ¶ms, 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) |
ServerInventoryManager * | getInventoryMgr () const |
void | sendDetachedInventory (Inventory *inventory, const std::string &name, session_t peer_id) |
ServerScripting * | getScriptIface () |
bool | rollbackRevertActions (const std::list< RollbackAction > &actions, std::list< std::string > *log) |
virtual IItemDefManager * | getItemDefManager () |
virtual const NodeDefManager * | getNodeDefManager () |
virtual ICraftDefManager * | getCraftDefManager () |
virtual u16 | allocateUnknownNodeId (const std::string &name) |
IRollbackManager * | getRollbackManager () |
virtual EmergeManager * | getEmergeManager () |
virtual ModStorageDatabase * | getModStorageDatabase () |
IWritableItemDefManager * | getWritableItemDefManager () |
NodeDefManager * | getWritableNodeDefManager () |
IWritableCraftDefManager * | getWritableCraftDefManager () |
virtual const std::vector< ModSpec > & | getMods () const |
virtual const ModSpec * | getModSpec (const std::string &modname) const |
virtual const SubgameSpec * | getGameSpec () 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) |
Map & | getMap () |
ServerEnvironment & | getEnv () |
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 ¶ms) |
void | setSun (RemotePlayer *player, const SunParams ¶ms) |
void | setMoon (RemotePlayer *player, const MoonParams ¶ms) |
void | setStars (RemotePlayer *player, const StarParams ¶ms) |
void | setClouds (RemotePlayer *player, const CloudParams ¶ms) |
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 ClientDynamicInfo * | getClientDynamicInfo (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) |
ModChannel * | getModChannel (const std::string &channel) |
bool | SendBlock (session_t peer_id, const v3s16 &blockpos) |
Translations * | getTranslationLanguage (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 | |
IItemDefManager * | idef () |
const NodeDefManager * | ndef () |
ICraftDefManager * | cdef () |
IRollbackManager * | rollback () |
Static Public Member Functions | |
static std::string | getBuiltinLuaPath () |
static ModStorageDatabase * | openModStorageDatabase (const std::string &world_path) |
static ModStorageDatabase * | openModStorageDatabase (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< PackedValue > | m_lua_globals_data |
Address | m_bind_addr |
Protected Attributes | |
std::unique_ptr< ServerScripting > | m_script |
std::unique_ptr< ServerModManager > | m_modmgr |
Private Types | |
typedef std::unordered_map< std::pair< v3s16, u16 >, std::string, SBCHash > | SerializedBlockCache |
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 ¶ms) |
void | SendSetSun (session_t peer_id, const SunParams ¶ms) |
void | SendSetMoon (session_t peer_id, const MoonParams ¶ms) |
void | SendSetStars (session_t peer_id, const StarParams ¶ms) |
void | SendCloudParams (session_t peer_id, const CloudParams ¶ms) |
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) |
RemoteClient * | getClient (session_t peer_id, ClientState state_min=CS_Active) |
RemoteClient * | getClientNoEx (session_t peer_id, ClientState state_min=CS_Active) |
std::string | getPlayerName (session_t peer_id) |
PlayerSAO * | getPlayerSAO (session_t peer_id) |
PlayerSAO * | emergePlayer (const char *name, session_t peer_id, u16 proto_version) |
s32 | nextSoundId () |
Friends | |
class | EmergeThread |
class | RemoteClient |
class | TestServerShutdownState |
class | TestMoveAction |
|
private |
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 ) |
References MetricsBackend::addCounter(), MetricsBackend::addGauge(), ARRLEN, fs::CreateDir(), DIR_DELIM, g_settings, Settings::getFloat(), SubgameSpec::isValid(), m_aom_buffer_counter, m_lag_gauge, m_map_edit_event_counter, m_metrics_backend, m_packet_recv_counter, m_packet_recv_processed_counter, m_path_mod_data, m_path_world, m_player_gauge, m_timeofday_gauge, m_uptime_counter, porting::path_user, and MetricGauge::set().
Server::~Server | ( | ) |
References actionstream, addShutdownError(), CHATMESSAGE_TYPE_ANNOUNCE, ServerEnvironment::deactivateBlocksAndObjects(), fs::DeleteSingleFileOrEmptyDirectory(), Database::endSave(), g_settings, Settings::get(), infostream, isShutdownRequested(), kickAllPlayers(), m_banmanager, m_craftdef, m_emerge, m_env, m_game_settings, m_inventory_mgr, m_itemdef, m_media, m_mod_storage_database, m_nodedef, m_rollback, m_script, m_shutdown_state, m_thread, m_unsent_map_edit_queue, Server::ShutdownState::message, ScriptApiServer::on_shutdown(), PEER_ID_INEXISTENT, ServerEnvironment::saveLoadedPlayers(), ServerEnvironment::saveMeta(), SendChatMessage(), SERVER_ACCESSDENIED_SHUTDOWN, Server::ShutdownState::should_reconnect, stop(), and EmergeManager::stopThreads().
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().
|
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().
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().
void Server::addShutdownError | ( | const ModError & | e | ) |
References errorstream, fmtgettext(), m_shutdown_errmsg, strgettext(), and BaseException::what().
Referenced by ~Server().
|
virtual |
Implements IGameDef.
References NodeDefManager::allocateDummy(), and m_nodedef.
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().
|
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().
|
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().
bool Server::checkPriv | ( | const std::string & | name, |
const std::string & | priv ) |
References getPlayerEffectivePrivs().
Referenced by handleChat(), handleCommand_Interact(), and handleCommand_InventoryAction().
|
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().
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().
|
virtual |
Implements con::PeerHandler.
References CDR_LEAVE, CDR_TIMEOUT, CSE_Disconnect, DeleteClient(), ClientInterface::event(), con::IPeer::id, m_clients, and verbosestream.
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().
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().
void Server::DenySudoAccess | ( | session_t | peer_id | ) |
References Send(), and TOCLIENT_DENY_SUDO_MODE.
Referenced by handleCommand_SrpBytesA(), and handleCommand_SrpBytesM().
Server::DISABLE_CLASS_COPY | ( | Server | ) |
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().
bool Server::dynamicAddMedia | ( | const DynamicMediaArgs & | args | ) |
References addMediaFile(), CS_Active, CS_DefinitionsSent, Server::DynamicMediaArgs::data, Server::DynamicMediaArgs::ephemeral, errorstream, Server::DynamicMediaArgs::filename, Server::DynamicMediaArgs::filepath, ClientInterface::getClientList(), fs::GetFilenameFromPath(), ServerEnvironment::getPlayer(), getPlayerName(), getScriptIface(), m_clients, m_env, m_media, m_pending_dyn_media, ScriptApiServer::on_dynamic_media_added(), NetworkPacket::putLongString(), sanity_check, Send(), ClientInterface::sendCustom(), Server::DynamicMediaArgs::to_player, TOCLIENT_MEDIA_PUSH, Server::DynamicMediaArgs::token, verbosestream, and warningstream.
|
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().
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().
|
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().
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().
std::string Server::getBanDescription | ( | const std::string & | ip_or_name | ) |
References BanManager::getBanDescription(), and m_banmanager.
|
static |
References DIR_DELIM, and porting::path_share.
Referenced by fillMediaCache(), EmergeThread::initScripting(), ServerScripting::loadBuiltin(), AsyncEngine::prepareEnvironment(), and TestMoveAction::runTests().
|
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().
bool Server::getClientConInfo | ( | session_t | peer_id, |
con::rtt_stat_type | type, | ||
float * | retval ) |
const ClientDynamicInfo * Server::getClientDynamicInfo | ( | session_t | peer_id | ) |
References CS_Invalid, ClientInterface::lockedGetClientNoEx(), and m_clients.
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.
|
private |
References ClientInterface::getClientNoEx(), and m_clients.
Referenced by getClient().
|
virtual |
Implements IGameDef.
References m_craftdef.
|
inlinevirtual |
References m_emerge.
Referenced by BiomeManager::clear(), SchematicManager::clear(), ModApiMapgen::getBiomeGen(), ModApiMapgen::getEmergeManager(), ModApiMapgen::getMapgen(), ModApiMapgen::l_clear_registered_biomes(), ModApiMapgen::l_clear_registered_decorations(), ModApiMapgen::l_clear_registered_ores(), ModApiMapgen::l_clear_registered_schematics(), ModApiEnv::l_emerge_area(), ModApiMapgen::l_get_spawn_level(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ModApiMapgen::l_register_biome(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), ModApiMapgen::l_register_schematic(), ModApiMapgen::l_set_gen_notify(), ModApiMapgen::l_set_mapgen_params(), ModApiMapgen::l_set_mapgen_setting(), ModApiMapgen::l_set_mapgen_setting_noiseparams(), and EmergeThread::run().
|
inline |
References m_env.
|
inlinevirtual |
Reimplemented from IGameDef.
References m_gamespec.
|
inline |
References m_inventory_mgr.
Referenced by ModApiBase::getServerInventoryMgr(), and handleCommand_InventoryAction().
|
virtual |
|
inline |
std::unordered_map< std::string, std::string > Server::getMediaList | ( | ) |
|
virtual |
Implements IGameDef.
References ModChannelMgr::getModChannel(), and m_modchannel_mgr.
|
inlinevirtual |
Reimplemented from IGameDef.
References m_path_mod_data.
Referenced by ModApiServer::l_get_mod_data_path().
|
virtual |
Implements IGameDef.
References ServerModManager::getMods(), and m_modmgr.
|
virtual |
Implements IGameDef.
References ServerModManager::getModSpec(), and m_modmgr.
Referenced by ModApiBase::getCurrentModPath().
|
inlinevirtual |
Implements IGameDef.
References m_mod_storage_database.
|
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().
References CS_Invalid, RemoteClient::getAddress(), and getClient().
Referenced by denyIfBanned(), handleCommand_FirstSrp(), handleCommand_SrpBytesA(), and StageTwoClientInit().
std::set< std::string > Server::getPlayerEffectivePrivs | ( | const std::string & | name | ) |
References ScriptApiServer::getAuth(), and m_script.
Referenced by checkPriv(), emergePlayer(), and reportPrivsModified().
|
private |
References Player::getName(), ServerEnvironment::getPlayer(), itos(), and m_env.
Referenced by broadcastModChannelMessage(), dynamicAddMedia(), handleCommand_Init2(), and handleCommand_RequestMedia().
References ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), and m_env.
Referenced by AsyncRunStep(), handleCommand_Init2(), and sendMetadataChanged().
|
static |
References g_settings, Settings::getBool(), LATEST_PROTOCOL_VERSION, and SERVER_PROTOCOL_VERSION_MAX.
Referenced by handleCommand_Init(), and ServerList::sendAnnounce().
|
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().
|
inlinevirtual |
Reimplemented from IGameDef.
References m_rollback.
|
inline |
References m_script.
Referenced by dynamicAddMedia(), EmergeThread::finishGen(), handleCommand_HaveMedia(), ModApiEnv::l_emerge_area(), and stepPendingDynMediaCallbacks().
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.
|
inline |
References m_step_settings.
Referenced by AsyncRunStep(), and ServerThread::run().
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().
|
inline |
|
inlinevirtual |
Reimplemented from IGameDef.
References m_path_world.
Referenced by ServerEnvironment::init(), ModApiServer::l_get_worldpath(), ServerEnvironment::loadMeta(), and ServerEnvironment::saveMeta().
IWritableCraftDefManager * Server::getWritableCraftDefManager | ( | ) |
References m_craftdef.
Referenced by ModApiCraft::l_clear_craft(), and ModApiCraft::l_register_craft().
IWritableItemDefManager * Server::getWritableItemDefManager | ( | ) |
References m_itemdef.
Referenced by ModApiItem::l_register_alias_raw(), ModApiItem::l_register_item_raw(), and ModApiItem::l_unregister_item_raw().
NodeDefManager * Server::getWritableNodeDefManager | ( | ) |
References m_nodedef.
Referenced by ModApiItem::l_register_item_raw(), and ModApiItem::l_unregister_item_raw().
|
private |
References ChatEventChat::evt_msg, handleChat(), m_admin_chat, ChatEventChat::nick, ChatInterface::outgoing_queue, and MutexedQueue< T >::push_back().
Referenced by handleChatInterfaceEvent().
|
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().
|
private |
References CET_CHAT, CET_NICK_ADD, errorstream, ScriptApiServer::getAuth(), handleAdminChat(), m_admin_nick, m_script, and ChatEvent::type.
Referenced by AsyncRunStep().
|
inline |
References NetworkPacket::getCommand(), ToServerCommandHandler::handler, and toServerCommandTable.
Referenced by ProcessData().
void Server::handleCommand_ChatMessage | ( | NetworkPacket * | pkt | ) |
References CHATMESSAGE_TYPE_SYSTEM, DisconnectPeer(), errorstream, Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), handleChat(), m_env, and SendChatMessage().
void Server::handleCommand_ClientReady | ( | NetworkPacket * | pkt | ) |
References CSE_SetClientReady, DisconnectPeer(), errorstream, ClientInterface::event(), RemotePlayer::formspec_version, ScriptApiServer::getAuth(), Player::getName(), NetworkPacket::getPeerId(), PlayerSAO::getPlayer(), ClientInterface::getPlayerNames(), NetworkPacket::getRemainingBytes(), Server::ShutdownState::getShutdownTimerMessage(), Server::ShutdownState::isTimerRunning(), m_clients, m_script, m_shutdown_state, ScriptApiPlayer::on_joinplayer(), PLAYER_LIST_INIT, Send(), SendChatMessage(), ClientInterface::setClientVersion(), StageTwoClientInit(), and TOCLIENT_UPDATE_PLAYER_LIST.
void Server::handleCommand_Damage | ( | NetworkPacket * | pkt | ) |
References actionstream, BS, DisconnectPeer(), errorstream, PlayerHPChangeReason::FALL, ServerActiveObject::getBasePosition(), UnitSAO::getHP(), Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), UnitSAO::isDead(), UnitSAO::isImmortal(), m_env, PlayerSAO::setHP(), and verbosestream.
void Server::handleCommand_DeletedBlocks | ( | NetworkPacket * | pkt | ) |
References getClient(), NetworkPacket::getPeerId(), NetworkPacket::getSize(), and p().
void Server::handleCommand_Deprecated | ( | NetworkPacket * | pkt | ) |
References NetworkPacket::getCommand(), infostream, ToServerCommandHandler::name, and toServerCommandTable.
void Server::handleCommand_FirstSrp | ( | NetworkPacket * | pkt | ) |
References acceptAuth(), actionstream, AUTH_MECHANISM_FIRST_SRP, CHATMESSAGE_TYPE_SYSTEM, ScriptApiServer::createAuth(), CS_HelloSent, CS_Invalid, CS_SudoMode, CSE_SudoLeave, DenyAccess(), encode_srp_verifier(), ClientInterface::event(), g_settings, ScriptApiServer::getAuth(), Settings::getBool(), getClient(), getPeerAddress(), NetworkPacket::getPeerId(), infostream, isSingleplayer(), m_clients, m_script, ScriptApiPlayer::on_authplayer(), SendChatMessage(), Address::serializeString(), SERVER_ACCESSDENIED_ALREADY_CONNECTED, SERVER_ACCESSDENIED_EMPTY_PASSWORD, SERVER_ACCESSDENIED_UNEXPECTED_DATA, ScriptApiServer::setPassword(), and verbosestream.
void Server::handleCommand_GotBlocks | ( | NetworkPacket * | pkt | ) |
References NetworkPacket::getPeerId(), NetworkPacket::getSize(), ClientInterface::lockedGetClientNoEx(), m_clients, and p().
void Server::handleCommand_HaveMedia | ( | NetworkPacket * | pkt | ) |
References NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), getScriptIface(), m_env, m_pending_dyn_media, and ScriptApiServer::on_dynamic_media_added().
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.
void Server::handleCommand_Init2 | ( | NetworkPacket * | pkt | ) |
References CHATMESSAGE_TYPE_SYSTEM, CS_InitDone, CSE_GotInit2, CSE_SetDefinitionsSent, ClientInterface::event(), g_settings, getClient(), Settings::getFloat(), NetworkPacket::getPeerId(), getPlayerName(), getPlayerSAO(), ClientInterface::getProtocolVersion(), NetworkPacket::getSize(), Environment::getTimeOfDay(), infostream, LATEST_PROTOCOL_VERSION, m_clients, m_env, m_itemdef, m_nodedef, SendActiveObjectRemoveAdd(), SendChatMessage(), SendCSMRestrictionFlags(), sendDetachedInventories(), SendItemDef(), sendMediaAnnouncement(), SendMovement(), SendNodeDef(), SendTimeOfDay(), and verbosestream.
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.
void Server::handleCommand_InventoryAction | ( | NetworkPacket * | pkt | ) |
References InventoryLocation::applyCurrentPlayer(), BS, ServerInventoryManager::checkDetachedInventoryAccess(), checkInteractDistance(), checkPriv(), Craft, ICraftAction::craft_inv, InventoryLocation::CURRENT_PLAYER, InventoryAction::deSerialize(), InventoryLocation::DETACHED, DisconnectPeer(), Drop, InventoryLocation::dump(), errorstream, MoveAction::from_inv, MoveAction::from_list, PlayerSAO::getEyePosition(), getInventoryMgr(), Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), NetworkPacket::getSize(), NetworkPacket::getString(), infostream, intToFloat(), UnitSAO::isDead(), m_env, m_inventory_mgr, m_rollback, Move, InventoryLocation::NODEMETA, InventoryLocation::PLAYER, ServerInventoryManager::setInventoryModified(), MoveAction::to_inv, MoveAction::to_list, and verbosestream.
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.
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.
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.
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.
void Server::handleCommand_NodeMetaFields | ( | NetworkPacket * | pkt | ) |
References DisconnectPeer(), errorstream, ServerEnvironment::getMap(), Player::getName(), NetworkPacket::getPeerId(), ServerEnvironment::getPlayer(), RemotePlayer::getPlayerSAO(), m_env, m_rollback, m_script, ScriptApiNode::node_on_receive_fields(), p(), pkt_read_formspec_fields(), IRollbackManager::reportAction(), IGameDef::rollback(), RollbackAction::setSetNode(), and warningstream.
|
inline |
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().
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.
void Server::handleCommand_RemovedSounds | ( | NetworkPacket * | pkt | ) |
References ServerPlayingSound::clients, NetworkPacket::getPeerId(), and m_playing_sounds.
void Server::handleCommand_RequestMedia | ( | NetworkPacket * | pkt | ) |
References NetworkPacket::getPeerId(), getPlayerName(), sendRequestedMedia(), and verbosestream.
void Server::handleCommand_SrpBytesA | ( | NetworkPacket * | pkt | ) |
References actionstream, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_NONE, AUTH_MECHANISM_SRP, CS_Active, CS_HelloSent, CS_Invalid, decode_srp_verifier_and_salt(), DenyAccess(), DenySudoAccess(), generate_srp_verifier_and_salt(), getClient(), getPeerAddress(), NetworkPacket::getPeerId(), infostream, Send(), Address::serializeString(), SERVER_ACCESSDENIED_SERVER_FAIL, SERVER_ACCESSDENIED_UNEXPECTED_DATA, SRP_NG_2048, SRP_SHA256, srp_verifier_new(), and TOCLIENT_SRP_BYTES_S_B.
void Server::handleCommand_SrpBytesM | ( | NetworkPacket * | pkt | ) |
References acceptAuth(), actionstream, AUTH_MECHANISM_LEGACY_PASSWORD, AUTH_MECHANISM_SRP, ScriptApiServer::createAuth(), CS_Active, CS_HelloSent, CS_Invalid, DenyAccess(), DenySudoAccess(), errorstream, ScriptApiServer::getAuth(), getClient(), NetworkPacket::getPeerId(), m_script, ScriptApiPlayer::on_authplayer(), SERVER_ACCESSDENIED_SERVER_FAIL, SERVER_ACCESSDENIED_UNEXPECTED_DATA, SERVER_ACCESSDENIED_WRONG_PASSWORD, srp_verifier_get_session_key_length(), srp_verifier_verify_session(), verbosestream, and warningstream.
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.
|
private |
References ActiveObject::clearParentAttachment(), Player::getName(), PlayerSAO::getPlayer(), infostream, m_script, and ScriptApiPlayer::on_dieplayer().
Referenced by 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().
u32 Server::hudAdd | ( | RemotePlayer * | player, |
HudElement * | element ) |
References Player::addHud(), RemotePlayer::getPeerId(), and SendHUDAdd().
Referenced by ObjectRef::l_hud_add().
bool Server::hudChange | ( | RemotePlayer * | player, |
u32 | id, | ||
HudElementStat | stat, | ||
void * | value ) |
References RemotePlayer::getPeerId(), and SendHUDChange().
Referenced by ObjectRef::l_hud_change().
bool Server::hudRemove | ( | RemotePlayer * | player, |
u32 | id ) |
References RemotePlayer::getPeerId(), Player::removeHud(), and SendHUDRemove().
bool Server::hudSetFlags | ( | RemotePlayer * | player, |
u32 | flags, | ||
u32 | mask ) |
References RemotePlayer::getPeerId(), RemotePlayer::getPlayerSAO(), Player::hud_flags, m_script, ScriptApiEnv::player_event(), and SendHUDSetFlags().
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().
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().
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().
|
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().
|
inline |
References Server::ShutdownState::is_requested, and m_shutdown_state.
Referenced by ~Server().
|
inline |
References m_simple_singleplayer_mode.
Referenced by AsyncRunStep(), emergePlayer(), handleCommand_FirstSrp(), handleCommand_Init(), handleCommand_Interact(), ModApiServer::l_is_singleplayer(), and reportPrivsModified().
|
virtual |
Implements IGameDef.
References ModChannelMgr::joinChannel(), m_modchannel_mgr, MODCHANNEL_STATE_READ_WRITE, PEER_ID_SERVER, and ModChannelMgr::setChannelState().
void Server::kickAllPlayers | ( | AccessDeniedCode | reason, |
const std::string & | str_reason, | ||
bool | reconnect ) |
References DenyAccess(), ClientInterface::getClientIDs(), and m_clients.
Referenced by ~Server(), and step().
|
virtual |
Implements IGameDef.
References ModChannelMgr::leaveChannel(), m_modchannel_mgr, and PEER_ID_SERVER.
|
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().
|
inlineprivate |
References m_playing_sounds, and m_playing_sounds_id_last_used.
Referenced by playSound().
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().
void Server::notifyPlayers | ( | const std::wstring & | msg | ) |
|
virtual |
Implements MapEventReceiver.
References VoxelArea::contains(), MapEditEvent::getArea(), m_ignore_map_edit_events_area, and m_unsent_map_edit_queue.
|
static |
|
static |
References DIR_DELIM, Settings::exists(), Settings::get(), openModStorageDatabase(), Settings::readConfigFile(), and warningstream.
Referenced by init(), migrateModStorageDatabase(), and openModStorageDatabase().
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().
|
virtual |
Implements con::PeerHandler.
References ClientInterface::CreateClient(), con::IPeer::id, m_clients, and verbosestream.
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().
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().
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().
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().
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().
void Server::reportFormspecPrependModified | ( | const std::string & | name | ) |
References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendPlayerFormspecPrepend().
Referenced by ObjectRef::l_set_formspec_prepend().
void Server::reportInventoryFormspecModified | ( | const std::string & | name | ) |
References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendPlayerInventoryFormspec().
Referenced by ObjectRef::l_set_inventory_formspec().
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().
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().
bool Server::rollbackRevertActions | ( | const std::list< RollbackAction > & | actions, |
std::list< std::string > * | log ) |
References ServerEnvironment::getServerMap(), infostream, m_env, and m_inventory_mgr.
void Server::Send | ( | NetworkPacket * | pkt | ) |
References FATAL_ERROR_IF, NetworkPacket::getPeerId(), and Send().
Referenced by acceptAuth(), broadcastModChannelMessage(), DenySudoAccess(), dynamicAddMedia(), fadeSound(), handleCommand_ClientReady(), handleCommand_Init(), handleCommand_ModChannelJoin(), handleCommand_ModChannelLeave(), handleCommand_ModChannelMsg(), handleCommand_SrpBytesA(), Send(), SendAccessDenied(), SendActiveObjectRemoveAdd(), SendAddParticleSpawner(), SendBlockNoLock(), SendBreath(), SendChatMessage(), SendCloudParams(), SendCSMRestrictionFlags(), SendDeleteParticleSpawner(), sendDetachedInventory(), SendEyeOffset(), SendHP(), SendHUDAdd(), SendHUDChange(), SendHUDRemove(), SendHUDSetFlags(), SendHUDSetParam(), SendInventory(), SendItemDef(), SendLocalPlayerAnimations(), sendMediaAnnouncement(), sendMetadataChanged(), SendMinimapModes(), SendMovement(), SendMovePlayer(), SendMovePlayerRel(), sendNodeChangePkt(), SendNodeDef(), SendOverrideDayNightRatio(), SendPlayerFormspecPrepend(), SendPlayerFov(), SendPlayerInventoryFormspec(), SendPlayerPrivileges(), SendPlayerSpeed(), sendRequestedMedia(), SendSetLighting(), SendSetMoon(), SendSetSky(), SendSetStars(), SendSetSun(), SendShowFormspecMessage(), SendSpawnParticle(), SendTimeOfDay(), and stopSound().
void Server::Send | ( | session_t | peer_id, |
NetworkPacket * | pkt ) |
|
private |
References Send(), SERVER_ACCESSDENIED_MAX, and TOCLIENT_ACCESS_DENIED.
Referenced by DenyAccess().
|
private |
References clientCommandFactoryTable, NetworkPacket::getCommand(), NetworkPacket::getPeerId(), m_clients, NetworkPacket::putRawString(), ClientInterface::sendCustom(), and TOCLIENT_ACTIVE_OBJECT_MESSAGES.
Referenced by AsyncRunStep().
|
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().
|
private |
References BS, getNodeBlockPos(), intToFloat(), p(), MapNode::param0, MapNode::param1, MapNode::param2, sendNodeChangePkt(), and TOCLIENT_ADDNODE.
Referenced by AsyncRunStep().
|
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().
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().
|
private |
References g_settings, MapBlock::getPos(), Settings::getS16(), NetworkPacket::putRawString(), rangelim, Send(), MapBlock::serialize(), MapBlock::serializeNetworkSpecific(), and TOCLIENT_BLOCKDATA.
Referenced by SendBlock(), and SendBlocks().
|
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().
|
private |
References Send(), and TOCLIENT_BREATH.
Referenced by SendPlayerBreath().
|
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().
|
private |
References params, Send(), and TOCLIENT_CLOUD_PARAMS.
Referenced by setClouds().
|
private |
References m_csm_restriction_flags, m_csm_restriction_noderange, Send(), and TOCLIENT_CSM_RESTRICTION_FLAGS.
Referenced by handleCommand_Init2().
|
private |
References m_clients, PEER_ID_INEXISTENT, Send(), ClientInterface::sendToAll(), and TOCLIENT_DELETE_PARTICLESPAWNER.
Referenced by deleteParticleSpawner().
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().
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().
References Send(), and TOCLIENT_EYE_OFFSET.
Referenced by setPlayerEyeOffset().
|
private |
References Send(), and TOCLIENT_HP.
Referenced by SendPlayerHP().
|
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().
|
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().
|
private |
References Send(), and TOCLIENT_HUDRM.
Referenced by hudRemove().
|
private |
References Send(), and TOCLIENT_HUD_SET_FLAGS.
Referenced by hudSetFlags().
|
private |
References Send(), and TOCLIENT_HUD_SET_PARAM.
Referenced by hudSetHotbarImage(), hudSetHotbarItemcount(), and hudSetHotbarSelectedImage().
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().
|
private |
References compressZlib(), NetworkPacket::getSize(), NetworkPacket::putLongString(), Send(), IItemDefManager::serialize(), TOCLIENT_ITEMDEF, and verbosestream.
Referenced by handleCommand_Init2().
|
private |
References Send(), and TOCLIENT_LOCAL_PLAYER_ANIMATIONS.
Referenced by setLocalPlayerAnimations().
|
private |
References g_settings, Settings::get(), NetworkPacket::getSize(), m_media, Send(), str_ends_with(), TOCLIENT_ANNOUNCE_MEDIA, and verbosestream.
Referenced by handleCommand_Init2().
|
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().
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().
|
virtual |
Implements IGameDef.
References broadcastModChannelMessage(), ModChannelMgr::canWriteOnChannel(), m_modchannel_mgr, and PEER_ID_SERVER.
|
private |
References g_settings, Settings::getFloat(), Send(), and TOCLIENT_MOVEMENT.
Referenced by handleCommand_Init2().
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().
References Send(), and TOCLIENT_MOVE_PLAYER_REL.
Referenced by PlayerSAO::addPos().
|
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().
|
private |
References compressZlib(), NetworkPacket::getSize(), NetworkPacket::putLongString(), Send(), NodeDefManager::serialize(), TOCLIENT_NODEDEF, and verbosestream.
Referenced by handleCommand_Init2().
|
private |
References Send(), and TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO.
Referenced by overrideDayNightRatio().
void Server::SendPlayerBreath | ( | PlayerSAO * | sao | ) |
References PlayerSAO::getBreath(), PlayerSAO::getPeerID(), m_script, ScriptApiEnv::player_event(), and SendBreath().
Referenced by PlayerSAO::setBreath(), and StageTwoClientInit().
|
private |
References Player::formspec_prepend, ServerEnvironment::getPlayer(), m_env, Send(), and TOCLIENT_FORMSPEC_PREPEND.
Referenced by reportFormspecPrependModified().
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().
void Server::SendPlayerHP | ( | PlayerSAO * | sao, |
bool | effect ) |
References UnitSAO::getHP(), PlayerSAO::getPeerID(), and SendHP().
Referenced by HandlePlayerHPChange(), PlayerSAO::setHP(), and StageTwoClientInit().
|
private |
References ServerEnvironment::getPlayer(), Player::inventory_formspec, m_env, NetworkPacket::putLongString(), Send(), and TOCLIENT_INVENTORY_FORMSPEC.
Referenced by reportInventoryFormspecModified(), and StageTwoClientInit().
|
private |
References ScriptApiServer::getAuth(), Player::getName(), ServerEnvironment::getPlayer(), m_env, m_script, Send(), and TOCLIENT_PRIVILEGES.
Referenced by reportPrivsModified(), and StageTwoClientInit().
References Send(), and TOCLIENT_PLAYER_SPEED.
Referenced by ObjectRef::l_add_velocity().
|
private |
References BS, getNodeBlockPos(), intToFloat(), p(), sendNodeChangePkt(), and TOCLIENT_REMOVENODE.
Referenced by AsyncRunStep().
|
private |
References CS_DefinitionsSent, errorstream, getClient(), NetworkPacket::getSize(), infostream, m_media, NetworkPacket::putLongString(), fs::ReadFile(), Send(), TOCLIENT_MEDIA, and verbosestream.
Referenced by handleCommand_RequestMedia().
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().
|
private |
References params, Send(), and TOCLIENT_SET_MOON.
Referenced by setMoon().
|
private |
References ClientInterface::getProtocolVersion(), m_clients, params, Send(), and TOCLIENT_SET_SKY.
Referenced by setSky().
|
private |
References params, Send(), and TOCLIENT_SET_STARS.
Referenced by setStars().
References params, Send(), and TOCLIENT_SET_SUN.
Referenced by setSun().
|
private |
References m_formspec_state_data, NetworkPacket::putLongString(), Send(), and TOCLIENT_SHOW_FORMSPEC.
Referenced by showFormspec().
|
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().
|
private |
References m_clients, PEER_ID_INEXISTENT, Send(), ClientInterface::sendToAll(), and TOCLIENT_TIME_OF_DAY.
Referenced by AsyncRunStep(), and handleCommand_Init2().
|
inline |
References setAsyncFatalError(), and BaseException::what().
|
inline |
References m_async_fatal_error, and MutexedVariable< T >::set().
Referenced by EmergeThread::finishGen(), EmergeThread::initScripting(), AsyncWorkerThread::run(), EmergeThread::run(), ServerThread::run(), and setAsyncFatalError().
void Server::setClouds | ( | RemotePlayer * | player, |
const CloudParams & | params ) |
References RemotePlayer::getPeerId(), params, sanity_check, SendCloudParams(), and RemotePlayer::setCloudParams().
Referenced by ObjectRef::l_set_clouds().
void Server::setIpBanned | ( | const std::string & | ip, |
const std::string & | name ) |
References BanManager::add(), CS_Created, denyIfBanned(), ClientInterface::getClientIDs(), m_banmanager, and m_clients.
void Server::setLighting | ( | RemotePlayer * | player, |
const Lighting & | lighting ) |
References RemotePlayer::getPeerId(), sanity_check, SendSetLighting(), and RemotePlayer::setLighting().
Referenced by ObjectRef::l_set_lighting().
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().
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().
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().
void Server::setSky | ( | RemotePlayer * | player, |
const SkyboxParams & | params ) |
References RemotePlayer::getPeerId(), params, sanity_check, SendSetSky(), and RemotePlayer::setSky().
Referenced by ObjectRef::l_set_sky().
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().
|
inline |
References m_step_settings.
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().
void Server::setTimeOfDay | ( | u32 | time | ) |
References m_env, m_time_of_day_send_timer, and Environment::setTimeOfDay().
Referenced by ModApiEnv::l_set_timeofday().
bool Server::showFormspec | ( | const char * | name, |
const std::string & | formspec, | ||
const std::string & | formname ) |
References RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), m_env, and SendShowFormspecMessage().
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().
References actionstream, CS_InitDone, DenyAccess(), emergePlayer(), errorstream, Player::getName(), getPeerAddress(), RemotePlayer::getPeerId(), ServerEnvironment::getPlayer(), ClientInterface::getPlayerNames(), ClientInterface::lockedGetClientNoEx(), m_clients, m_env, PEER_ID_INEXISTENT, PLAYER_LIST_ADD, SendInventory(), SendMovePlayer(), SendPlayerBreath(), SendPlayerHP(), SendPlayerInventoryFormspec(), SendPlayerPrivileges(), ClientInterface::sendToAll(), Address::serializeString(), SERVER_ACCESSDENIED_ALREADY_CONNECTED, SERVER_ACCESSDENIED_SERVER_FAIL, and TOCLIENT_UPDATE_PLAYER_LIST.
Referenced by handleCommand_ClientReady().
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().
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().
|
private |
References fs::DeleteSingleFileOrEmptyDirectory(), ScriptApiServer::freeDynamicMediaCallback(), getScriptIface(), m_media, m_pending_dyn_media, and sanity_check.
Referenced by AsyncRunStep().
void Server::stop | ( | ) |
References infostream, m_thread, Thread::stop(), and Thread::wait().
Referenced by ~Server().
void Server::stopSound | ( | s32 | handle | ) |
References ServerPlayingSound::clients, m_playing_sounds, Send(), and TOCLIENT_STOP_SOUND.
Referenced by ModApiServer::l_sound_stop().
void Server::unsetIpBanned | ( | const std::string & | ip_or_name | ) |
References m_banmanager, and BanManager::remove().
Referenced by ModApiServer::l_unban_player_or_ip().
|
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().
void Server::yieldToOtherThreads | ( | float | dtime | ) |
References Profiler::avg(), g_profiler, EmergeManager::getQueueSize(), m_emerge, sleep_ms, and SPT_AVG.
Referenced by ServerThread::run().
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
Referenced by AsyncRunStep(), DeleteClient(), handleAdminChat(), notifyPlayer(), printToConsoleOnly(), and start().
|
private |
Referenced by handleChatInterfaceEvent(), and notifyPlayer().
|
private |
Referenced by Server(), and AsyncRunStep().
|
private |
Referenced by setAsyncFatalError(), and step().
std::vector<std::pair<std::string, std::string> > Server::m_async_init_files |
Referenced by ModApiServer::l_register_async_dofile().
|
private |
Referenced by ~Server(), AsyncRunStep(), denyIfBanned(), getBanDescription(), init(), setIpBanned(), and unsetIpBanned().
Address Server::m_bind_addr |
Referenced by AsyncRunStep(), and start().
|
private |
Referenced by acceptAuth(), AsyncRunStep(), DeleteClient(), deletingPeer(), DenyAccess(), dynamicAddMedia(), getClientDynamicInfo(), getClientInfo(), getClientNoEx(), getStatusString(), handleChat(), handleCommand_ClientReady(), handleCommand_FirstSrp(), handleCommand_GotBlocks(), handleCommand_Init(), handleCommand_Init2(), init(), kickAllPlayers(), peerAdded(), playSound(), ProcessData(), reportPrivsModified(), Send(), SendActiveObjectMessages(), SendAddParticleSpawner(), SendBlock(), SendBlocks(), SendChatMessage(), SendDeleteParticleSpawner(), sendDetachedInventory(), sendMetadataChanged(), sendNodeChangePkt(), SendSetSky(), SendSpawnParticle(), SendTimeOfDay(), setIpBanned(), and StageTwoClientInit().
|
private |
Referenced by DisconnectPeer(), getClientConInfo(), handleCommand_Init(), Receive(), and start().
|
private |
Referenced by ~Server(), getCraftDefManager(), getWritableCraftDefManager(), and init().
|
private |
Referenced by init(), and SendCSMRestrictionFlags().
|
private |
Referenced by init(), and SendCSMRestrictionFlags().
|
private |
Referenced by AsyncRunStep().
|
private |
Referenced by ~Server(), AsyncRunStep(), findSpawnPos(), getEmergeManager(), handleCommand_Interact(), init(), SendBlocks(), and yieldToOtherThreads().
|
private |
Referenced by AsyncRunStep().
|
private |
Referenced by ~Server(), acceptAuth(), addParticleSpawner(), AsyncRunStep(), DeleteClient(), deleteParticleSpawner(), dynamicAddMedia(), emergePlayer(), findSpawnPos(), EmergeThread::finishGen(), getEnv(), getMap(), getPlayerName(), getPlayerSAO(), getStatusString(), handleCommand_ChatMessage(), handleCommand_Damage(), handleCommand_HaveMedia(), handleCommand_Init(), handleCommand_Init2(), handleCommand_Interact(), handleCommand_InventoryAction(), handleCommand_InventoryFields(), handleCommand_NodeMetaFields(), handleCommand_PlayerItem(), handleCommand_PlayerPos(), init(), notifyPlayer(), playSound(), reportFormspecPrependModified(), reportInventoryFormspecModified(), reportPrivsModified(), rollbackRevertActions(), EmergeThread::run(), SendActiveObjectRemoveAdd(), SendAddParticleSpawner(), SendBlock(), SendBlocks(), SendChatMessage(), sendMetadataChanged(), SendMinimapModes(), sendNodeChangePkt(), SendPlayerFormspecPrepend(), SendPlayerFov(), SendPlayerInventoryFormspec(), SendPlayerPrivileges(), SendSpawnParticle(), setTimeOfDay(), showFormspec(), spawnParticle(), StageTwoClientInit(), and UpdateCrafting().
|
private |
|
private |
Referenced by DeleteClient(), handleCommand_InventoryFields(), and SendShowFormspecMessage().
|
private |
Referenced by AsyncRunStep(), fillMediaCache(), getGameSpec(), getStatusString(), init(), and start().
|
private |
Referenced by EmergeThread::finishGen(), and onMapEditEvent().
|
private |
Referenced by ~Server(), getInventoryMgr(), handleCommand_InventoryAction(), init(), rollbackRevertActions(), and sendDetachedInventories().
|
private |
|
private |
Referenced by Server(), and AsyncRunStep().
|
private |
Referenced by AsyncRunStep(), and init().
|
private |
Referenced by AsyncRunStep().
std::unique_ptr<PackedValue> Server::m_lua_globals_data |
|
private |
Referenced by Server(), and AsyncRunStep().
|
private |
Referenced by AsyncRunStep().
std::vector<std::pair<std::string, std::string> > Server::m_mapgen_init_files |
Referenced by EmergeThread::initScripting(), and ModApiServer::l_register_mapgen_script().
|
private |
Referenced by AsyncRunStep().
|
private |
Referenced by handleChat(), and init().
|
private |
Referenced by AsyncRunStep().
|
private |
|
private |
|
private |
Referenced by ~Server(), AsyncRunStep(), getModStorageDatabase(), and init().
|
private |
Referenced by AsyncRunStep().
|
private |
|
protected |
Referenced by AsyncRunStep(), MockServer::createScripting(), fillMediaCache(), getMods(), getModSpec(), and init().
|
private |
|
private |
|
private |
|
private |
Referenced by Server(), and getModDataPath().
|
private |
Referenced by Server(), getWorldPath(), init(), and start().
|
private |
Referenced by dynamicAddMedia(), handleCommand_HaveMedia(), and stepPendingDynMediaCallbacks().
|
private |
Referenced by Server(), and AsyncRunStep().
|
private |
Referenced by DeleteClient(), fadeSound(), handleCommand_RemovedSounds(), nextSoundId(), playSound(), and stopSound().
|
private |
Referenced by nextSoundId().
|
private |
|
private |
Referenced by AsyncRunStep().
|
protected |
Referenced by ~Server(), broadcastModChannelMessage(), checkInteractDistance(), MockServer::createScripting(), DeleteClient(), emergePlayer(), getPlayerEffectivePrivs(), getScriptIface(), handleChat(), handleChatInterfaceEvent(), handleCommand_ClientReady(), handleCommand_FirstSrp(), handleCommand_Init(), handleCommand_Interact(), handleCommand_InventoryFields(), handleCommand_NodeMetaFields(), handleCommand_SrpBytesM(), HandlePlayerDeath(), HandlePlayerHPChange(), hudSetFlags(), init(), process_PlayerPos(), SendPlayerBreath(), and SendPlayerPrivileges().
|
private |
Referenced by addShutdownError().
|
private |
Referenced by ~Server(), AsyncRunStep(), handleCommand_ClientReady(), isShutdownRequested(), and requestShutdown().
|
private |
Referenced by handleCommand_Init(), init(), isSingleplayer(), and step().
|
private |
Referenced by AsyncRunStep().
|
private |
Referenced by getStepSettings(), and setStepSettings().
|
private |
|
private |
Referenced by AsyncRunStep(), and setTimeOfDay().
|
private |
Referenced by Server(), and AsyncRunStep().
|
private |
Referenced by ~Server(), AsyncRunStep(), and onMapEditEvent().
|
private |
Referenced by Server(), AsyncRunStep(), getStatusString(), and getUptime().
|
private |
Referenced by getTranslationLanguage().