1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

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
This commit is contained in:
Loïc Blot 2020-04-10 19:49:20 +02:00 committed by GitHub
parent 2349d31bae
commit f648fb76ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 300 additions and 407 deletions

View file

@ -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<ActiveObjectMessage> &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<ActiveObjectMessage> 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<u32> m_attached_particle_spawners;
/*
Queue of messages to be sent to the client
*/
std::queue<ActiveObjectMessage> m_messages_out;
private:
// Used for creating objects based on type
static std::map<u16, Factory> m_types;