2017-04-16 06:58:40 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 16.04.17.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef OPENMW_WORLDPROCESSSOR_HPP
|
|
|
|
#define OPENMW_WORLDPROCESSSOR_HPP
|
|
|
|
|
|
|
|
#include <boost/unordered_map.hpp>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
#include <components/openmw-mp/Log.hpp>
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
2017-04-18 03:35:50 +00:00
|
|
|
#include "WorldEvent.hpp"
|
2017-04-16 06:58:40 +00:00
|
|
|
#include "LocalPlayer.hpp"
|
|
|
|
#include "DedicatedPlayer.hpp"
|
2017-04-18 07:05:32 +00:00
|
|
|
#include "BaseClientPacketProcessor.hpp"
|
2017-04-16 06:58:40 +00:00
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2017-04-18 07:05:32 +00:00
|
|
|
class WorldProcessor : public BaseClientPacketProcessor
|
2017-04-16 06:58:40 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-18 03:35:50 +00:00
|
|
|
virtual void Do(WorldPacket &packet, WorldEvent &event) = 0;
|
2017-04-16 06:58:40 +00:00
|
|
|
|
2017-04-18 03:35:50 +00:00
|
|
|
static bool Process(RakNet::Packet &packet, WorldEvent &event);
|
|
|
|
static void AddProcessor(WorldProcessor *processor);
|
2017-04-16 06:58:40 +00:00
|
|
|
|
2017-04-18 03:35:50 +00:00
|
|
|
typedef boost::unordered_map<unsigned char, boost::shared_ptr<WorldProcessor> > processors_t;
|
2017-04-16 06:58:40 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static processors_t processors;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //OPENMW_WORLDPROCESSSOR_HPP
|