forked from mirror/openmw-tes3mp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
852 B
C++
34 lines
852 B
C++
8 years ago
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
||
7 years ago
|
#include "PacketWorldKillCount.hpp"
|
||
8 years ago
|
|
||
7 years ago
|
mwmp::PacketWorldKillCount::PacketWorldKillCount(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
||
8 years ago
|
{
|
||
7 years ago
|
packetID = ID_WORLD_KILL_COUNT;
|
||
8 years ago
|
}
|
||
|
|
||
7 years ago
|
void mwmp::PacketWorldKillCount::Packet(RakNet::BitStream *bs, bool send)
|
||
8 years ago
|
{
|
||
|
PlayerPacket::Packet(bs, send);
|
||
|
|
||
8 years ago
|
if (send)
|
||
|
player->killChanges.count = (unsigned int)(player->killChanges.kills.size());
|
||
|
else
|
||
|
player->killChanges.kills.clear();
|
||
|
|
||
|
RW(player->killChanges.count, send);
|
||
|
|
||
|
for (unsigned int i = 0; i < player->killChanges.count; i++)
|
||
|
{
|
||
|
Kill kill;
|
||
|
|
||
|
if (send)
|
||
|
kill = player->killChanges.kills.at(i);
|
||
|
|
||
7 years ago
|
RW(kill.refId, send, true);
|
||
8 years ago
|
RW(kill.number, send);
|
||
|
|
||
|
if (!send)
|
||
|
player->killChanges.kills.push_back(kill);
|
||
|
}
|
||
8 years ago
|
}
|