From 6a1670dbc31cc0e44178bbd9ad34ff0d5981a060 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Thu, 20 Dec 2012 21:19:49 +0400 Subject: Migrate to STL containers/algorithms. --- src/client.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index 809e98b81..570a6b3b0 100644 --- a/src/client.h +++ b/src/client.h @@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "server.h" #include "particles.h" #include "util/pointedthing.h" +#include struct MeshMakeData; class MapBlockMesh; @@ -142,9 +143,9 @@ public: void * Thread(); - core::list m_file_requests; + std::list m_file_requests; MutexedQueue > m_file_data; - core::list m_failed; + std::list m_failed; std::string m_remote_url; IGameDef *m_gamedef; }; @@ -282,7 +283,7 @@ public: // Prints a line or two of info void printDebugInfo(std::ostream &os); - core::list getConnectedPlayerNames(); + std::list getConnectedPlayerNames(); float getAnimationTime(); @@ -347,7 +348,7 @@ private: // Insert a media file appropriately into the appropriate manager bool loadMedia(const std::string &data, const std::string &filename); - void request_media(const core::list &file_requests); + void request_media(const std::list &file_requests); // Virtual methods from con::PeerHandler void peerAdded(con::Peer *peer); @@ -377,7 +378,7 @@ private: MtEventManager *m_event; MeshUpdateThread m_mesh_update_thread; - core::list m_media_fetch_threads; + std::list m_media_fetch_threads; ClientEnvironment m_env; con::Connection m_con; IrrlichtDevice *m_device; @@ -387,7 +388,7 @@ private: bool m_inventory_updated; Inventory *m_inventory_from_server; float m_inventory_from_server_age; - core::map m_active_blocks; + std::set m_active_blocks; PacketCounter m_packetcounter; // Block mesh animation parameters float m_animation_time; @@ -405,7 +406,7 @@ private: Queue m_client_event_queue; FileCache m_media_cache; // Mapping from media file name to SHA1 checksum - core::map m_media_name_sha1_map; + std::map m_media_name_sha1_map; bool m_media_receive_started; u32 m_media_count; u32 m_media_received_count; -- cgit v1.2.3 From e1ff5b13619666e5b987ecf4faaf294400ffd979 Mon Sep 17 00:00:00 2001 From: Jeija Date: Wed, 23 Jan 2013 18:32:02 +0100 Subject: Allow spawning particles from the server, from lua Spawn single particles or make use of ParticleSpawner for many randomly spawned particles. Accessible in Lua using minetest.spawn_particle and minetest.add_particlespawner. Increase Protocol Version to 17. Conflicts: src/clientserver.h --- src/client.h | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index 570a6b3b0..d476a1d51 100644 --- a/src/client.h +++ b/src/client.h @@ -157,7 +157,10 @@ enum ClientEventType CE_PLAYER_FORCE_MOVE, CE_DEATHSCREEN, CE_TEXTURES_UPDATED, - CE_SHOW_FORMSPEC + CE_SHOW_FORMSPEC, + CE_SPAWN_PARTICLE, + CE_ADD_PARTICLESPAWNER, + CE_DELETE_PARTICLESPAWNER }; struct ClientEvent @@ -185,6 +188,35 @@ struct ClientEvent } show_formspec; struct{ } textures_updated; + struct{ + v3f *pos; + v3f *vel; + v3f *acc; + f32 expirationtime; + f32 size; + bool collisiondetection; + std::string *texture; + } spawn_particle; + struct{ + u16 amount; + f32 spawntime; + v3f *minpos; + v3f *maxpos; + v3f *minvel; + v3f *maxvel; + v3f *minacc; + v3f *maxacc; + f32 minexptime; + f32 maxexptime; + f32 minsize; + f32 maxsize; + bool collisiondetection; + std::string *texture; + u32 id; + } add_particlespawner; + struct{ + u32 id; + } delete_particlespawner; }; }; -- cgit v1.2.3