1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 18:49:54 +00:00
openmw-tes3mp/components/openmw-mp/Master/PacketMasterUpdate.cpp
Koncord 9643eb6026 [Master] Notify server about announce state
Rename structure Server to QueryData
2017-04-24 19:58:48 +08:00

34 lines
741 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, QueryData> *serverPair)
{
server = serverPair;
}