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

Method CallvoteOption

src/game/client/components/voting.cpp:83–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void CVoting::CallvoteOption(int OptionId, const char *pReason, bool ForceVote)
84{
85 CVoteOptionClient *pOption = m_pFirst;
86 while(pOption && OptionId >= 0)
87 {
88 if(OptionId == 0)
89 {
90 if(ForceVote)
91 {
92 char aBuf[128] = "force_vote option \"";
93 char *pDst = aBuf + str_length(aBuf);
94 str_escape(&pDst, pOption->m_aDescription, aBuf + sizeof(aBuf));
95 str_append(aBuf, "\" \"");
96 pDst = aBuf + str_length(aBuf);
97 str_escape(&pDst, pReason, aBuf + sizeof(aBuf));
98 str_append(aBuf, "\"");
99 Client()->Rcon(aBuf);
100 }
101 else
102 Callvote("option", pOption->m_aDescription, pReason);
103 break;
104 }
105
106 OptionId--;
107 pOption = pOption->m_pNext;
108 }
109}
110
111void CVoting::RemovevoteOption(int OptionId)
112{

Callers 1

RenderServerControlMethod · 0.80

Calls 5

str_lengthFunction · 0.85
str_escapeFunction · 0.85
RconMethod · 0.80
str_appendFunction · 0.50
ClientFunction · 0.50

Tested by

no test coverage detected