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
198
199 /*
200 * Command Handlers
201 */
202
203 void handleCommand(NetworkPacket* pkt);
204
230
231 void ProcessData(NetworkPacket *pkt);
232
233 void Send(NetworkPacket *pkt);
234 void Send(session_t peer_id, NetworkPacket *pkt);
235
236 // Helper for handleCommand_PlayerPos and handleCommand_Interact
237 void process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao,
238 NetworkPacket *pkt);
239
240 // Both setter and getter need no envlock,
241 // can be called freely from threads
242 void setTimeOfDay(u32 time);
243
244 /*
245 Shall be called with the environment locked.
246 This is accessed by the map, which is inside the environment,
247 so it shouldn't be a problem.
248 */
249 void onMapEditEvent(const MapEditEvent &event);
250
251 // Connection must be locked when called
252 std::string getStatusString();
253 inline double getUptime() const { return m_uptime_counter->get(); }
254
255 // read shutdown state
256 inline bool isShutdownRequested() const { return m_shutdown_state.is_requested; }
257
258 // request server to shutdown
259 void requestShutdown(const std::string &msg, bool reconnect, float delay = 0.0f);
260
261 // Returns -1 if failed, sound handle on success
262 // Envlock
263 s32 playSound(ServerPlayingSound &params, bool ephemeral=false);
264 void stopSound(s32 handle);
265 void fadeSound(s32 handle, float step, float gain);
266
267 // Envlock
268 std::set<std::string> getPlayerEffectivePrivs(const std::string &name);
269 bool checkPriv(const std::string &name, const std::string &priv);
270 void reportPrivsModified(const std::string &name=""); // ""=all
271 void reportInventoryFormspecModified(const std::string &name);
272 void reportFormspecPrependModified(const std::string &name);
273
274 void setIpBanned(const std::string &ip, const std::string &name);
275 void unsetIpBanned(const std::string &ip_or_name);
276 std::string getBanDescription(const std::string &ip_or_name);
277 bool denyIfBanned(session_t peer_id);
278
279 void notifyPlayer(const char *name, const std::wstring &msg);
280 void notifyPlayers(const std::wstring &msg);
281
282 void spawnParticle(const std::string &playername,
283 const ParticleParameters &p);
284
286 ServerActiveObject *attached, const std::string &playername);
287
288 void deleteParticleSpawner(const std::string &playername, u32 id);
289
291 std::string filename;
292 std::optional<std::string> filepath;
293 std::optional<std::string_view> data;
294 u32 token;
295 std::string to_player;
296 bool ephemeral = false;
297 };
298 bool dynamicAddMedia(const DynamicMediaArgs &args);
299
301 void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id);
302
303 // Envlock and conlock should be locked when using scriptapi
304 inline ServerScripting *getScriptIface() { return m_script.get(); }
305
306 // actions: time-reversed list
307 // Return value: success/failure
308 bool rollbackRevertActions(const std::list<RollbackAction> &actions,
309 std::list<std::string> *log);
310
311 // IGameDef interface
312 // Under envlock
314 virtual const NodeDefManager* getNodeDefManager();
316 virtual u16 allocateUnknownNodeId(const std::string &name);
318 virtual EmergeManager *getEmergeManager() { return m_emerge.get(); }
320
324
325 // Not under envlock
326 virtual const std::vector<ModSpec> &getMods() const;
327 virtual const ModSpec* getModSpec(const std::string &modname) const;
328 virtual const SubgameSpec* getGameSpec() const { return &m_gamespec; }
329 static std::string getBuiltinLuaPath();
330 virtual std::string getWorldPath() const { return m_path_world; }
331 virtual std::string getModDataPath() const { return m_path_mod_data; }
332 virtual ModIPCStore *getModIPCStore() { return &m_ipcstore; }
333
334 inline bool isSingleplayer() const
336
338 float steplen;
339 bool pause;
340 };
341
342 void setStepSettings(StepSettings spdata) { m_step_settings.store(spdata); }
344
345 inline void setAsyncFatalError(const std::string &error)
346 { m_async_fatal_error.set(error); }
347 inline void setAsyncFatalError(const LuaError &e)
348 {
349 setAsyncFatalError(std::string("Lua: ") + e.what());
350 }
351
352 // Not thread-safe.
353 void addShutdownError(const ModError &e);
354
355 bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
356 Map & getMap() { return m_env->getMap(); }
359
360 u32 hudAdd(RemotePlayer *player, HudElement *element);
361 bool hudRemove(RemotePlayer *player, u32 id);
362 bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value);
363 bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask);
364 bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
365 void hudSetHotbarImage(RemotePlayer *player, const std::string &name);
366 void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name);
367
369
370 void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4],
371 f32 frame_speed);
372 void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front);
373
374 void setSky(RemotePlayer *player, const SkyboxParams &params);
375 void setSun(RemotePlayer *player, const SunParams &params);
376 void setMoon(RemotePlayer *player, const MoonParams &params);
377 void setStars(RemotePlayer *player, const StarParams &params);
378
379 void setClouds(RemotePlayer *player, const CloudParams &params);
380
381 void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);
382
383 void setLighting(RemotePlayer *player, const Lighting &lighting);
384
385 /* con::PeerHandler implementation. */
386 void peerAdded(con::IPeer *peer);
387 void deletingPeer(con::IPeer *peer, bool timeout);
388
389 void DenySudoAccess(session_t peer_id);
390 void DenyAccess(session_t peer_id, AccessDeniedCode reason,
391 std::string_view custom_reason = "", bool reconnect = false);
393 const std::string &str_reason, bool reconnect);
394 void acceptAuth(session_t peer_id, bool forSudoMode);
395 void DisconnectPeer(session_t peer_id);
396 bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval);
397 bool getClientInfo(session_t peer_id, ClientInfo &ret);
399
400 void printToConsoleOnly(const std::string &text);
401
402 void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason);
403 void SendPlayerHP(PlayerSAO *sao, bool effect);
404 void SendPlayerBreath(PlayerSAO *sao);
405 void SendInventory(RemotePlayer *player, bool incremental);
406 void SendMovePlayer(PlayerSAO *sao);
407 void SendMovePlayerRel(session_t peer_id, const v3f &added_pos);
408 void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
409 void SendPlayerFov(session_t peer_id);
410
411 void SendMinimapModes(session_t peer_id,
412 std::vector<MinimapMode> &modes,
413 size_t wanted_mode);
414
415 void sendDetachedInventories(session_t peer_id, bool incremental);
416
417 bool joinModChannel(const std::string &channel);
418 bool leaveModChannel(const std::string &channel);
419 bool sendModChannelMessage(const std::string &channel, const std::string &message);
420 ModChannel *getModChannel(const std::string &channel);
421
422 // Send block to specific player only
423 bool SendBlock(session_t peer_id, const v3s16 &blockpos);
424
425 // Get or load translations for a language
426 Translations *getTranslationLanguage(const std::string &lang_code);
427
428 // Returns all media files the server knows about
429 // map key = binary sha1, map value = file path
430 std::unordered_map<std::string, std::string> getMediaList();
431
432 static ModStorageDatabase *openModStorageDatabase(const std::string &world_path);
433
434 static ModStorageDatabase *openModStorageDatabase(const std::string &backend,
435 const std::string &world_path, const Settings &world_mt);
436
437 static bool migrateModStorageDatabase(const GameParams &game_params,
438 const Settings &cmd_args);
439
440 static u16 getProtocolVersionMin();
441 static u16 getProtocolVersionMax();
442
443 // Lua files registered for init of async env, pair of modname + path
444 std::vector<std::pair<std::string, std::string>> m_async_init_files;
445 // Identical but for mapgen env
446 std::vector<std::pair<std::string, std::string>> m_mapgen_init_files;
447
448 // Data transferred into other Lua envs at init time
449 std::unique_ptr<PackedValue> m_lua_globals_data;
450
451 // Bind address
453
454 // Public helper for taking the envlock in a scope
456 public:
458
459 private:
460 std::lock_guard<ordered_mutex> m_lock;
461 };
462
463protected:
464 /* Do not add more members here, this is only required to make unit tests work. */
465
466 // Scripting
467 // Envlock and conlock should be locked when using Lua
468 std::unique_ptr<ServerScripting> m_script;
469
470 // Mods
471 std::unique_ptr<ServerModManager> m_modmgr;
472
473private:
474 friend class EmergeThread;
475 friend class RemoteClient;
476
477 // unittest classes
479 friend class TestMoveAction;
480
483 public:
484 bool is_requested = false;
485 bool should_reconnect = false;
486 std::string message;
487
488 void reset();
489 void trigger(float delay, const std::string &msg, bool reconnect);
490 void tick(float dtime, Server *server);
491 std::wstring getShutdownTimerMessage() const;
492 bool isTimerRunning() const { return m_timer > 0.0f; }
493 private:
494 float m_timer = 0.0f;
495 };
496
498 std::string filename; // only set if media entry and file is to be deleted
500 std::unordered_set<session_t> waiting_players;
501 };
502
503 // The standard library does not implement std::hash for pairs so we have this:
504 struct SBCHash {
505 size_t operator() (const std::pair<v3s16, u16> &p) const {
506 return std::hash<v3s16>()(p.first) ^ p.second;
507 }
508 };
509
510 typedef std::unordered_map<std::pair<v3s16, u16>, std::string, SBCHash> SerializedBlockCache;
511
512 void init();
513
514 void SendMovement(session_t peer_id);
515 void SendHP(session_t peer_id, u16 hp, bool effect);
516 void SendBreath(session_t peer_id, u16 breath);
517 void SendAccessDenied(session_t peer_id, AccessDeniedCode reason,
518 std::string_view custom_reason, bool reconnect = false);
519 void SendItemDef(session_t peer_id, IItemDefManager *itemdef, u16 protocol_version);
520 void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef,
521 u16 protocol_version);
522
523
524 virtual void SendChatMessage(session_t peer_id, const ChatMessage &message);
525 void SendTimeOfDay(session_t peer_id, u16 time, f32 time_speed);
526
527 void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4],
528 f32 animation_speed);
529 void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front);
530 void SendPlayerPrivileges(session_t peer_id);
533 void SendShowFormspecMessage(session_t peer_id, const std::string &formspec,
534 const std::string &formname);
535 void SendHUDAdd(session_t peer_id, u32 id, HudElement *form);
536 void SendHUDRemove(session_t peer_id, u32 id);
537 void SendHUDChange(session_t peer_id, u32 id, HudElementStat stat, void *value);
538 void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask);
539 void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value);
540 void SendSetSky(session_t peer_id, const SkyboxParams &params);
541 void SendSetSun(session_t peer_id, const SunParams &params);
542 void SendSetMoon(session_t peer_id, const MoonParams &params);
543 void SendSetStars(session_t peer_id, const StarParams &params);
544 void SendCloudParams(session_t peer_id, const CloudParams &params);
545 void SendOverrideDayNightRatio(session_t peer_id, bool do_override, float ratio);
546 void SendSetLighting(session_t peer_id, const Lighting &lighting);
547 void broadcastModChannelMessage(const std::string &channel,
548 const std::string &message, session_t from_peer);
549
550 /*
551 Send a node removal/addition event to all clients except ignore_id.
552 Additionally, if far_players!=NULL, players further away than
553 far_d_nodes are ignored and their peer_ids are added to far_players
554 */
555 // Envlock and conlock should be locked when calling these
556 void sendRemoveNode(v3s16 p, std::unordered_set<u16> *far_players = nullptr,
557 float far_d_nodes = 100);
558 void sendAddNode(v3s16 p, MapNode n,
559 std::unordered_set<u16> *far_players = nullptr,
560 float far_d_nodes = 100, bool remove_metadata = true);
561 void sendNodeChangePkt(NetworkPacket &pkt, v3s16 block_pos,
562 v3f p, float far_d_nodes, std::unordered_set<u16> *far_players);
563
564 void sendMetadataChanged(const std::unordered_set<v3s16> &positions,
565 float far_d_nodes = 100);
566
567 // Environment and Connection must be locked when called
568 // `cache` may only be very short lived! (invalidation not handeled)
569 void SendBlockNoLock(session_t peer_id, MapBlock *block, u8 ver,
570 u16 net_proto_version, SerializedBlockCache *cache = nullptr);
571
572 // Sends blocks to clients (locks env and con on its own)
573 void SendBlocks(float dtime);
574
575 bool addMediaFile(const std::string &filename, const std::string &filepath,
576 std::string *filedata = nullptr, std::string *digest = nullptr);
577 void fillMediaCache();
578 void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code);
579 void sendRequestedMedia(session_t peer_id,
580 const std::unordered_set<std::string> &tosend);
581 void stepPendingDynMediaCallbacks(float dtime);
582
583 // Adds a ParticleSpawner on peer with peer_id (PEER_ID_INEXISTENT == all)
584 void SendAddParticleSpawner(session_t peer_id, u16 protocol_version,
585 const ParticleSpawnerParameters &p, u16 attached_id, u32 id);
586
587 void SendDeleteParticleSpawner(session_t peer_id, u32 id);
588
589 // Spawns particle on peer with peer_id (PEER_ID_INEXISTENT == all)
590 void SendSpawnParticle(session_t peer_id, u16 protocol_version,
591 const ParticleParameters &p);
592
594 void SendActiveObjectMessages(session_t peer_id, const std::string &datas,
595 bool reliable = true);
597
598 /*
599 Something random
600 */
601
602 void HandlePlayerDeath(PlayerSAO* sao, const PlayerHPChangeReason &reason);
603 void DeleteClient(session_t peer_id, ClientDeletionReason reason);
604 void UpdateCrafting(RemotePlayer *player);
605 bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what);
606
608
609 // This returns the answer to the sender of wmessage, or "" if there is none
610 std::wstring handleChat(const std::string &name, std::wstring wmessage_input,
611 bool check_shout_priv = false, RemotePlayer *player = nullptr);
612 void handleAdminChat(const ChatEventChat *evt);
613
614 // When called, connection mutex should be locked
617
618 // When called, environment mutex should be locked
619 std::string getPlayerName(session_t peer_id);
621
622 /*
623 Get a player from memory or creates one.
624 If player is already connected, return NULL
625 Does not verify/modify auth info and password.
626
627 Call with env and con locked.
628 */
629 PlayerSAO *emergePlayer(const char *name, session_t peer_id, u16 proto_version);
630
631 /*
632 Variables
633 */
634
635 // Environment mutex (envlock)
637
638 // World directory
639 std::string m_path_world;
640 std::string m_path_mod_data;
641 // Subgame specification
643 // If true, do not allow multiple players and hide some multiplayer
644 // functionality
647 // For "dedicated" server list flag
649
650 // Game settings layer
652
653 // Thread can set; step() will throw as ServerError
655
656 // Some timers
662 float m_savemap_timer = 0.0f;
665
666 // Environment
668
669 // server connection
670 std::shared_ptr<con::IConnection> m_con;
671
672 // Ban checking
674
675 // Rollback manager (behind m_env_mutex)
677
678 // Emerge manager
679 std::unique_ptr<EmergeManager> m_emerge;
680
681 // Item definition manager
683
684 // Node definition manager
686
687 // Craft definition manager
689
690 std::unordered_map<std::string, Translations> server_translations;
691
693
694 /*
695 Threads
696 */
697 // Set by Game
698 std::atomic<StepSettings> m_step_settings{{0.1f, false}};
699
700 // The server mainly operates in this thread
702
703 /*
704 Client interface
705 */
707
708 std::unordered_map<session_t, std::string> m_formspec_state_data;
709
710 /*
711 Random stuff
712 */
713
715
717 std::string m_admin_nick;
718
719 // If a mod error occurs while shutting down, the error message will be
720 // written into this.
721 std::string *const m_shutdown_errmsg;
722
723 /*
724 Map edit event queue. Automatically receives all map edits.
725 The constructor of this class registers us to receive them through
726 onMapEditEvent
727
728 NOTE: Should these be moved to actually be members of
729 ServerEnvironment?
730 */
731
732 /*
733 Queue of map edits from the environment for sending to the clients
734 This is behind m_env_mutex
735 */
736 std::queue<MapEditEvent*> m_unsent_map_edit_queue;
737 /*
738 If a non-empty area, map edit events contained within are left
739 unsent. Done at map generation time to speed up editing of the
740 generated area, as it will be sent anyway.
741 This is behind m_env_mutex
742 */
744
745 // media files known to server
746 std::unordered_map<std::string, MediaInfo> m_media;
747
748 // pending dynamic media callbacks, clients inform the server when they have a file fetched
749 std::unordered_map<u32, PendingDynamicMediaCallback> m_pending_dyn_media;
751
752 /*
753 Sounds
754 */
755 std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
756 s32 m_playing_sounds_id_last_used = 0; // positive values only
757 s32 nextSoundId();
758
761
762 // CSM restrictions byteflag
765
766 // ModChannel manager
767 std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
768
769 // Inventory manager
770 std::unique_ptr<ServerInventoryManager> m_inventory_mgr;
771
772 // Global server metrics backend
773 std::unique_ptr<MetricsBackend> m_metrics_backend;
774
775 // Server metrics
780 MetricCounterPtr m_aom_buffer_counter[2]; // [0] = rel, [1] = unrel
784};
785
786/*
787 Runs a simple dedicated server loop.
788
789 Shuts down when kill is set to true.
790*/
791void 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: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:540
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:455
std::lock_guard< ordered_mutex > m_lock
Definition server.h:460
EnvAutoLock(Server *server)
Definition server.h:457
Definition server.h:166
void kickAllPlayers(AccessDeniedCode reason, const std::string &str_reason, bool reconnect)
Definition server.cpp:2873
void setIpBanned(const std::string &ip, const std::string &name)
Definition server.cpp:3257
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:3966
void DisconnectPeer(session_t peer_id)
Definition server.cpp:2882
IRollbackManager * m_rollback
Definition server.h:676
void stop()
Definition server.cpp:597
void handleCommand_FirstSrp(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1446
float m_liquid_transform_timer
Definition server.h:658
void setStars(RemotePlayer *player, const StarParams &params)
Definition server.cpp:3472
void setSun(RemotePlayer *player, const SunParams &params)
Definition server.cpp:3458
RemoteClient * getClientNoEx(session_t peer_id, ClientState state_min=CS_Active)
Definition server.cpp:3145
Translations * getTranslationLanguage(const std::string &lang_code)
Definition server.cpp:4145
void handleCommand_PlayerItem(NetworkPacket *pkt)
Definition serverpackethandler.cpp:810
std::unordered_map< session_t, std::string > m_formspec_state_data
Definition server.h:708
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:3752
std::string m_admin_nick
Definition server.h:717
void init()
Definition server.cpp:431
u16 m_max_chatmessage_length
Definition server.h:646
void requestShutdown(const std::string &msg, bool reconnect, float delay=0.0f)
Definition server.cpp:3934
void setStepSettings(StepSettings spdata)
Definition server.h:342
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:3424
void overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness)
Definition server.cpp:3486
void SendPlayerInventoryFormspec(session_t peer_id)
Definition server.cpp:2033
void HandlePlayerDeath(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:2846
static u16 getProtocolVersionMax()
Definition server.cpp:4303
void SendMovePlayer(PlayerSAO *sao)
Definition server.cpp:1947
void DenySudoAccess(session_t peer_id)
Definition server.cpp:2858
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:688
ModStorageDatabase * m_mod_storage_database
Definition server.h:759
const ClientDynamicInfo * getClientDynamicInfo(session_t peer_id)
Definition server.cpp:1366
void spawnParticle(const std::string &playername, const ParticleParameters &p)
Definition server.cpp:3506
void step()
Definition server.cpp:608
virtual IItemDefManager * getItemDefManager()
Definition server.cpp:3796
MutexedVariable< std::string > m_async_fatal_error
Definition server.h:654
static ModStorageDatabase * openModStorageDatabase(const std::string &world_path)
Definition server.cpp:4182
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:746
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:763
bool checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what)
Definition serverpackethandler.cpp:851
void reportPrivsModified(const std::string &name="")
Definition server.cpp:3219
void sendDetachedInventory(Inventory *inventory, const std::string &name, session_t peer_id)
Definition server.cpp:2801
void handleCommand_Null(NetworkPacket *pkt)
Definition server.h:205
void handleCommand_SrpBytesA(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1535
void fadeSound(s32 handle, float step, float gain)
Definition server.cpp:2271
std::queue< MapEditEvent * > m_unsent_map_edit_queue
Definition server.h:736
void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3412
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:2913
void ProcessData(NetworkPacket *pkt)
Definition server.cpp:1246
bool denyIfBanned(session_t peer_id)
Definition server.cpp:3277
void setAsyncFatalError(const std::string &error)
Definition server.h:345
s32 playSound(ServerPlayingSound &params, bool ephemeral=false)
Definition server.cpp:2182
BanManager * m_banmanager
Definition server.h:673
void setSky(RemotePlayer *player, const SkyboxParams &params)
Definition server.cpp:3451
bool m_dedicated
Definition server.h:648
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:4105
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:332
void handleCommand_InventoryAction(NetworkPacket *pkt)
Definition serverpackethandler.cpp:564
std::unique_ptr< EmergeManager > m_emerge
Definition server.h:679
void handleCommand_Interact(NetworkPacket *pkt)
Definition serverpackethandler.cpp:879
void SendMovePlayerRel(session_t peer_id, const v3f &added_pos)
Definition server.cpp:1967
virtual ICraftDefManager * getCraftDefManager()
Definition server.cpp:3806
v3f findSpawnPos()
Definition server.cpp:3863
VoxelArea m_ignore_map_edit_events_area
Definition server.h:743
std::set< std::string > getPlayerEffectivePrivs(const std::string &name)
Definition server.cpp:3206
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:3836
IntervalLimiter m_map_timer_and_unload_interval
Definition server.h:663
void handleCommand_PlayerPos(NetworkPacket *pkt)
Definition serverpackethandler.cpp:503
void SendHUDSetFlags(session_t peer_id, u32 flags, u32 mask)
Definition server.cpp:1806
~Server()
Definition server.cpp:334
std::unique_ptr< ServerModManager > m_modmgr
Definition server.h:471
ServerEnvironment & getEnv()
Definition server.h:357
void sendDetachedInventories(session_t peer_id, bool incremental)
Definition server.cpp:2827
std::unordered_map< std::string, std::string > getMediaList()
Definition server.cpp:4169
PlayerSAO * getPlayerSAO(session_t peer_id)
Definition server.cpp:3158
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:3035
MetricGaugePtr m_lag_gauge
Definition server.h:779
void notifyPlayer(const char *name, const std::wstring &msg)
Definition server.cpp:3293
void setMoon(RemotePlayer *player, const MoonParams &params)
Definition server.cpp:3465
ClientInterface m_clients
Definition server.h:706
void stopSound(s32 handle)
Definition server.cpp:2252
float m_time_of_day_send_timer
Definition server.h:657
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:1336
virtual const SubgameSpec * getGameSpec() const
Definition server.h:328
MetricGaugePtr m_player_gauge
Definition server.h:777
void addShutdownError(const ModError &e)
Definition server.cpp:3847
float m_mod_storage_save_timer
Definition server.h:760
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:4096
std::string getBanDescription(const std::string &ip_or_name)
Definition server.cpp:3272
std::unordered_map< s32, ServerPlayingSound > m_playing_sounds
Definition server.h:755
virtual const NodeDefManager * getNodeDefManager()
Definition server.cpp:3801
virtual std::string getModDataPath() const
Definition server.h:331
void onMapEditEvent(const MapEditEvent &event)
Definition server.cpp:1312
MetricCounterPtr m_packet_recv_processed_counter
Definition server.h:782
float m_masterserver_timer
Definition server.h:660
void SendSetSun(session_t peer_id, const SunParams &params)
Definition server.cpp:1856
void setLighting(RemotePlayer *player, const Lighting &lighting)
Definition server.cpp:3494
void SendSetMoon(session_t peer_id, const MoonParams &params)
Definition server.cpp:1865
void UpdateCrafting(RemotePlayer *player)
Definition server.cpp:2991
bool checkPriv(const std::string &name, const std::string &priv)
Definition server.cpp:3213
void handleCommand_HaveMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1806
bool leaveModChannel(const std::string &channel)
Definition server.cpp:4091
NodeDefManager * getWritableNodeDefManager()
Definition server.cpp:3821
ShutdownState m_shutdown_state
Definition server.h:714
std::atomic< StepSettings > m_step_settings
Definition server.h:698
MetricCounterPtr m_uptime_counter
Definition server.h:776
IWritableItemDefManager * getWritableItemDefManager()
Definition server.cpp:3816
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:1430
void handleAdminChat(const ChatEventChat *evt)
Definition server.cpp:3124
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:3137
void SendSetLighting(session_t peer_id, const Lighting &lighting)
Definition server.cpp:1904
IRollbackManager * getRollbackManager()
Definition server.h:317
void SendInventory(RemotePlayer *player, bool incremental)
Definition server.cpp:1510
bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask)
Definition server.cpp:3361
std::vector< std::pair< std::string, std::string > > m_mapgen_init_files
Definition server.h:446
float m_step_pending_dyn_media_timer
Definition server.h:750
void start()
Definition server.cpp:558
MetricCounterPtr m_aom_buffer_counter[2]
Definition server.h:780
MetricCounterPtr m_packet_recv_counter
Definition server.h:781
IWritableCraftDefManager * getWritableCraftDefManager()
Definition server.cpp:3826
void SendHUDAdd(session_t peer_id, u32 id, HudElement *form)
Definition server.cpp:1756
std::unique_ptr< ModChannelMgr > m_modchannel_mgr
Definition server.h:767
bool isShutdownRequested() const
Definition server.h:256
std::unique_ptr< ServerInventoryManager > m_inventory_mgr
Definition server.h:770
void deletingPeer(con::IPeer *peer, bool timeout)
Definition server.cpp:1327
virtual const std::vector< ModSpec > & getMods() const
Definition server.cpp:3831
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:3811
bool showFormspec(const char *name, const std::string &formspec, const std::string &formname)
Definition server.cpp:3310
bool hudRemove(RemotePlayer *player, u32 id)
Definition server.cpp:3337
void SendHUDSetParam(session_t peer_id, u16 param, std::string_view value)
Definition server.cpp:1815
ordered_mutex m_env_mutex
Definition server.h:636
void broadcastModChannelMessage(const std::string &channel, const std::string &message, session_t from_peer)
Definition server.cpp:4110
void unsetIpBanned(const std::string &ip_or_name)
Definition server.cpp:3267
std::unique_ptr< ServerScripting > m_script
Definition server.h:468
void sendRequestedMedia(session_t peer_id, const std::unordered_set< std::string > &tosend)
Definition server.cpp:2660
u32 hudAdd(RemotePlayer *player, HudElement *element)
Definition server.cpp:3325
MetricCounterPtr m_map_edit_event_counter
Definition server.h:783
void SendLocalPlayerAnimations(session_t peer_id, v2f animation_frames[4], f32 animation_speed)
Definition server.cpp:1988
float m_savemap_timer
Definition server.h:662
float m_liquid_transform_every
Definition server.h:659
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:436
virtual ModStorageDatabase * getModStorageDatabase()
Definition server.h:319
Address m_bind_addr
Definition server.h:452
void DenyAccess(session_t peer_id, AccessDeniedCode reason, std::string_view custom_reason="", bool reconnect=false)
Definition server.cpp:2865
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:3841
void deleteParticleSpawner(const std::string &playername, u32 id)
Definition server.cpp:3555
void SendEyeOffset(session_t peer_id, v3f first, v3f third, v3f third_front)
Definition server.cpp:2007
IWritableItemDefManager * m_itemdef
Definition server.h:682
void handleCommand_ModChannelMsg(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1777
ServerScripting * getScriptIface()
Definition server.h:304
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:773
std::unordered_map< u32, PendingDynamicMediaCallback > m_pending_dyn_media
Definition server.h:749
void handleCommand_Init(NetworkPacket *pkt)
Definition serverpackethandler.cpp:38
IntervalLimiter m_max_lag_decrease
Definition server.h:664
void acceptAuth(session_t peer_id, bool forSudoMode)
Definition server.cpp:2888
void reportFormspecPrependModified(const std::string &name)
Definition server.cpp:3249
void handleCommand_DeletedBlocks(NetworkPacket *pkt)
Definition serverpackethandler.cpp:534
void SendMovement(session_t peer_id)
Definition server.cpp:1398
void handleCommand_Damage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:767
static bool migrateModStorageDatabase(const GameParams &game_params, const Settings &cmd_args)
Definition server.cpp:4223
void handleCommand_RemovedSounds(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1286
void handleCommand_Deprecated(NetworkPacket *pkt)
Definition serverpackethandler.cpp:32
Map & getMap()
Definition server.h:356
void handleCommand_ChatMessage(NetworkPacket *pkt)
Definition serverpackethandler.cpp:742
void handleChatInterfaceEvent(ChatEvent *evt)
Definition server.cpp:3016
ServerThread * m_thread
Definition server.h:701
ServerInventoryManager * getInventoryMgr() const
Definition server.h:300
void SendActiveObjectMessages(session_t peer_id, const std::string &datas, bool reliable=true)
Definition server.cpp:2138
double getUptime() const
Definition server.h:253
void handleCommand_NodeMetaFields(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1331
std::unique_ptr< PackedValue > m_lua_globals_data
Definition server.h:449
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:444
void SendCSMRestrictionFlags(session_t peer_id)
Definition server.cpp:2150
void setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third, v3f third_front)
Definition server.cpp:3438
void peerAdded(con::IPeer *peer)
Definition server.cpp:1320
void reportInventoryFormspecModified(const std::string &name)
Definition server.cpp:3241
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:3166
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:778
Settings * m_game_settings
Definition server.h:651
SubgameSpec m_gamespec
Definition server.h:642
bool joinModChannel(const std::string &channel)
Definition server.cpp:4085
std::string getPlayerName(session_t peer_id)
Definition server.cpp:3150
void hudSetHotbarImage(RemotePlayer *player, const std::string &name)
Definition server.cpp:3400
void stepPendingDynMediaCallbacks(float dtime)
Definition server.cpp:2758
std::string m_path_world
Definition server.h:639
bool isSingleplayer() const
Definition server.h:334
bool dynamicAddMedia(const DynamicMediaArgs &args)
Definition server.cpp:3592
void handleCommand_ModChannelJoin(NetworkPacket *pkt)
Definition serverpackethandler.cpp:1728
void Send(NetworkPacket *pkt)
Definition server.cpp:1387
void handleCommand_RequestMedia(NetworkPacket *pkt)
Definition serverpackethandler.cpp:334
std::string *const m_shutdown_errmsg
Definition server.h:721
s32 m_playing_sounds_id_last_used
Definition server.h:756
u32 m_csm_restriction_noderange
Definition server.h:764
static u16 getProtocolVersionMin()
Definition server.cpp:4293
u32 addParticleSpawner(const ParticleSpawnerParameters &p, ServerActiveObject *attached, const std::string &playername)
Definition server.cpp:3526
void SendBlocks(float dtime)
Definition server.cpp:2428
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:3501
std::unordered_map< std::pair< v3s16, u16 >, std::string, SBCHash > SerializedBlockCache
Definition server.h:510
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount)
Definition server.cpp:3382
void SendNodeDef(session_t peer_id, const NodeDefManager *nodedef, u16 protocol_version)
Definition server.cpp:1482
StepSettings getStepSettings()
Definition server.h:343
void SendBreath(session_t peer_id, u16 breath)
Definition server.cpp:1442
std::shared_ptr< con::IConnection > m_con
Definition server.h:670
void setLocalPlayerAnimations(RemotePlayer *player, v2f animation_frames[4], f32 frame_speed)
Definition server.cpp:3430
void setClouds(RemotePlayer *player, const CloudParams &params)
Definition server.cpp:3479
void HandlePlayerHPChange(PlayerSAO *sao, const PlayerHPChangeReason &reason)
Definition server.cpp:1418
float m_emergethread_trigger_timer
Definition server.h:661
ModIPCStore m_ipcstore
Definition server.h:692
std::string m_path_mod_data
Definition server.h:640
void sendMediaAnnouncement(session_t peer_id, const std::string &lang_code)
Definition server.cpp:2603
void setAsyncFatalError(const LuaError &e)
Definition server.h:347
void SendMinimapModes(session_t peer_id, std::vector< MinimapMode > &modes, size_t wanted_mode)
Definition server.cpp:2785
virtual EmergeManager * getEmergeManager()
Definition server.h:318
ServerEnvironment * m_env
Definition server.h:667
void fillMediaCache()
Definition server.cpp:2570
bool m_simple_singleplayer_mode
Definition server.h:645
std::unordered_map< std::string, Translations > server_translations
Definition server.h:690
virtual std::string getWorldPath() const
Definition server.h:330
ChatInterface * m_admin_chat
Definition server.h:716
NodeDefManager * m_nodedef
Definition server.h:685
bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value)
Definition server.cpp:3352
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: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:4026
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: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: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:227
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:290
bool ephemeral
Definition server.h:296
u32 token
Definition server.h:294
std::optional< std::string_view > data
Definition server.h:293
std::string to_player
Definition server.h:295
std::string filename
Definition server.h:291
std::optional< std::string > filepath
Definition server.h:292
std::unordered_set< session_t > waiting_players
Definition server.h:500
std::string filename
Definition server.h:498
float expiry_timer
Definition server.h:499
Definition server.h:504
size_t operator()(const std::pair< v3s16, u16 > &p) const
Definition server.h:505
Definition server.h:481
void trigger(float delay, const std::string &msg, bool reconnect)
Definition server.cpp:203
bool isTimerRunning() const
Definition server.h:492
void tick(float dtime, Server *server)
Definition server.cpp:210
void reset()
Definition server.cpp:195
bool is_requested
Definition server.h:484
bool should_reconnect
Definition server.h:485
float m_timer
Definition server.h:494
std::wstring getShutdownTimerMessage() const
Definition server.cpp:242
std::string message
Definition server.h:486
Definition server.h:337
bool pause
Definition server.h:339
float steplen
Definition server.h:338
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