mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 07:37:45 +00:00
Some clang-tidy love and new warpmanager, still empty though.
This commit is contained in:
parent
92bd74cde2
commit
453f441ad3
7 changed files with 64 additions and 38 deletions
|
@ -116,7 +116,7 @@ namespace Sapphire::Network::ActorControl
|
|||
ZoneInDefaultPos = 0xC9,
|
||||
|
||||
TeleportStart = 0xCB,
|
||||
|
||||
TeleportInvitation = 0xCC,
|
||||
TeleportDone = 0xCD,
|
||||
TeleportDoneFadeOut = 0xCE,
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <Logging/Logger.h>
|
||||
|
||||
#include <Util/ActorFilter.h>
|
||||
#include <Util/UtilMath.h>
|
||||
#include <Service.h>
|
||||
#include "WorldServer.h"
|
||||
|
||||
|
@ -140,7 +139,14 @@ bool Action::Action::init()
|
|||
}
|
||||
else
|
||||
{
|
||||
std::memset( &m_lutEntry, 0, sizeof( ActionEntry ) );
|
||||
m_lutEntry.curePotency = 0;
|
||||
m_lutEntry.restoreMPPercentage = 0;
|
||||
m_lutEntry.potency = 0;
|
||||
m_lutEntry.comboPotency = 0;
|
||||
m_lutEntry.flankPotency = 0;
|
||||
m_lutEntry.rearPotency = 0;
|
||||
m_lutEntry.frontPotency = 0;
|
||||
m_lutEntry.nextCombo.clear();
|
||||
}
|
||||
|
||||
addDefaultActorFilters();
|
||||
|
@ -252,7 +258,8 @@ bool Action::Action::update()
|
|||
player->setLastActionTick( tickCount );
|
||||
uint32_t delayMs = 100 - lastTickMs;
|
||||
castTime = ( m_castTimeMs + delayMs );
|
||||
m_castTimeRestMs = static_cast< uint64_t >( m_castTimeMs ) - std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) );
|
||||
m_castTimeRestMs = static_cast< uint64_t >( m_castTimeMs ) -
|
||||
static_cast< uint64_t >( std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) ) );
|
||||
}
|
||||
|
||||
if( !hasCastTime() || std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) ) > castTime )
|
||||
|
@ -301,7 +308,7 @@ void Action::Action::start()
|
|||
data.Action = static_cast< uint16_t >( m_id );
|
||||
data.ActionKey = m_id;
|
||||
data.ActionKind = m_actionKind;
|
||||
data.CastTime = m_castTimeMs / 1000.f;
|
||||
data.CastTime = static_cast< float >( m_castTimeMs ) / 1000.f;
|
||||
data.Target = static_cast< uint32_t >( m_targetId );
|
||||
|
||||
data.TargetPos[ 0 ] = Common::Util::floatToUInt16( m_pSource->getPos().x );
|
||||
|
@ -321,7 +328,7 @@ void Action::Action::start()
|
|||
auto actionStartPkt = makeActorControlSelf( m_pSource->getId(), ActorControlType::ActionStart, m_cooldownGroup, getId(),
|
||||
m_recastTimeMs / 10 );
|
||||
|
||||
player->setRecastGroup( m_cooldownGroup, m_castTimeMs / 1000.f );
|
||||
player->setRecastGroup( m_cooldownGroup, static_cast< float >( m_castTimeMs ) / 1000.f );
|
||||
|
||||
server.queueForPlayer( player->getCharacterId(), actionStartPkt );
|
||||
|
||||
|
@ -617,8 +624,8 @@ bool Action::Action::playerPreCheck( Entity::Player& player )
|
|||
return false;
|
||||
|
||||
// npc actions/non player actions
|
||||
if( m_actionData->data().UseClassJob == -1 /* dunno what this is in old data && !m_actionData->data().isRoleAction*/ )
|
||||
return false;
|
||||
//if( m_actionData->data().UseClassJob == -1 /* dunno what this is in old data && !m_actionData->data().isRoleAction*/ )
|
||||
// return false;
|
||||
|
||||
if( player.getLevel() < m_actionData->data().UseClassJob )
|
||||
return false;
|
||||
|
|
|
@ -166,43 +166,43 @@ namespace Sapphire::World::Action
|
|||
|
||||
bool hasValidLutEntry() const;
|
||||
|
||||
uint32_t m_id;
|
||||
uint8_t m_actionKind;
|
||||
uint32_t m_id{};
|
||||
uint8_t m_actionKind{};
|
||||
|
||||
uint16_t m_sequence;
|
||||
uint16_t m_sequence{};
|
||||
|
||||
Common::ActionPrimaryCostType m_primaryCostType;
|
||||
uint16_t m_primaryCost;
|
||||
uint16_t m_primaryCost{};
|
||||
|
||||
uint64_t m_startTime;
|
||||
uint64_t m_castTimeRestMs;
|
||||
uint32_t m_castTimeMs;
|
||||
uint32_t m_recastTimeMs;
|
||||
uint8_t m_cooldownGroup;
|
||||
int8_t m_range;
|
||||
uint8_t m_effectRange;
|
||||
uint8_t m_xAxisModifier;
|
||||
uint64_t m_startTime{};
|
||||
uint64_t m_castTimeRestMs{};
|
||||
uint32_t m_castTimeMs{};
|
||||
uint32_t m_recastTimeMs{};
|
||||
uint8_t m_cooldownGroup{};
|
||||
int8_t m_range{};
|
||||
uint8_t m_effectRange{};
|
||||
uint8_t m_xAxisModifier{};
|
||||
Common::ActionAspect m_aspect;
|
||||
Common::CastType m_castType;
|
||||
Common::ActionCategory m_category;
|
||||
|
||||
uint32_t m_additionalData;
|
||||
uint32_t m_additionalData{};
|
||||
|
||||
Entity::CharaPtr m_pSource;
|
||||
Entity::CharaPtr m_pTarget;
|
||||
uint64_t m_targetId;
|
||||
uint64_t m_targetId{};
|
||||
|
||||
bool m_canTargetSelf;
|
||||
bool m_canTargetParty;
|
||||
bool m_canTargetFriendly;
|
||||
bool m_canTargetHostile;
|
||||
bool m_canTargetDead;
|
||||
bool m_canTargetSelf{};
|
||||
bool m_canTargetParty{};
|
||||
bool m_canTargetFriendly{};
|
||||
bool m_canTargetHostile{};
|
||||
bool m_canTargetDead{};
|
||||
|
||||
Common::ActionInterruptType m_interruptType;
|
||||
|
||||
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > m_actionData;
|
||||
|
||||
Common::FFXIVARR_POSITION3 m_pos;
|
||||
Common::FFXIVARR_POSITION3 m_pos{};
|
||||
|
||||
EffectBuilderPtr m_effectBuilder;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ bool Sapphire::World::Manager::ShopMgr::sellGilShopItem( Sapphire::Entity::Playe
|
|||
auto inventoryItem = player.getItemAt( container, fromSlot );
|
||||
|
||||
// todo: adding stack remove
|
||||
if (quantity > 1)
|
||||
if( quantity > 1 )
|
||||
return false;
|
||||
|
||||
player.discardItem( ( Sapphire::Common::InventoryType )container, fromSlot );
|
||||
|
|
|
@ -711,15 +711,8 @@ bool Sapphire::World::Manager::TerritoryMgr::joinWorld( Sapphire::Entity::Player
|
|||
// see if a valid zone could be found for the character
|
||||
if( !pCurrZone )
|
||||
{
|
||||
Logger::error( "[{0}] Territory #{1} not found!", player.getCharacterId(), territoryTypeId );
|
||||
Logger::error( "[{0}] Setting default zone instead", player.getCharacterId() );
|
||||
|
||||
// default to new gridania
|
||||
// TODO: should probably just abort and mark character as corrupt
|
||||
pCurrZone = getZoneByTerritoryTypeId( 132 );
|
||||
|
||||
player.setPos( { 0.0f, 0.0f, 0.0f }, false );
|
||||
player.setRot( 0.0f );
|
||||
Logger::error( "[{0}] Territory #{1} not found, manual adjustment of territory required!", player.getCharacterId(), territoryTypeId );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !movePlayer( pCurrZone, player ) )
|
||||
|
|
8
src/world/Manager/WarpMgr.cpp
Normal file
8
src/world/Manager/WarpMgr.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <Logging/Logger.h>
|
||||
#include <Service.h>
|
||||
|
||||
#include "TaskMgr.h"
|
||||
#include "WarpMgr.h"
|
||||
|
||||
using namespace Sapphire::World::Manager;
|
||||
using namespace Sapphire::World;
|
18
src/world/Manager/WarpMgr.h
Normal file
18
src/world/Manager/WarpMgr.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <ForwardsZone.h>
|
||||
#include <Util/Util.h>
|
||||
|
||||
namespace Sapphire::World::Manager
|
||||
{
|
||||
|
||||
class WarpMgr
|
||||
{
|
||||
public:
|
||||
WarpMgr() = default;
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue