mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 20:49:56 +00:00
038757b91a
I originally added rotation animation sync as part of commit068a45be87
. Unfortunately, it meant the PlayerPosition packets were now twice as large as they had been before, which was less than ideal for such a frequently sent packet, which is why Koncord switched to a more optimized approach in commits5f30dfd5db
andd67db1a9bd
. Recently, there have since been some rotation animation problems in OpenMW, which have broken the way Koncord's approach looks. My original approach still looks somewhat okay, so I'm switching back to it until we can figure out how to reuse it under the current circumstances.
24 lines
565 B
C++
24 lines
565 B
C++
//
|
|
// Created by koncord on 05.01.16.
|
|
//
|
|
|
|
#include "PacketPlayerPosition.hpp"
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
using namespace std;
|
|
using namespace mwmp;
|
|
|
|
PacketPlayerPosition::PacketPlayerPosition(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
|
{
|
|
packetID = ID_PLAYER_POSITION;
|
|
priority = MEDIUM_PRIORITY;
|
|
//reliability = UNRELIABLE_SEQUENCED;
|
|
}
|
|
|
|
void PacketPlayerPosition::Packet(RakNet::BitStream *bs, bool send)
|
|
{
|
|
PlayerPacket::Packet(bs, send);
|
|
|
|
RW(player->position, send, 1);
|
|
RW(player->direction, send, 1);
|
|
}
|