1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-10 12:47:44 +00:00
sapphire/src/world/Manager/FreeCompanyMgr.h

65 lines
2.3 KiB
C
Raw Normal View History

#pragma once
#include <memory>
#include <map>
#include <vector>
#include "ForwardsZone.h"
namespace Sapphire::World::Manager
{
2023-02-06 15:49:47 +01:00
class FreeCompanyMgr
{
private:
2023-02-08 15:22:26 +01:00
std::unordered_map< uint64_t, FreeCompanyPtr > m_fcIdMap;
std::unordered_map< std::string, FreeCompanyPtr > m_fcNameMap;
2023-02-08 15:22:26 +01:00
/*! map used for easy lookup of char id to fc id */
std::unordered_map< uint64_t, uint64_t > m_charaIdToFcIdMap;
public:
FreeCompanyMgr() = default;
// initialize all fcs from db to memory
bool loadFreeCompanies();
void writeFreeCompany( uint64_t fcId );
// create new fc entry and insert into db
FreeCompanyPtr createFreeCompany( const std::string& name, const std::string& tag, Entity::Player& player );
bool renameFreeCompany( uint64_t fcId, const std::string& name, const std::string& tag, Entity::Player& player );
//void sendFreeCompanyResult( Entity::Player& player, uint64_t fcId, ResultType resultType, uint64_t target,
// uint32_t result, UpdateStatus updateStatus, std::string targetName );
2023-02-06 15:49:47 +01:00
void sendFcInviteList( Entity::Player& player );
void sendFcStatus( Entity::Player& player );
/* void invitePlayer( Entity::Player& sourcePlayer, Entity::Player& invitedPlayer, uint64_t linkshellId );
void kickPlayer( Entity::Player& sourcePlayer, Entity::Player& kickedPlayer, uint64_t linkshellId );
void addLeader( Entity::Player& sourcePlayer, Entity::Player& newLeaderPlayer, uint64_t linkshellId );
void removeLeader( Entity::Player& sourcePlayer, Entity::Player& leaderPlayer, uint64_t linkshellId );
void declineLeader( Entity::Player& sourcePlayer, uint64_t linkshellId );
void changeMaster( Entity::Player& sourcePlayer, Entity::Player& nextMasterPlayer, uint64_t linkshellId ); */
void sendFreeCompanyStatus( Entity::Player& player );
// get fc associated with player
FreeCompanyPtr getPlayerFreeCompany( Entity::Player& player );
FreeCompanyPtr getFreeCompanyById( uint64_t fcId );
2023-02-08 15:22:26 +01:00
FreeCompanyPtr getFreeCompanyByName( const std::string& name );
// void leaveLinkshell( uint64_t lsId, uint64_t characterId );
// void joinLinkshell( uint64_t lsId, uint64_t characterId );
void onFcLogin( uint64_t characterId );
2023-02-08 15:22:26 +01:00
void onSignPetition( Entity::Player& source, Entity::Player& target );
};
}