From ce873108aa91d19104f46c5acd3350385e7a4541 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Fri, 30 Mar 2018 18:32:52 +0200 Subject: Client eventmanager refactor (#7179) * Drop EventManager from GameDef & do some client cleanups * EventManager is only used by Client. Don't expose it on Server & GameDef for nothing * Drop Client::event() in favor of direct calls to getEventManager * Cleanup some event put from new + put to put(new) * MtEvent: add Type(u8) enum * This will enhance event performance & ensure stricter type * Drop MtEvent::checkIs (unused) * clang-tidy reported fixes * Code style * Move event_manager.h to the client directory as it's only used by client Add EventManager unittests + switch to unordered_map as order is not important here Drop a unused function --- src/server.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index ca2743ad2..e0a15ab87 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -50,7 +50,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_nodemeta.h" #include "content_sao.h" #include "mods.h" -#include "event_manager.h" #include "modchannels.h" #include "serverlist.h" #include "util/string.h" @@ -168,7 +167,6 @@ Server::Server( m_itemdef(createItemDefManager()), m_nodedef(createNodeDefManager()), m_craftdef(createCraftDefManager()), - m_event(new EventManager()), m_uptime(0), m_clients(m_con), m_admin_chat(iface), @@ -335,7 +333,6 @@ Server::~Server() delete m_env; delete m_rollback; delete m_banmanager; - delete m_event; delete m_itemdef; delete m_nodedef; delete m_craftdef; @@ -3296,11 +3293,6 @@ u16 Server::allocateUnknownNodeId(const std::string &name) return m_nodedef->allocateDummy(name); } -MtEventManager *Server::getEventManager() -{ - return m_event; -} - IWritableItemDefManager *Server::getWritableItemDefManager() { return m_itemdef; -- cgit v1.2.3