[General] Add placeholder for ObjectActivate packet

pull/471/head
David Cernat 7 years ago
parent 61da0d2475
commit 81b160cae8

@ -120,15 +120,16 @@ source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER})
set(PROCESSORS_OBJECT set(PROCESSORS_OBJECT
processors/object/ProcessorContainer.hpp processors/object/ProcessorDoorState.hpp processors/object/ProcessorContainer.hpp processors/object/ProcessorDoorState.hpp
processors/object/ProcessorMusicPlay.hpp processors/object/ProcessorObjectAnimPlay.hpp processors/object/ProcessorMusicPlay.hpp processors/object/ProcessorObjectActivate.hpp
processors/object/ProcessorObjectDelete.hpp processors/object/ProcessorObjectLock.hpp processors/object/ProcessorObjectAnimPlay.hpp processors/object/ProcessorObjectDelete.hpp
processors/object/ProcessorObjectMove.hpp processors/object/ProcessorObjectPlace.hpp processors/object/ProcessorObjectLock.hpp processors/object/ProcessorObjectMove.hpp
processors/object/ProcessorObjectRotate.hpp processors/object/ProcessorObjectScale.hpp processors/object/ProcessorObjectPlace.hpp processors/object/ProcessorObjectRotate.hpp
processors/object/ProcessorObjectSpawn.hpp processors/object/ProcessorObjectState.hpp processors/object/ProcessorObjectScale.hpp processors/object/ProcessorObjectSpawn.hpp
processors/object/ProcessorObjectTrap.hpp processors/object/ProcessorScriptLocalShort.hpp processors/object/ProcessorObjectState.hpp processors/object/ProcessorObjectTrap.hpp
processors/object/ProcessorScriptLocalFloat.hpp processors/object/ProcessorScriptMemberShort.hpp processors/object/ProcessorScriptLocalShort.hpp processors/object/ProcessorScriptLocalFloat.hpp
processors/object/ProcessorScriptMemberFloat.hpp processors/object/ProcessorScriptGlobalShort.hpp processors/object/ProcessorScriptMemberShort.hpp processors/object/ProcessorScriptMemberFloat.hpp
processors/object/ProcessorScriptGlobalFloat.hpp processors/object/ProcessorVideoPlay.hpp processors/object/ProcessorScriptGlobalShort.hpp processors/object/ProcessorScriptGlobalFloat.hpp
processors/object/ProcessorVideoPlay.hpp
) )
source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT}) source_group(tes3mp-server\\processors\\object FILES ${PROCESSORS_OBJECT})

@ -182,6 +182,7 @@ public:
{"OnCellDeletion", Function<void, const char*>()}, {"OnCellDeletion", Function<void, const char*>()},
{"OnContainer", Function<void, unsigned short, const char*>()}, {"OnContainer", Function<void, unsigned short, const char*>()},
{"OnDoorState", Function<void, unsigned short, const char*>()}, {"OnDoorState", Function<void, unsigned short, const char*>()},
{"OnObjectActivate", Function<void, unsigned short, const char*>()},
{"OnObjectPlace", Function<void, unsigned short, const char*>()}, {"OnObjectPlace", Function<void, unsigned short, const char*>()},
{"OnObjectState", Function<void, unsigned short, const char*>()}, {"OnObjectState", Function<void, unsigned short, const char*>()},
{"OnObjectSpawn", Function<void, unsigned short, const char*>()}, {"OnObjectSpawn", Function<void, unsigned short, const char*>()},

@ -56,6 +56,7 @@
#include "object/ProcessorContainer.hpp" #include "object/ProcessorContainer.hpp"
#include "object/ProcessorDoorState.hpp" #include "object/ProcessorDoorState.hpp"
#include "object/ProcessorMusicPlay.hpp" #include "object/ProcessorMusicPlay.hpp"
#include "object/ProcessorObjectActivate.hpp"
#include "object/ProcessorObjectAnimPlay.hpp" #include "object/ProcessorObjectAnimPlay.hpp"
#include "object/ProcessorObjectDelete.hpp" #include "object/ProcessorObjectDelete.hpp"
#include "object/ProcessorObjectPlace.hpp" #include "object/ProcessorObjectPlace.hpp"
@ -133,6 +134,7 @@ void ProcessorInitializer()
ObjectProcessor::AddProcessor(new ProcessorContainer()); ObjectProcessor::AddProcessor(new ProcessorContainer());
ObjectProcessor::AddProcessor(new ProcessorDoorState()); ObjectProcessor::AddProcessor(new ProcessorDoorState());
ObjectProcessor::AddProcessor(new ProcessorMusicPlay()); ObjectProcessor::AddProcessor(new ProcessorMusicPlay());
ObjectProcessor::AddProcessor(new ProcessorObjectActivate());
ObjectProcessor::AddProcessor(new ProcessorObjectAnimPlay()); ObjectProcessor::AddProcessor(new ProcessorObjectAnimPlay());
ObjectProcessor::AddProcessor(new ProcessorObjectDelete()); ObjectProcessor::AddProcessor(new ProcessorObjectDelete());
ObjectProcessor::AddProcessor(new ProcessorObjectLock()); ObjectProcessor::AddProcessor(new ProcessorObjectLock());

@ -0,0 +1,26 @@
#ifndef OPENMW_PROCESSOROBJECTACTIVATE_HPP
#define OPENMW_PROCESSOROBJECTACTIVATE_HPP
#include "../ObjectProcessor.hpp"
#include <apps/openmw-mp/Networking.hpp>
namespace mwmp
{
class ProcessorObjectActivate : public ObjectProcessor
{
public:
ProcessorObjectActivate()
{
BPP_INIT(ID_OBJECT_ACTIVATE)
}
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
Script::Call<Script::CallbackIdentity("OnObjectActivate")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}
#endif //OPENMW_PROCESSOROBJECTACTIVATE_HPP

@ -50,6 +50,7 @@
#include "object/ProcessorDoorDestination.hpp" #include "object/ProcessorDoorDestination.hpp"
#include "object/ProcessorDoorState.hpp" #include "object/ProcessorDoorState.hpp"
#include "object/ProcessorMusicPlay.hpp" #include "object/ProcessorMusicPlay.hpp"
#include "object/ProcessorObjectActivate.hpp"
#include "object/ProcessorObjectAnimPlay.hpp" #include "object/ProcessorObjectAnimPlay.hpp"
#include "object/ProcessorObjectAttach.hpp" #include "object/ProcessorObjectAttach.hpp"
#include "object/ProcessorObjectCollision.hpp" #include "object/ProcessorObjectCollision.hpp"
@ -147,6 +148,7 @@ void ProcessorInitializer()
ObjectProcessor::AddProcessor(new ProcessorDoorDestination()); ObjectProcessor::AddProcessor(new ProcessorDoorDestination());
ObjectProcessor::AddProcessor(new ProcessorDoorState()); ObjectProcessor::AddProcessor(new ProcessorDoorState());
ObjectProcessor::AddProcessor(new ProcessorMusicPlay()); ObjectProcessor::AddProcessor(new ProcessorMusicPlay());
ObjectProcessor::AddProcessor(new ProcessorObjectActivate());
ObjectProcessor::AddProcessor(new ProcessorObjectAnimPlay()); ObjectProcessor::AddProcessor(new ProcessorObjectAnimPlay());
ObjectProcessor::AddProcessor(new ProcessorObjectAttach()); ObjectProcessor::AddProcessor(new ProcessorObjectAttach());
ObjectProcessor::AddProcessor(new ProcessorObjectCollision()); ObjectProcessor::AddProcessor(new ProcessorObjectCollision());

@ -0,0 +1,26 @@
#ifndef OPENMW_PROCESSOROBJECTACTIVATE_HPP
#define OPENMW_PROCESSOROBJECTACTIVATE_HPP
#include "BaseObjectProcessor.hpp"
namespace mwmp
{
class ProcessorObjectActivate : public BaseObjectProcessor
{
public:
ProcessorObjectActivate()
{
BPP_INIT(ID_OBJECT_ACTIVATE)
}
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, objectList);
//objectList.activateObjects(ptrCellStore);
}
};
}
#endif //OPENMW_PROCESSOROBJECTACTIVATE_HPP

@ -191,11 +191,12 @@ add_component_dir (openmw-mp/Packets/Player
add_component_dir (openmw-mp/Packets/Object add_component_dir (openmw-mp/Packets/Object
ObjectPacket ObjectPacket
PacketConsoleCommand PacketContainer PacketObjectAnimPlay PacketObjectAttach PacketObjectCollision PacketConsoleCommand PacketContainer PacketObjectActivate PacketObjectAnimPlay PacketObjectAttach
PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace PacketObjectCollision PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock
PacketObjectReset PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap PacketObjectMove PacketObjectPlace PacketObjectReset PacketObjectRotate PacketObjectScale
PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort PacketObjectSpawn PacketObjectState PacketObjectTrap PacketMusicPlay PacketVideoPlay PacketScriptLocalShort
PacketScriptMemberFloat PacketScriptGlobalShort PacketScriptGlobalFloat PacketScriptLocalFloat PacketScriptMemberShort PacketScriptMemberFloat PacketScriptGlobalShort
PacketScriptGlobalFloat
) )
add_component_dir (openmw-mp/Packets/Worldstate add_component_dir (openmw-mp/Packets/Worldstate

@ -1,3 +1,4 @@
#include "../Packets/Object/PacketObjectActivate.hpp"
#include "../Packets/Object/PacketObjectAnimPlay.hpp" #include "../Packets/Object/PacketObjectAnimPlay.hpp"
#include "../Packets/Object/PacketObjectAttach.hpp" #include "../Packets/Object/PacketObjectAttach.hpp"
#include "../Packets/Object/PacketObjectCollision.hpp" #include "../Packets/Object/PacketObjectCollision.hpp"
@ -38,6 +39,7 @@ inline void AddPacket(mwmp::ObjectPacketController::packets_t *packets, RakNet::
mwmp::ObjectPacketController::ObjectPacketController(RakNet::RakPeerInterface *peer) mwmp::ObjectPacketController::ObjectPacketController(RakNet::RakPeerInterface *peer)
{ {
AddPacket<PacketObjectActivate>(&packets, peer);
AddPacket<PacketObjectAnimPlay>(&packets, peer); AddPacket<PacketObjectAnimPlay>(&packets, peer);
AddPacket<PacketObjectAttach>(&packets, peer); AddPacket<PacketObjectAttach>(&packets, peer);
AddPacket<PacketObjectCollision>(&packets, peer); AddPacket<PacketObjectCollision>(&packets, peer);

@ -73,6 +73,7 @@ enum GameMessages
ID_ACTOR_SPEECH, ID_ACTOR_SPEECH,
ID_ACTOR_STATS_DYNAMIC, ID_ACTOR_STATS_DYNAMIC,
ID_OBJECT_ACTIVATE,
ID_OBJECT_ANIM_PLAY, ID_OBJECT_ANIM_PLAY,
ID_OBJECT_ATTACH, ID_OBJECT_ATTACH,
ID_OBJECT_COLLISION, ID_OBJECT_COLLISION,

@ -0,0 +1,15 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectActivate.hpp"
using namespace mwmp;
PacketObjectActivate::PacketObjectActivate(RakNet::RakPeerInterface *peer) : ObjectPacket(peer)
{
packetID = ID_OBJECT_ACTIVATE;
hasCellData = true;
}
void PacketObjectActivate::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(baseObject, send);
}

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETOBJECTACTIVATE_HPP
#define OPENMW_PACKETOBJECTACTIVATE_HPP
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
namespace mwmp
{
class PacketObjectActivate : public ObjectPacket
{
public:
PacketObjectActivate(RakNet::RakPeerInterface *peer);
virtual void Object(BaseObject &baseObject, bool send);
};
}
#endif //OPENMW_PACKETOBJECTACTIVATE_HPP
Loading…
Cancel
Save