[General] Add placeholders for PlayerTopic & ObjectTrap packets

0.6.1
David Cernat 8 years ago
parent b1264cca92
commit 08de349133

@ -123,7 +123,7 @@ set(PROCESSORS_PLAYER
processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerLevel.hpp processors/player/ProcessorPlayerJournal.hpp processors/player/ProcessorPlayerLevel.hpp
processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerResurrect.hpp processors/player/ProcessorPlayerPosition.hpp processors/player/ProcessorPlayerResurrect.hpp
processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpellbook.hpp processors/player/ProcessorPlayerSkill.hpp processors/player/ProcessorPlayerSpellbook.hpp
processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerStatsDynamic.hpp processors/player/ProcessorPlayerTopic.hpp
) )
source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER}) source_group(tes3mp-server\\processors\\player FILES ${PROCESSORS_PLAYER})
@ -134,9 +134,9 @@ set(PROCESSORS_WORLD
processors/world/ProcessorObjectDelete.hpp processors/world/ProcessorObjectLock.hpp processors/world/ProcessorObjectDelete.hpp processors/world/ProcessorObjectLock.hpp
processors/world/ProcessorObjectMove.hpp processors/world/ProcessorObjectPlace.hpp processors/world/ProcessorObjectMove.hpp processors/world/ProcessorObjectPlace.hpp
processors/world/ProcessorObjectRotate.hpp processors/world/ProcessorObjectScale.hpp processors/world/ProcessorObjectRotate.hpp processors/world/ProcessorObjectScale.hpp
processors/world/ProcessorScriptGlobalShort.hpp processors/world/ProcessorScriptLocalFloat.hpp processors/world/ProcessorObjectTrap.hpp processors/world/ProcessorScriptLocalShort.hpp
processors/world/ProcessorScriptLocalShort.hpp processors/world/ProcessorScriptMemberShort.hpp processors/world/ProcessorScriptLocalFloat.hpp processors/world/ProcessorScriptMemberShort.hpp
processors/world/ProcessorVideoPlay.hpp processors/world/ProcessorScriptGlobalShort.hpp processors/world/ProcessorVideoPlay.hpp
) )
source_group(tes3mp-server\\processors\\world FILES ${PROCESSORS_WORLD}) source_group(tes3mp-server\\processors\\world FILES ${PROCESSORS_WORLD})

@ -29,6 +29,7 @@
#include "processors/player/ProcessorPlayerSkill.hpp" #include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp" #include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp" #include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "processors/player/ProcessorPlayerTopic.hpp"
#include "ActorProcessor.hpp" #include "ActorProcessor.hpp"
#include "processors/actor/ProcessorActorList.hpp" #include "processors/actor/ProcessorActorList.hpp"
#include "processors/actor/ProcessorActorAuthority.hpp" #include "processors/actor/ProcessorActorAuthority.hpp"
@ -52,6 +53,7 @@
#include "processors/world/ProcessorObjectMove.hpp" #include "processors/world/ProcessorObjectMove.hpp"
#include "processors/world/ProcessorObjectRotate.hpp" #include "processors/world/ProcessorObjectRotate.hpp"
#include "processors/world/ProcessorObjectScale.hpp" #include "processors/world/ProcessorObjectScale.hpp"
#include "processors/world/ProcessorObjectTrap.hpp"
#include "processors/world/ProcessorScriptLocalShort.hpp" #include "processors/world/ProcessorScriptLocalShort.hpp"
#include "processors/world/ProcessorScriptLocalFloat.hpp" #include "processors/world/ProcessorScriptLocalFloat.hpp"
#include "processors/world/ProcessorScriptMemberShort.hpp" #include "processors/world/ProcessorScriptMemberShort.hpp"
@ -84,6 +86,7 @@ void ProcessorInitializer()
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill()); PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook()); PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic()); PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
PlayerProcessor::AddProcessor(new ProcessorPlayerTopic());
ActorProcessor::AddProcessor(new ProcessorActorList()); ActorProcessor::AddProcessor(new ProcessorActorList());
ActorProcessor::AddProcessor(new ProcessorActorAuthority()); ActorProcessor::AddProcessor(new ProcessorActorAuthority());
@ -107,6 +110,7 @@ void ProcessorInitializer()
WorldProcessor::AddProcessor(new ProcessorObjectPlace()); WorldProcessor::AddProcessor(new ProcessorObjectPlace());
WorldProcessor::AddProcessor(new ProcessorObjectRotate()); WorldProcessor::AddProcessor(new ProcessorObjectRotate());
WorldProcessor::AddProcessor(new ProcessorObjectScale()); WorldProcessor::AddProcessor(new ProcessorObjectScale());
WorldProcessor::AddProcessor(new ProcessorObjectTrap());
WorldProcessor::AddProcessor(new ProcessorScriptLocalShort()); WorldProcessor::AddProcessor(new ProcessorScriptLocalShort());
WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat()); WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat());
WorldProcessor::AddProcessor(new ProcessorScriptMemberShort()); WorldProcessor::AddProcessor(new ProcessorScriptMemberShort());

@ -131,18 +131,20 @@ public:
{"OnPlayerJournal", Function<void, unsigned short>()}, {"OnPlayerJournal", Function<void, unsigned short>()},
{"OnPlayerFaction", Function<void, unsigned short>()}, {"OnPlayerFaction", Function<void, unsigned short>()},
{"OnPlayerSpellbook", Function<void, unsigned short>()}, {"OnPlayerSpellbook", Function<void, unsigned short>()},
{"OnPlayerTopic", Function<void, unsigned short>()},
{"OnCellLoad", Function<void, unsigned short, const char*>()}, {"OnCellLoad", Function<void, unsigned short, const char*>()},
{"OnCellUnload", Function<void, unsigned short, const char*>()}, {"OnCellUnload", Function<void, unsigned short, const char*>()},
{"OnCellDeletion", Function<void, const char*>()}, {"OnCellDeletion", Function<void, const char*>()},
{"OnContainer", Function<void, unsigned short, const char*>()},
{"OnDoorState", Function<void, unsigned short, const char*>()},
{"OnObjectDelete", Function<void, unsigned short, const char*>()},
{"OnObjectLock", Function<void, unsigned short, const char*>()},
{"OnObjectPlace", Function<void, unsigned short, const char*>()},
{"OnObjectScale", Function<void, unsigned short, const char*>()},
{"OnObjectTrap", Function<void, unsigned short, const char*>()},
{"OnActorList", Function<void, unsigned short, const char*>()}, {"OnActorList", Function<void, unsigned short, const char*>()},
{"OnActorCellChange", Function<void, unsigned short, const char*>()}, {"OnActorCellChange", Function<void, unsigned short, const char*>()},
{"OnActorTest", Function<void, unsigned short, const char*>()}, {"OnActorTest", Function<void, unsigned short, const char*>()},
{"OnObjectPlace", Function<void, unsigned short, const char*>()},
{"OnObjectDelete", Function<void, unsigned short, const char*>()},
{"OnObjectScale", Function<void, unsigned short, const char*>()},
{"OnObjectLock", Function<void, unsigned short, const char*>()},
{"OnDoorState", Function<void, unsigned short, const char*>()},
{"OnContainer", Function<void, unsigned short, const char*>()},
{"OnPlayerSendMessage", Function<bool, unsigned short, const char*>()}, {"OnPlayerSendMessage", Function<bool, unsigned short, const char*>()},
{"OnPlayerEndCharGen", Function<void, unsigned short>()}, {"OnPlayerEndCharGen", Function<void, unsigned short>()},
{"OnGUIAction", Function<void, unsigned short, int, const char*>()}, {"OnGUIAction", Function<void, unsigned short, int, const char*>()},

@ -0,0 +1,28 @@
#ifndef OPENMW_PROCESSORPLAYERTOPIC_HPP
#define OPENMW_PROCESSORPLAYERTOPIC_HPP
#include "apps/openmw-mp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerTopic : public PlayerProcessor
{
public:
ProcessorPlayerTopic()
{
BPP_INIT(ID_PLAYER_TOPIC)
}
void Do(PlayerPacket &packet, Player &player) override
{
DEBUG_PRINTF(strPacketID.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnPlayerTopic")>(player.getId());
}
};
}
#endif //OPENMW_PROCESSORPLAYERTOPIC_HPP

@ -0,0 +1,27 @@
#ifndef OPENMW_PROCESSOROBJECTTRAP_HPP
#define OPENMW_PROCESSOROBJECTTRAP_HPP
#include "apps/openmw-mp/WorldProcessor.hpp"
namespace mwmp
{
class ProcessorObjectTrap : public WorldProcessor
{
public:
ProcessorObjectTrap()
{
BPP_INIT(ID_OBJECT_TRAP)
}
void Do(WorldPacket &packet, Player &player, BaseEvent &event) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectTrap")>(player.getId(), event.cell.getDescription().c_str());
}
};
}
#endif //OPENMW_PROCESSOROBJECTTRAP_HPP

@ -111,12 +111,12 @@ add_openmw_dir (mwmp\\processors\\player ProcessorChatMessage ProcessorGameConso
ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState ProcessorPlayerAttack ProcessorPlayerAttribute ProcessorPlayerBounty ProcessorPlayerCellChange ProcessorPlayerCellState
ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerEquipment ProcessorPlayerFaction ProcessorPlayerCharClass ProcessorPlayerCharGen ProcessorPlayerDeath ProcessorPlayerEquipment ProcessorPlayerFaction
ProcessorPlayerInventory ProcessorPlayerJournal ProcessorPlayerLevel ProcessorPlayerPosition ProcessorPlayerResurrect ProcessorPlayerInventory ProcessorPlayerJournal ProcessorPlayerLevel ProcessorPlayerPosition ProcessorPlayerResurrect
ProcessorPlayerSkill ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerSkill ProcessorPlayerSpellbook ProcessorPlayerStatsDynamic ProcessorPlayerTopic
) )
add_openmw_dir (mwmp\\processors\\world BaseObjectProcessor ProcessorContainer ProcessorDoorState ProcessorMusicPlay add_openmw_dir (mwmp\\processors\\world BaseObjectProcessor ProcessorContainer ProcessorDoorState ProcessorMusicPlay
ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectAnimPlay ProcessorObjectDelete ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace
ProcessorObjectRotate ProcessorObjectScale ProcessorScriptGlobalShort ProcessorScriptLocalFloat ProcessorObjectRotate ProcessorObjectScale ProcessorObjectTrap ProcessorScriptGlobalShort ProcessorScriptLocalFloat
ProcessorScriptLocalShort ProcessorScriptMemberShort ProcessorVideoPlay ProcessorScriptLocalShort ProcessorScriptMemberShort ProcessorVideoPlay
) )

@ -33,6 +33,7 @@
#include "processors/player/ProcessorPlayerSkill.hpp" #include "processors/player/ProcessorPlayerSkill.hpp"
#include "processors/player/ProcessorPlayerSpellbook.hpp" #include "processors/player/ProcessorPlayerSpellbook.hpp"
#include "processors/player/ProcessorPlayerStatsDynamic.hpp" #include "processors/player/ProcessorPlayerStatsDynamic.hpp"
#include "processors/player/ProcessorPlayerTopic.hpp"
#include "WorldProcessor.hpp" #include "WorldProcessor.hpp"
#include "processors/world/ProcessorContainer.hpp" #include "processors/world/ProcessorContainer.hpp"
@ -45,6 +46,7 @@
#include "processors/world/ProcessorObjectPlace.hpp" #include "processors/world/ProcessorObjectPlace.hpp"
#include "processors/world/ProcessorObjectRotate.hpp" #include "processors/world/ProcessorObjectRotate.hpp"
#include "processors/world/ProcessorObjectScale.hpp" #include "processors/world/ProcessorObjectScale.hpp"
#include "processors/world/ProcessorObjectTrap.hpp"
#include "processors/world/ProcessorScriptLocalShort.hpp" #include "processors/world/ProcessorScriptLocalShort.hpp"
#include "processors/world/ProcessorScriptLocalFloat.hpp" #include "processors/world/ProcessorScriptLocalFloat.hpp"
#include "processors/world/ProcessorScriptMemberShort.hpp" #include "processors/world/ProcessorScriptMemberShort.hpp"
@ -94,6 +96,7 @@ void ProcessorInitializer()
PlayerProcessor::AddProcessor(new ProcessorPlayerSkill()); PlayerProcessor::AddProcessor(new ProcessorPlayerSkill());
PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook()); PlayerProcessor::AddProcessor(new ProcessorPlayerSpellbook());
PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic()); PlayerProcessor::AddProcessor(new ProcessorPlayerStatsDynamic());
PlayerProcessor::AddProcessor(new ProcessorPlayerTopic());
WorldProcessor::AddProcessor(new ProcessorContainer()); WorldProcessor::AddProcessor(new ProcessorContainer());
WorldProcessor::AddProcessor(new ProcessorDoorState()); WorldProcessor::AddProcessor(new ProcessorDoorState());
@ -105,6 +108,7 @@ void ProcessorInitializer()
WorldProcessor::AddProcessor(new ProcessorObjectPlace()); WorldProcessor::AddProcessor(new ProcessorObjectPlace());
WorldProcessor::AddProcessor(new ProcessorObjectRotate()); WorldProcessor::AddProcessor(new ProcessorObjectRotate());
WorldProcessor::AddProcessor(new ProcessorObjectScale()); WorldProcessor::AddProcessor(new ProcessorObjectScale());
WorldProcessor::AddProcessor(new ProcessorObjectTrap());
WorldProcessor::AddProcessor(new ProcessorScriptLocalShort()); WorldProcessor::AddProcessor(new ProcessorScriptLocalShort());
WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat()); WorldProcessor::AddProcessor(new ProcessorScriptLocalFloat());
WorldProcessor::AddProcessor(new ProcessorScriptMemberShort()); WorldProcessor::AddProcessor(new ProcessorScriptMemberShort());

@ -0,0 +1,30 @@
#ifndef OPENMW_PROCESSORPLAYERTOPIC_HPP
#define OPENMW_PROCESSORPLAYERTOPIC_HPP
#include "apps/openmw/mwmp/PlayerProcessor.hpp"
namespace mwmp
{
class ProcessorPlayerTopic : public PlayerProcessor
{
public:
ProcessorPlayerTopic()
{
BPP_INIT(ID_PLAYER_TOPIC)
}
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
if (isRequest())
{
// Entire list of topics cannot currently be requested from players
}
//else
//static_cast<LocalPlayer*>(player)->addTopics();
}
};
}
#endif //OPENMW_PROCESSORPLAYERTOPIC_HPP

@ -0,0 +1,26 @@
#ifndef OPENMW_PROCESSOROBJECTTRAP_HPP
#define OPENMW_PROCESSOROBJECTTRAP_HPP
#include "BaseObjectProcessor.hpp"
namespace mwmp
{
class ProcessorObjectTrap : public BaseObjectProcessor
{
public:
ProcessorObjectTrap()
{
BPP_INIT(ID_OBJECT_TRAP)
}
virtual void Do(WorldPacket &packet, WorldEvent &event)
{
BaseObjectProcessor::Do(packet, event);
//event.setObjectTraps(ptrCellStore);
}
};
}
#endif //OPENMW_PROCESSOROBJECTTRAP_HPP

@ -179,13 +179,13 @@ add_component_dir (openmw-mp\\Packets\\Player
PacketPlayerAttribute PacketPlayerBounty PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass PacketPlayerAttribute PacketPlayerBounty PacketPlayerCellChange PacketPlayerCellState PacketPlayerClass
PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction PacketPlayerInventory PacketPlayerJournal PacketPlayerLevel PacketPlayerDeath PacketPlayerEquipment PacketPlayerFaction PacketPlayerInventory PacketPlayerJournal PacketPlayerLevel
PacketPlayerPosition PacketPlayerResurrect PacketPlayerSkill PacketPlayerSpellbook PacketPlayerStatsDynamic PacketPlayerPosition PacketPlayerResurrect PacketPlayerSkill PacketPlayerSpellbook PacketPlayerStatsDynamic
PacketPlayerActiveSkills PacketGUIBoxes PacketTime PacketPlayerTopic PacketPlayerActiveSkills PacketGUIBoxes PacketTime
) )
add_component_dir (openmw-mp\\Packets\\World add_component_dir (openmw-mp\\Packets\\World
WorldPacket WorldPacket
PacketObjectDelete PacketObjectPlace PacketObjectScale PacketObjectLock PacketObjectMove PacketObjectRotate PacketContainer PacketObjectAnimPlay PacketObjectDelete PacketDoorState PacketObjectLock PacketObjectMove PacketObjectPlace
PacketObjectAnimPlay PacketContainer PacketDoorState PacketMusicPlay PacketVideoPlay PacketScriptLocalShort PacketObjectRotate PacketObjectScale PacketObjectTrap PacketMusicPlay PacketVideoPlay PacketScriptLocalShort
PacketScriptLocalFloat PacketScriptMemberShort PacketScriptGlobalShort PacketScriptLocalFloat PacketScriptMemberShort PacketScriptGlobalShort
) )

@ -31,6 +31,7 @@
#include "../Packets/Player/PacketPlayerSkill.hpp" #include "../Packets/Player/PacketPlayerSkill.hpp"
#include "../Packets/Player/PacketPlayerSpellbook.hpp" #include "../Packets/Player/PacketPlayerSpellbook.hpp"
#include "../Packets/Player/PacketPlayerStatsDynamic.hpp" #include "../Packets/Player/PacketPlayerStatsDynamic.hpp"
#include "../Packets/Player/PacketPlayerTopic.hpp"
#include "PlayerPacketController.hpp" #include "PlayerPacketController.hpp"
@ -74,6 +75,7 @@ mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *p
AddPacket<PacketPlayerSkill>(&packets, peer); AddPacket<PacketPlayerSkill>(&packets, peer);
AddPacket<PacketPlayerSpellbook>(&packets, peer); AddPacket<PacketPlayerSpellbook>(&packets, peer);
AddPacket<PacketPlayerStatsDynamic>(&packets, peer); AddPacket<PacketPlayerStatsDynamic>(&packets, peer);
AddPacket<PacketPlayerTopic>(&packets, peer);
} }

@ -2,13 +2,14 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include "../Packets/World/PacketObjectAnimPlay.hpp"
#include "../Packets/World/PacketObjectDelete.hpp" #include "../Packets/World/PacketObjectDelete.hpp"
#include "../Packets/World/PacketObjectPlace.hpp"
#include "../Packets/World/PacketObjectScale.hpp"
#include "../Packets/World/PacketObjectLock.hpp" #include "../Packets/World/PacketObjectLock.hpp"
#include "../Packets/World/PacketObjectMove.hpp" #include "../Packets/World/PacketObjectMove.hpp"
#include "../Packets/World/PacketObjectPlace.hpp"
#include "../Packets/World/PacketObjectRotate.hpp" #include "../Packets/World/PacketObjectRotate.hpp"
#include "../Packets/World/PacketObjectAnimPlay.hpp" #include "../Packets/World/PacketObjectScale.hpp"
#include "../Packets/World/PacketObjectTrap.hpp"
#include "../Packets/World/PacketContainer.hpp" #include "../Packets/World/PacketContainer.hpp"
#include "../Packets/World/PacketDoorState.hpp" #include "../Packets/World/PacketDoorState.hpp"
@ -32,14 +33,15 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R
mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer) mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer)
{ {
AddPacket<PacketObjectAnimPlay>(&packets, peer);
AddPacket<PacketObjectDelete>(&packets, peer); AddPacket<PacketObjectDelete>(&packets, peer);
AddPacket<PacketObjectPlace>(&packets, peer);
AddPacket<PacketObjectScale>(&packets, peer);
AddPacket<PacketObjectLock>(&packets, peer); AddPacket<PacketObjectLock>(&packets, peer);
AddPacket<PacketObjectMove>(&packets, peer); AddPacket<PacketObjectMove>(&packets, peer);
AddPacket<PacketObjectPlace>(&packets, peer);
AddPacket<PacketObjectRotate>(&packets, peer); AddPacket<PacketObjectRotate>(&packets, peer);
AddPacket<PacketObjectAnimPlay>(&packets, peer); AddPacket<PacketObjectScale>(&packets, peer);
AddPacket<PacketObjectTrap>(&packets, peer);
AddPacket<PacketContainer>(&packets, peer); AddPacket<PacketContainer>(&packets, peer);
AddPacket<PacketDoorState>(&packets, peer); AddPacket<PacketDoorState>(&packets, peer);
AddPacket<PacketMusicPlay>(&packets, peer); AddPacket<PacketMusicPlay>(&packets, peer);

@ -40,6 +40,7 @@ enum GameMessages
ID_PLAYER_SKILL, ID_PLAYER_SKILL,
ID_PLAYER_SPELLBOOK, ID_PLAYER_SPELLBOOK,
ID_PLAYER_STATS_DYNAMIC, ID_PLAYER_STATS_DYNAMIC,
ID_PLAYER_TOPIC,
ID_ACTOR_LIST, ID_ACTOR_LIST,
ID_ACTOR_AUTHORITY, ID_ACTOR_AUTHORITY,
@ -53,14 +54,15 @@ enum GameMessages
ID_ACTOR_SPEECH, ID_ACTOR_SPEECH,
ID_ACTOR_STATS_DYNAMIC, ID_ACTOR_STATS_DYNAMIC,
ID_OBJECT_PLACE, ID_OBJECT_ANIM_PLAY,
ID_OBJECT_DELETE, ID_OBJECT_DELETE,
ID_OBJECT_SCALE,
ID_OBJECT_LOCK, ID_OBJECT_LOCK,
ID_OBJECT_MOVE, ID_OBJECT_MOVE,
ID_OBJECT_PLACE,
ID_OBJECT_ROTATE, ID_OBJECT_ROTATE,
ID_OBJECT_ANIM_PLAY, ID_OBJECT_SCALE,
ID_OBJECT_TRAP,
ID_CONTAINER, ID_CONTAINER,
ID_DOOR_STATE, ID_DOOR_STATE,
ID_MUSIC_PLAY, ID_MUSIC_PLAY,

@ -0,0 +1,15 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketPlayerTopic.hpp"
using namespace std;
using namespace mwmp;
PacketPlayerTopic::PacketPlayerTopic(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_TOPIC;
}
void PacketPlayerTopic::Packet(RakNet::BitStream *bs, bool send)
{
PlayerPacket::Packet(bs, send);
}

@ -0,0 +1,18 @@
#ifndef OPENMW_PACKETPLAYERTOPIC_HPP
#define OPENMW_PACKETPLAYERTOPIC_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerTopic : public PlayerPacket
{
public:
PacketPlayerTopic(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send);
};
}
#endif //OPENMW_PACKETPLAYERTOPIC_HPP

@ -0,0 +1,45 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketObjectTrap.hpp"
using namespace mwmp;
PacketObjectTrap::PacketObjectTrap(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_OBJECT_TRAP;
}
void PacketObjectTrap::Packet(RakNet::BitStream *bs, bool send)
{
WorldPacket::Packet(bs, send);
if (!send)
event->worldObjects.clear();
else
event->worldObjectCount = (unsigned int)(event->worldObjects.size());
RW(event->worldObjectCount, send);
RW(event->cell.mData.mFlags, send);
RW(event->cell.mData.mX, send);
RW(event->cell.mData.mY, send);
RW(event->cell.mName, send);
WorldObject worldObject;
for (unsigned int i = 0; i < event->worldObjectCount; i++)
{
if (send)
{
worldObject = event->worldObjects.at(i);
}
RW(worldObject.refId, send);
RW(worldObject.refNumIndex, send);
RW(worldObject.mpNum, send);
if (!send)
{
event->worldObjects.push_back(worldObject);
}
}
}

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETOBJECTTRAP_HPP
#define OPENMW_PACKETOBJECTTRAP_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
namespace mwmp
{
class PacketObjectTrap : public WorldPacket
{
public:
PacketObjectTrap(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, bool send);
};
}
#endif //OPENMW_PACKETOBJECTTRAP_HPP
Loading…
Cancel
Save