1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 08:57:44 +00:00

Remove Component namespace

This commit is contained in:
Mordred 2022-01-27 21:24:54 +01:00
parent f5258bfd92
commit a27bb3e687
66 changed files with 764 additions and 764 deletions

View file

@ -54,7 +54,7 @@ namespace xiv::exd
const std::vector< Field > get_row( uint32_t id ); const std::vector< Field > get_row( uint32_t id );
template< typename T > template< typename T >
std::shared_ptr< Component::Excel::ExcelStruct< T > > get_row( uint32_t id ) std::shared_ptr< Excel::ExcelStruct< T > > get_row( uint32_t id )
{ {
using namespace xiv::utils; using namespace xiv::utils;
auto cacheEntryIt = _idCache.find( id ); auto cacheEntryIt = _idCache.find( id );
@ -75,7 +75,7 @@ namespace xiv::exd
std::vector< char > dataCpy = file_ptr->get_data_sections().front(); std::vector< char > dataCpy = file_ptr->get_data_sections().front();
std::istringstream iss( std::string( dataCpy.begin(), dataCpy.end() ) ); std::istringstream iss( std::string( dataCpy.begin(), dataCpy.end() ) );
auto pSheet = std::make_shared< Component::Excel::ExcelStruct< T > >(); auto pSheet = std::make_shared< Excel::ExcelStruct< T > >();
// Get the vector fields for the given record and preallocate it // Get the vector fields for the given record and preallocate it
auto fields = _data[ id ]; auto fields = _data[ id ];

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
namespace Component::Excel namespace Excel
{ {
struct ExcelDataRowHeader struct ExcelDataRowHeader
@ -29,8 +29,8 @@ namespace Component::Excel
/* struct LinkList::Holder /* struct LinkList::Holder
{ {
Common::Component::Excel::LinkList m_begin; Common::Excel::LinkList m_begin;
Common::Component::Excel::LinkList m_end; Common::Excel::LinkList m_end;
uint32_t m_size; uint32_t m_size;
};*/ };*/

File diff suppressed because it is too large Load diff

View file

@ -55,7 +55,7 @@ namespace xivps3::exd
const std::vector< Field > get_row( uint32_t id ); const std::vector< Field > get_row( uint32_t id );
template< typename T > template< typename T >
std::shared_ptr< Component::Excel::Ps3::ExcelStruct< T > > get_row( uint32_t id ) std::shared_ptr< Excel::Ps3::ExcelStruct< T > > get_row( uint32_t id )
{ {
using namespace xivps3::utils; using namespace xivps3::utils;
auto cacheEntryIt = _idCache.find( id ); auto cacheEntryIt = _idCache.find( id );
@ -76,7 +76,7 @@ namespace xivps3::exd
std::vector< char > dataCpy = file_ptr->get_data_sections().front(); std::vector< char > dataCpy = file_ptr->get_data_sections().front();
std::istringstream iss( std::string( dataCpy.begin(), dataCpy.end() ) ); std::istringstream iss( std::string( dataCpy.begin(), dataCpy.end() ) );
auto pSheet = std::make_shared< Component::Excel::Ps3::ExcelStruct< T > >(); auto pSheet = std::make_shared< Excel::Ps3::ExcelStruct< T > >();
// Get the vector fields for the given record and preallocate it // Get the vector fields for the given record and preallocate it
auto fields = _data[ id ]; auto fields = _data[ id ];

View file

@ -1,7 +1,7 @@
#ifndef SAPPHIRE_EXD_COMMON_H #ifndef SAPPHIRE_EXD_COMMON_H
#define SAPPHIRE_EXD_COMMON_H #define SAPPHIRE_EXD_COMMON_H
namespace Component::Excel::Ps3 namespace Excel::Ps3
{ {
struct ExcelDataRowHeader struct ExcelDataRowHeader
@ -30,8 +30,8 @@ namespace Component::Excel::Ps3
/* struct LinkList::Holder /* struct LinkList::Holder
{ {
Common::Component::Excel::LinkList m_begin; Common::Excel::LinkList m_begin;
Common::Component::Excel::LinkList m_end; Common::Excel::LinkList m_end;
uint32_t m_size; uint32_t m_size;
};*/ };*/

File diff suppressed because it is too large Load diff

View file

@ -178,7 +178,7 @@ std::string PlayerMinimal::getInfoJson()
uint8_t PlayerMinimal::getClassLevel() uint8_t PlayerMinimal::getClassLevel()
{ {
uint8_t classJobIndex = g_exdData.getRow< Component::Excel::ClassJob >( m_class )->data().WorkIndex; uint8_t classJobIndex = g_exdData.getRow< Excel::ClassJob >( m_class )->data().WorkIndex;
return static_cast< uint8_t >( m_classMap[ classJobIndex ] ); return static_cast< uint8_t >( m_classMap[ classJobIndex ] );
} }
@ -259,7 +259,7 @@ void PlayerMinimal::saveAsNew()
// CharacterId, ClassIdx, Exp, Lvl // CharacterId, ClassIdx, Exp, Lvl
auto stmtClass = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_CLASS_INS ); auto stmtClass = g_charaDb.getPreparedStatement( Db::ZoneDbStatements::CHARA_CLASS_INS );
stmtClass->setUInt64( 1, m_characterId ); stmtClass->setUInt64( 1, m_characterId );
stmtClass->setInt( 2, g_exdData.getRow< Component::Excel::ClassJob >( m_class )->data().WorkIndex ); stmtClass->setInt( 2, g_exdData.getRow< Excel::ClassJob >( m_class )->data().WorkIndex );
stmtClass->setInt( 3, 0 ); stmtClass->setInt( 3, 0 );
stmtClass->setInt( 4, 1 ); stmtClass->setInt( 4, 1 );
g_charaDb.directExecute( stmtClass ); g_charaDb.directExecute( stmtClass );
@ -320,14 +320,14 @@ void PlayerMinimal::saveAsNew()
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SETUP EQUIPMENT / STARTING GEAR /// SETUP EQUIPMENT / STARTING GEAR
auto classJobInfo = g_exdData.getRow< Component::Excel::ClassJob >( m_class ); auto classJobInfo = g_exdData.getRow< Excel::ClassJob >( m_class );
uint32_t weaponId = classJobInfo->data().InitWeapon[ 0 ]; uint32_t weaponId = classJobInfo->data().InitWeapon[ 0 ];
uint64_t uniqueId = getNextUId64(); uint64_t uniqueId = getNextUId64();
uint8_t race = customize[ CharaLook::Race ]; uint8_t race = customize[ CharaLook::Race ];
uint8_t gender = customize[ CharaLook::Gender ]; uint8_t gender = customize[ CharaLook::Gender ];
auto raceInfo = g_exdData.getRow< Component::Excel::Race >( race ); auto raceInfo = g_exdData.getRow< Excel::Race >( race );
uint32_t body; uint32_t body;
uint32_t hands; uint32_t hands;
@ -343,11 +343,11 @@ void PlayerMinimal::saveAsNew()
legs = raceInfo->data().Leg[ gender ]; legs = raceInfo->data().Leg[ gender ];
feet = raceInfo->data().Foot[ gender ]; feet = raceInfo->data().Foot[ gender ];
auto mainWeaponInfo = g_exdData.getRow< Component::Excel::Item >( weaponId ); auto mainWeaponInfo = g_exdData.getRow< Excel::Item >( weaponId );
auto bodyInfo = g_exdData.getRow< Component::Excel::Item >( body ); auto bodyInfo = g_exdData.getRow< Excel::Item >( body );
auto handsInfo = g_exdData.getRow< Component::Excel::Item >( hands ); auto handsInfo = g_exdData.getRow< Excel::Item >( hands );
auto legsInfo = g_exdData.getRow< Component::Excel::Item >( legs ); auto legsInfo = g_exdData.getRow< Excel::Item >( legs );
auto feetInfo = g_exdData.getRow< Component::Excel::Item >( feet ); auto feetInfo = g_exdData.getRow< Excel::Item >( feet );
uint64_t modelMainWeapon = mainWeaponInfo->data().ModelId; uint64_t modelMainWeapon = mainWeaponInfo->data().ModelId;

View file

@ -221,7 +221,7 @@ std::string buildHttpResponse( uint16_t rCode, const std::string& content = "",
void getZoneName( shared_ptr< HttpServer::Response > response, shared_ptr< HttpServer::Request > request ) void getZoneName( shared_ptr< HttpServer::Response > response, shared_ptr< HttpServer::Request > request )
{ {
string number = request->path_match[ 1 ]; string number = request->path_match[ 1 ];
auto info = g_exdData.getRow< Component::Excel::TerritoryType >( atoi( number.c_str() ) ); auto info = g_exdData.getRow< Excel::TerritoryType >( atoi( number.c_str() ) );
std::string responseStr = "Not found!"; std::string responseStr = "Not found!";
if( info ) if( info )
{ {

View file

@ -29,7 +29,7 @@ namespace Sapphire::Data
bool init( const std::string& path ); bool init( const std::string& path );
template< typename T > template< typename T >
std::shared_ptr< Component::Excel::ExcelStruct< T > > getRow( uint32_t row, uint32_t subrow = 0 ) std::shared_ptr< Excel::ExcelStruct< T > > getRow( uint32_t row, uint32_t subrow = 0 )
{ {
xiv::exd::Exd sheet; xiv::exd::Exd sheet;
auto needle = m_sheets.find( typeid( T ) ); auto needle = m_sheets.find( typeid( T ) );

View file

@ -113,7 +113,7 @@ public:
{ {
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto aetherInfo = exdData.getRow< Component::Excel::Aetheryte >( eventId & 0xFFFF ); auto aetherInfo = exdData.getRow< Excel::Aetheryte >( eventId & 0xFFFF );
if( !aetherInfo ) if( !aetherInfo )
return; return;

View file

@ -28,7 +28,7 @@ public:
return; return;
// param2 is the index starting from 0 inside housingaethernet.exd, but the ID column starts at 0x001E0000........ wtf // param2 is the index starting from 0 inside housingaethernet.exd, but the ID column starts at 0x001E0000........ wtf
/*auto pHousingAethernet = exdData.getRow< Component::Excel::HousingAethernet >( getId() + result.param2 ); /*auto pHousingAethernet = exdData.getRow< Excel::HousingAethernet >( getId() + result.param2 );
if( !pHousingAethernet ) if( !pHousingAethernet )
return; return;

View file

@ -35,7 +35,7 @@ public:
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto& popRange = Common::Service< Sapphire::InstanceObjectCache >::ref(); auto& popRange = Common::Service< Sapphire::InstanceObjectCache >::ref();
auto warp = exdData.getRow< Component::Excel::Warp >( getId() ); auto warp = exdData.getRow< Excel::Warp >( getId() );
if( !warp ) if( !warp )
return; return;
@ -78,7 +78,7 @@ public:
{ {
/* auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); /* auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto warp = exdData.getRow< Component::Excel::Warp >( eventId ); auto warp = exdData.getRow< Excel::Warp >( eventId );
if( !warp ) if( !warp )
return; return;

View file

@ -29,7 +29,7 @@ namespace Data
bool init( const std::string& path ); bool init( const std::string& path );
template< typename T > template< typename T >
std::shared_ptr< Component::Excel::Ps3::ExcelStruct< T > > getRow( uint32_t row, uint32_t subrow = 0 ) std::shared_ptr< Excel::Ps3::ExcelStruct< T > > getRow( uint32_t row, uint32_t subrow = 0 )
{ {
xivps3::exd::Exd sheet; xivps3::exd::Exd sheet;
auto needle = m_sheets.find( typeid( T ) ); auto needle = m_sheets.find( typeid( T ) );

View file

@ -371,7 +371,7 @@ int main( int argc, char* argv[] )
} }
auto teriIdList = g_exdDataGen.getIdList< Component::Excel::Ps3::TerritoryType >(); auto teriIdList = g_exdDataGen.getIdList< Excel::Ps3::TerritoryType >();
std::string data = std::string("GroupId, GroupName, TerritoryName, name, instanceId, x, y, z, Rotation, BaseId, PopWeather, PopTimeStart, PopTimeEnd, MoveAI, WanderingRange, Route, ") + std::string data = std::string("GroupId, GroupName, TerritoryName, name, instanceId, x, y, z, Rotation, BaseId, PopWeather, PopTimeStart, PopTimeEnd, MoveAI, WanderingRange, Route, ") +
@ -386,7 +386,7 @@ int main( int argc, char* argv[] )
std::set< std::string > zoneNames; std::set< std::string > zoneNames;
for( const auto& id : teriIdList ) for( const auto& id : teriIdList )
{ {
auto row = g_exdDataGen.getRow< Component::Excel::Ps3::TerritoryType >( id ); auto row = g_exdDataGen.getRow< Excel::Ps3::TerritoryType >( id );
if( !row ) if( !row )
continue; continue;
std::string zonePath = row->getString( row->data().LVB ); std::string zonePath = row->getString( row->data().LVB );
@ -405,7 +405,7 @@ int main( int argc, char* argv[] )
} }
for( const auto& name : zoneNames ) for( const auto& name : zoneNames )
{ {
// auto row = g_exdDataGen.getRow< Component::Excel::TerritoryType >( id ); // auto row = g_exdDataGen.getRow< Excel::TerritoryType >( id );
// if( !row ) // if( !row )
// continue; // continue;

View file

@ -103,7 +103,7 @@ int main( int argc, char* argv[] )
Logger::fatal( "Error setting up EXD data " ); Logger::fatal( "Error setting up EXD data " );
return 0; return 0;
} }
auto idList = g_exdDataGen.getIdList< Component::Excel::Action >(); auto idList = g_exdDataGen.getIdList< Excel::Action >();
std::map< uint32_t, ActionEntry > actions; std::map< uint32_t, ActionEntry > actions;
std::map< uint32_t, std::vector< uint32_t > > traversedCombos; std::map< uint32_t, std::vector< uint32_t > > traversedCombos;
@ -117,7 +117,7 @@ int main( int argc, char* argv[] )
if( cursor % 50 == 0 && cursor > 0 ) if( cursor % 50 == 0 && cursor > 0 )
Logger::info( "Processing {} actions of {} ({:.2f}%)", cursor, total, done ); Logger::info( "Processing {} actions of {} ({:.2f}%)", cursor, total, done );
auto action = g_exdDataGen.getRow< Component::Excel::Action >( id ); auto action = g_exdDataGen.getRow< Excel::Action >( id );
//auto actionTransient = g_exdData.get< Sapphire::Data::ActionTransient >( id ); //auto actionTransient = g_exdData.get< Sapphire::Data::ActionTransient >( id );
if( action ) if( action )
@ -130,7 +130,7 @@ int main( int argc, char* argv[] )
//if( actionData.PvPOnly ) //if( actionData.PvPOnly )
// continue; // continue;
// auto classJob = g_exdDataGen.getRow< Component::Excel::ClassJob >( actionData.UseClassJob ); // auto classJob = g_exdDataGen.getRow< Excel::ClassJob >( actionData.UseClassJob );
// if( !classJob ) // if( !classJob )
// continue; // continue;

View file

@ -66,10 +66,10 @@ std::string zoneNameToPath( const std::string& name )
if( it != g_nameMap.end() ) if( it != g_nameMap.end() )
return it->second; return it->second;
auto teriIdList = g_exdData.getIdList< Component::Excel::TerritoryType >(); auto teriIdList = g_exdData.getIdList< Excel::TerritoryType >();
for( auto teriId : teriIdList ) for( auto teriId : teriIdList )
{ {
auto teri = g_exdData.getRow< Component::Excel::TerritoryType >( teriId ); auto teri = g_exdData.getRow< Excel::TerritoryType >( teriId );
if( !teri ) if( !teri )
continue; continue;
@ -102,10 +102,10 @@ std::string zoneNameToPath( const std::string& name )
void loadEobjNames() void loadEobjNames()
{ {
auto nameIdList = g_exdData..getIdList< Component::Excel::EObj >(); auto nameIdList = g_exdData..getIdList< Excel::EObj >();
for( auto id : nameIdList ) for( auto id : nameIdList )
{ {
auto eObjName = g_exdData.getRow< Component::Excel::EObjName >( id ); auto eObjName = g_exdData.getRow< Excel::EObjName >( id );
if( !eObjName ) if( !eObjName )
continue; continue;

View file

@ -28,7 +28,7 @@ int main( int argc, char* argv[] )
auto exdData = Data::ExdData(); auto exdData = Data::ExdData();
exdData.init( datLocation ); exdData.init( datLocation );
auto row = exdData.getRow< Component::Excel::ClassJob >( 1 ); auto row = exdData.getRow< Excel::ClassJob >( 1 );
return 0; return 0;
} }

View file

@ -100,7 +100,7 @@ Container& split(
} }
void void
createScript( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Quest > >& pQuestData, std::set< std::string >& additionalList, int questId, std::vector< std::string >& functions ) createScript( std::shared_ptr< Excel::ExcelStruct< Excel::Quest > >& pQuestData, std::set< std::string >& additionalList, int questId, std::vector< std::string >& functions )
{ {
std::string header( std::string header(
"// This is an automatically generated C++ script template\n" "// This is an automatically generated C++ script template\n"
@ -492,7 +492,7 @@ int main( int argc, char** argv )
xiv::dat::GameData data( gamePath ); xiv::dat::GameData data( gamePath );
auto rows = g_exdDataGen.getIdList< Component::Excel::Quest >(); auto rows = g_exdDataGen.getIdList< Excel::Quest >();
if( !fs::exists( "./generated" ) ) if( !fs::exists( "./generated" ) )
fs::create_directory( "./generated" ); fs::create_directory( "./generated" );
@ -504,7 +504,7 @@ int main( int argc, char** argv )
for( const auto& row : rows ) for( const auto& row : rows )
{ {
Logger::info( "Generating {0}", row ); Logger::info( "Generating {0}", row );
auto questInfo = g_exdDataGen.getRow< Component::Excel::Quest >( row ); auto questInfo = g_exdDataGen.getRow< Excel::Quest >( row );
if( questInfo->getString( questInfo->data().Text.Name ).empty() || questInfo->getString( questInfo->data().Script ).empty() ) if( questInfo->getString( questInfo->data().Text.Name ).empty() || questInfo->getString( questInfo->data().Script ).empty() )
{ {

View file

@ -48,7 +48,7 @@ Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t seq
} }
Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence, Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData ) : std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData ) :
m_pSource( std::move( caster ) ), m_pSource( std::move( caster ) ),
m_actionData( std::move( actionData ) ), m_actionData( std::move( actionData ) ),
m_id( actionId ), m_id( actionId ),
@ -72,7 +72,7 @@ bool Action::Action::init()
// need to get actionData // need to get actionData
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto actionData = exdData.getRow< Component::Excel::Action >( m_id ); auto actionData = exdData.getRow< Excel::Action >( m_id );
if( !actionData ) if( !actionData )
throw std::runtime_error( "No actiondata found!" ); throw std::runtime_error( "No actiondata found!" );
@ -638,7 +638,7 @@ bool Action::Action::playerPreCheck( Entity::Player& player )
// check if not a base class action // check if not a base class action
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classJob = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( currentClass ) ); auto classJob = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( currentClass ) );
if( !classJob ) if( !classJob )
return false; return false;

View file

@ -17,7 +17,7 @@ namespace Sapphire::World::Action
Action(); Action();
Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence ); Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence );
Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence, std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData ); Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t sequence, std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData );
virtual ~Action(); virtual ~Action();
@ -200,7 +200,7 @@ namespace Sapphire::World::Action
Common::ActionInterruptType m_interruptType; Common::ActionInterruptType m_interruptType;
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > m_actionData; std::shared_ptr< Excel::ExcelStruct< Excel::Action > > m_actionData;
Common::FFXIVARR_POSITION3 m_pos{}; Common::FFXIVARR_POSITION3 m_pos{};

View file

@ -34,7 +34,7 @@ Action::EventAction::EventAction( Entity::CharaPtr pActor, uint32_t eventId, uin
m_eventId = eventId; m_eventId = eventId;
m_id = action; m_id = action;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
m_castTimeMs = exdData.getRow< Component::Excel::EventAction >( action )->data().Time * 1000; // TODO: Add security checks. m_castTimeMs = exdData.getRow< Excel::EventAction >( action )->data().Time * 1000; // TODO: Add security checks.
m_onActionFinishClb = std::move( finishRef ); m_onActionFinishClb = std::move( finishRef );
m_onActionInterruptClb = std::move( interruptRef ); m_onActionInterruptClb = std::move( interruptRef );
m_pSource = std::move( pActor ); m_pSource = std::move( pActor );

View file

@ -29,7 +29,7 @@ using namespace Sapphire::Network::Packets::WorldPackets::Server;
using namespace Sapphire::Network::ActorControl; using namespace Sapphire::Network::ActorControl;
EventItemAction::EventItemAction( Sapphire::Entity::CharaPtr source, uint32_t eventItemId, EventItemAction::EventItemAction( Sapphire::Entity::CharaPtr source, uint32_t eventItemId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::EventItem > > eventItemActionData, std::shared_ptr< Excel::ExcelStruct< Excel::EventItem > > eventItemActionData,
uint32_t sequence, uint64_t targetId ) : uint32_t sequence, uint64_t targetId ) :
m_eventItemAction( std::move( eventItemActionData ) ) m_eventItemAction( std::move( eventItemActionData ) )
{ {
@ -45,7 +45,7 @@ EventItemAction::EventItemAction( Sapphire::Entity::CharaPtr source, uint32_t ev
bool EventItemAction::init() bool EventItemAction::init()
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto actionInfoPtr = exdData.getRow< Component::Excel::Action >( m_eventItemAction->data().Action ); auto actionInfoPtr = exdData.getRow< Excel::Action >( m_eventItemAction->data().Action );
m_castTimeMs = static_cast< uint32_t >( m_eventItemAction->data().CastTime * 1000 ); m_castTimeMs = static_cast< uint32_t >( m_eventItemAction->data().CastTime * 1000 );
m_recastTimeMs = static_cast< uint32_t >( actionInfoPtr->data().RecastTime * 100 ); m_recastTimeMs = static_cast< uint32_t >( actionInfoPtr->data().RecastTime * 100 );

View file

@ -14,7 +14,7 @@ namespace Sapphire::World::Action
class EventItemAction : public Action class EventItemAction : public Action
{ {
public: public:
EventItemAction( Entity::CharaPtr source, uint32_t eventItemId, std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::EventItem > > itemActionData, EventItemAction( Entity::CharaPtr source, uint32_t eventItemId, std::shared_ptr< Excel::ExcelStruct< Excel::EventItem > > itemActionData,
uint32_t sequence, uint64_t targetId ); uint32_t sequence, uint64_t targetId );
virtual ~EventItemAction() = default; virtual ~EventItemAction() = default;
@ -29,7 +29,7 @@ namespace Sapphire::World::Action
private: private:
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::EventItem > > m_eventItemAction; std::shared_ptr< Excel::ExcelStruct< Excel::EventItem > > m_eventItemAction;
uint32_t m_eventItem; uint32_t m_eventItem;
uint32_t m_sequence; uint32_t m_sequence;
}; };

View file

@ -13,7 +13,7 @@ using namespace Sapphire::World::Action;
using namespace Sapphire::Network::Packets::WorldPackets::Server; using namespace Sapphire::Network::Packets::WorldPackets::Server;
ItemAction::ItemAction( Sapphire::Entity::CharaPtr source, uint32_t itemId, ItemAction::ItemAction( Sapphire::Entity::CharaPtr source, uint32_t itemId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > itemActionData, uint16_t itemSourceSlot, std::shared_ptr< Excel::ExcelStruct< Excel::ItemAction > > itemActionData, uint16_t itemSourceSlot,
uint16_t itemSourceContainer ) : uint16_t itemSourceContainer ) :
m_itemAction( std::move( itemActionData ) ), m_itemAction( std::move( itemActionData ) ),
m_itemSourceSlot( itemSourceSlot ), m_itemSourceSlot( itemSourceSlot ),

View file

@ -14,7 +14,7 @@ namespace Sapphire::World::Action
class ItemAction : public Action class ItemAction : public Action
{ {
public: public:
ItemAction( Entity::CharaPtr source, uint32_t itemId, std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > itemActionData, ItemAction( Entity::CharaPtr source, uint32_t itemId, std::shared_ptr< Excel::ExcelStruct< Excel::ItemAction > > itemActionData,
uint16_t itemSourceSlot, uint16_t itemSourceContainer ); uint16_t itemSourceSlot, uint16_t itemSourceContainer );
virtual ~ItemAction() = default; virtual ~ItemAction() = default;
@ -30,7 +30,7 @@ namespace Sapphire::World::Action
void handleMountItem(); void handleMountItem();
private: private:
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > m_itemAction; std::shared_ptr< Excel::ExcelStruct< Excel::ItemAction > > m_itemAction;
uint16_t m_itemSourceSlot; uint16_t m_itemSourceSlot;
uint16_t m_itemSourceContainer; uint16_t m_itemSourceContainer;

View file

@ -21,7 +21,7 @@ using namespace Sapphire::Network::ActorControl;
using namespace Sapphire::World::Action; using namespace Sapphire::World::Action;
MountAction::MountAction( Sapphire::Entity::CharaPtr source, uint16_t mountId, uint16_t sequence, MountAction::MountAction( Sapphire::Entity::CharaPtr source, uint16_t mountId, uint16_t sequence,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData ) : std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData ) :
Action::Action( source, 4, sequence, actionData ), Action::Action( source, 4, sequence, actionData ),
m_mountId( mountId ) m_mountId( mountId )
{ {

View file

@ -9,7 +9,7 @@ namespace Sapphire::World::Action
{ {
public: public:
MountAction( Entity::CharaPtr source, uint16_t mountId, uint16_t sequence, MountAction( Entity::CharaPtr source, uint16_t mountId, uint16_t sequence,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData ); std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData );
virtual ~MountAction() = default; virtual ~MountAction() = default;
bool preCheck() override; bool preCheck() override;

View file

@ -92,7 +92,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto bNpcBaseData = exdData.getRow< Component::Excel::BNpcBase >( m_bNpcBaseId ); auto bNpcBaseData = exdData.getRow< Excel::BNpcBase >( m_bNpcBaseId );
if( !bNpcBaseData ) if( !bNpcBaseData )
{ {
Logger::debug( "BNpcBase#{0} not found in exd data!", m_bNpcBaseId ); Logger::debug( "BNpcBase#{0} not found in exd data!", m_bNpcBaseId );
@ -133,7 +133,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
m_radius = bNpcBaseData->data().Scale; m_radius = bNpcBaseData->data().Scale;
if( bNpcBaseData->data().Customize != 0 ) if( bNpcBaseData->data().Customize != 0 )
{ {
auto bnpcCustom = exdData.getRow< Component::Excel::BNpcCustomize >( bNpcBaseData->data().Customize ); auto bnpcCustom = exdData.getRow< Excel::BNpcCustomize >( bNpcBaseData->data().Customize );
if( bnpcCustom ) if( bnpcCustom )
{ {
memcpy( m_customize, reinterpret_cast< char* >( &bnpcCustom->data() ), sizeof( m_customize ) ); memcpy( m_customize, reinterpret_cast< char* >( &bnpcCustom->data() ), sizeof( m_customize ) );
@ -142,7 +142,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
if( bNpcBaseData->data().Equipment != 0 ) if( bNpcBaseData->data().Equipment != 0 )
{ {
auto bnpcEquip = exdData.getRow< Component::Excel::NpcEquip >( bNpcBaseData->data().Equipment ); auto bnpcEquip = exdData.getRow< Excel::NpcEquip >( bNpcBaseData->data().Equipment );
if( bnpcEquip ) if( bnpcEquip )
{ {
m_weaponMain = bnpcEquip->data().WeaponModel; m_weaponMain = bnpcEquip->data().WeaponModel;
@ -151,10 +151,10 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
} }
} }
auto modelChara = exdData.getRow< Component::Excel::ModelChara >( bNpcBaseData->data().Model ); auto modelChara = exdData.getRow< Excel::ModelChara >( bNpcBaseData->data().Model );
if( modelChara ) if( modelChara )
{ {
auto modelSkeleton = exdData.getRow< Component::Excel::ModelSkeleton >( modelChara->data().SkeletonId ); auto modelSkeleton = exdData.getRow< Excel::ModelSkeleton >( modelChara->data().SkeletonId );
if( modelSkeleton ) if( modelSkeleton )
{ {
m_radius *= modelSkeleton->data().Radius; m_radius *= modelSkeleton->data().Radius;
@ -209,7 +209,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto bNpcBaseData = exdData.getRow< Component::Excel::BNpcBase >( m_bNpcBaseId ); auto bNpcBaseData = exdData.getRow< Excel::BNpcBase >( m_bNpcBaseId );
if( !bNpcBaseData ) if( !bNpcBaseData )
{ {
Logger::debug( "BNpcBase#{0} not found in exd data!", m_bNpcBaseId ); Logger::debug( "BNpcBase#{0} not found in exd data!", m_bNpcBaseId );
@ -246,7 +246,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
m_radius = bNpcBaseData->data().Scale; m_radius = bNpcBaseData->data().Scale;
if( bNpcBaseData->data().Customize != 0 ) if( bNpcBaseData->data().Customize != 0 )
{ {
auto bnpcCustom = exdData.getRow< Component::Excel::BNpcCustomize >( bNpcBaseData->data().Customize ); auto bnpcCustom = exdData.getRow< Excel::BNpcCustomize >( bNpcBaseData->data().Customize );
if( bnpcCustom ) if( bnpcCustom )
{ {
memcpy( m_customize, reinterpret_cast< char* >( &bnpcCustom->data() ), sizeof( m_customize ) ); memcpy( m_customize, reinterpret_cast< char* >( &bnpcCustom->data() ), sizeof( m_customize ) );
@ -255,7 +255,7 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
if( bNpcBaseData->data().Equipment != 0 ) if( bNpcBaseData->data().Equipment != 0 )
{ {
auto bnpcEquip = exdData.getRow< Component::Excel::NpcEquip >( bNpcBaseData->data().Equipment ); auto bnpcEquip = exdData.getRow< Excel::NpcEquip >( bNpcBaseData->data().Equipment );
if( bnpcEquip ) if( bnpcEquip )
{ {
m_weaponMain = bnpcEquip->data().WeaponModel; m_weaponMain = bnpcEquip->data().WeaponModel;
@ -264,10 +264,10 @@ Sapphire::Entity::BNpc::BNpc( uint32_t id, std::shared_ptr< Common::BNPCInstance
} }
} }
auto modelChara = exdData.getRow< Component::Excel::ModelChara >( bNpcBaseData->data().Model ); auto modelChara = exdData.getRow< Excel::ModelChara >( bNpcBaseData->data().Model );
if( modelChara ) if( modelChara )
{ {
auto modelSkeleton = exdData.getRow< Component::Excel::ModelSkeleton >( modelChara->data().ModelType ); auto modelSkeleton = exdData.getRow< Excel::ModelSkeleton >( modelChara->data().ModelType );
if( modelSkeleton ) if( modelSkeleton )
m_radius *= modelSkeleton->data().Radius; m_radius *= modelSkeleton->data().Radius;
} }
@ -792,7 +792,7 @@ void Sapphire::Entity::BNpc::onDeath()
taskMgr.queueTask( World::makeRemoveBNpcTask( 12000, getAsBNpc() ) ); taskMgr.queueTask( World::makeRemoveBNpcTask( 12000, getAsBNpc() ) );
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( m_level ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( m_level );
for( auto& pHateEntry : m_hateList ) for( auto& pHateEntry : m_hateList )
{ {
@ -965,8 +965,8 @@ void Sapphire::Entity::BNpc::calculateStats()
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( job ); auto classInfo = exdData.getRow< Excel::ClassJob >( job );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( level ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( level );
float base = Math::CalcStats::calculateBaseStat( *this ); float base = Math::CalcStats::calculateBaseStat( *this );

View file

@ -748,7 +748,7 @@ Sapphire::Common::BaseParam Sapphire::Entity::Chara::getPrimaryStat() const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classJob = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint16_t >( getClass() ) ); auto classJob = exdData.getRow< Excel::ClassJob >( static_cast< uint16_t >( getClass() ) );
assert( classJob ); assert( classJob );
return static_cast< Sapphire::Common::BaseParam >( classJob->data().Role ); return static_cast< Sapphire::Common::BaseParam >( classJob->data().Role );

View file

@ -219,7 +219,7 @@ Sapphire::Common::OnlineStatus Sapphire::Entity::Player::getOnlineStatus() const
if( !bit ) if( !bit )
continue; continue;
auto pOnlineStatus = exdData.getRow< Component::Excel::OnlineStatus >( i ); auto pOnlineStatus = exdData.getRow< Excel::OnlineStatus >( i );
if( !pOnlineStatus ) if( !pOnlineStatus )
continue; continue;
@ -323,9 +323,9 @@ void Sapphire::Entity::Player::calculateStats()
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( job ); auto classInfo = exdData.getRow< Excel::ClassJob >( job );
auto tribeInfo = exdData.getRow< Component::Excel::Tribe >( tribe ); auto tribeInfo = exdData.getRow< Excel::Tribe >( tribe );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( level ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( level );
float base = Math::CalcStats::calculateBaseStat( *this ); float base = Math::CalcStats::calculateBaseStat( *this );
@ -404,7 +404,7 @@ void Sapphire::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto& terriMgr = Common::Service< TerritoryMgr >::ref(); auto& terriMgr = Common::Service< TerritoryMgr >::ref();
auto aetherData = exdData.getRow< Component::Excel::Aetheryte >( aetheryteId ); auto aetherData = exdData.getRow< Excel::Aetheryte >( aetheryteId );
if( !aetherData ) if( !aetherData )
return; return;
@ -433,8 +433,8 @@ void Sapphire::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
PlayerMgr::sendDebug( *this, "Teleport: popRange {0} not found in {1}!", data.PopRange[ 0 ], data.TerritoryType ); PlayerMgr::sendDebug( *this, "Teleport: popRange {0} not found in {1}!", data.PopRange[ 0 ], data.TerritoryType );
} }
auto townPlace = exdData.getRow< Component::Excel::PlaceName >( data.TelepoName ); auto townPlace = exdData.getRow< Excel::PlaceName >( data.TelepoName );
auto aetherytePlace = exdData.getRow< Component::Excel::PlaceName >( data.TransferName ); auto aetherytePlace = exdData.getRow< Excel::PlaceName >( data.TransferName );
PlayerMgr::sendDebug( *this, "Teleport: {0} - {1} ({2})", PlayerMgr::sendDebug( *this, "Teleport: {0} - {1} ({2})",
townPlace->getString( townPlace->data().Text.SGL ), townPlace->getString( townPlace->data().Text.SGL ),
@ -617,7 +617,7 @@ void Sapphire::Entity::Player::discover( int16_t map_id, int16_t sub_id )
int32_t offset; int32_t offset;
auto info = exdData.getRow< Component::Excel::Map >( map_id ); auto info = exdData.getRow< Excel::Map >( map_id );
if( !info ) if( !info )
{ {
PlayerMgr::sendDebug( *this, "discover(): Could not obtain map data for map_id == {0}", map_id ); PlayerMgr::sendDebug( *this, "discover(): Could not obtain map data for map_id == {0}", map_id );
@ -638,7 +638,7 @@ void Sapphire::Entity::Player::discover( int16_t map_id, int16_t sub_id )
uint16_t level = getLevel(); uint16_t level = getLevel();
uint32_t exp = ( exdData.getRow< Component::Excel::ParamGrow >( level )->data().NextExp * 5 / 100 ); uint32_t exp = ( exdData.getRow< Excel::ParamGrow >( level )->data().NextExp * 5 / 100 );
gainExp( exp ); gainExp( exp );
@ -744,8 +744,8 @@ void Sapphire::Entity::Player::gainExp( uint32_t amount )
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint32_t neededExpToLevel = exdData.getRow< Component::Excel::ParamGrow >( level )->data().NextExp; uint32_t neededExpToLevel = exdData.getRow< Excel::ParamGrow >( level )->data().NextExp;
uint32_t neededExpToLevelPlus1 = exdData.getRow< Component::Excel::ParamGrow >( level + 1 )->data().NextExp; uint32_t neededExpToLevelPlus1 = exdData.getRow< Excel::ParamGrow >( level + 1 )->data().NextExp;
if( ( currentExp + amount ) >= neededExpToLevel ) if( ( currentExp + amount ) >= neededExpToLevel )
{ {
@ -785,7 +785,7 @@ void Sapphire::Entity::Player::sendStatusUpdate()
uint8_t Sapphire::Entity::Player::getLevel() const uint8_t Sapphire::Entity::Player::getLevel() const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex;
return static_cast< uint8_t >( m_classArray[ classJobIndex ] ); return static_cast< uint8_t >( m_classArray[ classJobIndex ] );
} }
@ -798,7 +798,7 @@ uint8_t Sapphire::Entity::Player::getLevelSync() const
uint8_t Sapphire::Entity::Player::getLevelForClass( Common::ClassJob pClass ) const uint8_t Sapphire::Entity::Player::getLevelForClass( Common::ClassJob pClass ) const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( pClass ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( pClass ) )->data().WorkIndex;
return static_cast< uint8_t >( m_classArray[ classJobIndex ] ); return static_cast< uint8_t >( m_classArray[ classJobIndex ] );
} }
@ -811,14 +811,14 @@ bool Sapphire::Entity::Player::isClassJobUnlocked( Common::ClassJob classJob ) c
uint32_t Sapphire::Entity::Player::getExp() const uint32_t Sapphire::Entity::Player::getExp() const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex;
return m_expArray[ classJobIndex ]; return m_expArray[ classJobIndex ];
} }
void Sapphire::Entity::Player::setExp( uint32_t amount ) void Sapphire::Entity::Player::setExp( uint32_t amount )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex;
m_expArray[ classJobIndex ] = amount; m_expArray[ classJobIndex ] = amount;
} }
@ -852,14 +852,14 @@ void Sapphire::Entity::Player::setClassJob( Common::ClassJob classJob )
void Sapphire::Entity::Player::setLevel( uint8_t level ) void Sapphire::Entity::Player::setLevel( uint8_t level )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex;
m_classArray[ classJobIndex ] = level; m_classArray[ classJobIndex ] = level;
} }
void Sapphire::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob classjob ) void Sapphire::Entity::Player::setLevelForClass( uint8_t level, Common::ClassJob classjob )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( classjob ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( classjob ) )->data().WorkIndex;
if( m_classArray[ classJobIndex ] == 0 ) if( m_classArray[ classJobIndex ] == 0 )
insertDbClass( classJobIndex, level ); insertDbClass( classJobIndex, level );
@ -1174,7 +1174,7 @@ const Sapphire::Entity::Player::OrchestrionList& Sapphire::Entity::Player::getOr
void Sapphire::Entity::Player::unlockMount( uint32_t mountId ) void Sapphire::Entity::Player::unlockMount( uint32_t mountId )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto mount = exdData.getRow< Component::Excel::Mount >( mountId ); auto mount = exdData.getRow< Excel::Mount >( mountId );
if( mount->data().MountOrder == -1 ) if( mount->data().MountOrder == -1 )
return; return;
@ -1408,7 +1408,7 @@ void Sapphire::Entity::Player::setCompanion( uint8_t id )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto companion = exdData.getRow< Component::Excel::Companion >( id ); auto companion = exdData.getRow< Excel::Companion >( id );
if( !id ) if( !id )
return; return;
@ -1698,12 +1698,12 @@ void Sapphire::Entity::Player::teleportQuery( uint16_t aetheryteId )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
// TODO: only register this action if enough gil is in possession // TODO: only register this action if enough gil is in possession
auto targetAetheryte = exdData.getRow< Component::Excel::Aetheryte >( aetheryteId ); auto targetAetheryte = exdData.getRow< Excel::Aetheryte >( aetheryteId );
if( targetAetheryte ) if( targetAetheryte )
{ {
auto fromAetheryte = exdData.getRow< Component::Excel::Aetheryte >( auto fromAetheryte = exdData.getRow< Excel::Aetheryte >(
exdData.getRow< Component::Excel::TerritoryType >( getTerritoryTypeId() )->data().Aetheryte ); exdData.getRow< Excel::TerritoryType >( getTerritoryTypeId() )->data().Aetheryte );
// calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets // calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets
auto cost = static_cast< uint16_t > ( auto cost = static_cast< uint16_t > (
@ -1892,7 +1892,7 @@ void Sapphire::Entity::Player::sendHuntingLog()
bool allComplete = true; bool allComplete = true;
auto monsterNoteId = ( count + 1 ) * 10000 + entry.rank * 10 + i; auto monsterNoteId = ( count + 1 ) * 10000 + entry.rank * 10 + i;
auto monsterNote = exdData.getRow< Component::Excel::MonsterNote >( monsterNoteId ); auto monsterNote = exdData.getRow< Excel::MonsterNote >( monsterNoteId );
if( !monsterNote ) if( !monsterNote )
continue; continue;
@ -1930,7 +1930,7 @@ void Sapphire::Entity::Player::updateHuntingLog( uint16_t id )
// make sure we get the matching base-class if a job is being used // make sure we get the matching base-class if a job is being used
auto currentClass = currentClassId; auto currentClass = currentClassId;
auto classJobInfo = pExdData.getRow< Component::Excel::ClassJob >( currentClass ); auto classJobInfo = pExdData.getRow< Excel::ClassJob >( currentClass );
if( !classJobInfo ) if( !classJobInfo )
return; return;
@ -1940,7 +1940,7 @@ void Sapphire::Entity::Player::updateHuntingLog( uint16_t id )
bool sectionComplete = true; bool sectionComplete = true;
bool sectionChanged = false; bool sectionChanged = false;
auto monsterNoteId = static_cast< uint32_t >( classJobInfo->data().MainClass * 10000 + logEntry.rank * 10 + i ); auto monsterNoteId = static_cast< uint32_t >( classJobInfo->data().MainClass * 10000 + logEntry.rank * 10 + i );
auto note = pExdData.getRow< Component::Excel::MonsterNote >( monsterNoteId ); auto note = pExdData.getRow< Excel::MonsterNote >( monsterNoteId );
// for classes that don't have entries, if the first fails the rest will fail // for classes that don't have entries, if the first fails the rest will fail
if( !note ) if( !note )
@ -1948,7 +1948,7 @@ void Sapphire::Entity::Player::updateHuntingLog( uint16_t id )
for( auto x = 0; x < 4; ++x ) for( auto x = 0; x < 4; ++x )
{ {
auto note1 = pExdData.getRow< Component::Excel::MonsterNoteTarget >( note->data().Target[ x ] ); auto note1 = pExdData.getRow< Excel::MonsterNoteTarget >( note->data().Target[ x ] );
if( note1->data().Monster == id && logEntry.entries[ i - 1 ][ x ] < note->data().NeededKills[ x ] ) if( note1->data().Monster == id && logEntry.entries[ i - 1 ][ x ] < note->data().NeededKills[ x ] )
{ {
logEntry.entries[ i - 1 ][ x ]++; logEntry.entries[ i - 1 ][ x ]++;

View file

@ -112,9 +112,9 @@ void Sapphire::Entity::Player::equipWeapon( const Item& item )
{ {
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto itemInfo = exdData.getRow< Component::Excel::Item >( item.getId() ); auto itemInfo = exdData.getRow< Excel::Item >( item.getId() );
auto itemClassJob = itemInfo->data().Class; auto itemClassJob = itemInfo->data().Class;
auto classJobInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint32_t >( getClass() ) ); auto classJobInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint32_t >( getClass() ) );
auto currentParentClass = static_cast< ClassJob >( classJobInfo->data().MainClass ); auto currentParentClass = static_cast< ClassJob >( classJobInfo->data().MainClass );
auto newClassJob = static_cast< ClassJob >( itemClassJob ); auto newClassJob = static_cast< ClassJob >( itemClassJob );
@ -128,7 +128,7 @@ void Sapphire::Entity::Player::equipSoulCrystal( const Item& item )
{ {
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto itemInfo = exdData.getRow< Component::Excel::Item >( item.getId() ); auto itemInfo = exdData.getRow< Excel::Item >( item.getId() );
auto itemClassJob = itemInfo->data().Class; auto itemClassJob = itemInfo->data().Class;
auto newClassJob = static_cast< ClassJob >( itemClassJob ); auto newClassJob = static_cast< ClassJob >( itemClassJob );
@ -281,7 +281,7 @@ void Sapphire::Entity::Player::unequipSoulCrystal()
{ {
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto currentClassJob = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint32_t >( getClass() ) ); auto currentClassJob = exdData.getRow< Excel::ClassJob >( static_cast< uint32_t >( getClass() ) );
auto parentClass = static_cast< ClassJob >( currentClassJob->data().MainClass ); auto parentClass = static_cast< ClassJob >( currentClassJob->data().MainClass );
setClassJob( parentClass ); setClassJob( parentClass );
} }
@ -567,7 +567,7 @@ bool Sapphire::Entity::Player::isObtainable( uint32_t catalogId, uint8_t quantit
Sapphire::ItemPtr Sapphire::Entity::Player::addItem( uint32_t catalogId, uint32_t quantity, bool isHq, bool silent, bool canMerge ) Sapphire::ItemPtr Sapphire::Entity::Player::addItem( uint32_t catalogId, uint32_t quantity, bool isHq, bool silent, bool canMerge )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto itemInfo = exdData.getRow< Component::Excel::Item >( catalogId ); auto itemInfo = exdData.getRow< Excel::Item >( catalogId );
// if item data doesn't exist or it's a blank field // if item data doesn't exist or it's a blank field
if( !itemInfo || itemInfo->data().EquipLevel == 0 ) if( !itemInfo || itemInfo->data().EquipLevel == 0 )

View file

@ -439,7 +439,7 @@ void Sapphire::Entity::Player::updateDbClass() const
{ {
auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref(); auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref();
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast<uint8_t>( getClass() ) )->data().WorkIndex; uint8_t classJobIndex = exdData.getRow< Excel::ClassJob >( static_cast<uint8_t>( getClass() ) )->data().WorkIndex;
//Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ? //Exp = ?, Lvl = ? WHERE CharacterId = ? AND ClassIdx = ?
auto stmtS = db.getPreparedStatement( Db::CHARA_CLASS_UP ); auto stmtS = db.getPreparedStatement( Db::CHARA_CLASS_UP );
@ -609,7 +609,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::createItem( uint32_t catalogId, uint
auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref(); auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref();
auto& itemMgr = Common::Service< World::Manager::ItemMgr >::ref(); auto& itemMgr = Common::Service< World::Manager::ItemMgr >::ref();
auto itemInfo = exdData.getRow< Component::Excel::Item >( catalogId ); auto itemInfo = exdData.getRow< Excel::Item >( catalogId );
if( !itemInfo ) if( !itemInfo )
return nullptr; return nullptr;

View file

@ -40,7 +40,7 @@ void Sapphire::World::ContentFinder::update()
break; break;
case MatchingComplete: case MatchingComplete:
{ {
auto contentInfo = exdData.getRow< Component::Excel::InstanceContent >( content->getContentId() ); auto contentInfo = exdData.getRow< Excel::InstanceContent >( content->getContentId() );
for( auto& queuedPlayer : content->m_players ) for( auto& queuedPlayer : content->m_players )
{ {
uint32_t inProgress = 0; // 0x01 - in progress uint32_t inProgress = 0; // 0x01 - in progress
@ -96,12 +96,12 @@ void Sapphire::World::ContentFinder::registerContentRequest( Sapphire::Entity::P
void Sapphire::World::ContentFinder::registerRandomContentRequest( Sapphire::Entity::Player &player, uint32_t randomContentTypeId ) void Sapphire::World::ContentFinder::registerRandomContentRequest( Sapphire::Entity::Player &player, uint32_t randomContentTypeId )
{ {
auto& exdData = Service< Data::ExdData >::ref(); auto& exdData = Service< Data::ExdData >::ref();
auto contentListIds = exdData.getIdList< Component::Excel::InstanceContent >(); auto contentListIds = exdData.getIdList< Excel::InstanceContent >();
std::vector< uint32_t > idList; std::vector< uint32_t > idList;
for( auto id : contentListIds ) for( auto id : contentListIds )
{ {
auto instanceContent = exdData.getRow< Component::Excel::InstanceContent >( id ); auto instanceContent = exdData.getRow< Excel::InstanceContent >( id );
if( instanceContent->data().RandomContentType == randomContentTypeId ) if( instanceContent->data().RandomContentType == randomContentTypeId )
{ {
if( instanceContent->data().LevelMin <= player.getLevel() ) if( instanceContent->data().LevelMin <= player.getLevel() )
@ -120,7 +120,7 @@ void Sapphire::World::ContentFinder::completeRegistration( const Sapphire::Entit
auto queuedContent = m_queuedContent[ m_queuedPlayer[ player.getId() ]->getActiveRegisterId() ]; auto queuedContent = m_queuedContent[ m_queuedPlayer[ player.getId() ]->getActiveRegisterId() ];
auto& exdData = Service< Data::ExdData >::ref(); auto& exdData = Service< Data::ExdData >::ref();
auto content = exdData.getRow< Component::Excel::InstanceContent >( queuedContent->getContentId() ); auto content = exdData.getRow< Excel::InstanceContent >( queuedContent->getContentId() );
auto updatePacket = makeUpdateFindContent( player.getId(), content->data().TerritoryType, auto updatePacket = makeUpdateFindContent( player.getId(), content->data().TerritoryType,
CompleteRegistration, 1, static_cast< uint32_t >( player.getClass() ) ); CompleteRegistration, 1, static_cast< uint32_t >( player.getClass() ) );
@ -251,7 +251,7 @@ Sapphire::World::ContentFinder::QueuedContentPtrList Sapphire::World::ContentFin
continue; continue;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto content = exdData.getRow< Component::Excel::InstanceContent >( contentId ); auto content = exdData.getRow< Excel::InstanceContent >( contentId );
if( !content ) if( !content )
continue; continue;
@ -316,7 +316,7 @@ void Sapphire::World::ContentFinder::withdraw( Entity::Player& player )
auto& exdData = Service< Data::ExdData >::ref(); auto& exdData = Service< Data::ExdData >::ref();
auto queuedPlayer = m_queuedPlayer[ player.getId() ]; auto queuedPlayer = m_queuedPlayer[ player.getId() ];
auto contentInfo = exdData.getRow< Component::Excel::InstanceContent >( m_queuedContent[ queuedPlayer->getActiveRegisterId() ]->getContentId() ); auto contentInfo = exdData.getRow< Excel::InstanceContent >( m_queuedContent[ queuedPlayer->getActiveRegisterId() ]->getContentId() );
// remove the player from the global CF list // remove the player from the global CF list
m_queuedPlayer.erase( player.getId() ); m_queuedPlayer.erase( player.getId() );
@ -345,7 +345,7 @@ void Sapphire::World::ContentFinder::withdraw( Entity::Player& player )
if( updateRegisterIdSet.count( regId ) == 0 ) if( updateRegisterIdSet.count( regId ) == 0 )
continue; continue;
auto queuedContentInfo = exdData.getRow< Component::Excel::InstanceContent >( content.second->getContentId() ); auto queuedContentInfo = exdData.getRow< Excel::InstanceContent >( content.second->getContentId() );
auto& playerList = content.second->m_players; auto& playerList = content.second->m_players;
for( const auto& pPlayer : playerList ) for( const auto& pPlayer : playerList )
{ {
@ -400,7 +400,7 @@ Sapphire::World::QueuedContent::QueuedContent( uint32_t registerId, uint32_t con
m_contentPopTime( 0 ) m_contentPopTime( 0 )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto content = exdData.getRow< Component::Excel::InstanceContent >( contentId ); auto content = exdData.getRow< Excel::InstanceContent >( contentId );
} }

View file

@ -15,7 +15,7 @@ Sapphire::Item::Item( uint64_t uId, uint32_t catalogId, bool isHq ) :
m_reservedFlag( 0 ) m_reservedFlag( 0 )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto itemInfo = exdData.getRow< Component::Excel::Item >( catalogId ); auto itemInfo = exdData.getRow< Excel::Item >( catalogId );
m_delayMs = itemInfo->data().AttackInterval; m_delayMs = itemInfo->data().AttackInterval;
m_physicalDmg = itemInfo->data().Damage; m_physicalDmg = itemInfo->data().Damage;

View file

@ -17,7 +17,7 @@ using namespace Sapphire;
using namespace Sapphire::World::Manager; using namespace Sapphire::World::Manager;
void ActionMgr::handlePlacedPlayerAction( Entity::Player& player, uint32_t actionId, void ActionMgr::handlePlacedPlayerAction( Entity::Player& player, uint32_t actionId,
Component::Excel::ExcelStructPtr< Component::Excel::Action > actionData, Common::FFXIVARR_POSITION3 pos, Excel::ExcelStructPtr< Excel::Action > actionData, Common::FFXIVARR_POSITION3 pos,
uint16_t sequence ) uint16_t sequence )
{ {
PlayerMgr::sendDebug( player, "got aoe act: {0}", actionData->getString( actionData->data().Text.Name ) ); PlayerMgr::sendDebug( player, "got aoe act: {0}", actionData->getString( actionData->data().Text.Name ) );
@ -40,7 +40,7 @@ void ActionMgr::handlePlacedPlayerAction( Entity::Player& player, uint32_t actio
} }
void ActionMgr::handleTargetedPlayerAction( Entity::Player& player, uint32_t actionId, void ActionMgr::handleTargetedPlayerAction( Entity::Player& player, uint32_t actionId,
Component::Excel::ExcelStructPtr< Component::Excel::Action > actionData, uint64_t targetId, uint16_t sequence ) Excel::ExcelStructPtr< Excel::Action > actionData, uint64_t targetId, uint16_t sequence )
{ {
auto action = Action::make_Action( player.getAsPlayer(), actionId, sequence, actionData ); auto action = Action::make_Action( player.getAsPlayer(), actionId, sequence, actionData );
@ -62,7 +62,7 @@ void ActionMgr::handleTargetedPlayerAction( Entity::Player& player, uint32_t act
} }
void ActionMgr::handleItemAction( Sapphire::Entity::Player& player, uint32_t itemId, void ActionMgr::handleItemAction( Sapphire::Entity::Player& player, uint32_t itemId,
Component::Excel::ExcelStructPtr< Component::Excel::ItemAction > itemActionData, Excel::ExcelStructPtr< Excel::ItemAction > itemActionData,
uint16_t itemSourceSlot, uint16_t itemSourceContainer ) uint16_t itemSourceSlot, uint16_t itemSourceContainer )
{ {
PlayerMgr::sendDebug( player, "got item act: {0}, slot: {1}, container: {2}", itemId, itemSourceSlot, itemSourceContainer ); PlayerMgr::sendDebug( player, "got item act: {0}, slot: {1}, container: {2}", itemId, itemSourceSlot, itemSourceContainer );
@ -75,7 +75,7 @@ void ActionMgr::handleItemAction( Sapphire::Entity::Player& player, uint32_t ite
} }
void ActionMgr::handleEventItemAction( Sapphire::Entity::Player& player, uint32_t itemId, void ActionMgr::handleEventItemAction( Sapphire::Entity::Player& player, uint32_t itemId,
Component::Excel::ExcelStructPtr< Component::Excel::EventItem > itemActionData, Excel::ExcelStructPtr< Excel::EventItem > itemActionData,
uint32_t sequence, uint64_t targetId ) uint32_t sequence, uint64_t targetId )
{ {
auto action = Action::make_EventItemAction( player.getAsChara(), itemId, itemActionData, sequence, targetId ); auto action = Action::make_EventItemAction( player.getAsChara(), itemId, itemActionData, sequence, targetId );
@ -90,7 +90,7 @@ void ActionMgr::handleEventItemAction( Sapphire::Entity::Player& player, uint32_
} }
void ActionMgr::handleMountAction( Entity::Player& player, uint16_t mountId, void ActionMgr::handleMountAction( Entity::Player& player, uint16_t mountId,
Component::Excel::ExcelStructPtr< Component::Excel::Action > actionData, uint64_t targetId, Excel::ExcelStructPtr< Excel::Action > actionData, uint64_t targetId,
uint16_t sequence ) uint16_t sequence )
{ {
PlayerMgr::sendDebug( player, "setMount: {0}", mountId ); PlayerMgr::sendDebug( player, "setMount: {0}", mountId );
@ -106,7 +106,7 @@ void ActionMgr::handleMountAction( Entity::Player& player, uint16_t mountId,
} }
void ActionMgr::bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction, void ActionMgr::bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction,
Component::Excel::ExcelStructPtr< Component::Excel::Action > actionData ) Excel::ExcelStructPtr< Excel::Action > actionData )
{ {
/* /*
//TODO: need to be fixed //TODO: need to be fixed
@ -140,7 +140,7 @@ void ActionMgr::bootstrapAction( Entity::Player& player, Action::ActionPtr curre
bool ActionMgr::actionHasCastTime( uint32_t actionId ) //TODO: Add logic for special cases bool ActionMgr::actionHasCastTime( uint32_t actionId ) //TODO: Add logic for special cases
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto actionInfoPtr = exdData.getRow< Component::Excel::Action >( actionId ); auto actionInfoPtr = exdData.getRow< Excel::Action >( actionId );
if( actionInfoPtr->data().ComboContinue ) if( actionInfoPtr->data().ComboContinue )
return false; return false;

View file

@ -21,23 +21,23 @@ namespace Sapphire::World::Manager
~ActionMgr() = default; ~ActionMgr() = default;
void handleTargetedPlayerAction( Entity::Player& player, uint32_t actionId, void handleTargetedPlayerAction( Entity::Player& player, uint32_t actionId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData, uint64_t targetId, uint16_t sequence ); std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData, uint64_t targetId, uint16_t sequence );
void handlePlacedPlayerAction( Entity::Player& player, uint32_t actionId, void handlePlacedPlayerAction( Entity::Player& player, uint32_t actionId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData, Common::FFXIVARR_POSITION3 pos, uint16_t sequence ); std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData, Common::FFXIVARR_POSITION3 pos, uint16_t sequence );
void handleItemAction( Entity::Player& player, uint32_t itemId, void handleItemAction( Entity::Player& player, uint32_t itemId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > itemActionData, std::shared_ptr< Excel::ExcelStruct< Excel::ItemAction > > itemActionData,
uint16_t itemSourceSlot, uint16_t itemSourceContainer ); uint16_t itemSourceSlot, uint16_t itemSourceContainer );
void handleEventItemAction( Entity::Player& player, uint32_t itemId, void handleEventItemAction( Entity::Player& player, uint32_t itemId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::EventItem > > itemActionData, uint32_t sequence, uint64_t targetId ); std::shared_ptr< Excel::ExcelStruct< Excel::EventItem > > itemActionData, uint32_t sequence, uint64_t targetId );
void handleMountAction( Entity::Player& player, uint16_t mountId, void handleMountAction( Entity::Player& player, uint16_t mountId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData, uint64_t targetId, uint16_t sequence ); std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData, uint64_t targetId, uint16_t sequence );
bool actionHasCastTime( uint32_t actionId ); bool actionHasCastTime( uint32_t actionId );
private: private:
void bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction, std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > actionData ); void bootstrapAction( Entity::Player& player, Action::ActionPtr currentAction, std::shared_ptr< Excel::ExcelStruct< Excel::Action > > actionData );
// item action handlers // item action handlers
void handleItemActionVFX( Entity::Player& player, uint32_t itemId, uint16_t vfxId ); void handleItemActionVFX( Entity::Player& player, uint32_t itemId, uint16_t vfxId );

View file

@ -584,7 +584,7 @@ void DebugCommandMgr::get( char* data, Entity::Player& player, std::shared_ptr<
if( ( subCommand == "pos" ) ) if( ( subCommand == "pos" ) )
{ {
int16_t map_id = exdData.getRow< Component::Excel::TerritoryType >( player.getTerritoryTypeId() )->data().Map; int16_t map_id = exdData.getRow< Excel::TerritoryType >( player.getTerritoryTypeId() )->data().Map;
PlayerMgr::sendServerNotice( player, "Pos:\n {0}\n {1}\n {2}\n {3}\n MapId: {4}\n ZoneId:{5}", PlayerMgr::sendServerNotice( player, "Pos:\n {0}\n {1}\n {2}\n {3}\n MapId: {4}\n ZoneId:{5}",
player.getPos().x, player.getPos().y, player.getPos().z, player.getPos().x, player.getPos().y, player.getPos().z,

View file

@ -48,7 +48,7 @@ std::string EventMgr::getEventName( uint32_t eventId )
{ {
case Event::EventHandler::EventHandlerType::Quest: case Event::EventHandler::EventHandlerType::Quest:
{ {
auto questInfo = exdData.getRow< Component::Excel::Quest >( eventId ); auto questInfo = exdData.getRow< Excel::Quest >( eventId );
if( !questInfo ) if( !questInfo )
return unknown + "Quest"; return unknown + "Quest";
@ -59,7 +59,7 @@ std::string EventMgr::getEventName( uint32_t eventId )
} }
case Event::EventHandler::EventHandlerType::CustomTalk: case Event::EventHandler::EventHandlerType::CustomTalk:
{ {
auto customTalkInfo = exdData.getRow< Component::Excel::CustomTalk >( eventId ); auto customTalkInfo = exdData.getRow< Excel::CustomTalk >( eventId );
if( !customTalkInfo ) if( !customTalkInfo )
return unknown + "CustomTalk"; return unknown + "CustomTalk";
@ -70,14 +70,14 @@ std::string EventMgr::getEventName( uint32_t eventId )
} }
case Event::EventHandler::EventHandlerType::Opening: case Event::EventHandler::EventHandlerType::Opening:
{ {
auto openingInfo = exdData.getRow< Component::Excel::Opening >( eventId ); auto openingInfo = exdData.getRow< Excel::Opening >( eventId );
if( openingInfo ) if( openingInfo )
return openingInfo->getString( openingInfo->data().Script ); return openingInfo->getString( openingInfo->data().Script );
return unknown + "Opening"; return unknown + "Opening";
} }
case Event::EventHandler::EventHandlerType::Aetheryte: case Event::EventHandler::EventHandlerType::Aetheryte:
{ {
auto aetherInfo = exdData.getRow< Component::Excel::Aetheryte >( eventId & 0xFFFF ); auto aetherInfo = exdData.getRow< Excel::Aetheryte >( eventId & 0xFFFF );
if( aetherInfo->data().Telepo ) if( aetherInfo->data().Telepo )
return "Aetheryte"; return "Aetheryte";
return "Aethernet"; return "Aethernet";
@ -90,10 +90,10 @@ std::string EventMgr::getEventName( uint32_t eventId )
case Event::EventHandler::EventHandlerType::QuestBattleDirector: case Event::EventHandler::EventHandlerType::QuestBattleDirector:
{ {
auto qbInfo = exdData.getRow< Component::Excel::QuestBattle >( eventId & 0xFFFF ); auto qbInfo = exdData.getRow< Excel::QuestBattle >( eventId & 0xFFFF );
if( !qbInfo ) if( !qbInfo )
return "unknown"; return "unknown";
auto questInfo = exdData.getRow< Component::Excel::Quest >( qbInfo->data().Quest ); auto questInfo = exdData.getRow< Excel::Quest >( qbInfo->data().Quest );
if( !questInfo ) if( !questInfo )
return "unknown"; return "unknown";
@ -107,7 +107,7 @@ std::string EventMgr::getEventName( uint32_t eventId )
case Event::EventHandler::EventHandlerType::Warp: case Event::EventHandler::EventHandlerType::Warp:
{ {
auto warpInfo = exdData.getRow< Component::Excel::Warp >( eventId ); auto warpInfo = exdData.getRow< Excel::Warp >( eventId );
if( warpInfo ) if( warpInfo )
return "WarpTaxi"; return "WarpTaxi";
return unknown + "ChocoboWarp"; //who know return unknown + "ChocoboWarp"; //who know
@ -115,7 +115,7 @@ std::string EventMgr::getEventName( uint32_t eventId )
case Event::EventHandler::EventHandlerType::Shop: case Event::EventHandler::EventHandlerType::Shop:
{ {
//auto shopInfo = exdData.getRow< Component::Excel::ShopStruct >( eventId ); //auto shopInfo = exdData.getRow< Excel::ShopStruct >( eventId );
return "GilShop" + std::to_string( eventId ); return "GilShop" + std::to_string( eventId );
/*if( shopInfo ) /*if( shopInfo )
@ -224,7 +224,7 @@ uint32_t EventMgr::mapEventActorToRealActor( uint32_t eventActorId )
{ {
auto& instanceObjectCache = Common::Service< InstanceObjectCache >::ref(); auto& instanceObjectCache = Common::Service< InstanceObjectCache >::ref();
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto levelInfo = exdData.getRow< Component::Excel::Level >( eventActorId ); auto levelInfo = exdData.getRow< Excel::Level >( eventActorId );
if( levelInfo ) if( levelInfo )
return levelInfo->data().BaseId; return levelInfo->data().BaseId;
else if( auto pObj = instanceObjectCache.getEObj( eventActorId ) ) else if( auto pObj = instanceObjectCache.getEObj( eventActorId ) )
@ -546,7 +546,7 @@ void EventMgr::playGilShop( Entity::Player& player, uint32_t eventId, uint32_t f
for( auto it = player.getSoldItems()->cbegin(); it != player.getSoldItems()->cend(); ++it ) for( auto it = player.getSoldItems()->cbegin(); it != player.getSoldItems()->cend(); ++it )
{ {
auto item = exdData.getRow< Component::Excel::Item >( it->first ); auto item = exdData.getRow< Excel::Item >( it->first );
params.push_back( it->first ); //itemCatalogId params.push_back( it->first ); //itemCatalogId
params.push_back( it->second ); //stack params.push_back( it->second ); //stack
params.push_back( item->data().Price ); //price params.push_back( item->data().Price ); //price

View file

@ -590,7 +590,7 @@ bool HousingMgr::initHouseModels( Entity::Player& player, LandPtr land, uint32_t
houseInventory[ Common::InventoryType::HousingExteriorAppearance ] = extContainer; houseInventory[ Common::InventoryType::HousingExteriorAppearance ] = extContainer;
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto preset = exdData.getRow< Component::Excel::HousingPreset >( getItemAdditionalData( presetCatalogId ) ); auto preset = exdData.getRow< Excel::HousingPreset >( getItemAdditionalData( presetCatalogId ) );
if( !preset ) if( !preset )
return false; return false;
@ -980,7 +980,7 @@ void HousingMgr::updateHouseModels( HousePtr house )
uint32_t HousingMgr::getItemAdditionalData( uint32_t catalogId ) uint32_t HousingMgr::getItemAdditionalData( uint32_t catalogId )
{ {
auto& pExdData = Common::Service< Data::ExdData >::ref(); auto& pExdData = Common::Service< Data::ExdData >::ref();
auto info = pExdData.getRow< Component::Excel::Item >( catalogId ); auto info = pExdData.getRow< Excel::Item >( catalogId );
return info->data().CategoryArg; return info->data().CategoryArg;
} }

View file

@ -78,7 +78,7 @@ ItemPtr InventoryMgr::createItem( Entity::Player& player, uint32_t catalogId, ui
{ {
auto& pExdData = Common::Service< Data::ExdData >::ref(); auto& pExdData = Common::Service< Data::ExdData >::ref();
auto& itemMgr = Common::Service< ItemMgr >::ref(); auto& itemMgr = Common::Service< ItemMgr >::ref();
auto itemInfo = pExdData.getRow< Component::Excel::Item >( catalogId ); auto itemInfo = pExdData.getRow< Excel::Item >( catalogId );
if( !itemInfo ) if( !itemInfo )
return nullptr; return nullptr;

View file

@ -134,7 +134,7 @@ ItemPtr ItemMgr::loadItem( uint64_t uId )
try try
{ {
auto itemInfo = exdData.getRow< Component::Excel::Item >( itemRes->getUInt( 1 ) ); auto itemInfo = exdData.getRow< Excel::Item >( itemRes->getUInt( 1 ) );
bool isHq = itemRes->getUInt( 3 ) == 1; bool isHq = itemRes->getUInt( 3 ) == 1;
ItemPtr pItem = make_Item( uId, ItemPtr pItem = make_Item( uId,

View file

@ -361,7 +361,7 @@ void PartyMgr::sendPartyUpdate( Party& party )
for( const auto& member : partyMembers ) for( const auto& member : partyMembers )
{ {
auto classJob = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( member->getClass() ) ); auto classJob = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( member->getClass() ) );
if( !classJob ) if( !classJob )
continue; continue;

View file

@ -84,11 +84,11 @@ void PlayerMgr::onSendStats( Entity::Player& player )
auto& exd = Common::Service< Data::ExdData >::ref(); auto& exd = Common::Service< Data::ExdData >::ref();
// todo: this is no doubt slow as shit... // todo: this is no doubt slow as shit...
auto idList = exd.getIdList< Component::Excel::BaseParam >(); auto idList = exd.getIdList< Excel::BaseParam >();
for( const auto id : idList ) for( const auto id : idList )
{ {
auto row = exd.getRow< Component::Excel::BaseParam >( id ); auto row = exd.getRow< Excel::BaseParam >( id );
if( !row ) if( !row )
{ {
continue; continue;

View file

@ -61,11 +61,11 @@ bool QuestMgr::giveQuestRewards( Entity::Player& player, uint16_t questId, uint3
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint32_t playerLevel = player.getLevel(); uint32_t playerLevel = player.getLevel();
auto questInfo = exdData.getRow< Component::Excel::Quest >( static_cast< uint32_t >( Event::EventHandler::EventHandlerType::Quest ) << 16 | questId ); auto questInfo = exdData.getRow< Excel::Quest >( static_cast< uint32_t >( Event::EventHandler::EventHandlerType::Quest ) << 16 | questId );
if( !questInfo ) if( !questInfo )
return false; return false;
auto paramGrowth = exdData.getRow< Component::Excel::ParamGrow >( questInfo->data().ClassLevel ); auto paramGrowth = exdData.getRow< Excel::ParamGrow >( questInfo->data().ClassLevel );
uint32_t exp = ( questInfo->data().Reward.ExpBonus * paramGrowth->data().BaseExp * paramGrowth->data().EventExpRate ) / 100; uint32_t exp = ( questInfo->data().Reward.ExpBonus * paramGrowth->data().BaseExp * paramGrowth->data().EventExpRate ) / 100;
uint32_t gilReward = questInfo->data().Reward.Gil; uint32_t gilReward = questInfo->data().Reward.Gil;

View file

@ -12,20 +12,20 @@ using namespace Sapphire::World::Manager;
void ShopMgr::cacheShop( uint32_t shopId ) void ShopMgr::cacheShop( uint32_t shopId )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto itemShopList = exdData.getIdList< Component::Excel::Shop >(); auto itemShopList = exdData.getIdList< Excel::Shop >();
uint8_t count = 0; uint8_t count = 0;
for( auto itemShop : itemShopList ) for( auto itemShop : itemShopList )
{ {
if( shopId == itemShop ) if( shopId == itemShop )
{ {
auto shop = exdData.getRow< Component::Excel::Shop >( itemShop ); auto shop = exdData.getRow< Excel::Shop >( itemShop );
for( auto shopItemId : shop->data().Item ) for( auto shopItemId : shop->data().Item )
{ {
auto shopItem = exdData.getRow< Component::Excel::ShopItem >( shopItemId ); auto shopItem = exdData.getRow< Excel::ShopItem >( shopItemId );
if( !shopItem ) if( !shopItem )
continue; continue;
auto item = exdData.getRow< Component::Excel::Item >( shopItem->data().ItemId ); auto item = exdData.getRow< Excel::Item >( shopItem->data().ItemId );
if( !item || item->data().Price == 0 ) if( !item || item->data().Price == 0 )
continue; continue;
@ -61,7 +61,7 @@ bool ShopMgr::purchaseGilShopItem( Entity::Player& player, uint32_t shopId, uint
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto item = exdData.getRow< Component::Excel::Item >( itemId ); auto item = exdData.getRow< Excel::Item >( itemId );
if( !item ) if( !item )
return false; return false;
@ -82,7 +82,7 @@ bool ShopMgr::sellGilShopItem( Entity::Player& player, uint16_t container, uint8
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto item = exdData.getRow< Component::Excel::Item >( itemId ); auto item = exdData.getRow< Excel::Item >( itemId );
if( !item ) if( !item )
return false; return false;

View file

@ -34,11 +34,11 @@ TerritoryMgr::TerritoryMgr() :
void TerritoryMgr::loadTerritoryTypeDetailCache() void TerritoryMgr::loadTerritoryTypeDetailCache()
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto idList = exdData.getIdList< Component::Excel::TerritoryType >(); auto idList = exdData.getIdList< Excel::TerritoryType >();
for( auto id : idList ) for( auto id : idList )
{ {
auto teri1 = exdData.getRow< Component::Excel::TerritoryType >( id ); auto teri1 = exdData.getRow< Excel::TerritoryType >( id );
if( !teri1->getString( teri1->data().Name ).empty() && id > 90 ) if( !teri1->getString( teri1->data().Name ).empty() && id > 90 )
m_territoryTypeDetailCacheMap[ id ] = teri1; m_territoryTypeDetailCacheMap[ id ] = teri1;
@ -79,10 +79,10 @@ uint32_t TerritoryMgr::getNextInstanceId()
return ++m_lastInstanceId; return ++m_lastInstanceId;
} }
Component::Excel::ExcelStructPtr< Component::Excel::TerritoryType > TerritoryMgr::getTerritoryDetail( uint32_t territoryTypeId ) const Excel::ExcelStructPtr< Excel::TerritoryType > TerritoryMgr::getTerritoryDetail( uint32_t territoryTypeId ) const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto teri1 = exdData.getRow< Component::Excel::TerritoryType >( territoryTypeId ); auto teri1 = exdData.getRow< Excel::TerritoryType >( territoryTypeId );
if( !teri1 ) if( !teri1 )
return nullptr; return nullptr;
@ -160,11 +160,11 @@ bool TerritoryMgr::isHousingTerritory( uint32_t territoryTypeId ) const
uint32_t TerritoryMgr::getInstanceContentId( uint32_t territoryTypeId ) const uint32_t TerritoryMgr::getInstanceContentId( uint32_t territoryTypeId ) const
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto contentListIds = exdData.getIdList< Component::Excel::InstanceContent >(); auto contentListIds = exdData.getIdList< Excel::InstanceContent >();
for( auto id : contentListIds ) for( auto id : contentListIds )
{ {
auto instanceContent = exdData.getRow< Component::Excel::InstanceContent >( id ); auto instanceContent = exdData.getRow< Excel::InstanceContent >( id );
if( instanceContent->data().TerritoryType == territoryTypeId ) if( instanceContent->data().TerritoryType == territoryTypeId )
{ {
return id; return id;
@ -188,7 +188,7 @@ bool TerritoryMgr::createDefaultTerritories()
if( territoryInfo->getString( territoryData.Name ).empty() ) if( territoryInfo->getString( territoryData.Name ).empty() )
continue; continue;
auto pPlaceName = exdData.getRow< Component::Excel::PlaceName >( territoryData.Area ); auto pPlaceName = exdData.getRow< Excel::PlaceName >( territoryData.Area );
if( !pPlaceName || pPlaceName->getString( pPlaceName->data().Text.SGL ).empty() || !isDefaultTerritory( territoryTypeId ) ) if( !pPlaceName || pPlaceName->getString( pPlaceName->data().Text.SGL ).empty() || !isDefaultTerritory( territoryTypeId ) )
continue; continue;
@ -237,7 +237,7 @@ bool TerritoryMgr::createHousingTerritories()
if( territoryInfo->getString( territoryInfo->data().Name ).empty() ) if( territoryInfo->getString( territoryInfo->data().Name ).empty() )
continue; continue;
auto pPlaceName = exdData.getRow< Component::Excel::PlaceName >( territoryInfo->data().Area ); auto pPlaceName = exdData.getRow< Excel::PlaceName >( territoryInfo->data().Area );
if( !pPlaceName || pPlaceName->getString( pPlaceName->data().Text.SGL ).empty() || !isHousingTerritory( territoryTypeId ) ) if( !pPlaceName || pPlaceName->getString( pPlaceName->data().Text.SGL ).empty() || !isHousingTerritory( territoryTypeId ) )
continue; continue;
@ -280,7 +280,7 @@ TerritoryPtr TerritoryMgr::createTerritoryInstance( uint32_t territoryTypeId )
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto pTeri = getTerritoryDetail( territoryTypeId ); auto pTeri = getTerritoryDetail( territoryTypeId );
auto pPlaceName = exdData.getRow< Component::Excel::PlaceName >( pTeri->data().Area ); auto pPlaceName = exdData.getRow< Excel::PlaceName >( pTeri->data().Area );
if( !pTeri || !pPlaceName ) if( !pTeri || !pPlaceName )
return nullptr; return nullptr;
@ -302,18 +302,18 @@ TerritoryPtr TerritoryMgr::createQuestBattle( uint32_t questBattleId )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto pQuestBattleInfo = exdData.getRow< Component::Excel::QuestBattle >( questBattleId ); auto pQuestBattleInfo = exdData.getRow< Excel::QuestBattle >( questBattleId );
if( !pQuestBattleInfo ) if( !pQuestBattleInfo )
return nullptr; return nullptr;
auto pQuestInfo = exdData.getRow< Component::Excel::Quest >( pQuestBattleInfo->data().Quest ); auto pQuestInfo = exdData.getRow< Excel::Quest >( pQuestBattleInfo->data().Quest );
if( !pQuestInfo || pQuestInfo->getString( pQuestInfo->data().Text.Name ).empty() ) if( !pQuestInfo || pQuestInfo->getString( pQuestInfo->data().Text.Name ).empty() )
return nullptr; return nullptr;
for( auto& teriId : exdData.getIdList< Component::Excel::TerritoryType >() ) for( auto& teriId : exdData.getIdList< Excel::TerritoryType >() )
{ {
auto pTeri = exdData.getRow< Component::Excel::TerritoryType >( teriId ); auto pTeri = exdData.getRow< Excel::TerritoryType >( teriId );
if( !pTeri || pTeri->data().QuestBattle != questBattleId ) if( !pTeri || pTeri->data().QuestBattle != questBattleId )
continue; continue;
@ -345,7 +345,7 @@ TerritoryPtr TerritoryMgr::createInstanceContent( uint32_t instanceContentId )
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto pInstanceContent = exdData.getRow< Component::Excel::InstanceContent >( instanceContentId ); auto pInstanceContent = exdData.getRow< Excel::InstanceContent >( instanceContentId );
if( !pInstanceContent || !isInstanceContentTerritory( pInstanceContent->data().TerritoryType ) ) if( !pInstanceContent || !isInstanceContentTerritory( pInstanceContent->data().TerritoryType ) )
return nullptr; return nullptr;

View file

@ -118,7 +118,7 @@ namespace Sapphire::World::Manager
TerritoryPtr getTerritoryByGuId( uint32_t guId ) const; TerritoryPtr getTerritoryByGuId( uint32_t guId ) const;
/*! returns the cached detail of a territory, nullptr if not found */ /*! returns the cached detail of a territory, nullptr if not found */
Component::Excel::ExcelStructPtr< Component::Excel::TerritoryType > getTerritoryDetail( uint32_t territoryTypeId ) const; Excel::ExcelStructPtr< Excel::TerritoryType > getTerritoryDetail( uint32_t territoryTypeId ) const;
/*! loop for processing territory logic, iterating all existing instances */ /*! loop for processing territory logic, iterating all existing instances */
void updateTerritoryInstances( uint64_t tickCount ); void updateTerritoryInstances( uint64_t tickCount );
@ -153,7 +153,7 @@ namespace Sapphire::World::Manager
float getInRangeDistance() const; float getInRangeDistance() const;
private: private:
using TerritoryTypeDetailCache = std::unordered_map< uint16_t, std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::TerritoryType > > >; using TerritoryTypeDetailCache = std::unordered_map< uint16_t, std::shared_ptr< Excel::ExcelStruct< Excel::TerritoryType > > >;
using InstanceIdToTerritoryPtrMap = std::unordered_map< uint32_t, TerritoryPtr >; using InstanceIdToTerritoryPtrMap = std::unordered_map< uint32_t, TerritoryPtr >;
using TerritoryTypeIdToInstanceMap = std::unordered_map< uint16_t, InstanceIdToTerritoryPtrMap >; using TerritoryTypeIdToInstanceMap = std::unordered_map< uint16_t, InstanceIdToTerritoryPtrMap >;
using InstanceContentIdToInstanceMap = std::unordered_map< uint16_t, InstanceIdToTerritoryPtrMap >; using InstanceContentIdToInstanceMap = std::unordered_map< uint16_t, InstanceIdToTerritoryPtrMap >;

View file

@ -32,8 +32,8 @@ using namespace Sapphire::Entity;
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency, Sapphire::FrameworkPtr pFw ) uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency, Sapphire::FrameworkPtr pFw )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) ); auto classInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( pPlayer->getLevel() ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( pPlayer->getLevel() );
if( !classInfo || !paramGrowthInfo ) if( !classInfo || !paramGrowthInfo )
return 0; return 0;

View file

@ -129,8 +129,8 @@ uint32_t CalcStats::calculateMaxHp( Player& player )
// Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table? // Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table?
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing // More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( player.getClass() ) ); auto classInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( player.getClass() ) );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( player.getLevel() ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( player.getLevel() );
if( !classInfo || !paramGrowthInfo ) if( !classInfo || !paramGrowthInfo )
return 0; return 0;
@ -159,8 +159,8 @@ uint32_t CalcStats::calculateMaxHp( Chara& chara )
// Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table? // Is there any way to pull reliable BaseHP without having to manually use a pet for every level, and using the values from a table?
// More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing // More info here: https://docs.google.com/spreadsheets/d/1de06KGT0cNRUvyiXNmjNgcNvzBCCQku7jte5QxEQRbs/edit?usp=sharing
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( chara.getClass() ) ); auto classInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( chara.getClass() ) );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( chara.getLevel() ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( chara.getLevel() );
if( !classInfo || !paramGrowthInfo ) if( !classInfo || !paramGrowthInfo )
return 0; return 0;
@ -186,8 +186,8 @@ uint32_t CalcStats::calculateMaxMp( Player& player )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( player.getClass() ) ); auto classInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( player.getClass() ) );
auto paramGrowthInfo = exdData.getRow< Component::Excel::ParamGrow >( player.getLevel() ); auto paramGrowthInfo = exdData.getRow< Excel::ParamGrow >( player.getLevel() );
if( !classInfo || !paramGrowthInfo ) if( !classInfo || !paramGrowthInfo )
return 0; return 0;
@ -356,7 +356,7 @@ float CalcStats::weaponDamage( const Sapphire::Entity::Chara& chara, float weapo
uint32_t jobMod = 1; uint32_t jobMod = 1;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto classInfo = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( chara.getClass() ) ); auto classInfo = exdData.getRow< Excel::ClassJob >( static_cast< uint8_t >( chara.getClass() ) );
if( !classInfo ) if( !classInfo )
return 0.f; return 0.f;

View file

@ -43,7 +43,7 @@ void Sapphire::Network::GameConnection::actionRequest( const Packets::FFXIVARR_P
} }
case Common::SkillType::Normal: case Common::SkillType::Normal:
{ {
auto action = exdData.getRow< Component::Excel::Action >( actionId ); auto action = exdData.getRow< Excel::Action >( actionId );
// ignore invalid actions // ignore invalid actions
if( !action ) if( !action )
@ -55,14 +55,14 @@ void Sapphire::Network::GameConnection::actionRequest( const Packets::FFXIVARR_P
case Common::SkillType::ItemAction: case Common::SkillType::ItemAction:
{ {
auto item = exdData.getRow< Component::Excel::Item >( actionId ); auto item = exdData.getRow< Excel::Item >( actionId );
if( !item ) if( !item )
return; return;
if( item->data().Action == 0 ) if( item->data().Action == 0 )
return; return;
auto itemAction = exdData.getRow< Component::Excel::ItemAction >( item->data().Action ); auto itemAction = exdData.getRow< Excel::ItemAction >( item->data().Action );
if( !itemAction ) if( !itemAction )
return; return;
@ -73,7 +73,7 @@ void Sapphire::Network::GameConnection::actionRequest( const Packets::FFXIVARR_P
case Common::SkillType::EventItem: case Common::SkillType::EventItem:
{ {
auto action = exdData.getRow< Component::Excel::EventItem >( actionId ); auto action = exdData.getRow< Excel::EventItem >( actionId );
assert( action ); assert( action );
actionMgr.handleEventItemAction( player, actionId, action, sequence, targetId ); actionMgr.handleEventItemAction( player, actionId, action, sequence, targetId );
break; break;
@ -81,7 +81,7 @@ void Sapphire::Network::GameConnection::actionRequest( const Packets::FFXIVARR_P
case Common::SkillType::MountSkill: case Common::SkillType::MountSkill:
{ {
auto action = exdData.getRow< Component::Excel::Action >( 4 ); auto action = exdData.getRow< Excel::Action >( 4 );
assert( action ); assert( action );
actionMgr.handleMountAction( player, static_cast< uint16_t >( actionId ), action, targetId, sequence ); actionMgr.handleMountAction( player, static_cast< uint16_t >( actionId ), action, targetId, sequence );
break; break;
@ -114,7 +114,7 @@ void Sapphire::Network::GameConnection::selectGroundActionRequest( const Packets
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto action = exdData.getRow< Component::Excel::Action >( actionId ); auto action = exdData.getRow< Excel::Action >( actionId );
// ignore invalid actions // ignore invalid actions
if( !action ) if( !action )

View file

@ -74,12 +74,12 @@ void Sapphire::Network::GameConnection::find5Contents( const Packets::FFXIVARR_P
if( packet.data().territoryTypes[ i ] != 0 ) if( packet.data().territoryTypes[ i ] != 0 )
selectedContent.insert( packet.data().territoryTypes[ i ] ); selectedContent.insert( packet.data().territoryTypes[ i ] );
auto contentListIds = exdData.getIdList< Component::Excel::InstanceContent >(); auto contentListIds = exdData.getIdList< Excel::InstanceContent >();
std::vector< uint32_t > idList; std::vector< uint32_t > idList;
for( auto id : contentListIds ) for( auto id : contentListIds )
{ {
auto instanceContent = exdData.getRow< Component::Excel::InstanceContent >( id ); auto instanceContent = exdData.getRow< Excel::InstanceContent >( id );
if( selectedContent.count( instanceContent->data().TerritoryType ) ) if( selectedContent.count( instanceContent->data().TerritoryType ) )
{ {
idList.push_back( id ); idList.push_back( id );

View file

@ -95,7 +95,7 @@ void Sapphire::Network::GameConnection::eventHandlerEmote( const Packets::FFXIVA
if( !scriptMgr.onEmote( player, actorId, eventId, static_cast< uint8_t >( emoteId ) ) && if( !scriptMgr.onEmote( player, actorId, eventId, static_cast< uint8_t >( emoteId ) ) &&
eventType == Event::EventHandler::EventHandlerType::Quest ) eventType == Event::EventHandler::EventHandlerType::Quest )
{ {
auto questInfo = exdData.getRow< Component::Excel::Quest >( eventId ); auto questInfo = exdData.getRow< Excel::Quest >( eventId );
if( questInfo ) if( questInfo )
World::Manager::PlayerMgr::sendUrgent( player, "Quest not implemented: {0}", questInfo->getString( questInfo->data().Text.Name ) ); World::Manager::PlayerMgr::sendUrgent( player, "Quest not implemented: {0}", questInfo->getString( questInfo->data().Text.Name ) );
} }

View file

@ -509,11 +509,11 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
bool doTeleport = false; bool doTeleport = false;
uint16_t teleport; uint16_t teleport;
auto idList = exdData.getIdList< Component::Excel::Aetheryte >(); auto idList = exdData.getIdList< Excel::Aetheryte >();
for( auto i : idList ) for( auto i : idList )
{ {
auto data = exdData.getRow< Component::Excel::Aetheryte >( i ); auto data = exdData.getRow< Excel::Aetheryte >( i );
if( !data ) if( !data )
continue; continue;

View file

@ -511,7 +511,7 @@ void Sapphire::Network::GameConnection::commandHandler( const Packets::FFXIVARR_
bool isSilent = param2 == 1; bool isSilent = param2 == 1;
auto& exdData = Service< Data::ExdData >::ref(); auto& exdData = Service< Data::ExdData >::ref();
auto emoteData = exdData.getRow< Component::Excel::Emote >( emoteId ); auto emoteData = exdData.getRow< Excel::Emote >( emoteId );
if( !emoteData ) if( !emoteData )
return; return;

View file

@ -173,7 +173,7 @@ bool Sapphire::Scripting::ScriptMgr::onTalk( Entity::Player& player, uint64_t ac
auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::QuestScript >( eventId ); auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::QuestScript >( eventId );
if( !script ) if( !script )
{ {
auto questInfo = exdData.getRow< Component::Excel::Quest >( eventId ); auto questInfo = exdData.getRow< Excel::Quest >( eventId );
if( questInfo ) if( questInfo )
{ {
World::Manager::PlayerMgr::sendUrgent( player, "Quest not implemented: {0} ({1})", questInfo->getString( questInfo->data().Text.Name ), eventId ); World::Manager::PlayerMgr::sendUrgent( player, "Quest not implemented: {0} ({1})", questInfo->getString( questInfo->data().Text.Name ), eventId );

View file

@ -28,7 +28,7 @@ Sapphire::StatusEffect::StatusEffect::StatusEffect( uint32_t id, Entity::CharaPt
m_lastTick( 0 ) m_lastTick( 0 )
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto entry = exdData.getRow< Component::Excel::Status >( id ); auto entry = exdData.getRow< Excel::Status >( id );
m_name = entry->getString( entry->data().Text.Name ); m_name = entry->getString( entry->data().Text.Name );
std::replace( m_name.begin(), m_name.end(), ' ', '_' ); std::replace( m_name.begin(), m_name.end(), ' ', '_' );

View file

@ -61,7 +61,7 @@ bool Sapphire::HousingZone::init()
housingIndex = 3; housingIndex = 3;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto info = exdData.getRow< Component::Excel::HousingLandSet >( housingIndex ); auto info = exdData.getRow< Excel::HousingLandSet >( housingIndex );
// build yard objects array indices // build yard objects array indices
int16_t cursor = -1; int16_t cursor = -1;

View file

@ -30,7 +30,7 @@ using namespace Sapphire::Network::Packets::WorldPackets::Server;
using namespace Sapphire::Network::ActorControl; using namespace Sapphire::Network::ActorControl;
using namespace Sapphire::World::Manager; using namespace Sapphire::World::Manager;
Sapphire::InstanceContent::InstanceContent( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::InstanceContent > > pInstanceConfiguration, Sapphire::InstanceContent::InstanceContent( std::shared_ptr< Excel::ExcelStruct< Excel::InstanceContent > > pInstanceConfiguration,
uint16_t territoryType, uint16_t territoryType,
uint32_t guId, uint32_t guId,
const std::string& internalName, const std::string& internalName,
@ -74,7 +74,7 @@ uint32_t Sapphire::InstanceContent::getInstanceContentId() const
return m_instanceContentId; return m_instanceContentId;
} }
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::InstanceContent > > Sapphire::InstanceContent::getInstanceConfiguration() const std::shared_ptr< Excel::ExcelStruct< Excel::InstanceContent > > Sapphire::InstanceContent::getInstanceConfiguration() const
{ {
return m_instanceConfiguration; return m_instanceConfiguration;
} }
@ -345,7 +345,7 @@ void Sapphire::InstanceContent::onRegisterEObj( Entity::EventObjectPtr object )
m_pEntranceEObj = object; m_pEntranceEObj = object;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto objData = exdData.getRow< Component::Excel::EObj >( object->getObjectId() ); auto objData = exdData.getRow< Excel::EObj >( object->getObjectId() );
if( objData ) if( objData )
{ {
m_eventIdToObjectMap[ objData->data().EventHandler ] = object; m_eventIdToObjectMap[ objData->data().EventHandler ] = object;

View file

@ -65,7 +65,7 @@ namespace Sapphire
Ended Ended
}; };
InstanceContent( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::InstanceContent > > pInstanceConfiguration, InstanceContent( std::shared_ptr< Excel::ExcelStruct< Excel::InstanceContent > > pInstanceConfiguration,
uint16_t territoryType, uint16_t territoryType,
uint32_t guId, uint32_t guId,
const std::string& internalName, const std::string& internalName,
@ -144,7 +144,7 @@ namespace Sapphire
InstanceContentState getState() const; InstanceContentState getState() const;
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::InstanceContent > > getInstanceConfiguration() const; std::shared_ptr< Excel::ExcelStruct< Excel::InstanceContent > > getInstanceConfiguration() const;
uint32_t getInstanceContentId() const; uint32_t getInstanceContentId() const;
@ -176,7 +176,7 @@ namespace Sapphire
size_t getInstancePlayerCount() const; size_t getInstancePlayerCount() const;
private: private:
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::InstanceContent > > m_instanceConfiguration; std::shared_ptr< Excel::ExcelStruct< Excel::InstanceContent > > m_instanceConfiguration;
uint32_t m_instanceContentId; uint32_t m_instanceContentId;
InstanceContentState m_state; InstanceContentState m_state;
uint16_t m_currentBgm; uint16_t m_currentBgm;

View file

@ -18,7 +18,7 @@ Sapphire::InstanceObjectCache::InstanceObjectCache()
{ {
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref(); auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
auto idList = exdData.getIdList< Component::Excel::TerritoryType >(); auto idList = exdData.getIdList< Excel::TerritoryType >();
size_t count = 0; size_t count = 0;
for( const auto& id : idList ) for( const auto& id : idList )
@ -27,7 +27,7 @@ Sapphire::InstanceObjectCache::InstanceObjectCache()
if( count++ % 10 == 0 ) if( count++ % 10 == 0 )
std::cout << "."; std::cout << ".";
auto territoryType = exdData.getRow< Component::Excel::TerritoryType >( id ); auto territoryType = exdData.getRow< Excel::TerritoryType >( id );
if( !territoryType ) if( !territoryType )
continue; continue;

View file

@ -27,7 +27,7 @@
using namespace Sapphire::Common; using namespace Sapphire::Common;
Sapphire::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Sapphire::Land::Land( uint16_t territoryTypeId, uint8_t wardNum, uint8_t landId, uint32_t landSetId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::HousingLandSet > > info ) : std::shared_ptr< Excel::ExcelStruct< Excel::HousingLandSet > > info ) :
m_currentPrice( 0 ), m_currentPrice( 0 ),
m_minPrice( 0 ), m_minPrice( 0 ),
m_nextDrop( Util::getTimeSeconds() + 21600 ), m_nextDrop( Util::getTimeSeconds() + 21600 ),
@ -65,7 +65,7 @@ void Sapphire::Land::init( Common::LandType type, Common::HouseSize size, Common
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
// EXD TODO: This does not exist in 2.3 // EXD TODO: This does not exist in 2.3
/*auto info = exdData.getRow< Component::Excel::HousingMapMarkerInfo >( m_landIdent.territoryTypeId, m_landIdent.landId ); /*auto info = exdData.getRow< Excel::HousingMapMarkerInfo >( m_landIdent.territoryTypeId, m_landIdent.landId );
if( info ) if( info )
{ {
m_mapMarkerPosition.x = info->x; m_mapMarkerPosition.x = info->x;

View file

@ -13,7 +13,7 @@ namespace Sapphire
public: public:
Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId, Land( uint16_t zoneId, uint8_t wardNum, uint8_t landId, uint32_t landSetId,
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::HousingLandSet > > info ); std::shared_ptr< Excel::ExcelStruct< Excel::HousingLandSet > > info );
virtual ~Land(); virtual ~Land();
void init( Common::LandType type, Common::HouseSize size, Common::HouseStatus state, uint32_t currentPrice, uint64_t ownerId, uint64_t houseId ); void init( Common::LandType type, Common::HouseSize size, Common::HouseStatus state, uint32_t currentPrice, uint64_t ownerId, uint64_t houseId );
@ -79,7 +79,7 @@ namespace Sapphire
Common::FFXIVARR_POSITION3 m_mapMarkerPosition; Common::FFXIVARR_POSITION3 m_mapMarkerPosition;
uint64_t m_ownerId; uint64_t m_ownerId;
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::HousingLandSet > > m_landInfo; std::shared_ptr< Excel::ExcelStruct< Excel::HousingLandSet > > m_landInfo;
Sapphire::HousePtr m_pHouse; Sapphire::HousePtr m_pHouse;

View file

@ -34,7 +34,7 @@ using namespace Sapphire::Network::ActorControl;
using namespace Sapphire::World::Manager; using namespace Sapphire::World::Manager;
Sapphire::QuestBattle::QuestBattle( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::QuestBattle > > pBattleDetails, Sapphire::QuestBattle::QuestBattle( std::shared_ptr< Excel::ExcelStruct< Excel::QuestBattle > > pBattleDetails,
uint16_t territoryType, uint32_t guId, uint16_t territoryType, uint32_t guId,
const std::string& internalName, const std::string& contentName, const std::string& internalName, const std::string& contentName,
uint32_t questBattleId ) : uint32_t questBattleId ) :
@ -67,7 +67,7 @@ uint32_t Sapphire::QuestBattle::getQuestBattleId() const
} }
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::QuestBattle > > Sapphire::QuestBattle::getQuestBattleDetails() const std::shared_ptr< Excel::ExcelStruct< Excel::QuestBattle > > Sapphire::QuestBattle::getQuestBattleDetails() const
{ {
return m_pBattleDetails; return m_pBattleDetails;
} }
@ -231,7 +231,7 @@ void Sapphire::QuestBattle::onRegisterEObj( Entity::EventObjectPtr object )
m_eventObjectMap[ object->getName() ] = object; m_eventObjectMap[ object->getName() ] = object;
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto objData = exdData.getRow< Component::Excel::EObj >( object->getObjectId() ); auto objData = exdData.getRow< Excel::EObj >( object->getObjectId() );
if( objData ) if( objData )
m_eventIdToObjectMap[ objData->data().EventHandler ] = object; m_eventIdToObjectMap[ objData->data().EventHandler ] = object;
else else

View file

@ -16,7 +16,7 @@ namespace Sapphire
class QuestBattle : public Event::Director, public Territory class QuestBattle : public Event::Director, public Territory
{ {
public: public:
QuestBattle( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::QuestBattle > > pBattleDetails, QuestBattle( std::shared_ptr< Excel::ExcelStruct< Excel::QuestBattle > > pBattleDetails,
uint16_t territoryType, uint16_t territoryType,
uint32_t guId, uint32_t guId,
const std::string& internalName, const std::string& internalName,
@ -75,7 +75,7 @@ namespace Sapphire
Event::Director::DirectorState getState() const; Event::Director::DirectorState getState() const;
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::QuestBattle > > getQuestBattleDetails() const; std::shared_ptr< Excel::ExcelStruct< Excel::QuestBattle > > getQuestBattleDetails() const;
uint32_t getQuestBattleId() const; uint32_t getQuestBattleId() const;
@ -87,7 +87,7 @@ namespace Sapphire
Entity::PlayerPtr getPlayerPtr(); Entity::PlayerPtr getPlayerPtr();
private: private:
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::QuestBattle > > m_pBattleDetails; std::shared_ptr< Excel::ExcelStruct< Excel::QuestBattle > > m_pBattleDetails;
uint32_t m_questBattleId; uint32_t m_questBattleId;
Event::Director::DirectorState m_state; Event::Director::DirectorState m_state;

View file

@ -80,7 +80,7 @@ Sapphire::Territory::Territory( uint16_t territoryTypeId, uint32_t guId, const s
m_lastMobUpdate = 0; m_lastMobUpdate = 0;
m_weatherOverride = Weather::None; m_weatherOverride = Weather::None;
m_territoryTypeInfo = exdData.getRow< Component::Excel::TerritoryType >( territoryTypeId ); m_territoryTypeInfo = exdData.getRow< Excel::TerritoryType >( territoryTypeId );
m_bgPath = m_territoryTypeInfo->getString( m_territoryTypeInfo->data().LVB ); m_bgPath = m_territoryTypeInfo->getString( m_territoryTypeInfo->data().LVB );
m_ident.territoryTypeId = territoryTypeId; m_ident.territoryTypeId = territoryTypeId;
@ -98,11 +98,11 @@ void Sapphire::Territory::loadWeatherRates()
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
uint8_t weatherRateId = m_territoryTypeInfo->data().WeatherRate > exdData.getIdList< Component::Excel::WeatherRate >().size() ? uint8_t weatherRateId = m_territoryTypeInfo->data().WeatherRate > exdData.getIdList< Excel::WeatherRate >().size() ?
uint8_t{ 0 } : m_territoryTypeInfo->data().WeatherRate; uint8_t{ 0 } : m_territoryTypeInfo->data().WeatherRate;
uint8_t sumPc = 0; uint8_t sumPc = 0;
auto weatherRate = exdData.getRow< Component::Excel::WeatherRate >( weatherRateId ); auto weatherRate = exdData.getRow< Excel::WeatherRate >( weatherRateId );
for( size_t i = 0; i < 8; ++i ) for( size_t i = 0; i < 8; ++i )
{ {
int32_t weatherId = weatherRate->data().WeatherId[ i ]; int32_t weatherId = weatherRate->data().WeatherId[ i ];
@ -796,7 +796,7 @@ Sapphire::Entity::EventObjectPtr Sapphire::Territory::registerEObj( const std::s
return eObj; return eObj;
} }
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::TerritoryType > > Sapphire::Territory::getTerritoryTypeInfo() const std::shared_ptr< Excel::ExcelStruct< Excel::TerritoryType > > Sapphire::Territory::getTerritoryTypeInfo() const
{ {
return m_territoryTypeInfo; return m_territoryTypeInfo;
} }

View file

@ -62,7 +62,7 @@ namespace Sapphire
FestivalPair m_currentFestival; FestivalPair m_currentFestival;
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::TerritoryType > > m_territoryTypeInfo; std::shared_ptr< Excel::ExcelStruct< Excel::TerritoryType > > m_territoryTypeInfo;
uint32_t m_nextEObjId; uint32_t m_nextEObjId;
uint32_t m_nextActorId; uint32_t m_nextActorId;
@ -94,7 +94,7 @@ namespace Sapphire
void setCurrentFestival( uint16_t festivalId, uint16_t additionalFestivalId = 0 ); void setCurrentFestival( uint16_t festivalId, uint16_t additionalFestivalId = 0 );
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::TerritoryType > > getTerritoryTypeInfo() const; std::shared_ptr< Excel::ExcelStruct< Excel::TerritoryType > > getTerritoryTypeInfo() const;
uint64_t getLastActivityTime() const; uint64_t getLastActivityTime() const;