123456789101112131415161718192021 |
- #include "common/network/toserver/PlayerUpdatePacket.h"
- #include "common/network/Packets.h"
- PlayerUpdatePacket::PlayerUpdatePacket(Entity& e) : position(e.position) {
- }
- PlayerUpdatePacket::PlayerUpdatePacket() {
- }
- void PlayerUpdatePacket::write(OutPacket& out) const {
- out.writeU16(Packets::C_PLAYER_UPDATE);
- Packets::writeVector(out, position);
- }
- bool PlayerUpdatePacket::read(InPacket& in) {
- return Packets::readVector(in, position);
- }
- int PlayerUpdatePacket::getSize() {
- return sizeof(PlayerUpdatePacket) + 2;
- }
|