openmw-tes3coop/components/openmw-mp/Master/PacketMasterUpdate.cpp
2017-04-23 13:39:43 +08:00

34 lines
738 B
C++

//
// Created by koncord on 22.04.17.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketMasterUpdate.hpp"
#include "ProxyMasterPacket.hpp"
using namespace mwmp;
using namespace std;
using namespace RakNet;
PacketMasterUpdate::PacketMasterUpdate(RakNet::RakPeerInterface *peer) : BasePacket(peer)
{
packetID = ID_MASTER_UPDATE;
orderChannel = CHANNEL_MASTER;
}
void PacketMasterUpdate::Packet(RakNet::BitStream *bs, bool send)
{
this->bs = bs;
if (send)
bs->Write(packetID);
RW(server->first, send);
ProxyMasterPacket::addServer(this, server->second, send);
}
void PacketMasterUpdate::SetServer(std::pair<RakNet::SystemAddress, Server> *serverPair)
{
server = serverPair;
}