// // Created by koncord on 16.04.17. // #ifndef OPENMW_WORLDPROCESSSOR_HPP #define OPENMW_WORLDPROCESSSOR_HPP #include #include #include #include #include #include #include "WorldEvent.hpp" #include "LocalPlayer.hpp" #include "DedicatedPlayer.hpp" namespace mwmp { class WorldProcessor : public BasePacketProcessor { public: virtual void Do(WorldPacket &packet, WorldEvent &event) = 0; static bool Process(RakNet::Packet &packet, WorldEvent &event); static void AddProcessor(WorldProcessor *processor); static void SetServerAddr(RakNet::SystemAddress addr) { serverAddr = addr; } typedef boost::unordered_map > processors_t; protected: inline bool isRequest() { return request; } LocalPlayer *getLocalPlayer(); protected: static RakNet::RakNetGUID guid; static RakNet::SystemAddress serverAddr; private: static processors_t processors; static bool request; }; } #endif //OPENMW_WORLDPROCESSSOR_HPP