From f648fb76aef96a1da608c64346fc65d4dd44caa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Fri, 10 Apr 2020 19:49:20 +0200 Subject: Drop genericobject.{cpp,h} (#9629) * Drop genericobject.{cpp,h} This file is not for generic object but for ActiveObject message passing. Put ownership of the various commands to the right objects and cleanup the related code. * Protect ServerActiveObject::m_messages_out * typo fix --- src/serverobject.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/serverobject.h') diff --git a/src/serverobject.h b/src/serverobject.h index 48689fcb4..2e013a6b6 100644 --- a/src/serverobject.h +++ b/src/serverobject.h @@ -113,7 +113,7 @@ public: The return value of this is passed to the client-side object when it is created */ - virtual std::string getClientInitializationData(u16 protocol_version){return "";} + virtual std::string getClientInitializationData(u16 protocol_version) {return "";} /* The return value of this is passed to the server-side object @@ -192,6 +192,10 @@ public: m_attached_particle_spawners.erase(id); } + std::string generateUpdateInfantCommand(u16 infant_id, u16 protocol_version); + std::string generateUpdateNametagAttributesCommand(const video::SColor &color) const; + + void dumpAOMessagesToQueue(std::queue &queue); /* Number of players which know about this object. Object won't be @@ -236,11 +240,6 @@ public: */ v3s16 m_static_block = v3s16(1337,1337,1337); - /* - Queue of messages to be sent to the client - */ - std::queue m_messages_out; - protected: virtual void onAttach(int parent_id) {} virtual void onDetach(int parent_id) {} @@ -255,6 +254,11 @@ protected: v3f m_base_position; std::unordered_set m_attached_particle_spawners; + /* + Queue of messages to be sent to the client + */ + std::queue m_messages_out; + private: // Used for creating objects based on type static std::map m_types; -- cgit v1.2.3