]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/server.h
Fix codestyle since CSM Camera API
[dragonfireclient.git] / src / server.h
index e1e8f84dc658d035c131d6b80f03b0a7a9f32b00..2e735e77c62abeded92d77f5f6f30a4fe3618a0c 100644 (file)
@@ -115,6 +115,7 @@ struct ServerSoundParams
        u16 object;
        float max_hear_distance;
        bool loop;
+       float fade;
 
        ServerSoundParams():
                gain(1.0),
@@ -123,7 +124,8 @@ struct ServerSoundParams
                pos(0,0,0),
                object(0),
                max_hear_distance(32*BS),
-               loop(false)
+               loop(false),
+               fade(0)
        {}
 
        v3f getPos(ServerEnvironment *env, bool *pos_exists) const;
@@ -132,6 +134,7 @@ struct ServerSoundParams
 struct ServerPlayingSound
 {
        ServerSoundParams params;
+       SimpleSoundSpec spec;
        UNORDERED_SET<u16> clients; // peer ids
 };
 
@@ -148,6 +151,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
                const SubgameSpec &gamespec,
                bool simple_singleplayer_mode,
                bool ipv6,
+               bool dedicated,
                ChatInterface *iface = NULL
        );
        ~Server();
@@ -173,7 +177,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        void handleCommand_Init_Legacy(NetworkPacket* pkt);
        void handleCommand_Init2(NetworkPacket* pkt);
        void handleCommand_RequestMedia(NetworkPacket* pkt);
-       void handleCommand_ReceivedMedia(NetworkPacket* pkt);
        void handleCommand_ClientReady(NetworkPacket* pkt);
        void handleCommand_GotBlocks(NetworkPacket* pkt);
        void handleCommand_PlayerPos(NetworkPacket* pkt);
@@ -225,17 +228,13 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        inline bool getShutdownRequested() const { return m_shutdown_requested; }
 
        // request server to shutdown
-       void requestShutdown(const std::string &msg, bool reconnect)
-       {
-               m_shutdown_requested = true;
-               m_shutdown_msg = msg;
-               m_shutdown_ask_reconnect = reconnect;
-       }
+       void requestShutdown(const std::string &msg, bool reconnect, float delay = 0.0f);
 
        // Returns -1 if failed, sound handle on success
        // Envlock
        s32 playSound(const SimpleSoundSpec &spec, const ServerSoundParams &params);
        void stopSound(s32 handle);
+       void fadeSound(s32 handle, float step, float gain);
 
        // Envlock
        std::set<std::string> getPlayerEffectivePrivs(const std::string &name);
@@ -311,6 +310,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
        Map & getMap() { return m_env->getMap(); }
        ServerEnvironment & getEnv() { return *m_env; }
+       v3f findSpawnPos();
 
        u32 hudAdd(RemotePlayer *player, HudElement *element);
        bool hudRemove(RemotePlayer *player, u32 id);
@@ -335,7 +335,14 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        bool setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third);
 
        bool setSky(RemotePlayer *player, const video::SColor &bgcolor,
-                       const std::string &type, const std::vector<std::string> &params);
+                       const std::string &type, const std::vector<std::string> &params,
+                       bool &clouds);
+       bool setClouds(RemotePlayer *player, float density,
+                       const video::SColor &color_bright,
+                       const video::SColor &color_ambient,
+                       float height,
+                       float thickness,
+                       const v2f &speed);
 
        bool overrideDayNightRatio(RemotePlayer *player, bool do_override, float brightness);
 
@@ -404,7 +411,14 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        void SendHUDSetFlags(u16 peer_id, u32 flags, u32 mask);
        void SendHUDSetParam(u16 peer_id, u16 param, const std::string &value);
        void SendSetSky(u16 peer_id, const video::SColor &bgcolor,
-                       const std::string &type, const std::vector<std::string> &params);
+                       const std::string &type, const std::vector<std::string> &params,
+                       bool &clouds);
+       void SendCloudParams(u16 peer_id, float density,
+                       const video::SColor &color_bright,
+                       const video::SColor &color_ambient,
+                       float height,
+                       float thickness,
+                       const v2f &speed);
        void SendOverrideDayNightRatio(u16 peer_id, bool do_override, float ratio);
 
        /*
@@ -477,8 +491,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
                RemotePlayer *player = NULL);
        void handleAdminChat(const ChatEventChat *evt);
 
-       v3f findSpawnPos();
-
        // When called, connection mutex should be locked
        RemoteClient* getClient(u16 peer_id,ClientState state_min=CS_Active);
        RemoteClient* getClientNoEx(u16 peer_id,ClientState state_min=CS_Active);
@@ -510,6 +522,8 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        // functionality
        bool m_simple_singleplayer_mode;
        u16 m_max_chatmessage_length;
+       // For "dedicated" server list flag
+       bool m_dedicated;
 
        // Thread can set; step() will throw as ServerError
        MutexedVariable<std::string> m_async_fatal_error;
@@ -599,6 +613,7 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        bool m_shutdown_requested;
        std::string m_shutdown_msg;
        bool m_shutdown_ask_reconnect;
+       float m_shutdown_timer;
 
        ChatInterface *m_admin_chat;
        std::string m_admin_nick;