Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] do i need to go manually add the sql files?

[DiscordArchive] do i need to go manually add the sql files?

[DiscordArchive] do i need to go manually add the sql files?

rektbyfaith
Administrator
0
09-27-2024, 02:40 PM
#1
Archived author: ShadowWolf • Posted: 2024-09-27T14:40:15.969000+00:00
Original source

do i need to go manually add the sql files?
rektbyfaith
09-27-2024, 02:40 PM #1

Archived author: ShadowWolf • Posted: 2024-09-27T14:40:15.969000+00:00
Original source

do i need to go manually add the sql files?

rektbyfaith
Administrator
0
09-27-2024, 02:41 PM
#2
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>
rektbyfaith
09-27-2024, 02:41 PM #2

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>

rektbyfaith
Administrator
0
09-27-2024, 02:46 PM
#3
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
rektbyfaith
09-27-2024, 02:46 PM #3

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

rektbyfaith
Administrator
0
09-27-2024, 02:48 PM
#4
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
rektbyfaith
09-27-2024, 02:48 PM #4

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

rektbyfaith
Administrator
0
09-27-2024, 02:48 PM
#5
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
rektbyfaith
09-27-2024, 02:48 PM #5

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

rektbyfaith
Administrator
0
09-27-2024, 02:49 PM
#6
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
rektbyfaith
09-27-2024, 02:49 PM #6

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

rektbyfaith
Administrator
0
09-27-2024, 02:49 PM
#7
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
rektbyfaith
09-27-2024, 02:49 PM #7

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

rektbyfaith
Administrator
0
09-27-2024, 02:56 PM
#8
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;
}```
rektbyfaith
09-27-2024, 02:56 PM #8

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;
}```

rektbyfaith
Administrator
0
09-27-2024, 02:59 PM
#9
Archived author: Tosty • Posted: 2024-09-27T14:59:22.483000+00:00
Original source

RBAC.h
`RBAC_PERM_ALLOW_GM_FRIEND = 40`
rektbyfaith
09-27-2024, 02:59 PM #9

Archived author: Tosty • Posted: 2024-09-27T14:59:22.483000+00:00
Original source

RBAC.h
`RBAC_PERM_ALLOW_GM_FRIEND = 40`

rektbyfaith
Administrator
0
09-27-2024, 03:01 PM
#10
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&]
rektbyfaith
09-27-2024, 03:01 PM #10

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&]

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)