1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 22:37:45 +00:00

more const correct;

This commit is contained in:
Alice Ogeda 2021-12-14 16:06:23 -03:00
parent 4a46e87641
commit ab668bdc68
2 changed files with 6 additions and 8 deletions

View file

@ -79,8 +79,6 @@ bool Sapphire::World::Manager::BlacklistMgr::onRemoveCharacter( Entity::Player&
auto& server = Common::Service< Sapphire::World::WorldServer >::ref();
uint32_t result = 0;
auto pTarget = server.getPlayer( targetName );
if( !pTarget )
{
@ -166,7 +164,7 @@ bool Sapphire::World::Manager::BlacklistMgr::onGetBlacklistPage( Entity::Player&
return true;
}
bool Sapphire::World::Manager::BlacklistMgr::isBlacklisted( Entity::Player& source, Entity::Player& target ) const
bool Sapphire::World::Manager::BlacklistMgr::isBlacklisted( Entity::Player& source, const Entity::Player& target ) const
{
return getEntryIndex( source, target.getCharacterId() ) != -1;
}
@ -183,7 +181,7 @@ ptrdiff_t Sapphire::World::Manager::BlacklistMgr::getEntryIndex( Entity::Player&
return sourceBlIt - std::begin( sourceBL );
}
void Sapphire::World::Manager::BlacklistMgr::sendAddResultPacket( Entity::Player& source, Entity::PlayerPtr pTarget, uint32_t result )
void Sapphire::World::Manager::BlacklistMgr::sendAddResultPacket( Entity::Player& source, const Entity::PlayerPtr pTarget, uint32_t result )
{
auto& server = Common::Service< Sapphire::World::WorldServer >::ref();
@ -204,7 +202,7 @@ void Sapphire::World::Manager::BlacklistMgr::sendAddResultPacket( Entity::Player
server.queueForPlayer( source.getCharacterId(), resultPacket );
}
void Sapphire::World::Manager::BlacklistMgr::sendRemoveResultPacket( Entity::Player& source, Entity::PlayerPtr pTarget, uint32_t result )
void Sapphire::World::Manager::BlacklistMgr::sendRemoveResultPacket( Entity::Player& source, const Entity::PlayerPtr pTarget, uint32_t result )
{
auto& server = Common::Service< Sapphire::World::WorldServer >::ref();

View file

@ -16,12 +16,12 @@ namespace Sapphire::World::Manager
bool onGetBlacklistPage( Entity::Player& source, uint8_t key, uint8_t nextIdx );
bool isBlacklisted( Entity::Player& source, Entity::Player& target ) const;
bool isBlacklisted( Entity::Player& source, const Entity::Player& target ) const;
private:
ptrdiff_t getEntryIndex( Entity::Player& source, uint64_t characterId ) const;
void sendAddResultPacket( Entity::Player& source, Entity::PlayerPtr pTarget, uint32_t result );
void sendRemoveResultPacket( Entity::Player& source, Entity::PlayerPtr pTarget, uint32_t result );
void sendAddResultPacket( Entity::Player& source, const Entity::PlayerPtr pTarget, uint32_t result );
void sendRemoveResultPacket( Entity::Player& source, const Entity::PlayerPtr pTarget, uint32_t result );
};
}