mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Add and implement ID_OBJECT_ROTATE
This commit is contained in:
parent
54ed9a7ab4
commit
385b5f39e3
7 changed files with 85 additions and 0 deletions
|
@ -478,6 +478,23 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ID_OBJECT_ROTATE:
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE from %s",
|
||||||
|
player->Npc()->mName.c_str());
|
||||||
|
|
||||||
|
myPacket->Read(event);
|
||||||
|
|
||||||
|
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||||
|
event->cellRef.mRefID.c_str(),
|
||||||
|
event->cellRef.mRefNum.mIndex,
|
||||||
|
event->cell.getDescription().c_str());
|
||||||
|
|
||||||
|
myPacket->Send(event, true);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ID_CONTAINER_ADD:
|
case ID_CONTAINER_ADD:
|
||||||
{
|
{
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER_ADD from %s",
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONTAINER_ADD from %s",
|
||||||
|
|
|
@ -814,6 +814,27 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ID_OBJECT_ROTATE:
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_ROTATE");
|
||||||
|
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||||
|
event->cellRef.mRefID.c_str(),
|
||||||
|
event->cellRef.mRefNum.mIndex,
|
||||||
|
event->cell.getDescription().c_str());
|
||||||
|
|
||||||
|
MWWorld::Ptr ptrFound = ptrCellStore->searchByRefNum(event->cellRef.mRefNum);
|
||||||
|
|
||||||
|
if (ptrFound)
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Found %s, %i",
|
||||||
|
ptrFound.getCellRef().getRefId().c_str(),
|
||||||
|
ptrFound.getCellRef().getRefNum());
|
||||||
|
|
||||||
|
MWBase::Environment::get().getWorld()->rotateObject(ptrFound, event->pos.rot[0], event->pos.rot[1], event->pos.rot[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ID_DOOR_ACTIVATE:
|
case ID_DOOR_ACTIVATE:
|
||||||
{
|
{
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_DOOR_ACTIVATE");
|
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_DOOR_ACTIVATE");
|
||||||
|
|
|
@ -159,6 +159,7 @@ add_component_dir (openmw-mp
|
||||||
|
|
||||||
Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectLock
|
Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectLock
|
||||||
Packets/World/PacketObjectUnlock Packets/World/PacketObjectScale Packets/World/PacketObjectMove
|
Packets/World/PacketObjectUnlock Packets/World/PacketObjectScale Packets/World/PacketObjectMove
|
||||||
|
Packets/World/PacketObjectRotate
|
||||||
|
|
||||||
Packets/World/PacketContainerAdd Packets/World/PacketContainerRemove Packets/World/PacketDoorActivate
|
Packets/World/PacketContainerAdd Packets/World/PacketContainerRemove Packets/World/PacketDoorActivate
|
||||||
Packets/World/PacketVideoPlay)
|
Packets/World/PacketVideoPlay)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "../Packets/World/PacketObjectUnlock.hpp"
|
#include "../Packets/World/PacketObjectUnlock.hpp"
|
||||||
#include "../Packets/World/PacketObjectScale.hpp"
|
#include "../Packets/World/PacketObjectScale.hpp"
|
||||||
#include "../Packets/World/PacketObjectMove.hpp"
|
#include "../Packets/World/PacketObjectMove.hpp"
|
||||||
|
#include "../Packets/World/PacketObjectRotate.hpp"
|
||||||
|
|
||||||
#include "../Packets/World/PacketContainerAdd.hpp"
|
#include "../Packets/World/PacketContainerAdd.hpp"
|
||||||
#include "../Packets/World/PacketContainerRemove.hpp"
|
#include "../Packets/World/PacketContainerRemove.hpp"
|
||||||
|
@ -32,6 +33,7 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee
|
||||||
AddPacket<PacketObjectUnlock>(&packets, peer);
|
AddPacket<PacketObjectUnlock>(&packets, peer);
|
||||||
AddPacket<PacketObjectScale>(&packets, peer);
|
AddPacket<PacketObjectScale>(&packets, peer);
|
||||||
AddPacket<PacketObjectMove>(&packets, peer);
|
AddPacket<PacketObjectMove>(&packets, peer);
|
||||||
|
AddPacket<PacketObjectRotate>(&packets, peer);
|
||||||
|
|
||||||
AddPacket<PacketContainerAdd>(&packets, peer);
|
AddPacket<PacketContainerAdd>(&packets, peer);
|
||||||
AddPacket<PacketContainerRemove>(&packets, peer);
|
AddPacket<PacketContainerRemove>(&packets, peer);
|
||||||
|
|
|
@ -39,6 +39,7 @@ enum GameMessages
|
||||||
ID_OBJECT_UNLOCK,
|
ID_OBJECT_UNLOCK,
|
||||||
ID_OBJECT_SCALE,
|
ID_OBJECT_SCALE,
|
||||||
ID_OBJECT_MOVE,
|
ID_OBJECT_MOVE,
|
||||||
|
ID_OBJECT_ROTATE,
|
||||||
|
|
||||||
ID_CONTAINER_ADD,
|
ID_CONTAINER_ADD,
|
||||||
ID_CONTAINER_REMOVE,
|
ID_CONTAINER_REMOVE,
|
||||||
|
|
26
components/openmw-mp/Packets/World/PacketObjectRotate.cpp
Normal file
26
components/openmw-mp/Packets/World/PacketObjectRotate.cpp
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||||
|
#include "PacketObjectRotate.hpp"
|
||||||
|
|
||||||
|
using namespace mwmp;
|
||||||
|
|
||||||
|
PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||||
|
{
|
||||||
|
packetID = ID_OBJECT_ROTATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PacketObjectRotate::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send)
|
||||||
|
{
|
||||||
|
WorldPacket::Packet(bs, event, send);
|
||||||
|
|
||||||
|
RW(event->cellRef.mRefID, send);
|
||||||
|
RW(event->cellRef.mRefNum.mIndex, send);
|
||||||
|
|
||||||
|
RW(event->cell.mData.mFlags, send);
|
||||||
|
RW(event->cell.mData.mX, send);
|
||||||
|
RW(event->cell.mData.mY, send);
|
||||||
|
RW(event->cell.mName, send);
|
||||||
|
|
||||||
|
RW(event->pos.rot[0], send);
|
||||||
|
RW(event->pos.rot[1], send);
|
||||||
|
RW(event->pos.rot[2], send);
|
||||||
|
}
|
17
components/openmw-mp/Packets/World/PacketObjectRotate.hpp
Normal file
17
components/openmw-mp/Packets/World/PacketObjectRotate.hpp
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#ifndef OPENMW_PACKETOBJECTROTATE_HPP
|
||||||
|
#define OPENMW_PACKETOBJECTROTATE_HPP
|
||||||
|
|
||||||
|
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||||
|
|
||||||
|
namespace mwmp
|
||||||
|
{
|
||||||
|
class PacketObjectRotate : public WorldPacket
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PacketObjectRotate(RakNet::RakPeerInterface *peer);
|
||||||
|
|
||||||
|
virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OPENMW_PACKETOBJECTROTATE_HPP
|
Loading…
Reference in a new issue