mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
Fix linux build, properly display fc petition page based on member hierarchy.
This commit is contained in:
parent
9c4eddce4a
commit
81b4f8ac72
2 changed files with 9 additions and 9 deletions
|
@ -56,6 +56,9 @@ bool FreeCompanyMgr::loadFreeCompanies()
|
||||||
std::string board = res->getString( 14 );
|
std::string board = res->getString( 14 );
|
||||||
std::string motto = res->getString( 15 );
|
std::string motto = res->getString( 15 );
|
||||||
|
|
||||||
|
if( m_maxFcId < fcId )
|
||||||
|
m_maxFcId = fcId;
|
||||||
|
|
||||||
|
|
||||||
auto chatChannelId = chatChannelMgr.createChatChannel( Common::ChatChannelType::FreeCompanyChat );
|
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 )
|
FreeCompanyPtr FreeCompanyMgr::createFreeCompany( const std::string& name, const std::string& tag, Entity::Player& player )
|
||||||
{
|
{
|
||||||
uint64_t freeCompanyId = 1;
|
uint64_t freeCompanyId = ++m_maxFcId;
|
||||||
|
|
||||||
if( !m_fcIdMap.empty() )
|
|
||||||
{
|
|
||||||
auto lastIdx = ( --m_fcIdMap.end() )->first;
|
|
||||||
freeCompanyId = lastIdx + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if a fc with the same name already exists
|
// check if a fc with the same name already exists
|
||||||
auto lsIt = m_fcNameMap.find( name );
|
auto lsIt = m_fcNameMap.find( name );
|
||||||
|
@ -329,13 +326,14 @@ void FreeCompanyMgr::sendFcStatus( Entity::Player& player )
|
||||||
{
|
{
|
||||||
resultData.FreeCompanyID = fc->getId();
|
resultData.FreeCompanyID = fc->getId();
|
||||||
resultData.AuthorityList = 0;
|
resultData.AuthorityList = 0;
|
||||||
resultData.HierarchyType = 0;
|
resultData.HierarchyType = player.getCharacterId() == fc->getMasterId() ? 0 : 1;
|
||||||
resultData.GrandCompanyID = fc->getGrandCompany();
|
resultData.GrandCompanyID = fc->getGrandCompany();
|
||||||
resultData.FcRank = fc->getRank();
|
resultData.FcRank = fc->getRank();
|
||||||
resultData.CrestID = fc->getCrest();
|
resultData.CrestID = fc->getCrest();
|
||||||
resultData.FcStatus = static_cast< uint8_t >( fc->getFcStatus() );
|
resultData.FcStatus = static_cast< uint8_t >( fc->getFcStatus() );
|
||||||
resultData.ChannelID = fc->getChatChannel();
|
resultData.ChannelID = fc->getChatChannel();
|
||||||
resultData.CharaFcParam = 0;
|
//resultData.CharaFcParam = 1;
|
||||||
|
//resultData.CharaFcState = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& server = Common::Service< World::WorldServer >::ref();
|
auto& server = Common::Service< World::WorldServer >::ref();
|
||||||
|
|
|
@ -19,6 +19,8 @@ namespace Sapphire::World::Manager
|
||||||
/*! map used for easy lookup of char id to fc id */
|
/*! map used for easy lookup of char id to fc id */
|
||||||
std::unordered_map< uint64_t, uint64_t > m_charaIdToFcIdMap;
|
std::unordered_map< uint64_t, uint64_t > m_charaIdToFcIdMap;
|
||||||
|
|
||||||
|
uint64_t m_maxFcId{ 0 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FreeCompanyMgr() = default;
|
FreeCompanyMgr() = default;
|
||||||
|
|
Loading…
Add table
Reference in a new issue