2021-11-27 00:53:57 +01:00
|
|
|
#pragma once
|
2017-08-28 18:36:51 +02:00
|
|
|
|
2018-10-25 12:44:51 +11:00
|
|
|
#include <memory>
|
2017-08-28 18:36:51 +02:00
|
|
|
#include <map>
|
2021-11-27 00:53:57 +01:00
|
|
|
#include <vector>
|
2018-12-02 02:01:41 +01:00
|
|
|
#include "ForwardsZone.h"
|
2017-08-28 18:36:51 +02:00
|
|
|
|
2018-12-02 02:01:41 +01:00
|
|
|
namespace Sapphire::World::Manager
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
2017-08-28 18:36:51 +02:00
|
|
|
|
2021-12-04 01:02:25 +01:00
|
|
|
enum Hierarchy : __int32
|
|
|
|
{
|
|
|
|
NONE_1 = 0x0,
|
|
|
|
MASTER = 0x1,
|
|
|
|
LEADER = 0x2,
|
|
|
|
MEMBER = 0x3,
|
|
|
|
INVITE = 0x4,
|
|
|
|
MAX_0 = 0x7,
|
|
|
|
};
|
|
|
|
|
2020-03-01 01:00:57 +11:00
|
|
|
class LinkshellMgr
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::map< uint64_t, LinkshellPtr > m_linkshellIdMap;
|
|
|
|
std::map< std::string, LinkshellPtr > m_linkshellNameMap;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
LinkshellPtr getLinkshellByName( const std::string& name );
|
2017-08-28 18:36:51 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
public:
|
2020-03-01 01:00:57 +11:00
|
|
|
LinkshellMgr() = default;
|
2017-08-28 18:36:51 +02:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
// initialize all linkshells from db to memory
|
2018-10-28 21:53:21 +01:00
|
|
|
bool loadLinkshells();
|
2021-12-04 12:29:54 +01:00
|
|
|
void writeLinkshell( uint64_t lsId );
|
2021-11-27 00:53:57 +01:00
|
|
|
|
|
|
|
// create new linkshell entry and insert into db
|
|
|
|
LinkshellPtr createLinkshell( const std::string& name, Entity::Player& player );
|
|
|
|
|
2021-12-03 22:21:18 +01:00
|
|
|
void finishLinkshellCreation( const std::string& name, uint32_t result, Entity::Player& player );
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
// get all linkshells associated with player
|
|
|
|
const std::vector< LinkshellPtr > getPlayerLinkshells( Entity::Player& player ) const;
|
|
|
|
|
|
|
|
LinkshellPtr getLinkshellById( uint64_t lsId );
|
2021-12-04 12:29:54 +01:00
|
|
|
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
2017-08-28 18:36:51 +02:00
|
|
|
|
|
|
|
}
|