1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-31 13:37:45 +00:00
sapphire/src/servers/Server_Zone/Social/Manager/SocialMgr.h

71 lines
2.1 KiB
C
Raw Normal View History

2017-11-21 17:01:05 +00:00
#ifndef _GROUPMGR_H
#define _GROUPMGR_H
#include <map>
#include <cstdint>
#include <boost/enable_shared_from_this.hpp>
#include <Server_Zone/Forwards.h>
#include <Social/Group.h>
2017-11-21 17:01:05 +00:00
namespace Core {
namespace Social {
2017-11-21 17:01:05 +00:00
template< class T >
class SocialMgr
2017-11-21 17:01:05 +00:00
{
2017-12-07 04:15:20 -02:00
public:
SocialMgr();
virtual ~SocialMgr();
2017-12-07 04:15:20 -02:00
T findGroupByInviteIdForPlayer( uint64_t playerId ) const;
T findGroupById( uint64_t groupId ) const;
/*
T findGroup( uint64_t groupId )
{
auto it = m_groups.find( groupId );
if ( it != m_groups.end() )
{
return it->second;
}
return nullptr;
}*/
2017-12-07 04:15:20 -02:00
bool hasInvite( uint64_t playerId ) const;
protected:
// those would be implemented in T, so you'd have T.m_type and T.m_maxEntries
// GroupType m_type{ GroupType::None };
// uint32_t m_maxEntries{ 0xFFFFFFFF };
uint64_t m_groupCount{ 0 };
std::map< uint64_t, uint64_t > m_invites;
uint64_t m_lastGroupId{ 0 };
// < recipient, groupid >
//virtual GroupPtr createGroup( PlayerPtr pOwner ) = 0;
2017-11-21 17:01:05 +00:00
/*
friend virtual Core::Network::Packets::GamePacketPtr Core::Entity::Group::Group::addMember( PlayerPtr pSender, PlayerPtr pRecipient, uint64_t senderId = 0, uint64_t recipientId = 0 );
friend virtual Core::Network::Packets::GamePacketPtr Core::Entity::Group::Group::inviteMember( PlayerPtr pSender, PlayerPtr pRecipient, uint64_t senderId = 0, uint64_t recipientId = 0 );
friend virtual Core::Network::Packets::GamePacketPtr Core::Entity::Group::Group::removeMember( PlayerPtr pSender, PlayerPtr pRecipient, uint64_t senderId = 0, uint64_t recipientId = 0 );
friend virtual Core::Network::Packets::GamePacketPtr Core::Entity::Group::Group::kickMember( PlayerPtr pSender, PlayerPtr pRecipient, uint64_t senderId = 0, uint64_t recipientId = 0 );
friend virtual void sendPacketToMembers( Core::Network::Packets::GamePacketPtr pPacket, bool invitesToo = false );
friend virtual void load();
friend virtual void update();
friend virtual void disband();
*/
2017-11-21 17:01:05 +00:00
virtual uint64_t generateGroupId();
private:
std::map< uint64_t, T > m_groups;
2017-11-21 17:01:05 +00:00
};
}
}
#endif /* ! _GROUPMGR_H */