mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 11:07:45 +00:00
Woo
This commit is contained in:
parent
5c793993d3
commit
01ca2fa544
8 changed files with 11 additions and 84 deletions
|
@ -51,6 +51,7 @@ extern Core::ServerZone g_serverZone;
|
||||||
extern Core::ZoneMgr g_zoneMgr;
|
extern Core::ZoneMgr g_zoneMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdData g_exdData;
|
||||||
extern Core::Scripting::ScriptManager g_scriptMgr;
|
extern Core::Scripting::ScriptManager g_scriptMgr;
|
||||||
|
extern Core::Social::SocialMgr< Core::Social::FriendList > g_friendListMgr;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <Server_Common/Common.h>
|
#include <Server_Common/Common.h>
|
||||||
#include <Server_Common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <Server_Common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <Server_Zone/Social/FriendList.h>
|
#include <Server_Zone/Social/FriendList.h>
|
||||||
#include <Server_Zone/Social/Manager/FriendListMgr.h>
|
|
||||||
#include <Server_Common/Common.h>
|
#include <Server_Common/Common.h>
|
||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "Event/EventHelper.h"
|
#include "Event/EventHelper.h"
|
||||||
#include "Action/Action.h"
|
#include "Action/Action.h"
|
||||||
#include "Action/ActionTeleport.h"
|
#include "Action/ActionTeleport.h"
|
||||||
#include "Social/Manager/FriendListMgr.h"
|
#include "Social/Manager/SocialMgr.h"
|
||||||
|
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
@ -44,7 +44,7 @@ extern Core::ServerZone g_serverZone;
|
||||||
extern Core::ZoneMgr g_zoneMgr;
|
extern Core::ZoneMgr g_zoneMgr;
|
||||||
extern Core::Data::ExdData g_exdData;
|
extern Core::Data::ExdData g_exdData;
|
||||||
extern Core::DebugCommandHandler g_gameCommandMgr;
|
extern Core::DebugCommandHandler g_gameCommandMgr;
|
||||||
extern Core::Social::SocialMgr<Core::Common::SocialListType> g_socialMgr;
|
extern Core::Social::SocialMgr< Core::Social::FriendList > g_friendListMgr;
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "Script/ScriptManager.h"
|
#include "Script/ScriptManager.h"
|
||||||
#include "Linkshell/LinkshellMgr.h"
|
#include "Linkshell/LinkshellMgr.h"
|
||||||
|
|
||||||
|
#include "Social/Manager/SocialMgr.h"
|
||||||
|
|
||||||
#include "Forwards.h"
|
#include "Forwards.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
@ -41,7 +43,7 @@ Core::Data::ExdData g_exdData;
|
||||||
Core::ZoneMgr g_zoneMgr;
|
Core::ZoneMgr g_zoneMgr;
|
||||||
Core::LinkshellMgr g_linkshellMgr;
|
Core::LinkshellMgr g_linkshellMgr;
|
||||||
Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
Core::Db::DbWorkerPool< Core::Db::CharaDbConnection > g_charaDb;
|
||||||
Core::Social::SocialMgr< Core::Social:: > g_friendListMgr;
|
Core::Social::SocialMgr< Core::Social::FriendList > g_friendListMgr;
|
||||||
|
|
||||||
Core::ServerZone::ServerZone( const std::string& configPath )
|
Core::ServerZone::ServerZone( const std::string& configPath )
|
||||||
: m_configPath( configPath ),
|
: m_configPath( configPath ),
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
#include <random>
|
|
||||||
|
|
||||||
#include <boost/make_shared.hpp>
|
|
||||||
#include <src/servers/Server_Common/Logging/Logger.h>
|
|
||||||
|
|
||||||
#include "../Group.h"
|
|
||||||
#include "../FriendList.h"
|
|
||||||
#include "FriendListMgr.h"
|
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
|
||||||
|
|
||||||
|
|
||||||
Core::Social::FriendListMgr::FriendListMgr()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Core::Social::FriendListMgr::init()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t Core::Social::FriendListMgr::fetchPlayerFriendsList( uint32_t playerId )
|
|
||||||
{
|
|
||||||
uint64_t newGroupId = generateGroupId();
|
|
||||||
|
|
||||||
auto pFriendList = boost::make_shared< FriendList >( newGroupId, playerId );
|
|
||||||
|
|
||||||
m_groups.emplace( newGroupId, pFriendList );
|
|
||||||
|
|
||||||
g_log.debug( std::to_string( m_groups.size() ) );
|
|
||||||
|
|
||||||
return newGroupId;
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
#ifndef _FRIENDLISTMGR_H
|
|
||||||
#define _FRIENDLISTMGR_H
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include <boost/enable_shared_from_this.hpp>
|
|
||||||
#include <Server_Zone/Forwards.h>
|
|
||||||
#include <Server_Zone/Social/Group.h>
|
|
||||||
#include <Server_Zone/Social/FriendList.h>
|
|
||||||
|
|
||||||
#include <Server_Zone/Social/Manager/SocialMgr.h>
|
|
||||||
#include <Server_Zone/Forwards.h>
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
namespace Social {
|
|
||||||
|
|
||||||
class FriendListMgr
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
FriendListMgr();
|
|
||||||
|
|
||||||
bool init();
|
|
||||||
|
|
||||||
uint64_t fetchPlayerFriendsList( uint32_t playerId );
|
|
||||||
/*
|
|
||||||
FriendListPtr findGroupByInviteIdForPlayer( uint64_t playerId ) const;
|
|
||||||
FriendListPtr findGroupById( uint64_t groupId ) const;
|
|
||||||
*/
|
|
||||||
//std::map< uint64_t, FriendListPtr > m_groups;
|
|
||||||
private:
|
|
||||||
// todo: can we handle this m_groups grouptype better..?
|
|
||||||
|
|
||||||
//GroupType m_type{ GroupType::FriendList };
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ! _FRIENDLISTMGR_H */
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
Core::Social::SocialMgr::SocialMgr()
|
Core::Social::SocialMgr< T >::SocialMgr()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
template< class T >
|
template< class T >
|
||||||
Core::Social::SocialMgr::~SocialMgr()
|
Core::Social::SocialMgr< T >::~SocialMgr()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef _GROUPMGR_H
|
#ifndef _SOCIALMGR_H
|
||||||
#define _GROUPMGR_H
|
#define _SOCIALMGR_H
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
@ -68,4 +68,4 @@ private:
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* ! _GROUPMGR_H */
|
#endif /* ! _SOCIALMGR_H */
|
Loading…
Add table
Reference in a new issue