]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/server.h
Notify other players of wielded item change
[dragonfireclient.git] / src / server.h
index 1da004da57c78f8d805352906406b3623093d339..b10703e707803ee671c5e8ca9cdf4ac93621890a 100644 (file)
@@ -235,6 +235,8 @@ class RemoteClient
        u16 peer_id;
        // The serialization version to use with the client
        u8 serialization_version;
+       //
+       u16 net_proto_version;
        // Version is stored in here after INIT before INIT2
        u8 pending_serialization_version;
 
@@ -244,6 +246,7 @@ class RemoteClient
        {
                peer_id = 0;
                serialization_version = SER_FMT_VER_INVALID;
+               net_proto_version = 0;
                pending_serialization_version = SER_FMT_VER_INVALID;
                m_nearest_unsent_d = 0;
                m_nearest_unsent_reset_timer = 0.0;
@@ -364,7 +367,8 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        */
 
        Server(
-               std::string mapsavedir
+               std::string mapsavedir,
+               std::string configpath
        );
        ~Server();
        void start(unsigned short port);
@@ -443,6 +447,13 @@ class Server : public con::PeerHandler, public MapEventReceiver,
                        dstream<<"WARNING: Auth not found for "<<name<<std::endl;
                }
        }
+       
+       // Saves g_settings to configpath given at initialization
+       void saveConfig()
+       {
+               if(m_configpath != "")
+                       g_settings.updateConfigFile(m_configpath.c_str());
+       }
 
 private:
 
@@ -468,6 +479,10 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        void SendObjectData(float dtime);
        void SendPlayerInfos();
        void SendInventory(u16 peer_id);
+       // send wielded item info about player to all
+       void SendWieldedItem(const Player *player);
+       // send wielded item info about all players to all players
+       void SendPlayerItems();
        void SendChatMessage(u16 peer_id, const std::wstring &message);
        void BroadcastChatMessage(const std::wstring &message);
        void SendPlayerHP(Player *player);
@@ -606,6 +621,9 @@ class Server : public con::PeerHandler, public MapEventReceiver,
        // Map directory
        std::string m_mapsavedir;
 
+       // Configuration path ("" = no configuration file)
+       std::string m_configpath;
+
        bool m_shutdown_requested;
        
        /*