2022-01-23 11:04:26 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include <ForwardsZone.h>
|
|
|
|
#include <Util/Util.h>
|
2022-01-27 21:08:43 +01:00
|
|
|
#include <unordered_map>
|
2022-01-23 11:04:26 +01:00
|
|
|
|
|
|
|
namespace Sapphire::World::Manager
|
|
|
|
{
|
|
|
|
|
2022-01-27 21:08:43 +01:00
|
|
|
struct WarpInfo
|
|
|
|
{
|
2022-01-30 14:44:17 +01:00
|
|
|
uint32_t m_targetTerritoryId;
|
2022-01-27 21:08:43 +01:00
|
|
|
Common::WarpType m_warpType;
|
2022-01-30 14:44:17 +01:00
|
|
|
Common::FFXIVARR_POSITION3 m_targetPos;
|
|
|
|
float m_targetRot;
|
2022-01-27 21:08:43 +01:00
|
|
|
};
|
|
|
|
|
2022-01-23 11:04:26 +01:00
|
|
|
class WarpMgr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WarpMgr() = default;
|
2023-02-10 13:05:53 -03:00
|
|
|
|
|
|
|
/// <summary>
|
2023-02-18 17:59:24 +01:00
|
|
|
/// request to move a player to specified territory guid and position, with given WarpType
|
2023-02-10 13:05:53 -03:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
|
|
|
/// <param name="warpType"></param>
|
|
|
|
/// <param name="targetTerritoryId"></param>
|
|
|
|
/// <param name="targetPos"></param>
|
|
|
|
/// <param name="targetRot"></param>
|
2022-01-30 14:44:17 +01:00
|
|
|
void requestMoveTerritory( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryId, Common::FFXIVARR_POSITION3 targetPos, float targetRot );
|
2023-02-10 13:05:53 -03:00
|
|
|
|
2023-02-17 15:34:51 +01:00
|
|
|
|
|
|
|
/// <summary>
|
2023-02-18 17:59:24 +01:00
|
|
|
/// request to move a player to specified territory guid with given WarpType, position will be the same as before
|
2023-02-17 15:34:51 +01:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
|
|
|
/// <param name="warpType"></param>
|
|
|
|
/// <param name="targetTerritoryId"></param>
|
|
|
|
void requestMoveTerritory( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryId );
|
|
|
|
|
2023-02-10 13:05:53 -03:00
|
|
|
/// <summary>
|
2023-02-18 17:59:24 +01:00
|
|
|
/// request to move a player to specified territory type with given WarpType, position will be the same as before
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
|
|
|
/// <param name="warpType"></param>
|
|
|
|
/// <param name="targetTerritoryTypeId"></param>
|
|
|
|
void requestMoveTerritoryType( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryTypeId );
|
|
|
|
|
|
|
|
/// <summary>
|
2023-02-10 13:05:53 -03:00
|
|
|
/// handle player state pre-warp and tells client to warp player
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
|
|
|
/// <param name="warpType"></param>
|
|
|
|
/// <param name="targetPos"></param>
|
|
|
|
/// <param name="targetRot"></param>
|
2022-01-30 14:44:17 +01:00
|
|
|
void requestWarp( Entity::Player& player, Common::WarpType warpType, Common::FFXIVARR_POSITION3 targetPos, float targetRot );
|
2023-02-10 13:05:53 -03:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// handle player state post-warp after client is done loading
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
2022-01-30 14:44:17 +01:00
|
|
|
void finishWarp( Entity::Player& player );
|
2022-01-23 11:04:26 +01:00
|
|
|
|
2023-02-10 13:05:53 -03:00
|
|
|
/// <summary>
|
|
|
|
/// teleport a player to specified aetheryte and teleport type (teleport, return, etc)
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="player"></param>
|
|
|
|
/// <param name="aetheryteId"></param>
|
|
|
|
/// <param name="teleportType"></param>
|
|
|
|
void requestPlayerTeleport( Entity::Player& player, uint16_t aetheryteId, uint8_t teleportType );
|
|
|
|
|
2022-01-27 21:08:43 +01:00
|
|
|
private:
|
2022-01-30 14:44:17 +01:00
|
|
|
std::unordered_map< uint32_t, WarpInfo > m_entityIdToWarpInfoMap;
|
2022-01-27 21:08:43 +01:00
|
|
|
|
2022-01-23 11:04:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|