1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Fix linux build, properly display fc petition page based on member hierarchy.

This commit is contained in:
Mordred 2023-02-09 07:55:18 +01:00
parent 9c4eddce4a
commit 81b4f8ac72
2 changed files with 9 additions and 9 deletions

View file

@ -56,6 +56,9 @@ bool FreeCompanyMgr::loadFreeCompanies()
std::string board = res->getString( 14 );
std::string motto = res->getString( 15 );
if( m_maxFcId < fcId )
m_maxFcId = fcId;
auto chatChannelId = chatChannelMgr.createChatChannel( Common::ChatChannelType::FreeCompanyChat );
@ -169,13 +172,7 @@ FreeCompanyPtr FreeCompanyMgr::getFreeCompanyById( uint64_t fcId )
FreeCompanyPtr FreeCompanyMgr::createFreeCompany( const std::string& name, const std::string& tag, Entity::Player& player )
{
uint64_t freeCompanyId = 1;
if( !m_fcIdMap.empty() )
{
auto lastIdx = ( --m_fcIdMap.end() )->first;
freeCompanyId = lastIdx + 1;
}
uint64_t freeCompanyId = ++m_maxFcId;
// check if a fc with the same name already exists
auto lsIt = m_fcNameMap.find( name );
@ -329,13 +326,14 @@ void FreeCompanyMgr::sendFcStatus( Entity::Player& player )
{
resultData.FreeCompanyID = fc->getId();
resultData.AuthorityList = 0;
resultData.HierarchyType = 0;
resultData.HierarchyType = player.getCharacterId() == fc->getMasterId() ? 0 : 1;
resultData.GrandCompanyID = fc->getGrandCompany();
resultData.FcRank = fc->getRank();
resultData.CrestID = fc->getCrest();
resultData.FcStatus = static_cast< uint8_t >( fc->getFcStatus() );
resultData.ChannelID = fc->getChatChannel();
resultData.CharaFcParam = 0;
//resultData.CharaFcParam = 1;
//resultData.CharaFcState = 1;
}
auto& server = Common::Service< World::WorldServer >::ref();

View file

@ -19,6 +19,8 @@ namespace Sapphire::World::Manager
/*! map used for easy lookup of char id to fc id */
std::unordered_map< uint64_t, uint64_t > m_charaIdToFcIdMap;
uint64_t m_maxFcId{ 0 };
public:
FreeCompanyMgr() = default;