mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 09:26:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			927 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			927 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| //
 | |
| // Created by koncord on 22.04.17.
 | |
| //
 | |
| 
 | |
| #include <components/openmw-mp/NetworkMessages.hpp>
 | |
| #include <iostream>
 | |
| #include "PacketMasterAnnounce.hpp"
 | |
| #include "ProxyMasterPacket.hpp"
 | |
| 
 | |
| using namespace mwmp;
 | |
| using namespace RakNet;
 | |
| using namespace std;
 | |
| 
 | |
| PacketMasterAnnounce::PacketMasterAnnounce(RakNet::RakPeerInterface *peer) : BasePacket(peer)
 | |
| {
 | |
|     packetID = ID_MASTER_ANNOUNCE;
 | |
|     orderChannel = CHANNEL_MASTER;
 | |
|     reliability = RELIABLE_ORDERED_WITH_ACK_RECEIPT;
 | |
| }
 | |
| 
 | |
| void PacketMasterAnnounce::Packet(BitStream *bs, bool send)
 | |
| {
 | |
|     this->bs = bs;
 | |
|     if (send)
 | |
|         bs->Write(packetID);
 | |
| 
 | |
|     RW(func, send);
 | |
| 
 | |
|     if (func == FUNCTION_ANNOUNCE)
 | |
|         ProxyMasterPacket::addServer(this, *server, send);
 | |
| }
 | |
| 
 | |
| void PacketMasterAnnounce::SetServer(QueryData *_server)
 | |
| {
 | |
|     server = _server;
 | |
| }
 | |
| 
 | |
| void PacketMasterAnnounce::SetFunc(int _func)
 | |
| {
 | |
|     func = _func;
 | |
| }
 | |
| 
 | |
| int PacketMasterAnnounce::GetFunc()
 | |
| {
 | |
|     return func;
 | |
| }
 |