[DiscordArchive] do i need to go manually add the sql files?
[DiscordArchive] do i need to go manually add the sql files?
Archived author: ShadowWolf • Posted: 2024-09-27T14:40:15.969000+00:00
Original source
do i need to go manually add the sql files?
Archived author: jackpoz • Posted: 2024-09-27T14:41:02.647000+00:00
Original source
that's no TC, that's TC with NPC bots, please take it to <#870722120458600528>
Archived author: Tosty • Posted: 2024-09-27T14:46:11.581000+00:00
Original source
Ok so I found the DB statement in CharacterDatabase.cpp where the entry for the friend list would be made
`PrepareStatement(CHAR_INS_CHARACTER_SOCIAL, "INSERT INTO character_social (guid, friend, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC);`
And the function where this statement is called in SocialMgr.cpp
```bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
{
// check client limits
if (GetNumberOfSocialsWithFlag(flag) >= (((flag & SOCIAL_FLAG_FRIEND) != 0) ? SOCIALMGR_FRIEND_LIMIT : SOCIALMGR_IGNORE_LIMIT))
return false;
PlayerSocialMap::iterator itr = _playerSocialMap.find(friendGuid);
if (itr != _playerSocialMap.end())
{
itr->second.Flags |= flag;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
stmt->setUInt8(0, itr->second.Flags);
stmt->setUInt32(1, GetPlayerGUID().GetCounter());
stmt->setUInt32(2, friendGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
else
{
_playerSocialMap[friendGuid].Flags |= flag;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
stmt->setUInt32(0, GetPlayerGUID().GetCounter());
stmt->setUInt32(1, friendGuid.GetCounter());
stmt->setUInt8(2, flag);
CharacterDatabase.Execute(stmt);
}
return true;
}```
To me it looks like it just checks, if the friend list (or social list if we go by the names in the code) is already full and if the character to be added is already in the list.
I don't see any check for GM status of the target character
Archived author: stoneharry • Posted: 2024-09-27T14:48:02.677000+00:00
Original source
Check where that method is invoked from, I think you went too deep
Archived author: stoneharry • Posted: 2024-09-27T14:48:30.305000+00:00
Original source
View Call Hierarchy helps, but can be slow with the size of TC
Archived author: jackpoz • Posted: 2024-09-27T14:49:07.747000+00:00
Original source
yeah, Find in Files looks not as good but it's blazing faster
Archived author: Tosty • Posted: 2024-09-27T14:49:57.990000+00:00
Original source
Ah you're right I think I found it. I'll have a look at that code
Archived author: Tosty • Posted: 2024-09-27T14:56:29.267000+00:00
Original source
Found the interesting part I think
```if (HasPermission(rbac::RBAC_PERM_ALLOW_GM_FRIEND))
{
processFriendRequest();
return;
}```
Archived author: Tosty • Posted: 2024-09-27T14:59:22.483000+00:00
Original source
RBAC.h
`RBAC_PERM_ALLOW_GM_FRIEND = 40`
![[Image: image.png?ex=690c0fa4&is=690abe24&hm=e08...71b4ceff1&]](https://cdn.discordapp.com/attachments/376457042392514560/1289240616894464093/image.png?ex=690c0fa4&is=690abe24&hm=e08a55c5df975d7c9a2de0c1aa5af5f02f48812c2b2f6c626a14e5d71b4ceff1&)
Archived author: Tosty • Posted: 2024-09-27T15:01:55.982000+00:00
Original source
I also found a database entry in the auth database rbac_permissions table, that reflects the assignments in RBAC.h
![[Image: image.png?ex=690c0fa4&is=690abe24&hm=e08...71b4ceff1&]](https://cdn.discordapp.com/attachments/376457042392514560/1289240616894464093/image.png?ex=690c0fa4&is=690abe24&hm=e08a55c5df975d7c9a2de0c1aa5af5f02f48812c2b2f6c626a14e5d71b4ceff1&)