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

Method GeneratePassphrase

src/game/server/score.cpp:66–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void CScore::GeneratePassphrase(char *pBuf, int BufSize)
67{
68 for(int i = 0; i < 3; i++)
69 {
70 if(i != 0)
71 str_append(pBuf, " ", BufSize);
72 // TODO: decide if the slight bias towards lower numbers is ok
73 int Rand = m_Prng.RandomBits() % m_vWordlist.size();
74 str_append(pBuf, m_vWordlist[Rand].c_str(), BufSize);
75 }
76}
77
78CScore::CScore(CGameContext *pGameServer, CDbConnectionPool *pPool) :
79 m_pPool(pPool),

Callers

nothing calls this directly

Calls 2

RandomBitsMethod · 0.80
str_appendFunction · 0.50

Tested by

no test coverage detected