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

Method RateLimitPlayerMapVote

src/game/server/gamecontext.cpp:5372–5383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5370}
5371
5372bool CGameContext::RateLimitPlayerMapVote(int ClientId) const
5373{
5374 if(!Server()->IsRconAuthed(ClientId) && time_get() < m_LastMapVote + (time_freq() * g_Config.m_SvVoteMapTimeDelay))
5375 {
5376 char aChatMessage[128];
5377 str_format(aChatMessage, sizeof(aChatMessage), "There's a %d second delay between map-votes, please wait %d seconds.",
5378 g_Config.m_SvVoteMapTimeDelay, (int)((m_LastMapVote + g_Config.m_SvVoteMapTimeDelay * time_freq() - time_get()) / time_freq()));
5379 SendChatTarget(ClientId, aChatMessage);
5380 return true;
5381 }
5382 return false;
5383}
5384
5385void CGameContext::OnUpdatePlayerServerInfo(CJsonWriter *pJsonWriter, int ClientId)
5386{

Callers 1

ConMapMethod · 0.80

Calls 5

time_getFunction · 0.85
time_freqFunction · 0.85
str_formatFunction · 0.85
IsRconAuthedMethod · 0.80
ServerClass · 0.50

Tested by

no test coverage detected