diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 0b289e31..b2862271 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -51,6 +51,7 @@ extern Core::ServerZone g_serverZone; extern Core::ZoneMgr g_zoneMgr; extern Core::Data::ExdData g_exdData; extern Core::Scripting::ScriptManager g_scriptMgr; +extern Core::Social::SocialMgr< Core::Social::FriendList > g_friendListMgr; using namespace Core::Common; using namespace Core::Network::Packets; diff --git a/src/servers/Server_Zone/Actor/Player.h b/src/servers/Server_Zone/Actor/Player.h index 507f7215..ff74bca5 100644 --- a/src/servers/Server_Zone/Actor/Player.h +++ b/src/servers/Server_Zone/Actor/Player.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "Actor.h" diff --git a/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp index 2d7c6bee..688b3c83 100644 --- a/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/PacketHandlers.cpp @@ -36,7 +36,7 @@ #include "Event/EventHelper.h" #include "Action/Action.h" #include "Action/ActionTeleport.h" -#include "Social/Manager/FriendListMgr.h" +#include "Social/Manager/SocialMgr.h" extern Core::Logger g_log; @@ -44,7 +44,7 @@ extern Core::ServerZone g_serverZone; extern Core::ZoneMgr g_zoneMgr; extern Core::Data::ExdData g_exdData; extern Core::DebugCommandHandler g_gameCommandMgr; -extern Core::Social::SocialMgr g_socialMgr; +extern Core::Social::SocialMgr< Core::Social::FriendList > g_friendListMgr; using namespace Core::Common; using namespace Core::Network::Packets; diff --git a/src/servers/Server_Zone/ServerZone.cpp b/src/servers/Server_Zone/ServerZone.cpp index a6bd54d3..7ab41011 100644 --- a/src/servers/Server_Zone/ServerZone.cpp +++ b/src/servers/Server_Zone/ServerZone.cpp @@ -28,6 +28,8 @@ #include "Script/ScriptManager.h" #include "Linkshell/LinkshellMgr.h" +#include "Social/Manager/SocialMgr.h" + #include "Forwards.h" #include #include @@ -41,7 +43,7 @@ Core::Data::ExdData g_exdData; Core::ZoneMgr g_zoneMgr; Core::LinkshellMgr g_linkshellMgr; 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 ) : m_configPath( configPath ), diff --git a/src/servers/Server_Zone/Social/Manager/FriendListMgr.cpp b/src/servers/Server_Zone/Social/Manager/FriendListMgr.cpp deleted file mode 100644 index c33a59bc..00000000 --- a/src/servers/Server_Zone/Social/Manager/FriendListMgr.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include -#include - -#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; -} \ No newline at end of file diff --git a/src/servers/Server_Zone/Social/Manager/FriendListMgr.h b/src/servers/Server_Zone/Social/Manager/FriendListMgr.h deleted file mode 100644 index 161e39b4..00000000 --- a/src/servers/Server_Zone/Social/Manager/FriendListMgr.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _FRIENDLISTMGR_H -#define _FRIENDLISTMGR_H - -#include -#include - -#include -#include -#include -#include - -#include -#include - -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 */ \ No newline at end of file diff --git a/src/servers/Server_Zone/Social/Manager/SocialMgr.cpp b/src/servers/Server_Zone/Social/Manager/SocialMgr.cpp index c308c4b3..2d228ed5 100644 --- a/src/servers/Server_Zone/Social/Manager/SocialMgr.cpp +++ b/src/servers/Server_Zone/Social/Manager/SocialMgr.cpp @@ -3,12 +3,12 @@ template< class T > -Core::Social::SocialMgr::SocialMgr() +Core::Social::SocialMgr< T >::SocialMgr() { } template< class T > -Core::Social::SocialMgr::~SocialMgr() +Core::Social::SocialMgr< T >::~SocialMgr() { } diff --git a/src/servers/Server_Zone/Social/Manager/SocialMgr.h b/src/servers/Server_Zone/Social/Manager/SocialMgr.h index e70c877d..99895e2d 100644 --- a/src/servers/Server_Zone/Social/Manager/SocialMgr.h +++ b/src/servers/Server_Zone/Social/Manager/SocialMgr.h @@ -1,5 +1,5 @@ -#ifndef _GROUPMGR_H -#define _GROUPMGR_H +#ifndef _SOCIALMGR_H +#define _SOCIALMGR_H #include #include @@ -68,4 +68,4 @@ private: } } -#endif /* ! _GROUPMGR_H */ \ No newline at end of file +#endif /* ! _SOCIALMGR_H */ \ No newline at end of file