MCPcopy Create free account
hub / github.com/ddnet/ddnet / IsFriend

Method IsFriend

src/engine/client/friends.cpp:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89bool CFriends::IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const
90{
91 unsigned NameHash = str_quickhash(pName);
92 unsigned ClanHash = str_quickhash(pClan);
93 for(int i = 0; i < m_NumFriends; ++i)
94 {
95 if(((g_Config.m_ClFriendsIgnoreClan && m_aFriends[i].m_aName[0]) || (m_aFriends[i].m_ClanHash == ClanHash && !str_comp(m_aFriends[i].m_aClan, pClan))) &&
96 ((!PlayersOnly && m_aFriends[i].m_aName[0] == 0) || (m_aFriends[i].m_NameHash == NameHash && !str_comp(m_aFriends[i].m_aName, pName))))
97 return true;
98 }
99 return false;
100}
101
102void CFriends::AddFriend(const char *pName, const char *pClan)
103{

Callers 1

OnNewSnapshotMethod · 0.80

Calls 2

str_quickhashFunction · 0.85
str_compFunction · 0.85

Tested by

no test coverage detected