mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-09 12:17:45 +00:00
more warning cleanups; general styling fixes;
This commit is contained in:
parent
c30f1866ad
commit
2f5d5e9d18
9 changed files with 13 additions and 21 deletions
|
@ -474,7 +474,7 @@ Sapphire::Entity::Player::InvSlotPair Sapphire::Entity::Player::getFreeBagSlot()
|
||||||
|
|
||||||
Sapphire::Entity::Player::InvSlotPair Sapphire::Entity::Player::getFreeContainerSlot( uint32_t containerId )
|
Sapphire::Entity::Player::InvSlotPair Sapphire::Entity::Player::getFreeContainerSlot( uint32_t containerId )
|
||||||
{
|
{
|
||||||
auto freeSlot = static_cast < int8_t >( m_storageMap[ containerId ]->getFreeSlot() );
|
auto freeSlot = static_cast< int8_t >( m_storageMap[ containerId ]->getFreeSlot() );
|
||||||
|
|
||||||
if( freeSlot != -1 )
|
if( freeSlot != -1 )
|
||||||
return std::make_pair( containerId, freeSlot );
|
return std::make_pair( containerId, freeSlot );
|
||||||
|
|
|
@ -53,7 +53,7 @@ bool LinkshellMgr::loadLinkshells()
|
||||||
size_t entryCount = inData.size() / 8;
|
size_t entryCount = inData.size() / 8;
|
||||||
std::vector< uint64_t > list( entryCount );
|
std::vector< uint64_t > list( entryCount );
|
||||||
|
|
||||||
for( int i = 0; i < entryCount; ++i )
|
for( uint64_t i = 0; i < entryCount; ++i )
|
||||||
{
|
{
|
||||||
auto val = *reinterpret_cast< const uint64_t* >( &inData[ i * 8 ] );
|
auto val = *reinterpret_cast< const uint64_t* >( &inData[ i * 8 ] );
|
||||||
list[ i ] = val;
|
list[ i ] = val;
|
||||||
|
|
|
@ -26,7 +26,8 @@ using namespace Sapphire;
|
||||||
using namespace Sapphire::World::Manager;
|
using namespace Sapphire::World::Manager;
|
||||||
|
|
||||||
TerritoryMgr::TerritoryMgr() :
|
TerritoryMgr::TerritoryMgr() :
|
||||||
m_lastInstanceId( 10000 )
|
m_lastInstanceId( 10000 ),
|
||||||
|
m_inRangeDistance( 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void Sapphire::Network::GameConnection::getCommonlistHandler( const Packets::FFX
|
||||||
const size_t itemsPerPage = 10;
|
const size_t itemsPerPage = 10;
|
||||||
|
|
||||||
// this func paginates any commonlist entry, associating them with online player data and hierarchy ID (optional)
|
// this func paginates any commonlist entry, associating them with online player data and hierarchy ID (optional)
|
||||||
auto generateEntries = [&]( const auto& idVec, size_t offset, const std::vector< Common::HierarchyData >& hierarchyVec ) -> std::vector< PlayerEntry >
|
auto generateEntries = [ & ]( const auto& idVec, size_t offset, const std::vector< Common::HierarchyData >& hierarchyVec ) -> std::vector< PlayerEntry >
|
||||||
{
|
{
|
||||||
std::vector< PlayerEntry > entries;
|
std::vector< PlayerEntry > entries;
|
||||||
|
|
||||||
|
|
|
@ -447,10 +447,9 @@ void Sapphire::Network::GameConnection::commandHandler( const Packets::FFXIVARR_
|
||||||
}
|
}
|
||||||
case PacketCommand::TARGET_DECIDE: // Change target
|
case PacketCommand::TARGET_DECIDE: // Change target
|
||||||
{
|
{
|
||||||
|
|
||||||
uint64_t targetId = param1;
|
uint64_t targetId = param1;
|
||||||
|
|
||||||
if( targetId == player.getTargetId() || targetId == 0xE0000000 )
|
if( targetId == player.getTargetId() || targetId == Common::INVALID_GAME_OBJECT_ID )
|
||||||
targetId = 0;
|
targetId = 0;
|
||||||
|
|
||||||
player.changeTarget( targetId );
|
player.changeTarget( targetId );
|
||||||
|
|
|
@ -641,7 +641,7 @@ void Sapphire::Network::GameConnection::gearSetEquip( const Packets::FFXIVARR_PA
|
||||||
auto& server = Common::Service< World::WorldServer >::ref();
|
auto& server = Common::Service< World::WorldServer >::ref();
|
||||||
|
|
||||||
// Loop over all slots
|
// Loop over all slots
|
||||||
for (int slot = 0; slot < 14; slot++ )
|
for( int slot = 0; slot < 14; ++slot )
|
||||||
{
|
{
|
||||||
const auto fromSlot = packet.data().containerIndex[ slot ];
|
const auto fromSlot = packet.data().containerIndex[ slot ];
|
||||||
const auto fromContainer = packet.data().storageId[ slot ];
|
const auto fromContainer = packet.data().storageId[ slot ];
|
||||||
|
@ -659,19 +659,19 @@ void Sapphire::Network::GameConnection::gearSetEquip( const Packets::FFXIVARR_PA
|
||||||
ackPacket->data().operationType = operationType;
|
ackPacket->data().operationType = operationType;
|
||||||
server.queueForPlayer( player.getCharacterId(), ackPacket );
|
server.queueForPlayer( player.getCharacterId(), ackPacket );
|
||||||
|
|
||||||
if ( fromItem && equippedItem )
|
if( fromItem && equippedItem )
|
||||||
{
|
{
|
||||||
player.swapItem( fromContainer, fromSlot, Common::GearSet0, slot );
|
player.swapItem( fromContainer, fromSlot, Common::GearSet0, slot );
|
||||||
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), fromSlot, fromContainer, *equippedItem, 0 ) );
|
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), fromSlot, fromContainer, *equippedItem, 0 ) );
|
||||||
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), slot, Common::GearSet0, *fromItem, 0 ) );
|
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), slot, Common::GearSet0, *fromItem, 0 ) );
|
||||||
}
|
}
|
||||||
else if ( fromItem && !equippedItem )
|
else if( fromItem && !equippedItem )
|
||||||
{
|
{
|
||||||
player.moveItem( fromContainer, fromSlot, Common::GearSet0, slot );
|
player.moveItem( fromContainer, fromSlot, Common::GearSet0, slot );
|
||||||
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), fromSlot, fromContainer, 0 ) );
|
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), fromSlot, fromContainer, 0 ) );
|
||||||
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), slot, Common::GearSet0, *fromItem, 0 ) );
|
server.queueForPlayer( player.getCharacterId(), std::make_shared< UpdateInventorySlotPacket >( player.getId(), slot, Common::GearSet0, *fromItem, 0 ) );
|
||||||
}
|
}
|
||||||
else if ( !fromItem && equippedItem )
|
else if( !fromItem && equippedItem )
|
||||||
{
|
{
|
||||||
auto containerId = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( static_cast< Common::EquipSlotCategory >( equippedItem->getSlot() ) );
|
auto containerId = World::Manager::ItemMgr::getCharaEquipSlotCategoryToArmoryId( static_cast< Common::EquipSlotCategory >( equippedItem->getSlot() ) );
|
||||||
auto freeSlot = player.getFreeContainerSlot( containerId ).second;
|
auto freeSlot = player.getFreeContainerSlot( containerId ).second;
|
||||||
|
|
|
@ -7,15 +7,6 @@
|
||||||
namespace Sapphire::Network::Packets::WorldPackets::Server
|
namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
{
|
{
|
||||||
|
|
||||||
uint64_t ExecuteCharacterID;
|
|
||||||
uint64_t TargetCharacterID;
|
|
||||||
uint8_t ExecuteIdentity;
|
|
||||||
uint8_t TargetIdentity;
|
|
||||||
uint8_t UpdateStatus;
|
|
||||||
uint8_t Count;
|
|
||||||
char ExecuteCharacterName[32];
|
|
||||||
char TargetCharacterName[32];
|
|
||||||
|
|
||||||
class PcPartyUpdatePacket : public ZoneChannelPacket< FFXIVIpcPcPartyUpdate >
|
class PcPartyUpdatePacket : public ZoneChannelPacket< FFXIVIpcPcPartyUpdate >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
memcpy( m_data.Aetheryte, player.getAetheryteArray().data(), sizeof( m_data.Aetheryte ) );
|
memcpy( m_data.Aetheryte, player.getAetheryteArray().data(), sizeof( m_data.Aetheryte ) );
|
||||||
|
|
||||||
// Set the class levels and exp.
|
// Set the class levels and exp.
|
||||||
for( uint8_t i = 0; i < 23; i++ )
|
for( uint8_t i = 0; i < Common::CLASSJOB_TOTAL; ++i )
|
||||||
{
|
{
|
||||||
m_data.Lv[ i ] = player.getClassArray()[ i ];
|
m_data.Lv[ i ] = player.getClassArray()[ i ];
|
||||||
m_data.Exp[ i ] = player.getExpArray()[ i ];
|
m_data.Exp[ i ] = player.getExpArray()[ i ];
|
||||||
|
|
|
@ -60,7 +60,8 @@ WorldServer::WorldServer( const std::string& configName ) :
|
||||||
m_configName( configName ),
|
m_configName( configName ),
|
||||||
m_bRunning( true ),
|
m_bRunning( true ),
|
||||||
m_lastDBPingTime( 0 ),
|
m_lastDBPingTime( 0 ),
|
||||||
m_worldId( 67 )
|
m_worldId( 67 ),
|
||||||
|
m_port( 0 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue