mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 16:39:40 +00:00
[Server] Move all world handlers to WorldProcessors
This commit is contained in:
parent
3ab25fb3f1
commit
f5600c508f
18 changed files with 492 additions and 208 deletions
|
@ -18,9 +18,9 @@
|
||||||
#include "MasterClient.hpp"
|
#include "MasterClient.hpp"
|
||||||
#include "Cell.hpp"
|
#include "Cell.hpp"
|
||||||
#include "PlayerProcessor.hpp"
|
#include "PlayerProcessor.hpp"
|
||||||
|
#include "WorldProcessor.hpp"
|
||||||
#include <components/openmw-mp/Version.hpp>
|
#include <components/openmw-mp/Version.hpp>
|
||||||
#include <components/openmw-mp/Packets/PacketPreInit.hpp>
|
#include <components/openmw-mp/Packets/PacketPreInit.hpp>
|
||||||
#include <apps/openmw-mp/processors/ProcessorPlayerPos.hpp>
|
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -165,214 +165,8 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
||||||
baseEvent.objectChanges.objects.clear();
|
baseEvent.objectChanges.objects.clear();
|
||||||
baseEvent.guid = packet->guid;
|
baseEvent.guid = packet->guid;
|
||||||
|
|
||||||
switch (packet->data[0])
|
if(!WorldProcessor::Process(*packet))
|
||||||
{
|
|
||||||
|
|
||||||
case ID_OBJECT_PLACE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_DELETE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_SCALE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_SCALE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnObjectScale")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_LOCK:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnObjectLock")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_UNLOCK:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnObjectUnlock")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_MOVE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_MOVE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_ROTATE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_OBJECT_ANIM_PLAY:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ANIM_PLAY from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_DOOR_STATE:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_STATE from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnDoorState")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_CONTAINER:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
|
|
||||||
LOG_APPEND(Log::LOG_WARN, "- action: %i", baseEvent.action);
|
|
||||||
|
|
||||||
// Until we have a timestamp-based system, send packets pertaining to more
|
|
||||||
// than one container (i.e. replies to server requests for container contents)
|
|
||||||
// only to players who have the container's cell loaded
|
|
||||||
if (baseEvent.action == BaseEvent::SET && baseEvent.objectChanges.count > 1)
|
|
||||||
CellController::get()->getCell(&baseEvent.cell)->sendToLoaded(myPacket, &baseEvent);
|
|
||||||
else
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
Script::Call<Script::CallbackIdentity("OnContainer")>(player->getId(), baseEvent.cell.getDescription().c_str());
|
|
||||||
|
|
||||||
LOG_APPEND(Log::LOG_INFO, "- Finished processing ID_CONTAINER");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_SCRIPT_LOCAL_SHORT:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_SHORT from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_SCRIPT_LOCAL_FLOAT:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_FLOAT from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_SCRIPT_MEMBER_SHORT:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_MEMBER_SHORT from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_SCRIPT_GLOBAL_SHORT:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_GLOBAL_SHORT from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_MUSIC_PLAY:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_MUSIC_PLAY from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case ID_VIDEO_PLAY:
|
|
||||||
{
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_VIDEO_PLAY from %s", player->npc.mName.c_str());
|
|
||||||
|
|
||||||
myPacket->setEvent(&baseEvent);
|
|
||||||
myPacket->Read();
|
|
||||||
myPacket->Send(true);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]);
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled WorldPacket with identifier %i has arrived", packet->data[0]);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,23 @@
|
||||||
#include "processors/player/ProcessorPlayerCharGen.hpp"
|
#include "processors/player/ProcessorPlayerCharGen.hpp"
|
||||||
#include "processors/player/ProcessorGUIMessageBox.hpp"
|
#include "processors/player/ProcessorGUIMessageBox.hpp"
|
||||||
#include "processors/player/ProcessorPlayerCharClass.hpp"
|
#include "processors/player/ProcessorPlayerCharClass.hpp"
|
||||||
|
#include "WorldProcessor.hpp"
|
||||||
|
#include "processors/world/ProcessorContainer.hpp"
|
||||||
|
#include "processors/world/ProcessorDoorState.hpp"
|
||||||
|
#include "processors/world/ProcessorMusicPlay.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectAnimPlay.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectDelete.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectLock.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectMove.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectPlace.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectRotate.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectScale.hpp"
|
||||||
|
#include "processors/world/ProcessorObjectUnlock.hpp"
|
||||||
|
#include "processors/world/ProcessorScriptGlobalShort.hpp"
|
||||||
|
#include "processors/world/ProcessorScriptLocalFloat.hpp"
|
||||||
|
#include "processors/world/ProcessorScriptLocalShort.hpp"
|
||||||
|
#include "processors/world/ProcessorScriptMemberShort.hpp"
|
||||||
|
#include "processors/world/ProcessorVideoPlay.hpp"
|
||||||
|
|
||||||
|
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
@ -49,4 +66,21 @@ void ProcessorInitializer()
|
||||||
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
|
PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen());
|
||||||
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
|
PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox());
|
||||||
PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass());
|
PlayerProcessor::AddProcessor(new ProcessorPlayerCharClass());
|
||||||
|
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorContainer());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorDoorState());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorMusicPlay());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectAnimPlay());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectDelete());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectLock());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectMove());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectPlace());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectRotate());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectScale());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorObjectUnlock());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorScriptGlobalShort());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorScriptLocalShort());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorScriptMemberShort());
|
||||||
|
WorldProcessor::AddProcessor(new ProcessorVideoPlay());
|
||||||
}
|
}
|
39
apps/openmw-mp/processors/world/ProcessorContainer.hpp
Normal file
39
apps/openmw-mp/processors/world/ProcessorContainer.hpp
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORCONTAINER_HPP
|
||||||
|
#define OPENMW_PROCESSORCONTAINER_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorContainer : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorContainer()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_VIDEO_PLAY)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
LOG_APPEND(Log::LOG_WARN, "- action: %i", event.action);
|
||||||
|
|
||||||
|
// Until we have a timestamp-based system, send packets pertaining to more
|
||||||
|
// than one container (i.e. replies to server requests for container contents)
|
||||||
|
// only to players who have the container's cell loaded
|
||||||
|
if (event.action == BaseEvent::SET && event.objectChanges.count > 1)
|
||||||
|
CellController::get()->getCell(&event.cell)->sendToLoaded(&packet, &event);
|
||||||
|
else
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnContainer")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "- Finished processing ID_CONTAINER");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORCONTAINER_HPP
|
29
apps/openmw-mp/processors/world/ProcessorDoorState.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorDoorState.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORDOORSTATE_HPP
|
||||||
|
#define OPENMW_PROCESSORDOORSTATE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorDoorState : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorDoorState()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_DOOR_STATE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnDoorState")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORDOORSTATE_HPP
|
27
apps/openmw-mp/processors/world/ProcessorMusicPlay.hpp
Normal file
27
apps/openmw-mp/processors/world/ProcessorMusicPlay.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORMUSICPLAY_HPP
|
||||||
|
#define OPENMW_PROCESSORMUSICPLAY_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorMusicPlay : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorMusicPlay()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_MUSIC_PLAY)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORMUSICPLAY_HPP
|
27
apps/openmw-mp/processors/world/ProcessorObjectAnimPlay.hpp
Normal file
27
apps/openmw-mp/processors/world/ProcessorObjectAnimPlay.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTANIMPLAY_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTANIMPLAY_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectAnimPlay : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectAnimPlay()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_ANIM_PLAY)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTANIMPLAY_HPP
|
29
apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTDELETE_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTDELETE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectDelete : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectDelete()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_DELETE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTDELETE_HPP
|
29
apps/openmw-mp/processors/world/ProcessorObjectLock.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorObjectLock.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTLOCK_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTLOCK_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectLock : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectLock()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_LOCK)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnObjectLock")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTLOCK_HPP
|
27
apps/openmw-mp/processors/world/ProcessorObjectMove.hpp
Normal file
27
apps/openmw-mp/processors/world/ProcessorObjectMove.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTMOVE_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTMOVE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectMove : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectMove()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_MOVE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTMOVE_HPP
|
29
apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTPLACE_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTPLACE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectPlace : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectPlace()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_PLACE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTPLACE_HPP
|
27
apps/openmw-mp/processors/world/ProcessorObjectRotate.hpp
Normal file
27
apps/openmw-mp/processors/world/ProcessorObjectRotate.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTROTATE_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTROTATE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectRotate : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectRotate()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_ROTATE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTROTATE_HPP
|
29
apps/openmw-mp/processors/world/ProcessorObjectScale.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorObjectScale.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTSCALE_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTSCALE_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectScale : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectScale()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_SCALE)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnObjectScale")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTSCALE_HPP
|
29
apps/openmw-mp/processors/world/ProcessorObjectUnlock.hpp
Normal file
29
apps/openmw-mp/processors/world/ProcessorObjectUnlock.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
||||||
|
#define OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorObjectUnlock : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorObjectUnlock()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_OBJECT_UNLOCK)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
|
||||||
|
Script::Call<Script::CallbackIdentity("OnObjectUnlock")>(player.getId(), event.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORSCRIPTGLOBALSHORT_HPP
|
||||||
|
#define OPENMW_PROCESSORSCRIPTGLOBALSHORT_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorScriptGlobalShort : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorScriptGlobalShort()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_SCRIPT_GLOBAL_SHORT)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORSCRIPTGLOBALSHORT_HPP
|
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP
|
||||||
|
#define OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorScriptLocalFloat : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorScriptLocalFloat()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_SCRIPT_LOCAL_FLOAT)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORSCRIPTLOCALFLOAT_HPP
|
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
|
||||||
|
#define OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorScriptLocalShort : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorScriptLocalShort()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_SCRIPT_LOCAL_SHORT)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORSCRIPTLOCALSHORT_HPP
|
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORSCRIPTMEMBERSHORT_HPP
|
||||||
|
#define OPENMW_PROCESSORSCRIPTMEMBERSHORT_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorScriptMemberShort : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorScriptMemberShort()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_SCRIPT_MEMBER_SHORT)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORSCRIPTMEMBERSHORT_HPP
|
27
apps/openmw-mp/processors/world/ProcessorVideoPlay.hpp
Normal file
27
apps/openmw-mp/processors/world/ProcessorVideoPlay.hpp
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
//
|
||||||
|
// Created by koncord on 03.04.17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef OPENMW_PROCESSORVIDEOPLAY_HPP
|
||||||
|
#define OPENMW_PROCESSORVIDEOPLAY_HPP
|
||||||
|
|
||||||
|
#include "apps/openmw-mp/WorldProcessor.hpp"
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class ProcessorVideoPlay : public WorldProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProcessorVideoPlay()
|
||||||
|
{
|
||||||
|
BPP_INIT(ID_VIDEO_PLAY)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
|
||||||
|
{
|
||||||
|
packet.Send(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PROCESSORVIDEOPLAY_HPP
|
Loading…
Reference in a new issue