Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
server.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "irr_v3d.h"
8#include "map.h"
9#include "hud.h"
10#include "gamedef.h"
11#include "serialization.h" // For SER_FMT_VER_INVALID
12#include "content/mods.h"
13#include "inventorymanager.h"
14#include "content/subgames.h"
15#include "network/peerhandler.h"
16#include "network/connection.h"
17#include "util/numeric.h"
18#include "util/thread.h"
19#include "util/basic_macros.h"
20#include "util/metricsbackend.h"
21#include "serverenvironment.h"
22#include "server/clientiface.h"
24#include "chatmessage.h"
25#include "sound.h"
26#include "translation.h"
27#include <atomic>
28#include <string>
29#include <list>
30#include <map>
31#include <vector>
32#include <unordered_set>
33#include <optional>
34#include <string_view>
35#include <shared_mutex>
36#include <condition_variable>
37
38class ChatEvent;
39struct ChatEventChat;
40struct ChatInterface;
42class NodeDefManager;
44class BanManager;
45class Inventory;
46class ModChannelMgr;
47class RemotePlayer;
48class PlayerSAO;
51struct RollbackAction;
52class EmergeManager;
53class ServerScripting;
55struct SoundSpec;
56struct CloudParams;
57struct SkyboxParams;
58struct SunParams;
59struct MoonParams;
60struct StarParams;
61struct Lighting;
62class ServerThread;
65struct PackedValue;
68
69// Anticheat flags
70enum {
71 AC_DIGGING = 0x01,
73 AC_MOVEMENT = 0x04
74};
75
76constexpr const static FlagDesc flagdesc_anticheat[] = {
77 {"digging", AC_DIGGING},
78 {"interaction", AC_INTERACTION},
79 {"movement", AC_MOVEMENT},
80 {NULL, 0}
81};
82
88
90{
91 std::string path;
92 std::string sha1_digest; // base64-encoded
93 // true = not announced in TOCLIENT_ANNOUNCE_MEDIA (at player join)
95 // does what it says. used by some cases of dynamic media.
97
98 MediaInfo(std::string_view path_ = "",
99 std::string_view sha1_digest_ = ""):
100 path(path_),
101 sha1_digest(sha1_digest_),
102 no_announce(false),
103 delete_at_shutdown(false)
104 {
105 }
106};
107
108// Combines the pure sound (SoundSpec) with positional information
110{
112
113 float gain = 1.0f; // for amplification of the base sound
114 float max_hear_distance = 32 * BS;
116 u16 object = 0;
117 std::string to_player;
118 std::string exclude_player;
119
120 v3f getPos(ServerEnvironment *env, bool *pos_exists) const;
121
123
124 std::unordered_set<session_t> clients; // peer ids
125};
126
129 std::string label;
130 u16 size = 0;
131 std::string texture;
132 u16 scale = 1;
133};
134
135// structure for everything getClientInfo returns, for convenience
145
147 ModIPCStore() = default;
148 ~ModIPCStore();
149
151 std::shared_mutex mutex;
153 std::condition_variable_any condvar;
159 std::unordered_map<std::string, std::unique_ptr<PackedValue>> map;
160
162 inline void signal() { condvar.notify_all(); }
163};
164
166 public IGameDef
167{
168public:
169 /*
170 NOTE: Every public method should be thread-safe
171 */
172
173 Server(
174 const std::string &path_world,
175 const SubgameSpec &gamespec,
176 bool simple_singleplayer_mode,
177 Address bind_addr,
178 bool dedicated,
179 ChatInterface *iface = nullptr,
180 std::string *shutdown_errmsg = nullptr
181 );
182 ~Server();
184
185 void start();
186 void stop();
187 // Actual processing is done in another thread.
188 // This just checks if there was an error in that thread.
189 void step();
190
191 // This is run by ServerThread and does the actual processing
192 void AsyncRunStep(float dtime, bool initial_step = false);
195 void Receive(float min_time);
196 void yieldToOtherThreads(float dtime);
197
199
200 /*
201 * Command Handlers
202 */
203
204 void handleCommand(NetworkPacket* pkt);
205
231
232 void ProcessData(NetworkPacket *pkt);
233
234 void Send(NetworkPacket *pkt);
235 void Send(session_t peer_id, NetworkPacket *pkt);
236
237 // Helper for handleCommand_PlayerPos and handleCommand_Interact
238 void process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao,
239 NetworkPacket *pkt);
240
241 // Both setter and getter need no envlock,
242 // can be called freely from threads
243 void setTimeOfDay(u32 time);
244
245 /*
246 Shall be called with the environment locked.
247 This is accessed by the map, which is inside the environment,
248 so it shouldn't be a problem.
249 */
250 void onMapEditEvent(const MapEditEvent &event);
251
252 // Connection must be locked when called
253 std::string getStatusString();
254 inline double getUptime() const { return m_uptime_counter->get(); }
255
256 // read shutdown state
257 inline bool isShutdownRequested() const { return m_shutdown_state.is_requested; }
258
259 // request server to shutdown
260 void requestShutdown(const std::string &msg, bool reconnect, float delay = 0.0f);
261
262 // Returns -1 if failed, sound handle on success
263 // Envlock
264 s32 playSound(ServerPlayingSound &params, bool ephemeral=false);
265 void stopSound(s32 handle);
266 void fadeSound(s32 handle, float step, float gain);
267
268 // Envlock
269 std::set<std::string> getPlayerEffectivePrivs(const std::string &name);
270 bool checkPriv(const std::string &name, const std::string &priv);
271 void reportPrivsModified(const std::string &name=""); // ""=all
272 void reportInventoryFormspecModified(const std::string &name);
273 void reportFormspecPrependModified(const std::string &name);
274
275 void setIpBanned(const std::string &ip, const std::string &name);
276 void unsetIpBanned(const std::string &ip_or_name);
277 std::string getBanDescription(const std::string &ip_or_name);
278 bool denyIfBanned(session_t peer_id);
279
280 void notifyPlayer(const char *name, const std::wstring &msg);
281 void notifyPlayers(const std::wstring &msg);
282
283 void spawnParticle(const std::string &playername,
284 const ParticleParameters &p);
285
287 ServerActiveObject *attached, const std::string &playername);
288
289 void deleteParticleSpawner(const std::string &playername, u32 id);
290
292 std::string filename;
293 std::optional<std::string> filepath;
294 std::optional<std::string_view> data;
295 u32 token;
296 std::string to_player;
297 bool ephemeral = false;
298 };
299 bool dynamicAddMedia(const DynamicMediaArgs &args);
300
302 void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id);
303
304 // Envlock and conlock should be locked when using scriptapi
305 inline ServerScripting *getScriptIface() { return m_script.get(); }
306
307 // actions: time-reversed list
308 // Return value: success/failure
309 bool rollbackRevertActions(const std::list<RollbackAction> &actions,
310 std::list<std::string> *log);
311
312 // IGameDef interface
313 // Under envlock
315 virtual const NodeDefManager* getNodeDefManager();
317 virtual u16 allocateUnknownNodeId(const std::string &name);
319 virtual EmergeManager *getEmergeManager() { return m_emerge.get(); }
321
325
326 // Not under envlock
327 virtual const std::vector<ModSpec> &getMods() const;
328 virtual const ModSpec* getModSpec(const std::string &modname) const;
329 virtual const SubgameSpec* getGameSpec() const { return &m_gamespec; }
330 static std::string getBuiltinLuaPath();
331 virtual std::string getWorldPath() const { return m_path_world; }
332 virtual std::string getModDataPath() const { return m_path_mod_data; }
333 virtual ModIPCStore *getModIPCStore() { return &m_ipcstore; }
334
335 inline bool isSingleplayer() const
337
339 float steplen;
340 bool pause;
341 };
342
343 void setStepSettings(StepSettings spdata) { m_step_settings.store(spdata); }
345
346 inline void setAsyncFatalError(const std::string &error)
347 { m_async_fatal_error.set(error); }
348 inline void setAsyncFatalError(const LuaError &e)
349 {
350 setAsyncFatalError(std::string("Lua: ") + e.what());
351 }
352
353 // Not thread-safe.
354 void addShutdownError(const ModError &e);
355
356 bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
357 Map & getMap() { return m_env->getMap(); }
360
361 u32 hudAdd(RemotePlayer *player, HudElement *element);
362 bool hudRemove(RemotePlayer *player, u32 id);
363 bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value);
364 bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask);
365 bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
366 void hudSetHotbarImage(RemotePlayer *player, const std::string &name);
367 void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name);
368
370
371 void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4],
372 f32 frame_speed);
373 void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front);
374
375 void setSky(RemotePlayer *player, const SkyboxParams &params);
376 void setSun(RemotePlayer *player, const SunParams &params);
377 void setMoon(RemotePlayer *player, const MoonParams &params);
378 void setStars(RemotePlayer *player, const StarParams &params);
379
380 void setClouds(RemotePlayer *player, const CloudParams &params);
381
382 void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);
383
384 void setLighting(RemotePlayer *player, const Lighting &lighting);
385
386 /* con::PeerHandler implementation. */
387 void peerAdded(con::IPeer *peer);
388 void deletingPeer(con::IPeer *peer, bool timeout);
389
390 void DenySudoAccess(session_t peer_id);
391 void DenyAccess(session_t peer_id, AccessDeniedCode reason,
392 std::string_view custom_reason = "", bool reconnect = false);
394 const std::string &str_reason, bool reconnect);
395 void acceptAuth(session_t peer_id, bool forSudoMode);
396 void DisconnectPeer(session_t peer_id);
397 bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
398 bool getClientInfo(session_t peer_id, ClientInfo &ret);
400
401 void printToConsoleOnly(const std::string &text);
402
403 void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason);
404 void SendPlayerHP(PlayerSAO *sao, bool effect);
405 void SendPlayerBreath(PlayerSAO *sao);
406 void SendInventory(RemotePlayer *player, bool incremental);
407 void SendMovePlayer(PlayerSAO *sao);
408 void SendMovePlayerRel(session_t peer_id, const v3f &added_pos);
409 void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
410 void SendPlayerFov(session_t peer_id);
411
412 void SendMinimapModes(session_t peer_id,
413 std::vector<MinimapMode> &modes,
414 size_t wanted_mode);
415
416 void sendDetachedInventories(session_t peer_id, bool incremental);
417
418 bool joinModChannel(const std::string &channel);
419 bool leaveModChannel(const std::string &channel);
420 bool sendModChannelMessage(const std::string &channel, const std::string &message);
421 ModChannel *getModChannel(const std::string &channel);
422
423 // Send block to specific player only
424 bool SendBlock(session_t peer_id, const v3s16 &blockpos);
425
426 // Get or load translations for a language
427 Translations *getTranslationLanguage(const std::string &lang_code);
428
429 // Returns all media files the server knows about
430 // map key = binary sha1, map value = file path
431 std::unordered_map<std::string, std::string> getMediaList();
432
433 static ModStorageDatabase *openModStorageDatabase(const std::string &world_path);
434
435 static ModStorageDatabase *openModStorageDatabase(const std::string &backend,
436 const std::string &world_path, const Settings &world_mt);
437
438 static bool migrateModStorageDatabase(const GameParams &game_params,
439 const Settings &cmd_args);
440
441 static u16 getProtocolVersionMin();
442 static u16 getProtocolVersionMax();
443
444 // Lua files registered for init of async env, pair of modname + path
445 std::vector<std::pair<std::string, std::string>> m_async_init_files;
446 // Identical but for mapgen env
447 std::vector<std::pair<std::string, std::string>> m_mapgen_init_files;
448
449 // Data transferred into other Lua envs at init time
450 std::unique_ptr<PackedValue> m_lua_globals_data;
451
452 // Bind address
454
455 // Public helper for taking the envlock in a scope
457 public:
459
460 private:
461 std::lock_guard<ordered_mutex> m_lock;
462 };
463
464protected:
465 /* Do not add more members here, this is only required to make unit tests work. */
466
467 // Scripting
468 // Envlock and conlock should be locked when using Lua
469 std::unique_ptr<ServerScripting> m_script;
470
471 // Mods
472 std::unique_ptr<ServerModManager> m_modmgr;
473
474private:
475 friend class EmergeThread;
476 friend class RemoteClient;
477
478 // unittest classes
480 friend class TestMoveAction;
481
484 public:
485 bool is_requested = false;
486 bool should_reconnect = false;
487 std::string message;
488
489 void reset();
490 void trigger(float delay, const std::string &msg, bool reconnect);
491 void tick(float dtime, Server *server);
492 std::wstring getShutdownTimerMessage() const;
493 bool isTimerRunning() const { return m_timer > 0.0f; }
494 private:
495 float m_timer = 0.0f;
496 };
497
499 std::string filename; // only set if media entry and file is to be deleted
501 std::unordered_set<session_t> waiting_players;
502 };
503
504 // The standard library does not implement std::hash for pairs so we have this:
505 struct SBCHash {
506 size_t operator() (const std::pair<v3s16, u16> &p) const {
507 return std::hash<v3s16>()(p.first) ^ p.second;
508 }
509 };
510
511 typedef std::unordered_map<std::pair<v3s16, u16>, std::string, SBCHash> SerializedBlockCache;
512
513 void init();
514
515 void SendMovement(session_t peer_id);
516 void SendHP(session_t peer_id, u16 hp, bool effect);
517 void SendBreath(session_t peer_id, u16 breath);
518 void SendAccessDenied(session_t peer_id, AccessDeniedCode reason,
519 std::string_view custom_reason, bool reconnect = false);
520 void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version);
521 void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef,
522 u16 protocol_version);
523
524
525 virtual void SendChatMessage(session_t peer_id, const ChatMessage &message);
526 void SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed);
527
528 void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4],
529 f32 animation_speed);
530 void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front);
531 void SendPlayerPrivileges(session_t peer_id);
534 void SendShowFormspecMessage(session_t peer_id, const std::string &formspec,
535 const std::string &formname);
536 void SendHUDAdd(session_t peer_id, u32 id, HudElement *form);
537 void SendHUDRemove(session_t peer_id, u32 id);
538 void SendHUDChange(session_t peer_id, u32 id, HudElementStat stat, void *value);
539 void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask);
540 void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value);
541 void SendSetSky(session_t peer_id, const SkyboxParams &params);
542 void SendSetSun(session_t peer_id, const SunParams &params);
543 void SendSetMoon(session_t peer_id, const MoonParams &params);
544 void SendSetStars(session_t peer_id, const StarParams &params);
545 void SendCloudParams(session_t peer_id, const CloudParams &params);
546 void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio);
547 void SendSetLighting(session_t peer_id, const Lighting &lighting);
548 void broadcastModChannelMessage(const std::string &channel,
549 const std::string &message, session_t from_peer);
550
551 /*
552 Send a node removal/addition event to all clients except ignore_id.
553 Additionally, if far_players!=NULL, players further away than
554 far_d_nodes are ignored and their peer_ids are added to far_players
555 */
556 // Envlock and conlock should be locked when calling these
557 void sendRemoveNode(v3s16 p, std::unordered_set<u16> *far_players = nullptr,
558 float far_d_nodes = 100);
559 void sendAddNode(v3s16 p, MapNode n,
560 std::unordered_set<u16> *far_players = nullptr,
561 float far_d_nodes = 100, bool remove_metadata = true);
562 void sendNodeChangePkt(NetworkPacket &pkt, v3s16 block_pos,
563 v3f p, float far_d_nodes, std::unordered_set<u16> *far_players);
564
565 void sendMetadataChanged(const std::unordered_set<v3s16> &positions,
566 float far_d_nodes = 100);
567
568 // Environment and Connection must be locked when called
569 // `cache` may only be very short lived! (invalidation not handeled)
570 void SendBlockNoLock(session_t peer_id, MapBlock *block, u8 ver,
571 u16 net_proto_version, SerializedBlockCache *cache = nullptr);
572
573 // Sends blocks to clients (locks env and con on its own)
574 void SendBlocks(float dtime);
575
576 bool addMediaFile(const std::string &filename, const std::string &filepath,
577 std::string *filedata = nullptr, std::string *digest = nullptr);
578 void fillMediaCache();
579 void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code);
580 void sendRequestedMedia(session_t peer_id,
581 const std::unordered_set<std::string> &tosend);
582 void stepPendingDynMediaCallbacks(float dtime);
583
584 // Adds a ParticleSpawner on peer with peer_id (PEER_ID_INEXISTENT == all)
585 void SendAddParticleSpawner(session_t peer_id, u16 protocol_version,
586 const ParticleSpawnerParameters &p, u16 attached_id, u32 id);
587
588 void SendDeleteParticleSpawner(session_t peer_id, u32 id);
589
590 // Spawns particle on peer with peer_id (PEER_ID_INEXISTENT == all)
591 void SendSpawnParticle(session_t peer_id, u16 protocol_version,
592 const ParticleParameters &p);
593
595 void SendActiveObjectMessages(session_t peer_id, const std::string &datas,
596 bool reliable = true);
598
599 /*
600 Something random
601 */
602
603 void HandlePlayerDeath(PlayerSAO* sao, const PlayerHPChangeReason &reason);
604 void DeleteClient(session_t peer_id, ClientDeletionReason reason);
605 void UpdateCrafting(RemotePlayer *player);
606 bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what);
607
609
610 // This returns the answer to the sender of wmessage, or "" if there is none
611 std::wstring handleChat(const std::string &name, std::wstring wmessage_input,
612 bool check_shout_priv = false, RemotePlayer *player = nullptr);
613 void handleAdminChat(const ChatEventChat *evt);
614
615 // When called, connection mutex should be locked
618
619 // When called, environment mutex should be locked
620 std::string getPlayerName(session_t peer_id);
622
623 /*
624 Get a player from memory or creates one.
625 If player is already connected, return NULL
626 Does not verify/modify auth info and password.
627
628 Call with env and con locked.
629 */
630 PlayerSAO *emergePlayer(const char *name, session_t peer_id, u16 proto_version);
631
632 /*
633 Variables
634 */
635
636 // Environment mutex (envlock)
638
639 // World directory
640 std::string m_path_world;
641 std::string m_path_mod_data;
642 // Subgame specification
644 // If true, do not allow multiple players and hide some multiplayer
645 // functionality
648 // For "dedicated" server list flag
650
651 // Game settings layer
653
654 // Thread can set; step() will throw as ServerError
656
657 // Some timers
663 float m_savemap_timer = 0.0f;
666
667 // Environment
669
670 // server connection
671 std::shared_ptr<con::IConnection> m_con;
672
673 // Ban checking
675
676 // Rollback manager (behind m_env_mutex)
678
679 // Emerge manager
680 std::unique_ptr<EmergeManager> m_emerge;
681
682 // Item definition manager
684
685 // Node definition manager
687
688 // Craft definition manager
690
691 std::unordered_map<std::string, Translations> server_translations;
692
694
695 /*
696 Threads
697 */
698 // Set by Game
699 std::atomic<StepSettings> m_step_settings{{0.1f, false}};
700
701 // The server mainly operates in this thread
703
704 /*
705 Client interface
706 */
708
709 std::unordered_map<session_t, std::string> m_formspec_state_data;
710
711 /*
712 Random stuff
713 */
714
716
718 std::string m_admin_nick;
719
720 // If a mod error occurs while shutting down, the error message will be
721 // written into this.
722 std::string *const m_shutdown_errmsg;
723
724 /*
725 Map edit event queue. Automatically receives all map edits.
726 The constructor of this class registers us to receive them through
727 onMapEditEvent
728
729 NOTE: Should these be moved to actually be members of
730 ServerEnvironment?
731 */
732
733 /*
734 Queue of map edits from the environment for sending to the clients
735 This is behind m_env_mutex
736 */
737 std::queue<MapEditEvent*> m_unsent_map_edit_queue;
738 /*
739 If a non-empty area, map edit events contained within are left
740 unsent. Done at map generation time to speed up editing of the
741 generated area, as it will be sent anyway.
742 This is behind m_env_mutex
743 */
745
746 // media files known to server
747 std::unordered_map<std::string, MediaInfo> m_media;
748
749 // pending dynamic media callbacks, clients inform the server when they have a file fetched
750 std::unordered_map<u32, PendingDynamicMediaCallback> m_pending_dyn_media;
752
753 /*
754 Sounds
755 */
756 std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
757 s32 m_playing_sounds_id_last_used = 0; // positive values only
758 s32 nextSoundId();
759
762
763 // CSM restrictions byteflag
766
767 // ModChannel manager
768 std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
769
770 // Inventory manager
771 std::unique_ptr<ServerInventoryManager> m_inventory_mgr;
772
773 // Global server metrics backend
774 std::unique_ptr<MetricsBackend> m_metrics_backend;
775
776 // Server metrics
781 MetricCounterPtr m_aom_buffer_counter[2]; // [0] = rel, [1] = unrel
785};
786
787/*
788 Runs a simple dedicated server loop.
789
790 Shuts down when kill is set to true.
791*/
792void dedicated_server_loop(Server &server, bool &kill);
Definition address.h:28
Definition ban.h:15
virtual const char * what() const noexcept
Definition exceptions.h:17
Definition chat_interface.h:19
Definition clientiface.h:443
Definition emerge.h:117
Definition emerge_internal.h:25
Definition craftdef.h:390
Definition gamedef.h:36
Definition itemdef.h:129
Definition rollback_interface.h:97
Definition craftdef.h:419
Definition itemdef.h:172
Definition numeric.h:347
Definition inventory.h:314
Definition c_types.h:40
Definition mapblock.h:58
Definition map.h:94
Definition map.h:101
virtual double get() const =0
Definition modchannels.h:52
Definition modchannels.h:23
Definition exceptions.h:85
Definition database.h:74
Definition thread.h:16
void set(const T &value)
Definition thread.h:28
Definition networkpacket.h:14
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:541
Definition player_sao.h:56
Definition clientiface.h:214
Definition remoteplayer.h:26
Definition serveractiveobject.h:41
Definition serverenvironment.h:219
Map & getMap()
Definition serverenvironment.cpp:578
Definition serverinventorymgr.h:17
Manages server mods.
Definition mods.h:18
Definition scripting_server.h:33
Definition server.cpp:84
Definition server.h:456
std::lock_guard< ordered_mutex > m_lock
Definition server.h:461
EnvAutoLock(Server *server)
Definition server.h:458
Definition server.h:167
void kickAllPlayers(AccessDeniedCode reason, const std::string &str_reason, bool reconnect)
Definition server.cpp:2880
void setIpBanned(const std::string &ip, const std::string &name)
Definition server.cpp:3264
void sendMetadataChanged(const std::unordered_set< v3s16 > &positions, float far_d_nodes=100)
Definition server.cpp:2345
PlayerSAO * emergePlayer(const char *name, session_t peer_id, u16 proto_version)
Definition server.cpp:3973
void DisconnectPeer(session_t peer_id)
Definition server.cpp:2889
IRollbackManager * m_rollback
Definition server.h:677
void stop()
Definition server.cpp:597
void handleCommand_FirstSrp(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1451
float m_liquid_transform_timer
Definition server.h:659
void setStars(RemotePlayer *player, const StarParams &params)
Definition server.cpp:3479
void setSun(RemotePlayer *player, const SunParams &params)
Definition server.cpp:3465
RemoteClient * getClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition server.cpp:3152
Translations * getTranslationLanguage(const std::string &lang_code)
Definition server.cpp:4152
void handleCommand_PlayerItem(NetworkPacket *pkt)
Definition serverpackethandler.cpp:815
std::unordered_map< session_t, std::string > m_formspec_state_data
Definition server.h:709
void SendPlayerFormspecPrepend(session_t peer_id)
Definition server.cpp:2045
bool rollbackRevertActions(const std::list< RollbackAction > &actions, std::list< std::string > *log)
Definition server.cpp:3759
std::string m_admin_nick
Definition server.h:718
void init()
Definition server.cpp:430
u16 m_max_chatmessage_length
Definition server.h:647
void requestShutdown(const std::string &msg, bool reconnect, float delay=0.0f)
Definition server.cpp:3941
void setStepSettings(StepSettings spdata)
Definition server.h:343
void SendShowFormspecMessage(session_t peer_id, const std::string &formspec, const std::string &formname)
Definition server.cpp:1551
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel)
Definition server.cpp:2158
Address getPeerAddress(session_t peer_id)
Definition server.cpp:3431
void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness)
Definition server.cpp:3493
void SendPlayerInventoryFormspec(session_t peer_id)
Definition server.cpp:2033
void HandlePlayerDeath(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:2853
static u16 getProtocolVersionMax()
Definition server.cpp:4310
void SendMovePlayer(PlayerSAO *sao)
Definition server.cpp:1947
void DenySudoAccess(session_t peer_id)
Definition server.cpp:2865
void SendPlayerBreath(PlayerSAO *sao)
Definition server.cpp:1939
void SendAccessDenied(session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason, bool reconnect=false)
Definition server.cpp:1449
IWritableCraftDefManager * m_craftdef
Definition server.h:689
ModStorageDatabase * m_mod_storage_database
Definition server.h:760
const ClientDynamicInfo * getClientDynamicInfo(session_t peer_id)
Definition server.cpp:1366
void spawnParticle(const std::string &playername, const ParticleParameters &p)
Definition server.cpp:3513
void step()
Definition server.cpp:608
virtual IItemDefManager * getItemDefManager()
Definition server.cpp:3803
MutexedVariable< std::string > m_async_fatal_error
Definition server.h:655
static ModStorageDatabase * openModStorageDatabase(const std::string &world_path)
Definition server.cpp:4189
void SendSetSky(session_t peer_id, const SkyboxParams &params)
Definition server.cpp:1822
void SendHUDChange(session_t peer_id, u32 id, HudElementStat stat, void *value)
Definition server.cpp:1775
std::unordered_map< std::string, MediaInfo > m_media
Definition server.h:747
void SendHP(session_t peer_id, u16 hp, bool effect)
Definition server.cpp:1435
void SendDeleteParticleSpawner(session_t peer_id, u32 id)
Definition server.cpp:1743
u64 m_csm_restriction_flags
Definition server.h:764
bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what)
Definition serverpackethandler.cpp:856
void reportPrivsModified(const std::string &name="")
Definition server.cpp:3226
void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id)
Definition server.cpp:2808
void handleCommand_Null(NetworkPacket *pkt)
Definition server.h:206
void handleCommand_SrpBytesA(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1540
void fadeSound(s32 handle, float step, float gain)
Definition server.cpp:2271
std::queue< MapEditEvent * > m_unsent_map_edit_queue
Definition server.h:737
void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3419
void printToConsoleOnly(const std::string &text)
Definition server.cpp:1377
void setTimeOfDay(u32 time)
Definition server.cpp:1306
void DeleteClient(session_t peer_id, ClientDeletionReason reason)
Definition server.cpp:2920
void ProcessData(NetworkPacket *pkt)
Definition server.cpp:1246
bool denyIfBanned(session_t peer_id)
Definition server.cpp:3284
void setAsyncFatalError(const std::string &error)
Definition server.h:346
s32 playSound(ServerPlayingSound &params, bool ephemeral=false)
Definition server.cpp:2182
BanManager * m_banmanager
Definition server.h:674
void setSky(RemotePlayer *player, const SkyboxParams &params)
Definition server.cpp:3458
bool m_dedicated
Definition server.h:649
void SendSpawnParticle(session_t peer_id, u16 protocol_version, const ParticleParameters &p)
Definition server.cpp:1576
DISABLE_CLASS_COPY(Server)
bool addMediaFile(const std::string &filename, const std::string &filepath, std::string *filedata=nullptr, std::string *digest=nullptr)
Definition server.cpp:2513
ModChannel * getModChannel(const std::string &channel)
Definition server.cpp:4112
void sendNodeChangePkt(NetworkPacket &pkt, v3s16 block_pos, v3f p, float far_d_nodes, std::unordered_set< u16 > *far_players)
Definition server.cpp:2316
virtual ModIPCStore * getModIPCStore()
Definition server.h:333
void handleCommand_InventoryAction(NetworkPacket *pkt)
Definition serverpackethandler.cpp:569
std::unique_ptr< EmergeManager > m_emerge
Definition server.h:680
void handleCommand_Interact(NetworkPacket *pkt)
Definition serverpackethandler.cpp:884
void SendMovePlayerRel(session_t peer_id, const v3f &added_pos)
Definition server.cpp:1967
virtual ICraftDefManager * getCraftDefManager()
Definition server.cpp:3813
v3f findSpawnPos()
Definition server.cpp:3870
VoxelArea m_ignore_map_edit_events_area
Definition server.h:744
std::set< std::string > getPlayerEffectivePrivs(const std::string &name)
Definition server.cpp:3213
s32 nextSoundId()
Definition server.cpp:2165
bool SendBlock(session_t peer_id, const v3s16 &blockpos)
Definition server.cpp:2497
virtual const ModSpec * getModSpec(const std::string &modname) const
Definition server.cpp:3843
IntervalLimiter m_map_timer_and_unload_interval
Definition server.h:664
void handleCommand_PlayerPos(NetworkPacket *pkt)
Definition serverpackethandler.cpp:508
void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask)
Definition server.cpp:1806
~Server()
Definition server.cpp:333
std::unique_ptr< ServerModManager > m_modmgr
Definition server.h:472
ServerEnvironment & getEnv()
Definition server.h:358
void sendDetachedInventories(session_t peer_id, bool incremental)
Definition server.cpp:2834
std::unordered_map< std::string, std::string > getMediaList()
Definition server.cpp:4176
PlayerSAO * getPlayerSAO(session_t peer_id)
Definition server.cpp:3165
void handleCommand(NetworkPacket *pkt)
Definition server.cpp:1240
void SendPlayerPrivileges(session_t peer_id)
Definition server.cpp:2014
std::wstring handleChat(const std::string &name, std::wstring wmessage_input, bool check_shout_priv=false, RemotePlayer *player=nullptr)
Definition server.cpp:3042
MetricGaugePtr m_lag_gauge
Definition server.h:780
void notifyPlayer(const char *name, const std::wstring &msg)
Definition server.cpp:3300
void setMoon(RemotePlayer *player, const MoonParams &params)
Definition server.cpp:3472
ClientInterface m_clients
Definition server.h:707
void stopSound(s32 handle)
Definition server.cpp:2252
float m_time_of_day_send_timer
Definition server.h:658
void handleCommand_SrpBytesM(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1647
void handleCommand_InventoryFields(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1388
bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval)
Definition server.cpp:1336
virtual const SubgameSpec * getGameSpec() const
Definition server.h:329
MetricGaugePtr m_player_gauge
Definition server.h:778
void addShutdownError(const ModError &e)
Definition server.cpp:3854
float m_mod_storage_save_timer
Definition server.h:761
void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio)
Definition server.cpp:1893
bool sendModChannelMessage(const std::string &channel, const std::string &message)
Definition server.cpp:4103
std::string getBanDescription(const std::string &ip_or_name)
Definition server.cpp:3279
std::unordered_map< s32, ServerPlayingSound > m_playing_sounds
Definition server.h:756
virtual const NodeDefManager * getNodeDefManager()
Definition server.cpp:3808
virtual std::string getModDataPath() const
Definition server.h:332
void onMapEditEvent(const MapEditEvent &event)
Definition server.cpp:1312
MetricCounterPtr m_packet_recv_processed_counter
Definition server.h:783
float m_masterserver_timer
Definition server.h:661
void SendSetSun(session_t peer_id, const SunParams &params)
Definition server.cpp:1856
void setLighting(RemotePlayer *player, const Lighting &lighting)
Definition server.cpp:3501
void SendSetMoon(session_t peer_id, const MoonParams &params)
Definition server.cpp:1865
void UpdateCrafting(RemotePlayer *player)
Definition server.cpp:2998
bool checkPriv(const std::string &name, const std::string &priv)
Definition server.cpp:3220
void handleCommand_HaveMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1811
bool leaveModChannel(const std::string &channel)
Definition server.cpp:4098
NodeDefManager * getWritableNodeDefManager()
Definition server.cpp:3828
ShutdownState m_shutdown_state
Definition server.h:715
std::atomic< StepSettings > m_step_settings
Definition server.h:699
MetricCounterPtr m_uptime_counter
Definition server.h:777
IWritableItemDefManager * getWritableItemDefManager()
Definition server.cpp:3823
void handleCommand_ModChannelLeave(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1758
void handleCommand_ClientReady(NetworkPacket *pkt)
Definition serverpackethandler.cpp:363
void SendPlayerHP(PlayerSAO *sao, bool effect)
Definition server.cpp:1430
void handleAdminChat(const ChatEventChat *evt)
Definition server.cpp:3131
void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version)
Definition server.cpp:1459
RemoteClient * getClient(session_t peer_id, ClientState state_min=CS_Active)
Definition server.cpp:3144
void SendSetLighting(session_t peer_id, const Lighting &lighting)
Definition server.cpp:1904
IRollbackManager * getRollbackManager()
Definition server.h:318
void SendInventory(RemotePlayer *player, bool incremental)
Definition server.cpp:1510
bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask)
Definition server.cpp:3368
std::vector< std::pair< std::string, std::string > > m_mapgen_init_files
Definition server.h:447
float m_step_pending_dyn_media_timer
Definition server.h:751
void start()
Definition server.cpp:557
MetricCounterPtr m_aom_buffer_counter[2]
Definition server.h:781
MetricCounterPtr m_packet_recv_counter
Definition server.h:782
IWritableCraftDefManager * getWritableCraftDefManager()
Definition server.cpp:3833
void SendHUDAdd(session_t peer_id, u32 id, HudElement *form)
Definition server.cpp:1756
std::unique_ptr< ModChannelMgr > m_modchannel_mgr
Definition server.h:768
bool isShutdownRequested() const
Definition server.h:257
std::unique_ptr< ServerInventoryManager > m_inventory_mgr
Definition server.h:771
void deletingPeer(con::IPeer *peer, bool timeout)
Definition server.cpp:1327
virtual const std::vector< ModSpec > & getMods() const
Definition server.cpp:3838
void sendRemoveNode(v3s16 p, std::unordered_set< u16 > *far_players=nullptr, float far_d_nodes=100)
Definition server.cpp:2292
void SendCloudParams(session_t peer_id, const CloudParams &params)
Definition server.cpp:1885
virtual u16 allocateUnknownNodeId(const std::string &name)
Definition server.cpp:3818
bool showFormspec(const char *name, const std::string &formspec, const std::string &formname)
Definition server.cpp:3317
bool hudRemove(RemotePlayer *player, u32 id)
Definition server.cpp:3344
void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value)
Definition server.cpp:1815
ordered_mutex m_env_mutex
Definition server.h:637
void broadcastModChannelMessage(const std::string &channel, const std::string &message, session_t from_peer)
Definition server.cpp:4117
void unsetIpBanned(const std::string &ip_or_name)
Definition server.cpp:3274
std::unique_ptr< ServerScripting > m_script
Definition server.h:469
void sendRequestedMedia(session_t peer_id, const std::unordered_set< std::string > &tosend)
Definition server.cpp:2667
u32 hudAdd(RemotePlayer *player, HudElement *element)
Definition server.cpp:3332
MetricCounterPtr m_map_edit_event_counter
Definition server.h:784
void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4], f32 animation_speed)
Definition server.cpp:1988
float m_savemap_timer
Definition server.h:663
float m_liquid_transform_every
Definition server.h:660
void SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed)
Definition server.cpp:1926
void process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao, NetworkPacket *pkt)
Definition serverpackethandler.cpp:441
virtual ModStorageDatabase * getModStorageDatabase()
Definition server.h:320
Address m_bind_addr
Definition server.h:453
void DenyAccess(session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason="", bool reconnect=false)
Definition server.cpp:2872
bool getClientInfo(session_t peer_id, ClientInfo &ret)
Definition server.cpp:1342
void SendBlockNoLock(session_t peer_id, MapBlock *block, u8 ver, u16 net_proto_version, SerializedBlockCache *cache=nullptr)
Definition server.cpp:2397
void SendHUDRemove(session_t peer_id, u32 id)
Definition server.cpp:1768
static std::string getBuiltinLuaPath()
Definition server.cpp:3848
void deleteParticleSpawner(const std::string &playername, u32 id)
Definition server.cpp:3562
void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front)
Definition server.cpp:2007
IWritableItemDefManager * m_itemdef
Definition server.h:683
void handleCommand_ModChannelMsg(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1782
ServerScripting * getScriptIface()
Definition server.h:305
void handleCommand_Init2(NetworkPacket *pkt)
Definition serverpackethandler.cpp:276
void yieldToOtherThreads(float dtime)
Definition server.cpp:1125
void handleCommand_GotBlocks(NetworkPacket *pkt)
Definition serverpackethandler.cpp:410
std::unique_ptr< MetricsBackend > m_metrics_backend
Definition server.h:774
std::unordered_map< u32, PendingDynamicMediaCallback > m_pending_dyn_media
Definition server.h:750
void handleCommand_Init(NetworkPacket *pkt)
Definition serverpackethandler.cpp:37
IntervalLimiter m_max_lag_decrease
Definition server.h:665
void acceptAuth(session_t peer_id, bool forSudoMode)
Definition server.cpp:2895
void reportFormspecPrependModified(const std::string &name)
Definition server.cpp:3256
void handleCommand_DeletedBlocks(NetworkPacket *pkt)
Definition serverpackethandler.cpp:539
void SendMovement(session_t peer_id)
Definition server.cpp:1398
void handleCommand_Damage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:772
static bool migrateModStorageDatabase(const GameParams &game_params, const Settings &cmd_args)
Definition server.cpp:4230
void handleCommand_RemovedSounds(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1291
void handleCommand_Deprecated(NetworkPacket *pkt)
Definition serverpackethandler.cpp:31
Map & getMap()
Definition server.h:357
void handleCommand_ChatMessage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:747
void handleChatInterfaceEvent(ChatEvent *evt)
Definition server.cpp:3023
ServerThread * m_thread
Definition server.h:702
ServerInventoryManager * getInventoryMgr() const
Definition server.h:301
void SendActiveObjectMessages(session_t peer_id, const std::string &datas, bool reliable=true)
Definition server.cpp:2138
double getUptime() const
Definition server.h:254
void handleCommand_NodeMetaFields(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1336
std::unique_ptr< PackedValue > m_lua_globals_data
Definition server.h:450
PlayerSAO * StageTwoClientInit(session_t peer_id)
Definition server.cpp:1171
void SendAddParticleSpawner(session_t peer_id, u16 protocol_version, const ParticleSpawnerParameters &p, u16 attached_id, u32 id)
Definition server.cpp:1619
void sendAddNode(v3s16 p, MapNode n, std::unordered_set< u16 > *far_players=nullptr, float far_d_nodes=100, bool remove_metadata=true)
Definition server.cpp:2304
std::vector< std::pair< std::string, std::string > > m_async_init_files
Definition server.h:445
void SendCSMRestrictionFlags(session_t peer_id)
Definition server.cpp:2150
void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front)
Definition server.cpp:3445
void peerAdded(con::IPeer *peer)
Definition server.cpp:1320
void reportInventoryFormspecModified(const std::string &name)
Definition server.cpp:3248
void SendSetStars(session_t peer_id, const StarParams &params)
Definition server.cpp:1874
virtual void SendChatMessage(session_t peer_id, const ChatMessage &message)
Definition server.cpp:1532
std::string getStatusString()
Definition server.cpp:3173
void SendActiveObjectRemoveAdd(RemoteClient *client, PlayerSAO *playersao)
Definition server.cpp:2056
void AsyncRunStep(float dtime, bool initial_step=false)
Definition server.cpp:622
MetricGaugePtr m_timeofday_gauge
Definition server.h:779
Settings * m_game_settings
Definition server.h:652
SubgameSpec m_gamespec
Definition server.h:643
bool joinModChannel(const std::string &channel)
Definition server.cpp:4092
std::string getPlayerName(session_t peer_id)
Definition server.cpp:3157
void hudSetHotbarImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3407
void stepPendingDynMediaCallbacks(float dtime)
Definition server.cpp:2765
std::string m_path_world
Definition server.h:640
bool isSingleplayer() const
Definition server.h:335
bool dynamicAddMedia(const DynamicMediaArgs &args)
Definition server.cpp:3599
void handleCommand_ModChannelJoin(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1733
void Send(NetworkPacket *pkt)
Definition server.cpp:1387
void handleCommand_RequestMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:339
std::string *const m_shutdown_errmsg
Definition server.h:722
s32 m_playing_sounds_id_last_used
Definition server.h:757
u32 m_csm_restriction_noderange
Definition server.h:765
static u16 getProtocolVersionMin()
Definition server.cpp:4300
u32 addParticleSpawner(const ParticleSpawnerParameters &p, ServerActiveObject *attached, const std::string &playername)
Definition server.cpp:3533
void SendBlocks(float dtime)
Definition server.cpp:2428
void handleCommand_UpdateClientInfo(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1838
void Receive(float min_time)
Receive and process all incoming packets.
Definition server.cpp:1073
void notifyPlayers(const std::wstring &msg)
Definition server.cpp:3508
std::unordered_map< std::pair< v3s16, u16 >, std::string, SBCHash > SerializedBlockCache
Definition server.h:511
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount)
Definition server.cpp:3389
void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef, u16 protocol_version)
Definition server.cpp:1482
StepSettings getStepSettings()
Definition server.h:344
void SendBreath(session_t peer_id, u16 breath)
Definition server.cpp:1442
std::shared_ptr< con::IConnection > m_con
Definition server.h:671
void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4], f32 frame_speed)
Definition server.cpp:3437
void setClouds(RemotePlayer *player, const CloudParams &params)
Definition server.cpp:3486
void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:1418
float m_emergethread_trigger_timer
Definition server.h:662
ModIPCStore m_ipcstore
Definition server.h:693
std::string m_path_mod_data
Definition server.h:641
void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code)
Definition server.cpp:2610
void setAsyncFatalError(const LuaError &e)
Definition server.h:348
void SendMinimapModes(session_t peer_id, std::vector< MinimapMode > &modes, size_t wanted_mode)
Definition server.cpp:2792
virtual EmergeManager * getEmergeManager()
Definition server.h:319
ServerEnvironment * m_env
Definition server.h:668
void fillMediaCache()
Definition server.cpp:2577
bool m_simple_singleplayer_mode
Definition server.h:646
std::unordered_map< std::string, Translations > server_translations
Definition server.h:691
virtual std::string getWorldPath() const
Definition server.h:331
ChatInterface * m_admin_chat
Definition server.h:717
NodeDefManager * m_nodedef
Definition server.h:686
bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value)
Definition server.cpp:3359
void SendPlayerFov(session_t peer_id)
Definition server.cpp:1974
Definition settings.h:109
Definition test_moveaction.cpp:12
Definition test_server_shutdown_state.cpp:13
Definition translation.h:19
Definition voxel.h:44
Definition connection.h:34
Definition peerhandler.h:13
Definition ordered_mutex.h:13
ClientState
Definition clientiface.h:165
@ CS_Active
Definition clientiface.h:174
#define BS
Definition constants.h:61
HudElementStat
Definition hud.h:59
MinimapType
Definition hud.h:108
@ MINIMAP_TYPE_OFF
Definition hud.h:109
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
std::shared_ptr< MetricCounter > MetricCounterPtr
Definition metricsbackend.h:22
std::shared_ptr< MetricGauge > MetricGaugePtr
Definition metricsbackend.h:36
Definition activeobjectmgr.cpp:11
rtt_stat_type
Definition connection.h:16
Definition activeobjectmgr.cpp:11
AccessDeniedCode
Definition networkprotocol.h:902
@ CSM_RF_NONE
Definition networkprotocol.h:927
u16 session_t
Definition networkprotocol.h:22
@ AC_INTERACTION
Definition server.h:72
@ AC_MOVEMENT
Definition server.h:73
@ AC_DIGGING
Definition server.h:71
ClientDeletionReason
Definition server.h:83
@ CDR_LEAVE
Definition server.h:84
@ CDR_DENY
Definition server.h:86
@ CDR_TIMEOUT
Definition server.h:85
constexpr static const FlagDesc flagdesc_anticheat[]
Definition server.h:76
void dedicated_server_loop(Server &server, bool &kill)
Definition server.cpp:4033
SoundLocation
Definition sound.h:67
Definition chat_interface.h:49
Definition chat_interface.h:61
Definition chatmessage.h:20
Definition clientdynamicinfo.h:12
Definition server.h:136
u32 uptime
Definition server.h:139
u8 ser_vers
Definition server.h:140
u8 patch
Definition server.h:142
u16 prot_vers
Definition server.h:141
ClientState state
Definition server.h:137
std::string vers_string
Definition server.h:143
Address addr
Definition server.h:138
std::string lang_code
Definition server.h:143
u8 major
Definition server.h:142
u8 minor
Definition server.h:142
Definition skyparams.h:65
Definition string.h:67
Definition gameparams.h:12
Definition hud.h:84
Describes ambient light settings for a player.
Definition lighting.h:39
Definition map.h:44
Definition mapnode.h:124
Definition server.h:90
MediaInfo(std::string_view path_="", std::string_view sha1_digest_="")
Definition server.h:98
bool delete_at_shutdown
Definition server.h:96
std::string path
Definition server.h:91
std::string sha1_digest
Definition server.h:92
bool no_announce
Definition server.h:94
Definition server.h:127
u16 size
Definition server.h:130
MinimapType type
Definition server.h:128
std::string texture
Definition server.h:131
std::string label
Definition server.h:129
u16 scale
Definition server.h:132
Definition server.h:146
std::condition_variable_any condvar
Signalled on any changes to the map contents.
Definition server.h:153
std::shared_mutex mutex
RW lock for this entire structure.
Definition server.h:151
ModIPCStore()=default
~ModIPCStore()
Definition server.cpp:74
std::unordered_map< std::string, std::unique_ptr< PackedValue > > map
Map storing the data.
Definition server.h:159
void signal()
Definition server.h:162
Definition mods.h:25
Definition skyparams.h:48
A packed value can be a primitive like a string or number but also a table including all of its conte...
Definition c_packer.h:72
Definition particles.h:303
Definition particles.h:314
Definition player_sao.h:227
Definition rollback_interface.h:40
Definition server.h:110
std::string to_player
Definition server.h:117
float gain
Definition server.h:113
std::unordered_set< session_t > clients
Definition server.h:124
std::string exclude_player
Definition server.h:118
SoundSpec spec
Definition server.h:122
v3f pos
Definition server.h:115
float max_hear_distance
Definition server.h:114
v3f getPos(ServerEnvironment *env, bool *pos_exists) const
Definition server.cpp:166
SoundLocation type
Definition server.h:111
Definition server.h:291
bool ephemeral
Definition server.h:297
u32 token
Definition server.h:295
std::optional< std::string_view > data
Definition server.h:294
std::string to_player
Definition server.h:296
std::string filename
Definition server.h:292
std::optional< std::string > filepath
Definition server.h:293
std::unordered_set< session_t > waiting_players
Definition server.h:501
std::string filename
Definition server.h:499
float expiry_timer
Definition server.h:500
Definition server.h:505
size_t operator()(const std::pair< v3s16, u16 > &p) const
Definition server.h:506
Definition server.h:482
void trigger(float delay, const std::string &msg, bool reconnect)
Definition server.cpp:202
bool isTimerRunning() const
Definition server.h:493
void tick(float dtime, Server *server)
Definition server.cpp:209
void reset()
Definition server.cpp:194
bool is_requested
Definition server.h:485
bool should_reconnect
Definition server.h:486
float m_timer
Definition server.h:495
std::wstring getShutdownTimerMessage() const
Definition server.cpp:241
std::string message
Definition server.h:487
Definition server.h:338
bool pause
Definition server.h:340
float steplen
Definition server.h:339
Definition skyparams.h:20
Describes the sound information for playback.
Definition sound.h:20
Definition skyparams.h:56
Definition subgames.h:15
Definition skyparams.h:38
static std::string p(std::string path)
Definition test_filesys.cpp:53