2017-05-24 16:01:28 +00:00
|
|
|
#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);
|
2017-11-28 13:37:46 +00:00
|
|
|
|
|
|
|
uint32_t count;
|
2017-05-24 18:43:34 +00:00
|
|
|
|
|
|
|
if (send)
|
2017-11-28 13:37:46 +00:00
|
|
|
count = static_cast<uint32_t>(player->topicChanges.topics.size());
|
2017-05-24 18:43:34 +00:00
|
|
|
|
2017-11-28 13:37:46 +00:00
|
|
|
RW(count, send);
|
2017-05-24 18:43:34 +00:00
|
|
|
|
2017-11-28 13:37:46 +00:00
|
|
|
for (auto &&topic : player->topicChanges.topics)
|
2017-05-24 18:43:34 +00:00
|
|
|
{
|
2017-11-28 13:37:46 +00:00
|
|
|
RW(topic.topicId, send, true);
|
2017-05-24 18:43:34 +00:00
|
|
|
}
|
2017-05-24 16:01:28 +00:00
|
|
|
}
|