forked from mirror/openmw-tes3mp
[General] Remove ObjectUnlock packet, use ObjectLock with 0 lock instead
parent
48ee8fd536
commit
870fd9a78b
@ -1,31 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
{
|
||||
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("OnObjectUnlock")>(player.getId(), event.cell.getDescription().c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
@ -1,30 +0,0 @@
|
||||
//
|
||||
// Created by koncord on 18.04.17.
|
||||
//
|
||||
|
||||
#ifndef OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
||||
#define OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
||||
|
||||
|
||||
#include "BaseObjectProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorObjectUnlock : public BaseObjectProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorObjectUnlock()
|
||||
{
|
||||
BPP_INIT(ID_OBJECT_UNLOCK)
|
||||
}
|
||||
|
||||
virtual void Do(WorldPacket &packet, WorldEvent &event)
|
||||
{
|
||||
BaseObjectProcessor::Do(packet, event);
|
||||
|
||||
event.unlockObjects(ptrCellStore);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSOROBJECTUNLOCK_HPP
|
@ -1,45 +0,0 @@
|
||||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include "PacketObjectUnlock.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketObjectUnlock::PacketObjectUnlock(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
|
||||
{
|
||||
packetID = ID_OBJECT_UNLOCK;
|
||||
}
|
||||
|
||||
void PacketObjectUnlock::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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#ifndef OPENMW_PACKETOBJECTUNLOCK_HPP
|
||||
#define OPENMW_PACKETOBJECTUNLOCK_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketObjectUnlock : public WorldPacket
|
||||
{
|
||||
public:
|
||||
PacketObjectUnlock(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETOBJECTUNLOCK_HPP
|
Loading…
Reference in New Issue