openmw-tes3coop/components/openmw-mp/Packets/Player/PacketPlayerTopic.cpp
2017-11-28 21:38:45 +08:00

27 lines
604 B
C++

#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);
uint32_t count;
if (send)
count = static_cast<uint32_t>(player->topicChanges.topics.size());
RW(count, send);
for (auto &&topic : player->topicChanges.topics)
{
RW(topic.topicId, send, true);
}
}