Luanti 5.11.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 "content/mods.h"
12#include "inventorymanager.h"
13#include "content/subgames.h"
14#include "network/peerhandler.h"
15#include "network/connection.h"
16#include "util/numeric.h"
17#include "util/thread.h"
18#include "util/basic_macros.h"
19#include "util/metricsbackend.h"
20#include "serverenvironment.h"
21#include "server/clientiface.h"
23#include "chatmessage.h"
24#include "sound.h"
25#include "translation.h"
26#include <atomic>
27#include <string>
28#include <list>
29#include <map>
30#include <vector>
31#include <unordered_set>
32#include <optional>
33#include <string_view>
34#include <shared_mutex>
35#include <condition_variable>
36
37class ChatEvent;
38struct ChatEventChat;
39struct ChatInterface;
41class NodeDefManager;
43class BanManager;
44class Inventory;
45class ModChannelMgr;
46class RemotePlayer;
47class PlayerSAO;
50struct RollbackAction;
51class EmergeManager;
52class ServerScripting;
54struct SoundSpec;
55struct CloudParams;
56struct SkyboxParams;
57struct SunParams;
58struct MoonParams;
59struct StarParams;
60struct Lighting;
61class ServerThread;
64struct PackedValue;
67
68// Anticheat flags
69enum {
70 AC_DIGGING = 0x01,
72 AC_MOVEMENT = 0x04
73};
74
75constexpr const static FlagDesc flagdesc_anticheat[] = {
76 {"digging", AC_DIGGING},
77 {"interaction", AC_INTERACTION},
78 {"movement", AC_MOVEMENT},
79 {NULL, 0}
80};
81
87
89{
90 std::string path;
91 std::string sha1_digest; // base64-encoded
92 // true = not announced in TOCLIENT_ANNOUNCE_MEDIA (at player join)
94 // does what it says. used by some cases of dynamic media.
96
97 MediaInfo(std::string_view path_ = "",
98 std::string_view sha1_digest_ = ""):
99 path(path_),
100 sha1_digest(sha1_digest_),
101 no_announce(false),
102 delete_at_shutdown(false)
103 {
104 }
105};
106
107// Combines the pure sound (SoundSpec) with positional information
109{
111
112 float gain = 1.0f; // for amplification of the base sound
113 float max_hear_distance = 32 * BS;
115 u16 object = 0;
116 std::string to_player;
117 std::string exclude_player;
118
119 v3f getPos(ServerEnvironment *env, bool *pos_exists) const;
120
122
123 std::unordered_set<session_t> clients; // peer ids
124};
125
128 std::string label;
129 u16 size = 0;
130 std::string texture;
131 u16 scale = 1;
132};
133
134// structure for everything getClientInfo returns, for convenience
144
146 ModIPCStore() = default;
147 ~ModIPCStore();
148
150 std::shared_mutex mutex;
152 std::condition_variable_any condvar;
158 std::unordered_map<std::string, std::unique_ptr<PackedValue>> map;
159
161 inline void signal() { condvar.notify_all(); }
162};
163
165 public IGameDef
166{
167public:
168 /*
169 NOTE: Every public method should be thread-safe
170 */
171
172 Server(
173 const std::string &path_world,
174 const SubgameSpec &gamespec,
175 bool simple_singleplayer_mode,
176 Address bind_addr,
177 bool dedicated,
178 ChatInterface *iface = nullptr,
179 std::string *shutdown_errmsg = nullptr
180 );
181 ~Server();
183
184 void start();
185 void stop();
186 // Actual processing is done in another thread.
187 // This just checks if there was an error in that thread.
188 void step();
189
190 // This is run by ServerThread and does the actual processing
191 void AsyncRunStep(float dtime, bool initial_step = false);
194 void Receive(float min_time);
195 void yieldToOtherThreads(float dtime);
196
197 // Full player initialization after they processed all static media
198 // This is a helper function for TOSERVER_CLIENT_READY
200
201 /*
202 * Command Handlers
203 */
204
205 void handleCommand(NetworkPacket* pkt);
206
232
233 void ProcessData(NetworkPacket *pkt);
234
235 void Send(NetworkPacket *pkt);
236 void Send(session_t peer_id, NetworkPacket *pkt);
237
238 // Helper for handleCommand_PlayerPos and handleCommand_Interact
239 void process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao,
240 NetworkPacket *pkt);
241
242 // Both setter and getter need no envlock,
243 // can be called freely from threads
244 void setTimeOfDay(u32 time);
245
246 /*
247 Shall be called with the environment locked.
248 This is accessed by the map, which is inside the environment,
249 so it shouldn't be a problem.
250 */
251 void onMapEditEvent(const MapEditEvent &event);
252
253 // Connection must be locked when called
254 std::string getStatusString();
255 inline double getUptime() const { return m_uptime_counter->get(); }
256
257 // read shutdown state
258 inline bool isShutdownRequested() const { return m_shutdown_state.is_requested; }
259
260 // request server to shutdown
261 void requestShutdown(const std::string &msg, bool reconnect, float delay = 0.0f);
262
263 // Returns -1 if failed, sound handle on success
264 // Envlock
265 s32 playSound(ServerPlayingSound &params, bool ephemeral=false);
266 void stopSound(s32 handle);
267 void fadeSound(s32 handle, float step, float gain);
268
269 // Envlock
270 std::set<std::string> getPlayerEffectivePrivs(const std::string &name);
271 bool checkPriv(const std::string &name, const std::string &priv);
272 void reportPrivsModified(const std::string &name=""); // ""=all
273 void reportInventoryFormspecModified(const std::string &name);
274 void reportFormspecPrependModified(const std::string &name);
275
276 void setIpBanned(const std::string &ip, const std::string &name);
277 void unsetIpBanned(const std::string &ip_or_name);
278 std::string getBanDescription(const std::string &ip_or_name);
279 bool denyIfBanned(session_t peer_id);
280
281 void notifyPlayer(const char *name, const std::wstring &msg);
282 void notifyPlayers(const std::wstring &msg);
283
284 void spawnParticle(const std::string &playername,
285 const ParticleParameters &p);
286
288 ServerActiveObject *attached, const std::string &playername);
289
290 void deleteParticleSpawner(const std::string &playername, u32 id);
291
293 std::string filename;
294 std::optional<std::string> filepath;
295 std::optional<std::string_view> data;
296 u32 token;
297 std::string to_player;
298 bool ephemeral = false;
299 };
300 bool dynamicAddMedia(const DynamicMediaArgs &args);
301
303 void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id);
304
305 // Envlock and conlock should be locked when using scriptapi
306 inline ServerScripting *getScriptIface() { return m_script.get(); }
307
308 // actions: time-reversed list
309 // Return value: success/failure
310 bool rollbackRevertActions(const std::list<RollbackAction> &actions,
311 std::list<std::string> *log);
312
313 // IGameDef interface
314 // Under envlock
316 virtual const NodeDefManager* getNodeDefManager();
318 virtual u16 allocateUnknownNodeId(const std::string &name);
320 virtual EmergeManager *getEmergeManager() { return m_emerge.get(); }
322
326
327 // Not under envlock
328 virtual const std::vector<ModSpec> &getMods() const;
329 virtual const ModSpec* getModSpec(const std::string &modname) const;
330 virtual const SubgameSpec* getGameSpec() const { return &m_gamespec; }
331 static std::string getBuiltinLuaPath();
332 virtual std::string getWorldPath() const { return m_path_world; }
333 virtual std::string getModDataPath() const { return m_path_mod_data; }
334 virtual ModIPCStore *getModIPCStore() { return &m_ipcstore; }
335
336 inline bool isSingleplayer() const
338
340 float steplen;
341 bool pause;
342 };
343
344 void setStepSettings(StepSettings spdata) { m_step_settings.store(spdata); }
346
347 inline void setAsyncFatalError(const std::string &error)
348 { m_async_fatal_error.set(error); }
349 inline void setAsyncFatalError(const LuaError &e)
350 {
351 setAsyncFatalError(std::string("Lua: ") + e.what());
352 }
353
354 // Not thread-safe.
355 void addShutdownError(const ModError &e);
356
357 bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
358 Map & getMap() { return m_env->getMap(); }
361
362 u32 hudAdd(RemotePlayer *player, HudElement *element);
363 bool hudRemove(RemotePlayer *player, u32 id);
364 bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value);
365 bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask);
366 bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
367 void hudSetHotbarImage(RemotePlayer *player, const std::string &name);
368 void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name);
369
371
372 void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4],
373 f32 frame_speed);
374 void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front);
375
376 void setSky(RemotePlayer *player, const SkyboxParams &params);
377 void setSun(RemotePlayer *player, const SunParams &params);
378 void setMoon(RemotePlayer *player, const MoonParams &params);
379 void setStars(RemotePlayer *player, const StarParams &params);
380
381 void setClouds(RemotePlayer *player, const CloudParams &params);
382
383 void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);
384
385 void setLighting(RemotePlayer *player, const Lighting &lighting);
386
387 /* con::PeerHandler implementation. */
388 void peerAdded(con::IPeer *peer);
389 void deletingPeer(con::IPeer *peer, bool timeout);
390
391 void DenySudoAccess(session_t peer_id);
392 void DenyAccess(session_t peer_id, AccessDeniedCode reason,
393 std::string_view custom_reason = "", bool reconnect = false);
395 const std::string &str_reason, bool reconnect);
396 void acceptAuth(session_t peer_id, bool forSudoMode);
397 void DisconnectPeer(session_t peer_id);
398 bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
399 bool getClientInfo(session_t peer_id, ClientInfo &ret);
401
402 void printToConsoleOnly(const std::string &text);
403
404 void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason);
405 void SendPlayerHP(PlayerSAO *sao, bool effect);
406 void SendPlayerBreath(PlayerSAO *sao);
407 void SendInventory(RemotePlayer *player, bool incremental);
408 void SendMovePlayer(PlayerSAO *sao);
409 void SendMovePlayerRel(session_t peer_id, const v3f &added_pos);
410 void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
411 void SendPlayerFov(session_t peer_id);
412
413 void SendMinimapModes(session_t peer_id,
414 std::vector<MinimapMode> &modes,
415 size_t wanted_mode);
416
417 void sendDetachedInventories(session_t peer_id, bool incremental);
418
419 bool joinModChannel(const std::string &channel);
420 bool leaveModChannel(const std::string &channel);
421 bool sendModChannelMessage(const std::string &channel, const std::string &message);
422 ModChannel *getModChannel(const std::string &channel);
423
424 // Send block to specific player only
425 bool SendBlock(session_t peer_id, const v3s16 &blockpos);
426
427 // Get or load translations for a language
428 Translations *getTranslationLanguage(const std::string &lang_code);
429
430 // Returns all media files the server knows about
431 // map key = binary sha1, map value = file path
432 std::unordered_map<std::string, std::string> getMediaList();
433
434 static ModStorageDatabase *openModStorageDatabase(const std::string &world_path);
435
436 static ModStorageDatabase *openModStorageDatabase(const std::string &backend,
437 const std::string &world_path, const Settings &world_mt);
438
439 static bool migrateModStorageDatabase(const GameParams &game_params,
440 const Settings &cmd_args);
441
442 static u16 getProtocolVersionMin();
443 static u16 getProtocolVersionMax();
444
445 // Lua files registered for init of async env, pair of modname + path
446 std::vector<std::pair<std::string, std::string>> m_async_init_files;
447 // Identical but for mapgen env
448 std::vector<std::pair<std::string, std::string>> m_mapgen_init_files;
449
450 // Data transferred into other Lua envs at init time
451 std::unique_ptr<PackedValue> m_lua_globals_data;
452
453 // Bind address
455
456 // Public helper for taking the envlock in a scope
458 public:
460
461 private:
462 std::lock_guard<ordered_mutex> m_lock;
463 };
464
465protected:
466 /* Do not add more members here, this is only required to make unit tests work. */
467
468 // Scripting
469 // Envlock and conlock should be locked when using Lua
470 std::unique_ptr<ServerScripting> m_script;
471
472 // Mods
473 std::unique_ptr<ServerModManager> m_modmgr;
474
475private:
476 friend class EmergeThread;
477 friend class RemoteClient;
478
479 // unittest classes
481 friend class TestMoveAction;
482
485 public:
486 bool is_requested = false;
487 bool should_reconnect = false;
488 std::string message;
489
490 void reset();
491 void trigger(float delay, const std::string &msg, bool reconnect);
492 void tick(float dtime, Server *server);
493 std::wstring getShutdownTimerMessage() const;
494 bool isTimerRunning() const { return m_timer > 0.0f; }
495 private:
496 float m_timer = 0.0f;
497 };
498
500 std::string filename; // only set if media entry and file is to be deleted
502 std::unordered_set<session_t> waiting_players;
503 };
504
505 // The standard library does not implement std::hash for pairs so we have this:
506 struct SBCHash {
507 size_t operator() (const std::pair<v3s16, u16> &p) const {
508 return std::hash<v3s16>()(p.first) ^ p.second;
509 }
510 };
511
512 typedef std::unordered_map<std::pair<v3s16, u16>, std::string, SBCHash> SerializedBlockCache;
513
514 void init();
515
516 void SendMovement(session_t peer_id);
517 void SendHP(session_t peer_id, u16 hp, bool effect);
518 void SendBreath(session_t peer_id, u16 breath);
519 void SendAccessDenied(session_t peer_id, AccessDeniedCode reason,
520 std::string_view custom_reason, bool reconnect = false);
521 void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version);
522 void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef,
523 u16 protocol_version);
524
525
526 virtual void SendChatMessage(session_t peer_id, const ChatMessage &message);
527 void SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed);
528
529 void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4],
530 f32 animation_speed);
531 void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front);
532 void SendPlayerPrivileges(session_t peer_id);
535 void SendShowFormspecMessage(session_t peer_id, const std::string &formspec,
536 const std::string &formname);
537 void SendHUDAdd(session_t peer_id, u32 id, HudElement *form);
538 void SendHUDRemove(session_t peer_id, u32 id);
539 void SendHUDChange(session_t peer_id, u32 id, HudElementStat stat, void *value);
540 void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask);
541 void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value);
542 void SendSetSky(session_t peer_id, const SkyboxParams &params);
543 void SendSetSun(session_t peer_id, const SunParams &params);
544 void SendSetMoon(session_t peer_id, const MoonParams &params);
545 void SendSetStars(session_t peer_id, const StarParams &params);
546 void SendCloudParams(session_t peer_id, const CloudParams &params);
547 void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio);
548 void SendSetLighting(session_t peer_id, const Lighting &lighting);
549 void broadcastModChannelMessage(const std::string &channel,
550 const std::string &message, session_t from_peer);
551
552 /*
553 Send a node removal/addition event to all clients except ignore_id.
554 Additionally, if far_players!=NULL, players further away than
555 far_d_nodes are ignored and their peer_ids are added to far_players
556 */
557 // Envlock and conlock should be locked when calling these
558 void sendRemoveNode(v3s16 p, std::unordered_set<u16> *far_players = nullptr,
559 float far_d_nodes = 100);
560 void sendAddNode(v3s16 p, MapNode n,
561 std::unordered_set<u16> *far_players = nullptr,
562 float far_d_nodes = 100, bool remove_metadata = true);
563 void sendNodeChangePkt(NetworkPacket &pkt, v3s16 block_pos,
564 v3f p, float far_d_nodes, std::unordered_set<u16> *far_players);
565
566 void sendMetadataChanged(const std::unordered_set<v3s16> &positions,
567 float far_d_nodes = 100);
568
569 // Environment and Connection must be locked when called
570 // `cache` may only be very short lived! (invalidation not handeled)
571 void SendBlockNoLock(session_t peer_id, MapBlock *block, u8 ver,
572 u16 net_proto_version, SerializedBlockCache *cache = nullptr);
573
574 // Sends blocks to clients (locks env and con on its own)
575 void SendBlocks(float dtime);
576
577 bool addMediaFile(const std::string &filename, const std::string &filepath,
578 std::string *filedata = nullptr, std::string *digest = nullptr);
579 void fillMediaCache();
580 void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code);
581 void sendRequestedMedia(session_t peer_id,
582 const std::unordered_set<std::string> &tosend);
583 void stepPendingDynMediaCallbacks(float dtime);
584
585 // Adds a ParticleSpawner on peer with peer_id (PEER_ID_INEXISTENT == all)
586 void SendAddParticleSpawner(session_t peer_id, u16 protocol_version,
587 const ParticleSpawnerParameters &p, u16 attached_id, u32 id);
588
589 void SendDeleteParticleSpawner(session_t peer_id, u32 id);
590
591 // Spawns particle on peer with peer_id (PEER_ID_INEXISTENT == all)
592 void SendSpawnParticle(session_t peer_id, u16 protocol_version,
593 const ParticleParameters &p);
594
596 void SendActiveObjectMessages(session_t peer_id, const std::string &datas,
597 bool reliable = true);
599
600 /*
601 Something random
602 */
603
604 void HandlePlayerDeath(PlayerSAO* sao, const PlayerHPChangeReason &reason);
605 void DeleteClient(session_t peer_id, ClientDeletionReason reason);
606 void UpdateCrafting(RemotePlayer *player);
607 bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what);
608
610
611 // This returns the answer to the sender of wmessage, or "" if there is none
612 std::wstring handleChat(const std::string &name, std::wstring wmessage_input,
613 bool check_shout_priv = false, RemotePlayer *player = nullptr);
614 void handleAdminChat(const ChatEventChat *evt);
615
616 // When called, connection mutex should be locked
619
620 // When called, environment mutex should be locked
621 std::string getPlayerName(session_t peer_id);
623
624 /*
625 Get a player from memory or creates one.
626 If player is already connected, return NULL
627 Does not verify/modify auth info and password.
628
629 Call with env and con locked.
630 */
631 std::unique_ptr<PlayerSAO> emergePlayer(const char *name, session_t peer_id,
632 u16 proto_version);
633
634 /*
635 Variables
636 */
637
638 // Environment mutex (envlock)
640
641 // World directory
642 std::string m_path_world;
643 std::string m_path_mod_data;
644 // Subgame specification
646 // If true, do not allow multiple players and hide some multiplayer
647 // functionality
650 // For "dedicated" server list flag
652
653 // Game settings layer
655
656 // Thread can set; step() will throw as ServerError
658
659 // Some timers
665 float m_savemap_timer = 0.0f;
668
669 // Environment
671
672 // server connection
673 std::shared_ptr<con::IConnection> m_con;
674
675 // Ban checking
677
678 // Rollback manager (behind m_env_mutex)
680
681 // Emerge manager
682 std::unique_ptr<EmergeManager> m_emerge;
683
684 // Item definition manager
686
687 // Node definition manager
689
690 // Craft definition manager
692
693 std::unordered_map<std::string, Translations> server_translations;
694
696
697 /*
698 Threads
699 */
700 // Set by Game
701 std::atomic<StepSettings> m_step_settings{{0.1f, false}};
702
703 // The server mainly operates in this thread
705
706 /*
707 Client interface
708 */
710
711 std::unordered_map<session_t, std::string> m_formspec_state_data;
712
713 /*
714 Random stuff
715 */
716
718
720 std::string m_admin_nick;
721
722 // If a mod error occurs while shutting down, the error message will be
723 // written into this.
724 std::string *const m_shutdown_errmsg;
725
726 /*
727 Map edit event queue. Automatically receives all map edits.
728 The constructor of this class registers us to receive them through
729 onMapEditEvent
730
731 NOTE: Should these be moved to actually be members of
732 ServerEnvironment?
733 */
734
735 /*
736 Queue of map edits from the environment for sending to the clients
737 This is behind m_env_mutex
738 */
739 std::queue<MapEditEvent*> m_unsent_map_edit_queue;
740 /*
741 If a non-empty area, map edit events contained within are left
742 unsent. Done at map generation time to speed up editing of the
743 generated area, as it will be sent anyway.
744 This is behind m_env_mutex
745 */
747
748 // media files known to server
749 std::unordered_map<std::string, MediaInfo> m_media;
750
751 // pending dynamic media callbacks, clients inform the server when they have a file fetched
752 std::unordered_map<u32, PendingDynamicMediaCallback> m_pending_dyn_media;
754
755 /*
756 Sounds
757 */
758 std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
759 s32 m_playing_sounds_id_last_used = 0; // positive values only
760 s32 nextSoundId();
761
764
765 // CSM restrictions byteflag
768
769 // ModChannel manager
770 std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
771
772 // Inventory manager
773 std::unique_ptr<ServerInventoryManager> m_inventory_mgr;
774
775 // Global server metrics backend
776 std::unique_ptr<MetricsBackend> m_metrics_backend;
777
778 // Server metrics
783 MetricCounterPtr m_aom_buffer_counter[2]; // [0] = rel, [1] = unrel
787};
788
789/*
790 Runs a simple dedicated server loop.
791
792 Shuts down when kill is set to true.
793*/
794void dedicated_server_loop(Server &server, bool &kill);
Definition address.h:28
Definition ban.h:12
virtual const char * what() const noexcept
Definition exceptions.h:17
Definition chat_interface.h:19
Definition clientiface.h:442
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:545
Definition player_sao.h:56
Definition clientiface.h:213
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:85
Definition server.h:457
std::lock_guard< ordered_mutex > m_lock
Definition server.h:462
EnvAutoLock(Server *server)
Definition server.h:459
Definition server.h:166
void kickAllPlayers(AccessDeniedCode reason, const std::string &str_reason, bool reconnect)
Definition server.cpp:2884
void setIpBanned(const std::string &ip, const std::string &name)
Definition server.cpp:3266
void sendMetadataChanged(const std::unordered_set< v3s16 > &positions, float far_d_nodes=100)
Definition server.cpp:2359
void DisconnectPeer(session_t peer_id)
Definition server.cpp:2893
IRollbackManager * m_rollback
Definition server.h:679
void stop()
Definition server.cpp:597
void handleCommand_FirstSrp(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1446
float m_liquid_transform_timer
Definition server.h:661
void setStars(RemotePlayer *player, const StarParams &params)
Definition server.cpp:3481
void setSun(RemotePlayer *player, const SunParams &params)
Definition server.cpp:3467
RemoteClient * getClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition server.cpp:3156
Translations * getTranslationLanguage(const std::string &lang_code)
Definition server.cpp:4153
void handleCommand_PlayerItem(NetworkPacket *pkt)
Definition serverpackethandler.cpp:810
std::unordered_map< session_t, std::string > m_formspec_state_data
Definition server.h:711
void SendPlayerFormspecPrepend(session_t peer_id)
Definition server.cpp:2059
bool rollbackRevertActions(const std::list< RollbackAction > &actions, std::list< std::string > *log)
Definition server.cpp:3761
std::string m_admin_nick
Definition server.h:720
void init()
Definition server.cpp:431
u16 m_max_chatmessage_length
Definition server.h:649
void requestShutdown(const std::string &msg, bool reconnect, float delay=0.0f)
Definition server.cpp:3948
void setStepSettings(StepSettings spdata)
Definition server.h:344
void SendShowFormspecMessage(session_t peer_id, const std::string &formspec, const std::string &formname)
Definition server.cpp:1565
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel)
Definition server.cpp:2172
Address getPeerAddress(session_t peer_id)
Definition server.cpp:3433
void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness)
Definition server.cpp:3495
void SendPlayerInventoryFormspec(session_t peer_id)
Definition server.cpp:2047
void HandlePlayerDeath(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:2857
static u16 getProtocolVersionMax()
Definition server.cpp:4311
void SendMovePlayer(PlayerSAO *sao)
Definition server.cpp:1961
void DenySudoAccess(session_t peer_id)
Definition server.cpp:2869
void SendPlayerBreath(PlayerSAO *sao)
Definition server.cpp:1953
void SendAccessDenied(session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason, bool reconnect=false)
Definition server.cpp:1463
IWritableCraftDefManager * m_craftdef
Definition server.h:691
ModStorageDatabase * m_mod_storage_database
Definition server.h:762
const ClientDynamicInfo * getClientDynamicInfo(session_t peer_id)
Definition server.cpp:1380
void spawnParticle(const std::string &playername, const ParticleParameters &p)
Definition server.cpp:3515
std::unique_ptr< PlayerSAO > emergePlayer(const char *name, session_t peer_id, u16 proto_version)
Definition server.cpp:3980
void step()
Definition server.cpp:608
virtual IItemDefManager * getItemDefManager()
Definition server.cpp:3805
MutexedVariable< std::string > m_async_fatal_error
Definition server.h:657
static ModStorageDatabase * openModStorageDatabase(const std::string &world_path)
Definition server.cpp:4190
void SendSetSky(session_t peer_id, const SkyboxParams &params)
Definition server.cpp:1836
void SendHUDChange(session_t peer_id, u32 id, HudElementStat stat, void *value)
Definition server.cpp:1789
std::unordered_map< std::string, MediaInfo > m_media
Definition server.h:749
void SendHP(session_t peer_id, u16 hp, bool effect)
Definition server.cpp:1449
void SendDeleteParticleSpawner(session_t peer_id, u32 id)
Definition server.cpp:1757
u64 m_csm_restriction_flags
Definition server.h:766
bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what)
Definition serverpackethandler.cpp:851
void reportPrivsModified(const std::string &name="")
Definition server.cpp:3230
void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id)
Definition server.cpp:2812
void handleCommand_Null(NetworkPacket *pkt)
Definition server.h:207
void handleCommand_SrpBytesA(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1535
void fadeSound(s32 handle, float step, float gain)
Definition server.cpp:2285
std::queue< MapEditEvent * > m_unsent_map_edit_queue
Definition server.h:739
void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3421
void printToConsoleOnly(const std::string &text)
Definition server.cpp:1391
void setTimeOfDay(u32 time)
Definition server.cpp:1320
void DeleteClient(session_t peer_id, ClientDeletionReason reason)
Definition server.cpp:2924
void ProcessData(NetworkPacket *pkt)
Definition server.cpp:1260
bool denyIfBanned(session_t peer_id)
Definition server.cpp:3286
void setAsyncFatalError(const std::string &error)
Definition server.h:347
s32 playSound(ServerPlayingSound &params, bool ephemeral=false)
Definition server.cpp:2196
BanManager * m_banmanager
Definition server.h:676
void setSky(RemotePlayer *player, const SkyboxParams &params)
Definition server.cpp:3460
bool m_dedicated
Definition server.h:651
void SendSpawnParticle(session_t peer_id, u16 protocol_version, const ParticleParameters &p)
Definition server.cpp:1590
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:2527
ModChannel * getModChannel(const std::string &channel)
Definition server.cpp:4113
void sendNodeChangePkt(NetworkPacket &pkt, v3s16 block_pos, v3f p, float far_d_nodes, std::unordered_set< u16 > *far_players)
Definition server.cpp:2330
virtual ModIPCStore * getModIPCStore()
Definition server.h:334
void handleCommand_InventoryAction(NetworkPacket *pkt)
Definition serverpackethandler.cpp:564
std::unique_ptr< EmergeManager > m_emerge
Definition server.h:682
void handleCommand_Interact(NetworkPacket *pkt)
Definition serverpackethandler.cpp:879
void SendMovePlayerRel(session_t peer_id, const v3f &added_pos)
Definition server.cpp:1981
virtual ICraftDefManager * getCraftDefManager()
Definition server.cpp:3815
v3f findSpawnPos()
Definition server.cpp:3872
VoxelArea m_ignore_map_edit_events_area
Definition server.h:746
std::set< std::string > getPlayerEffectivePrivs(const std::string &name)
Definition server.cpp:3217
s32 nextSoundId()
Definition server.cpp:2179
bool SendBlock(session_t peer_id, const v3s16 &blockpos)
Definition server.cpp:2511
virtual const ModSpec * getModSpec(const std::string &modname) const
Definition server.cpp:3845
IntervalLimiter m_map_timer_and_unload_interval
Definition server.h:666
void handleCommand_PlayerPos(NetworkPacket *pkt)
Definition serverpackethandler.cpp:503
void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask)
Definition server.cpp:1820
~Server()
Definition server.cpp:334
std::unique_ptr< ServerModManager > m_modmgr
Definition server.h:473
ServerEnvironment & getEnv()
Definition server.h:359
void sendDetachedInventories(session_t peer_id, bool incremental)
Definition server.cpp:2838
std::unordered_map< std::string, std::string > getMediaList()
Definition server.cpp:4177
PlayerSAO * getPlayerSAO(session_t peer_id)
Definition server.cpp:3169
void handleCommand(NetworkPacket *pkt)
Definition server.cpp:1254
void SendPlayerPrivileges(session_t peer_id)
Definition server.cpp:2028
std::wstring handleChat(const std::string &name, std::wstring wmessage_input, bool check_shout_priv=false, RemotePlayer *player=nullptr)
Definition server.cpp:3046
MetricGaugePtr m_lag_gauge
Definition server.h:782
void notifyPlayer(const char *name, const std::wstring &msg)
Definition server.cpp:3302
void setMoon(RemotePlayer *player, const MoonParams &params)
Definition server.cpp:3474
ClientInterface m_clients
Definition server.h:709
void stopSound(s32 handle)
Definition server.cpp:2266
float m_time_of_day_send_timer
Definition server.h:660
void handleCommand_SrpBytesM(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1642
void handleCommand_InventoryFields(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1383
bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval)
Definition server.cpp:1350
virtual const SubgameSpec * getGameSpec() const
Definition server.h:330
MetricGaugePtr m_player_gauge
Definition server.h:780
void addShutdownError(const ModError &e)
Definition server.cpp:3856
float m_mod_storage_save_timer
Definition server.h:763
void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio)
Definition server.cpp:1907
bool sendModChannelMessage(const std::string &channel, const std::string &message)
Definition server.cpp:4104
std::string getBanDescription(const std::string &ip_or_name)
Definition server.cpp:3281
std::unordered_map< s32, ServerPlayingSound > m_playing_sounds
Definition server.h:758
virtual const NodeDefManager * getNodeDefManager()
Definition server.cpp:3810
virtual std::string getModDataPath() const
Definition server.h:333
void onMapEditEvent(const MapEditEvent &event)
Definition server.cpp:1326
MetricCounterPtr m_packet_recv_processed_counter
Definition server.h:785
float m_masterserver_timer
Definition server.h:663
void SendSetSun(session_t peer_id, const SunParams &params)
Definition server.cpp:1870
void setLighting(RemotePlayer *player, const Lighting &lighting)
Definition server.cpp:3503
void SendSetMoon(session_t peer_id, const MoonParams &params)
Definition server.cpp:1879
void UpdateCrafting(RemotePlayer *player)
Definition server.cpp:3002
bool checkPriv(const std::string &name, const std::string &priv)
Definition server.cpp:3224
void handleCommand_HaveMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1806
bool leaveModChannel(const std::string &channel)
Definition server.cpp:4099
NodeDefManager * getWritableNodeDefManager()
Definition server.cpp:3830
ShutdownState m_shutdown_state
Definition server.h:717
std::atomic< StepSettings > m_step_settings
Definition server.h:701
MetricCounterPtr m_uptime_counter
Definition server.h:779
IWritableItemDefManager * getWritableItemDefManager()
Definition server.cpp:3825
void handleCommand_ModChannelLeave(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1753
void handleCommand_ClientReady(NetworkPacket *pkt)
Definition serverpackethandler.cpp:358
void SendPlayerHP(PlayerSAO *sao, bool effect)
Definition server.cpp:1444
void handleAdminChat(const ChatEventChat *evt)
Definition server.cpp:3135
void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version)
Definition server.cpp:1473
RemoteClient * getClient(session_t peer_id, ClientState state_min=CS_Active)
Definition server.cpp:3148
void SendSetLighting(session_t peer_id, const Lighting &lighting)
Definition server.cpp:1918
IRollbackManager * getRollbackManager()
Definition server.h:319
void SendInventory(RemotePlayer *player, bool incremental)
Definition server.cpp:1524
bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask)
Definition server.cpp:3370
std::vector< std::pair< std::string, std::string > > m_mapgen_init_files
Definition server.h:448
float m_step_pending_dyn_media_timer
Definition server.h:753
void start()
Definition server.cpp:558
MetricCounterPtr m_aom_buffer_counter[2]
Definition server.h:783
MetricCounterPtr m_packet_recv_counter
Definition server.h:784
IWritableCraftDefManager * getWritableCraftDefManager()
Definition server.cpp:3835
void SendHUDAdd(session_t peer_id, u32 id, HudElement *form)
Definition server.cpp:1770
std::unique_ptr< ModChannelMgr > m_modchannel_mgr
Definition server.h:770
bool isShutdownRequested() const
Definition server.h:258
std::unique_ptr< ServerInventoryManager > m_inventory_mgr
Definition server.h:773
void deletingPeer(con::IPeer *peer, bool timeout)
Definition server.cpp:1341
virtual const std::vector< ModSpec > & getMods() const
Definition server.cpp:3840
void sendRemoveNode(v3s16 p, std::unordered_set< u16 > *far_players=nullptr, float far_d_nodes=100)
Definition server.cpp:2306
void SendCloudParams(session_t peer_id, const CloudParams &params)
Definition server.cpp:1899
virtual u16 allocateUnknownNodeId(const std::string &name)
Definition server.cpp:3820
bool showFormspec(const char *name, const std::string &formspec, const std::string &formname)
Definition server.cpp:3319
bool hudRemove(RemotePlayer *player, u32 id)
Definition server.cpp:3346
void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value)
Definition server.cpp:1829
ordered_mutex m_env_mutex
Definition server.h:639
void broadcastModChannelMessage(const std::string &channel, const std::string &message, session_t from_peer)
Definition server.cpp:4118
void unsetIpBanned(const std::string &ip_or_name)
Definition server.cpp:3276
std::unique_ptr< ServerScripting > m_script
Definition server.h:470
void sendRequestedMedia(session_t peer_id, const std::unordered_set< std::string > &tosend)
Definition server.cpp:2671
u32 hudAdd(RemotePlayer *player, HudElement *element)
Definition server.cpp:3334
MetricCounterPtr m_map_edit_event_counter
Definition server.h:786
void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4], f32 animation_speed)
Definition server.cpp:2002
float m_savemap_timer
Definition server.h:665
float m_liquid_transform_every
Definition server.h:662
void SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed)
Definition server.cpp:1940
void process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao, NetworkPacket *pkt)
Definition serverpackethandler.cpp:436
virtual ModStorageDatabase * getModStorageDatabase()
Definition server.h:321
Address m_bind_addr
Definition server.h:454
void DenyAccess(session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason="", bool reconnect=false)
Definition server.cpp:2876
bool getClientInfo(session_t peer_id, ClientInfo &ret)
Definition server.cpp:1356
void SendBlockNoLock(session_t peer_id, MapBlock *block, u8 ver, u16 net_proto_version, SerializedBlockCache *cache=nullptr)
Definition server.cpp:2411
void SendHUDRemove(session_t peer_id, u32 id)
Definition server.cpp:1782
static std::string getBuiltinLuaPath()
Definition server.cpp:3850
void deleteParticleSpawner(const std::string &playername, u32 id)
Definition server.cpp:3564
void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front)
Definition server.cpp:2021
IWritableItemDefManager * m_itemdef
Definition server.h:685
void handleCommand_ModChannelMsg(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1777
ServerScripting * getScriptIface()
Definition server.h:306
void handleCommand_Init2(NetworkPacket *pkt)
Definition serverpackethandler.cpp:271
void yieldToOtherThreads(float dtime)
Definition server.cpp:1125
void handleCommand_GotBlocks(NetworkPacket *pkt)
Definition serverpackethandler.cpp:405
std::unique_ptr< MetricsBackend > m_metrics_backend
Definition server.h:776
std::unordered_map< u32, PendingDynamicMediaCallback > m_pending_dyn_media
Definition server.h:752
void handleCommand_Init(NetworkPacket *pkt)
Definition serverpackethandler.cpp:38
IntervalLimiter m_max_lag_decrease
Definition server.h:667
void acceptAuth(session_t peer_id, bool forSudoMode)
Definition server.cpp:2899
void reportFormspecPrependModified(const std::string &name)
Definition server.cpp:3258
void handleCommand_DeletedBlocks(NetworkPacket *pkt)
Definition serverpackethandler.cpp:534
void SendMovement(session_t peer_id)
Definition server.cpp:1412
void handleCommand_Damage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:767
static bool migrateModStorageDatabase(const GameParams &game_params, const Settings &cmd_args)
Definition server.cpp:4231
void handleCommand_RemovedSounds(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1286
void handleCommand_Deprecated(NetworkPacket *pkt)
Definition serverpackethandler.cpp:32
Map & getMap()
Definition server.h:358
void handleCommand_ChatMessage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:742
void handleChatInterfaceEvent(ChatEvent *evt)
Definition server.cpp:3027
ServerThread * m_thread
Definition server.h:704
ServerInventoryManager * getInventoryMgr() const
Definition server.h:302
void SendActiveObjectMessages(session_t peer_id, const std::string &datas, bool reliable=true)
Definition server.cpp:2152
double getUptime() const
Definition server.h:255
void handleCommand_NodeMetaFields(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1331
std::unique_ptr< PackedValue > m_lua_globals_data
Definition server.h:451
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:1633
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:2318
std::vector< std::pair< std::string, std::string > > m_async_init_files
Definition server.h:446
void SendCSMRestrictionFlags(session_t peer_id)
Definition server.cpp:2164
void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front)
Definition server.cpp:3447
void peerAdded(con::IPeer *peer)
Definition server.cpp:1334
void reportInventoryFormspecModified(const std::string &name)
Definition server.cpp:3250
void SendSetStars(session_t peer_id, const StarParams &params)
Definition server.cpp:1888
virtual void SendChatMessage(session_t peer_id, const ChatMessage &message)
Definition server.cpp:1546
std::string getStatusString()
Definition server.cpp:3177
void SendActiveObjectRemoveAdd(RemoteClient *client, PlayerSAO *playersao)
Definition server.cpp:2070
void AsyncRunStep(float dtime, bool initial_step=false)
Definition server.cpp:622
MetricGaugePtr m_timeofday_gauge
Definition server.h:781
Settings * m_game_settings
Definition server.h:654
SubgameSpec m_gamespec
Definition server.h:645
bool joinModChannel(const std::string &channel)
Definition server.cpp:4093
std::string getPlayerName(session_t peer_id)
Definition server.cpp:3161
void hudSetHotbarImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3409
void stepPendingDynMediaCallbacks(float dtime)
Definition server.cpp:2769
std::string m_path_world
Definition server.h:642
bool isSingleplayer() const
Definition server.h:336
bool dynamicAddMedia(const DynamicMediaArgs &args)
Definition server.cpp:3601
void handleCommand_ModChannelJoin(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1728
void Send(NetworkPacket *pkt)
Definition server.cpp:1401
void handleCommand_RequestMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:334
std::string *const m_shutdown_errmsg
Definition server.h:724
s32 m_playing_sounds_id_last_used
Definition server.h:759
u32 m_csm_restriction_noderange
Definition server.h:767
static u16 getProtocolVersionMin()
Definition server.cpp:4301
u32 addParticleSpawner(const ParticleSpawnerParameters &p, ServerActiveObject *attached, const std::string &playername)
Definition server.cpp:3535
void SendBlocks(float dtime)
Definition server.cpp:2442
void handleCommand_UpdateClientInfo(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1833
void Receive(float min_time)
Receive and process all incoming packets.
Definition server.cpp:1073
void notifyPlayers(const std::wstring &msg)
Definition server.cpp:3510
std::unordered_map< std::pair< v3s16, u16 >, std::string, SBCHash > SerializedBlockCache
Definition server.h:512
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount)
Definition server.cpp:3391
void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef, u16 protocol_version)
Definition server.cpp:1496
StepSettings getStepSettings()
Definition server.h:345
void SendBreath(session_t peer_id, u16 breath)
Definition server.cpp:1456
std::shared_ptr< con::IConnection > m_con
Definition server.h:673
void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4], f32 frame_speed)
Definition server.cpp:3439
void setClouds(RemotePlayer *player, const CloudParams &params)
Definition server.cpp:3488
void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:1432
float m_emergethread_trigger_timer
Definition server.h:664
ModIPCStore m_ipcstore
Definition server.h:695
std::string m_path_mod_data
Definition server.h:643
void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code)
Definition server.cpp:2614
void setAsyncFatalError(const LuaError &e)
Definition server.h:349
void SendMinimapModes(session_t peer_id, std::vector< MinimapMode > &modes, size_t wanted_mode)
Definition server.cpp:2796
virtual EmergeManager * getEmergeManager()
Definition server.h:320
ServerEnvironment * m_env
Definition server.h:670
void fillMediaCache()
Definition server.cpp:2581
bool m_simple_singleplayer_mode
Definition server.h:648
std::unordered_map< std::string, Translations > server_translations
Definition server.h:693
virtual std::string getWorldPath() const
Definition server.h:332
ChatInterface * m_admin_chat
Definition server.h:719
NodeDefManager * m_nodedef
Definition server.h:688
bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value)
Definition server.cpp:3361
void SendPlayerFov(session_t peer_id)
Definition server.cpp:1988
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:164
@ CS_Active
Definition clientiface.h:173
#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:71
@ AC_MOVEMENT
Definition server.h:72
@ AC_DIGGING
Definition server.h:70
ClientDeletionReason
Definition server.h:82
@ CDR_LEAVE
Definition server.h:83
@ CDR_DENY
Definition server.h:85
@ CDR_TIMEOUT
Definition server.h:84
constexpr static const FlagDesc flagdesc_anticheat[]
Definition server.h:75
void dedicated_server_loop(Server &server, bool &kill)
Definition server.cpp:4034
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:135
u32 uptime
Definition server.h:138
u8 ser_vers
Definition server.h:139
u8 patch
Definition server.h:141
u16 prot_vers
Definition server.h:140
ClientState state
Definition server.h:136
std::string vers_string
Definition server.h:142
Address addr
Definition server.h:137
std::string lang_code
Definition server.h:142
u8 major
Definition server.h:141
u8 minor
Definition server.h:141
Definition skyparams.h:65
Definition string.h:68
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:89
MediaInfo(std::string_view path_="", std::string_view sha1_digest_="")
Definition server.h:97
bool delete_at_shutdown
Definition server.h:95
std::string path
Definition server.h:90
std::string sha1_digest
Definition server.h:91
bool no_announce
Definition server.h:93
Definition server.h:126
u16 size
Definition server.h:129
MinimapType type
Definition server.h:127
std::string texture
Definition server.h:130
std::string label
Definition server.h:128
u16 scale
Definition server.h:131
Definition server.h:145
std::condition_variable_any condvar
Signalled on any changes to the map contents.
Definition server.h:152
std::shared_mutex mutex
RW lock for this entire structure.
Definition server.h:150
ModIPCStore()=default
~ModIPCStore()
Definition server.cpp:75
std::unordered_map< std::string, std::unique_ptr< PackedValue > > map
Map storing the data.
Definition server.h:158
void signal()
Definition server.h:161
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:304
Definition particles.h:315
Definition player_sao.h:230
Definition rollback_interface.h:40
Definition server.h:109
std::string to_player
Definition server.h:116
float gain
Definition server.h:112
std::unordered_set< session_t > clients
Definition server.h:123
std::string exclude_player
Definition server.h:117
SoundSpec spec
Definition server.h:121
v3f pos
Definition server.h:114
float max_hear_distance
Definition server.h:113
v3f getPos(ServerEnvironment *env, bool *pos_exists) const
Definition server.cpp:167
SoundLocation type
Definition server.h:110
Definition server.h:292
bool ephemeral
Definition server.h:298
u32 token
Definition server.h:296
std::optional< std::string_view > data
Definition server.h:295
std::string to_player
Definition server.h:297
std::string filename
Definition server.h:293
std::optional< std::string > filepath
Definition server.h:294
std::unordered_set< session_t > waiting_players
Definition server.h:502
std::string filename
Definition server.h:500
float expiry_timer
Definition server.h:501
Definition server.h:506
size_t operator()(const std::pair< v3s16, u16 > &p) const
Definition server.h:507
Definition server.h:483
void trigger(float delay, const std::string &msg, bool reconnect)
Definition server.cpp:203
bool isTimerRunning() const
Definition server.h:494
void tick(float dtime, Server *server)
Definition server.cpp:210
void reset()
Definition server.cpp:195
bool is_requested
Definition server.h:486
bool should_reconnect
Definition server.h:487
float m_timer
Definition server.h:496
std::wstring getShutdownTimerMessage() const
Definition server.cpp:242
std::string message
Definition server.h:488
Definition server.h:339
bool pause
Definition server.h:341
float steplen
Definition server.h:340
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:55