mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
Add main handling for chara gear param state;
This commit is contained in:
parent
edd42c53da
commit
d4fe294f51
11 changed files with 55 additions and 7 deletions
|
@ -70,6 +70,7 @@ CREATE TABLE IF NOT EXISTS `charadetail` (
|
||||||
`StepIndex` int(5) DEFAULT NULL,
|
`StepIndex` int(5) DEFAULT NULL,
|
||||||
`ChocoboTaxiStandFlags` binary(8) DEFAULT NULL,
|
`ChocoboTaxiStandFlags` binary(8) DEFAULT NULL,
|
||||||
`GMRank` int(3) DEFAULT '0',
|
`GMRank` int(3) DEFAULT '0',
|
||||||
|
`CharaGearParamState` int(3) DEFAULT '0',
|
||||||
`unlocks` binary(64) DEFAULT NULL,
|
`unlocks` binary(64) DEFAULT NULL,
|
||||||
`CharacterId` int(20) NOT NULL DEFAULT '0',
|
`CharacterId` int(20) NOT NULL DEFAULT '0',
|
||||||
`IS_DELETE` int(3) DEFAULT '0',
|
`IS_DELETE` int(3) DEFAULT '0',
|
||||||
|
|
|
@ -23,3 +23,5 @@
|
||||||
-- ALTER TABLE `charadetail` CHANGE `OpeningSequence` `OpeningSequence` INT(3) NULL DEFAULT '0';
|
-- ALTER TABLE `charadetail` CHANGE `OpeningSequence` `OpeningSequence` INT(3) NULL DEFAULT '0';
|
||||||
-- -------------------------------------------
|
-- -------------------------------------------
|
||||||
-- update.sql Before Merge into Other SQL's 30/08/2017
|
-- update.sql Before Merge into Other SQL's 30/08/2017
|
||||||
|
|
||||||
|
ALTER TABLE `charadetail` ADD `CharaGearParamState` int(3) DEFAULT '0' AFTER `GMRank`;
|
|
@ -946,7 +946,7 @@ namespace Core {
|
||||||
|
|
||||||
SetMaxGearSets = 0x230,
|
SetMaxGearSets = 0x230,
|
||||||
|
|
||||||
ToggleDisplayHeadAndWeapon = 0x260,
|
SetCharaGearParamUI = 0x260,
|
||||||
|
|
||||||
GearSetEquipMsg = 0x321
|
GearSetEquipMsg = 0x321
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,6 +118,8 @@ namespace Packets {
|
||||||
|
|
||||||
EorzeaTimeOffset = 0x01B4,
|
EorzeaTimeOffset = 0x01B4,
|
||||||
|
|
||||||
|
CharaGearParams = 0x01C0,
|
||||||
|
|
||||||
CFAvailableContents = 0x01CF,
|
CFAvailableContents = 0x01CF,
|
||||||
|
|
||||||
PrepareZoning = 0x0239, // updated for sb
|
PrepareZoning = 0x0239, // updated for sb
|
||||||
|
@ -185,6 +187,8 @@ namespace Packets {
|
||||||
|
|
||||||
LinkshellEventHandler = 0x013B,
|
LinkshellEventHandler = 0x013B,
|
||||||
LinkshellEventHandler1 = 0x013C,
|
LinkshellEventHandler1 = 0x013C,
|
||||||
|
|
||||||
|
ReqCharaGearParamChange = 0x0143,
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1286,6 +1286,14 @@ struct FFXIVIpcEorzeaTimeOffset : FFXIVIpcBasePacket<EorzeaTimeOffset>
|
||||||
uint64_t timestamp;
|
uint64_t timestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structural representation of the packet sent by the server
|
||||||
|
* to set the gear show/hide status of a character
|
||||||
|
*/
|
||||||
|
struct FFXIVIpcCharaGearParams : FFXIVIpcBasePacket<CharaGearParams>
|
||||||
|
{
|
||||||
|
uint8_t bitmask;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
} /* Server */
|
} /* Server */
|
||||||
|
|
|
@ -388,6 +388,11 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
|
||||||
|
|
||||||
sendInventory();
|
sendInventory();
|
||||||
|
|
||||||
|
if( isLogin() )
|
||||||
|
{
|
||||||
|
queuePacket(ActorControlPacket143( getId(), SetCharaGearParamUI, m_charaGearParamState, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
// set flags, will be reset automatically by zoning ( only on client side though )
|
// set flags, will be reset automatically by zoning ( only on client side though )
|
||||||
pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas );
|
pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas );
|
||||||
pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas1 );
|
pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas1 );
|
||||||
|
@ -1421,6 +1426,20 @@ void Core::Entity::Player::setTitle( uint16_t titleId )
|
||||||
sendToInRangeSet( ActorControlPacket142( getId(), SetTitle, titleId ), true );
|
sendToInRangeSet( ActorControlPacket142( getId(), SetTitle, titleId ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Core::Entity::Player::setCharaGearParamState( uint8_t state )
|
||||||
|
{
|
||||||
|
m_charaGearParamState = state;
|
||||||
|
GamePacketNew< FFXIVIpcCharaGearParams, ServerZoneIpcType > paramPacket( getId() );
|
||||||
|
paramPacket.data().bitmask = m_charaGearParamState;
|
||||||
|
sendToInRangeSet( paramPacket, true );
|
||||||
|
setSyncFlag( PlayerSyncFlags::Status );
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t Core::Entity::Player::getCharaGearParamState() const
|
||||||
|
{
|
||||||
|
return m_charaGearParamState;
|
||||||
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,10 @@ public:
|
||||||
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
|
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
|
||||||
/*! change player's title */
|
/*! change player's title */
|
||||||
void setTitle( uint16_t titleId );
|
void setTitle( uint16_t titleId );
|
||||||
|
/*! change gear param state */
|
||||||
|
void setCharaGearParamState( uint8_t state );
|
||||||
|
/*! get gear param state and send update to inRangeSet */
|
||||||
|
uint8_t getCharaGearParamState() const;
|
||||||
|
|
||||||
void calculateStats() override;
|
void calculateStats() override;
|
||||||
void sendStats();
|
void sendStats();
|
||||||
|
@ -602,6 +606,8 @@ private:
|
||||||
uint8_t m_gmRank;
|
uint8_t m_gmRank;
|
||||||
uint16_t zoneId;
|
uint16_t zoneId;
|
||||||
|
|
||||||
|
uint8_t m_charaGearParamState;
|
||||||
|
|
||||||
bool m_bInCombat;
|
bool m_bInCombat;
|
||||||
bool m_bLoadingComplete;
|
bool m_bLoadingComplete;
|
||||||
bool m_bAutoattack;
|
bool m_bAutoattack;
|
||||||
|
|
|
@ -81,7 +81,8 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
|
||||||
"cd.GrandCompanyRank, "
|
"cd.GrandCompanyRank, "
|
||||||
"cd.CFPenaltyUntil, "
|
"cd.CFPenaltyUntil, "
|
||||||
"cd.OpeningSequence, "
|
"cd.OpeningSequence, "
|
||||||
"cd.GMRank "
|
"cd.GMRank, "
|
||||||
|
"cd.CharaGearParamState "
|
||||||
"FROM charabase AS c "
|
"FROM charabase AS c "
|
||||||
" INNER JOIN charadetail AS cd "
|
" INNER JOIN charadetail AS cd "
|
||||||
" ON c.CharacterId = cd.CharacterId "
|
" ON c.CharacterId = cd.CharacterId "
|
||||||
|
@ -173,6 +174,7 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession )
|
||||||
m_openingSequence = field[36].get< uint32_t >();
|
m_openingSequence = field[36].get< uint32_t >();
|
||||||
|
|
||||||
m_gmRank = field[37].get< uint8_t >();
|
m_gmRank = field[37].get< uint8_t >();
|
||||||
|
m_charaGearParamState = field[38].get< uint8_t >();
|
||||||
|
|
||||||
m_pCell = nullptr;
|
m_pCell = nullptr;
|
||||||
|
|
||||||
|
@ -350,6 +352,7 @@ void Core::Entity::Player::createUpdateSql()
|
||||||
charaBaseSet.insert( " ModelEquip = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_modelEquip ), 40 ) ) + "')" );
|
charaBaseSet.insert( " ModelEquip = UNHEX('" + std::string( Util::binaryToHexString( reinterpret_cast< uint8_t* >( m_modelEquip ), 40 ) ) + "')" );
|
||||||
charaDetailSet.insert( " Class = " + std::to_string( static_cast< uint32_t >( getClass() ) ) );
|
charaDetailSet.insert( " Class = " + std::to_string( static_cast< uint32_t >( getClass() ) ) );
|
||||||
charaDetailSet.insert( " Status = " + std::to_string( static_cast< uint8_t >( getStatus() ) ) );
|
charaDetailSet.insert( " Status = " + std::to_string( static_cast< uint8_t >( getStatus() ) ) );
|
||||||
|
charaDetailSet.insert( " CharaGearParamState = " + std::to_string( static_cast< uint8_t >( getCharaGearParamState() ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_updateFlags & PlayerSyncFlags::OpeningSeq )
|
if( m_updateFlags & PlayerSyncFlags::OpeningSeq )
|
||||||
|
|
|
@ -93,8 +93,9 @@ Core::Network::GameConnection::GameConnection( Core::Network::HivePtr pHive,
|
||||||
setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
|
setZoneHandler( ClientZoneIpcType::CFRegisterRoulette, "CFRegisterRoulette", &GameConnection::cfRegisterRoulette );
|
||||||
setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
|
setZoneHandler( ClientZoneIpcType::CFCommenceHandler, "CFDutyAccepted", &GameConnection::cfDutyAccepted);
|
||||||
|
|
||||||
|
setZoneHandler( ClientZoneIpcType::ReqCharaGearParamChange, "ReqCharaGearParamChange",&GameConnection::reqCharaGearParamHandler);
|
||||||
|
|
||||||
setChatHandler( ClientChatIpcType::TellReq, "TellReq", &GameConnection::tellHandler);
|
setChatHandler( ClientChatIpcType::TellReq, "TellReq", &GameConnection::tellHandler);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,10 +116,10 @@ public:
|
||||||
DECLARE_HANDLER( gm1Handler );
|
DECLARE_HANDLER( gm1Handler );
|
||||||
DECLARE_HANDLER( gm2Handler );
|
DECLARE_HANDLER( gm2Handler );
|
||||||
|
|
||||||
|
DECLARE_HANDLER( reqCharaGearParamHandler );
|
||||||
|
|
||||||
DECLARE_HANDLER( tellHandler );
|
DECLARE_HANDLER( tellHandler );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,11 @@ void Core::Network::GameConnection::updatePositionHandler( const Packets::GamePa
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Core::Network::GameConnection::reqCharaGearParamHandler( const Packets::GamePacket& inPacket,
|
||||||
|
Entity::PlayerPtr pPlayer )
|
||||||
|
{
|
||||||
|
pPlayer->setCharaGearParamState( inPacket.getValAt< uint8_t >( 0x20 ) );
|
||||||
|
}
|
||||||
|
|
||||||
void Core::Network::GameConnection::zoneLineHandler( const Packets::GamePacket& inPacket,
|
void Core::Network::GameConnection::zoneLineHandler( const Packets::GamePacket& inPacket,
|
||||||
Entity::PlayerPtr pPlayer )
|
Entity::PlayerPtr pPlayer )
|
||||||
|
|
Loading…
Add table
Reference in a new issue