]> git.lizzy.rs Git - minetest.git/blobdiff - src/client.h
mobv2
[minetest.git] / src / client.h
index 442eaef5df9282ac460bffb9743f6e8738394dba..87c7e328dbca8ac94762cf317b5e09a3325591be 100644 (file)
@@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "jmutex.h"
 #include <ostream>
 #include "clientobject.h"
+#include "utility.h" // For IntervalLimiter
 
 struct MeshMakeData;
 
@@ -182,10 +183,8 @@ class Client : public con::PeerHandler, public InventoryManager
 
        void groundAction(u8 action, v3s16 nodepos_undersurface,
                        v3s16 nodepos_oversurface, u16 item);
-       void clickObject(u8 button, v3s16 blockpos, s16 id, u16 item);
        void clickActiveObject(u8 button, u16 id, u16 item);
 
-       void sendSignText(v3s16 blockpos, s16 id, std::string text);
        void sendSignNodeText(v3s16 p, std::string text);
        void sendInventoryAction(InventoryAction *a);
        void sendChatMessage(const std::wstring &message);
@@ -198,17 +197,21 @@ class Client : public con::PeerHandler, public InventoryManager
        // locks envlock
        void addNode(v3s16 p, MapNode n);
        
-       void updateCamera(v3f pos, v3f dir);
+       void updateCamera(v3f pos, v3f dir, f32 fov);
+       
+       void renderPostFx();
        
        // Returns InvalidPositionException if not found
        MapNode getNode(v3s16 p);
        // Wrapper to Map
        NodeMetadata* getNodeMetadata(v3s16 p);
 
-       v3f getPlayerPosition();
+       LocalPlayer* getLocalPlayer();
 
        void setPlayerControl(PlayerControl &control);
-       
+
+       void selectPlayerItem(u16 item);
+
        // Returns true if the inventory of the local player has been
        // updated from the server. If it is true, it is set to false.
        bool getLocalInventoryUpdated();
@@ -220,14 +223,6 @@ class Client : public con::PeerHandler, public InventoryManager
        Inventory* getInventory(InventoryContext *c, std::string id);
        void inventoryAction(InventoryAction *a);
 
-       // Gets closest object pointed by the shootline
-       // Returns NULL if not found
-       MapBlockObject * getSelectedObject(
-                       f32 max_d,
-                       v3f from_pos_f_on_map,
-                       core::line3d<f32> shootline_on_map
-       );
-
        // Gets closest object pointed by the shootline
        // Returns NULL if not found
        ClientActiveObject * getSelectedActiveObject(
@@ -265,6 +260,12 @@ class Client : public con::PeerHandler, public InventoryManager
 
        void addChatMessage(const std::wstring &message)
        {
+               if (message[0] == L'/') {
+                       m_chat_queue.push_back(
+                               (std::wstring)L"issued command: "+message);
+                       return;
+               }
+
                //JMutexAutoLock envlock(m_env_mutex); //bulk comment-out
                LocalPlayer *player = m_env.getLocalPlayer();
                assert(player != NULL);
@@ -304,13 +305,15 @@ class Client : public con::PeerHandler, public InventoryManager
        void sendPlayerPos();
        // This sends the player's current name etc to the server
        void sendPlayerInfo();
+       // Send the item number 'item' as player item to the server
+       void sendPlayerItem(u16 item);
        
        float m_packetcounter_timer;
-       float m_delete_unused_sectors_timer;
        float m_connection_reinit_timer;
        float m_avg_rtt_timer;
        float m_playerpos_send_timer;
        float m_ignore_damage_timer; // Used after server moves player
+       IntervalLimiter m_map_timer_and_unload_interval;
 
        MeshUpdateThread m_mesh_update_thread;
        
@@ -320,9 +323,6 @@ class Client : public con::PeerHandler, public InventoryManager
 
        IrrlichtDevice *m_device;
 
-       v3f camera_position;
-       v3f camera_direction;
-       
        // Server serialization version
        u8 m_server_ser_ver;