2017-04-23 05:36:47 +00:00
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
#include "PacketMasterAnnounce.hpp"
|
|
|
|
#include "ProxyMasterPacket.hpp"
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
using namespace RakNet;
|
|
|
|
|
|
|
|
PacketMasterAnnounce::PacketMasterAnnounce(RakNet::RakPeerInterface *peer) : BasePacket(peer)
|
|
|
|
{
|
|
|
|
packetID = ID_MASTER_ANNOUNCE;
|
|
|
|
orderChannel = CHANNEL_MASTER;
|
2017-07-31 10:58:51 +00:00
|
|
|
reliability = RELIABLE_ORDERED_WITH_ACK_RECEIPT;
|
2017-04-23 05:36:47 +00:00
|
|
|
}
|
|
|
|
|
2019-12-04 08:17:33 +00:00
|
|
|
void PacketMasterAnnounce::Packet(BitStream *newBitstream, bool send)
|
2017-04-23 05:36:47 +00:00
|
|
|
{
|
2019-12-04 08:17:33 +00:00
|
|
|
bs = newBitstream;
|
2017-04-23 05:36:47 +00:00
|
|
|
if (send)
|
|
|
|
bs->Write(packetID);
|
|
|
|
|
|
|
|
RW(func, send);
|
|
|
|
|
2017-05-02 19:47:58 +00:00
|
|
|
if (func == FUNCTION_ANNOUNCE)
|
2017-04-23 05:36:47 +00:00
|
|
|
ProxyMasterPacket::addServer(this, *server, send);
|
|
|
|
}
|
|
|
|
|
2017-04-24 11:58:48 +00:00
|
|
|
void PacketMasterAnnounce::SetServer(QueryData *_server)
|
2017-04-23 05:36:47 +00:00
|
|
|
{
|
|
|
|
server = _server;
|
|
|
|
}
|
|
|
|
|
2018-07-02 15:28:25 +00:00
|
|
|
void PacketMasterAnnounce::SetFunc(uint32_t _func)
|
2017-04-23 05:36:47 +00:00
|
|
|
{
|
|
|
|
func = _func;
|
|
|
|
}
|
|
|
|
|
|
|
|
int PacketMasterAnnounce::GetFunc()
|
|
|
|
{
|
|
|
|
return func;
|
|
|
|
}
|