1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-24 12:53:52 +00:00
openmw-tes3mp/components/openmw-mp/Packets/Worldstate/PacketWorldRegionAuthority.cpp
David Cernat 17ee3d54e4 [General] Lower priority of WorldRegionAuthority packets
Previously, sending a PlayerCellChange packet and a WorldRegionAuthority packet to the player at the same time made the latter arrive first even if the former was intended by a server script to arrive first.
2021-03-25 11:25:22 +02:00

17 lines
617 B
C++

#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketWorldRegionAuthority.hpp"
mwmp::PacketWorldRegionAuthority::PacketWorldRegionAuthority(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer)
{
packetID = ID_WORLD_REGION_AUTHORITY;
// Make sure the priority is lower than PlayerCellChange's, so it doesn't get sent before it
priority = HIGH_PRIORITY;
reliability = RELIABLE_ORDERED;
}
void mwmp::PacketWorldRegionAuthority::Packet(RakNet::BitStream *newBitstream, bool send)
{
WorldstatePacket::Packet(newBitstream, send);
RW(worldstate->authorityRegion, send, true);
}