aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/server.h b/src/server.h
index f44716531..4b3ac5cf7 100644
--- a/src/server.h
+++ b/src/server.h
@@ -38,6 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "serverenvironment.h"
#include "clientiface.h"
#include "chatmessage.h"
+#include "translation.h"
#include <string>
#include <list>
#include <map>
@@ -117,6 +118,14 @@ struct ServerPlayingSound
std::unordered_set<session_t> clients; // peer ids
};
+struct MinimapMode {
+ MinimapType type = MINIMAP_TYPE_OFF;
+ std::string label;
+ u16 size = 0;
+ std::string texture;
+ u16 scale = 1;
+};
+
class Server : public con::PeerHandler, public MapEventReceiver,
public IGameDef
{
@@ -131,7 +140,8 @@ public:
bool simple_singleplayer_mode,
Address bind_addr,
bool dedicated,
- ChatInterface *iface = nullptr
+ ChatInterface *iface = nullptr,
+ std::string *on_shutdown_errmsg = nullptr
);
~Server();
DISABLE_CLASS_COPY(Server);
@@ -329,6 +339,10 @@ public:
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
void SendPlayerFov(session_t peer_id);
+ void SendMinimapModes(session_t peer_id,
+ std::vector<MinimapMode> &modes,
+ size_t wanted_mode);
+
void sendDetachedInventories(session_t peer_id, bool incremental);
virtual bool registerModStorage(ModMetadata *storage);
@@ -342,8 +356,8 @@ public:
// Send block to specific player only
bool SendBlock(session_t peer_id, const v3s16 &blockpos);
- // Load translations for a language
- void loadTranslationLanguage(const std::string &lang_code);
+ // Get or load translations for a language
+ Translations *getTranslationLanguage(const std::string &lang_code);
// Bind address
Address m_bind_addr;
@@ -556,6 +570,8 @@ private:
// Mods
std::unique_ptr<ServerModManager> m_modmgr;
+ std::unordered_map<std::string, Translations> server_translations;
+
/*
Threads
*/
@@ -596,6 +612,10 @@ private:
ChatInterface *m_admin_chat;
std::string m_admin_nick;
+ // if a mod-error occurs in the on_shutdown callback, the error message will
+ // be written into this
+ std::string *const m_on_shutdown_errmsg;
+
/*
Map edit event queue. Automatically receives all map edits.
The constructor of this class registers us to receive them through