Generic NodeMetadata text input
[oweals/minetest.git] / src / server.h
index d51f910682805a6c1e3ba0a76487903aab6e529d..ab8c31a00a0a57186692d91eba573269d64874c1 100644 (file)
@@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "inventory.h"
 #include "auth.h"
 #include "ban.h"
+struct LuaState;
+typedef struct lua_State lua_State;
 
 /*
        Some random functions
@@ -391,7 +393,7 @@ public:
        // Environment must be locked when called
        void setTimeOfDay(u32 time)
        {
-               m_env.setTimeOfDay(time);
+               m_env->setTimeOfDay(time);
                m_time_of_day_send_timer = 0;
        }
 
@@ -468,10 +470,17 @@ public:
                return m_banmanager.getBanDescription(ip_or_name);
        }
 
-       con::Peer* getPeerNoEx(u16 peer_id)
+       Address getPeerAddress(u16 peer_id)
        {
-               return m_con.GetPeerNoEx(peer_id);
+               return m_con.GetPeerAddress(peer_id);
        }
+       
+       // Envlock and conlock should be locked when calling this
+       void notifyPlayer(const char *name, const std::wstring msg);
+       void notifyPlayers(const std::wstring msg);
+       
+       // Envlock and conlock should be locked when using Lua
+       lua_State *getLua(){ return m_lua; }
 
 private:
 
@@ -488,6 +497,8 @@ private:
        static void SendHP(con::Connection &con, u16 peer_id, u8 hp);
        static void SendAccessDenied(con::Connection &con, u16 peer_id,
                        const std::wstring &reason);
+       static void SendDeathscreen(con::Connection &con, u16 peer_id,
+                       bool set_camera_point_target, v3f camera_point_target);
        
        /*
                Non-static send methods
@@ -526,6 +537,9 @@ private:
                Something random
        */
        
+       void HandlePlayerHP(Player *player, s16 damage);
+       void RespawnPlayer(Player *player);
+       
        void UpdateCrafting(u16 peer_id);
        
        // When called, connection mutex should be locked
@@ -534,7 +548,7 @@ private:
        // When called, environment mutex should be locked
        std::string getPlayerName(u16 peer_id)
        {
-               Player *player = m_env.getPlayer(peer_id);
+               Player *player = m_env->getPlayer(peer_id);
                if(player == NULL)
                        return "[id="+itos(peer_id);
                return player->getName();
@@ -573,7 +587,7 @@ private:
        // environment shall be locked first.
 
        // Environment
-       ServerEnvironment m_env;
+       ServerEnvironment *m_env;
        JMutex m_env_mutex;
        
        // Connection
@@ -587,6 +601,10 @@ private:
 
        // Bann checking
        BanManager m_banmanager;
+
+       // Scripting
+       // Envlock and conlock should be locked when using Lua
+       lua_State *m_lua;
        
        /*
                Threads