1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 02:57:45 +00:00

Partial friend request/list coupling with social manager

This commit is contained in:
Maru 2017-12-07 19:38:17 -02:00
parent 28f2a91b21
commit f5ae374c31
6 changed files with 33 additions and 17 deletions

View file

@ -52,8 +52,6 @@ extern Core::ZoneMgr g_zoneMgr;
extern Core::Data::ExdData g_exdData;
extern Core::Scripting::ScriptManager g_scriptMgr;
extern Core::Entity::Social::FriendListMgr g_friendListMgr;
using namespace Core::Common;
using namespace Core::Network::Packets;
using namespace Core::Network::Packets::Server;
@ -446,7 +444,10 @@ void Core::Entity::Player::setZone( uint32_t zoneId )
gcAffPacket.data().gcRank[2] = m_gcRank[2];
queuePacket( gcAffPacket );
m_friendsList = g_friendListMgr.getPlayerFriendsList( getId() );
//todo: change this to extern, global obj
Core::Entity::Social::FriendListMgr fListMgr = {};
m_friendsList = fListMgr.getPlayerFriendsList( getId() );
m_itemLevel = getInventory()->calculateEquippedGearItemLevel();
sendItemLevel();

View file

@ -53,6 +53,7 @@ Core::Network::Packets::GamePacketPtr Group::addMember( Core::Entity::PlayerPtr
member.inviterId = senderId;
member.role = 0;
member.contentId = recipientId;
member.name = pSender->getName();
m_members.emplace( recipientId, member );
}
else
@ -85,17 +86,17 @@ Core::Network::Packets::Server::PlayerEntry Group::generatePlayerEntry( GroupMem
// We check if player is online. If so, we can pull more data - otherwise just name
// todo: set as offline in one of the unknown values, if session does not exist
auto pSession = g_serverZone.getSession( groupMember.name ); // todo: aa i don't like this. maybe just store their ID instead of contentID???
if( pSession )
{
auto pPlayer = pSession->getPlayer();
entry.bytes[2] = pPlayer->getCurrentZone()->getId();
auto pSession = g_serverZone.getSession( groupMember.contentId ); // todo: aa i don't like this. maybe just store their ID instead of contentID???
entry.bytes[3] = 0x80;
entry.bytes[4] = 0x02;
entry.bytes[6] = 0x3B;
entry.bytes[11] = 0x10;
if( pSession )
{
auto pPlayer = pSession->getPlayer();
entry.contentId = pPlayer->getContentId();
entry.bytes[2] = pPlayer->getCurrentZone()->getId();
entry.classJob = pPlayer->getClass();
entry.level = pPlayer->getLevel();

View file

@ -11,11 +11,21 @@ extern Core::Logger g_log;
using namespace Core::Entity;
Social::FriendListMgr::FriendListMgr()
Core::Entity::Social::FriendListMgr::FriendListMgr()
{
}
Core::Entity::Social::FriendListMgr::~FriendListMgr()
{
}
bool Social::FriendListMgr::init()
{
return true;
}
Social::FriendListPtr Social::FriendListMgr::getPlayerFriendsList( uint32_t playerId )
{
std::mt19937_64 engine( std::random_device{}( ) );

View file

@ -10,6 +10,7 @@
#include <Server_Zone/Actor/Social/FriendList.h>
#include <Server_Zone/Actor/Social/Manager/GroupMgr.h>
#include <Server_Zone/Forwards.h>
namespace Core {
namespace Entity {
@ -19,6 +20,9 @@ class FriendListMgr
{
public:
FriendListMgr();
~FriendListMgr();
bool init();
FriendListPtr getPlayerFriendsList( uint32_t playerId );

View file

@ -7,8 +7,8 @@ project(Sapphire_Zone)
file(GLOB SERVER_PUBLIC_INCLUDE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
/*.h
Actor/*.h
Actor/Group/*.h
Actor/Group/Manager/*.h
Actor/Social/*.h
Actor/Social/Manager/*.h
Action/*.h
DebugCommand/*.h
Event/*.h
@ -25,8 +25,8 @@ file(GLOB SERVER_PUBLIC_INCLUDE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
file(GLOB SERVER_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.c*
Actor/*.c*
Actor/Group/*.c*
Actor/Group/Manager/*.c*
Actor/Social/*.c*
Actor/Social/Manager/*.c*
Action/*.c*
DebugCommand/*.c*
Event/*.c*

View file

@ -454,7 +454,7 @@ void Core::Network::GameConnection::socialListHandler( const Packets::GamePacket
ZoneChannelPacket< FFXIVIpcSocialList > listPacket( pPlayer->getId() );
listPacket.data().type = 0x0B;
listPacket.data().sequence = 10;
listPacket.data().sequence = count;
memset( listPacket.data().entries, 0, sizeof( listPacket.data().entries ) );
uint16_t i = 0;