66 lines
3.0 KiB
C++
66 lines
3.0 KiB
C++
#pragma once
|
|
#include "gateway/protocol.hpp"
|
|
#include <array>
|
|
#include <optional>
|
|
namespace gateway {
|
|
struct WorldLocation { uint32_t map; std::array<float,4> position; };
|
|
float forever_facing(float source_facing);
|
|
WorldLocation turtle_login_world(std::span<const uint8_t>);
|
|
Bytes forever_login_world(const WorldLocation&);
|
|
uint64_t selected_turtle_guid(std::span<const uint8_t>,uint16_t realm,
|
|
const std::vector<Character>& owned);
|
|
}
|
|
namespace gateway {
|
|
struct GroundMovement { uint64_t guid; uint32_t flags,time; std::array<float,4> position; };
|
|
GroundMovement forever_ground_movement(std::span<const uint8_t>,uint16_t realm,
|
|
const std::vector<Character>& owned);
|
|
GroundMovement turtle_ground_movement(std::span<const uint8_t>,uint64_t guid);
|
|
Bytes turtle_ground_movement(const GroundMovement&);
|
|
Bytes forever_ground_movement(const GroundMovement&,uint16_t realm);
|
|
Bytes turtle_active_mover(std::span<const uint8_t>,uint64_t selected,uint16_t realm);
|
|
}
|
|
namespace gateway {
|
|
Bytes forever_bind_point(std::span<const uint8_t>);
|
|
Bytes forever_initial_world_states(std::span<const uint8_t>);
|
|
Bytes forever_login_time(std::span<const uint8_t>);
|
|
}
|
|
namespace gateway {
|
|
struct InitialSpells { Bytes known,history; };
|
|
InitialSpells forever_initial_spells(std::span<const uint8_t>);
|
|
Bytes forever_action_buttons(std::span<const uint8_t>);
|
|
}
|
|
|
|
namespace gateway {
|
|
// Client-originated basic movement; flags in state use the legacy grounded subset.
|
|
struct BasicMovement {
|
|
GroundMovement state;
|
|
uint32_t fall_time=0;
|
|
float vertical_speed=0, sin_angle=0, cos_angle=0, horizontal_speed=0;
|
|
bool falling=false, falling_far=false, has_fall=false, has_direction=false;
|
|
float swim_pitch=0;
|
|
bool swimming=false;
|
|
float spline_elevation=0;
|
|
bool has_spline_elevation=false;
|
|
// Explicitly unconverted native UNK extension flags. Retained as opaque
|
|
// metadata; never copied into the legacy32bit flag word or called an
|
|
// equivalent source physics mode.
|
|
uint64_t native_opaque_extensions=0;
|
|
// Riding a ship/zeppelin (native TransportInfo on an MO-transport GUID): the Source ONTRANSPORT block, so
|
|
// vmangos keeps the player as a passenger and carries them across its map change. Lifts stay world-only.
|
|
struct Transport {uint64_t source_guid=0;std::array<float,4> offset{};uint32_t time=0;};
|
|
std::optional<Transport> transport;
|
|
};
|
|
BasicMovement forever_basic_movement_prefix(std::span<const uint8_t> body,uint16_t realm,
|
|
const std::vector<Character>& owned,size_t& consumed);
|
|
BasicMovement forever_basic_movement(std::span<const uint8_t>,uint16_t,
|
|
const std::vector<Character>&);
|
|
Bytes turtle_basic_movement(const BasicMovement&);
|
|
}
|
|
|
|
namespace gateway {
|
|
struct NearTeleport {uint64_t guid;uint32_t sequence;std::array<float,4> position;};
|
|
NearTeleport turtle_near_teleport(std::span<const uint8_t>,uint64_t selected);
|
|
Bytes forever_near_teleport(const NearTeleport&,uint16_t realm);
|
|
Bytes turtle_near_teleport_ack(std::span<const uint8_t>,const NearTeleport&,uint16_t realm);
|
|
}
|