1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-22 11:23:51 +00:00
openmw-tes3mp/components/openmw-mp/Packets/World/PacketConsoleCommand.cpp

28 lines
666 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketConsoleCommand.hpp"
using namespace mwmp;
PacketConsoleCommand::PacketConsoleCommand(RakNet::RakPeerInterface *peer) : WorldPacket(peer)
{
packetID = ID_CONSOLE_COMMAND;
}
void PacketConsoleCommand::Packet(RakNet::BitStream *bs, bool send)
{
if (!PacketHeader(bs, send))
return;
RW(event->consoleCommand, send);
WorldObject worldObject;
for (auto &&worldObject : event->worldObjects)
{
RW(worldObject.isPlayer, send);
if (worldObject.isPlayer)
RW(worldObject.guid, send);
else
Object(worldObject, send);
}
}