MCPcopy Create free account
hub / github.com/assaultcube/AC / end

Method end

source/src/server.cpp:2564–2575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2562 ~voteinfo() { delete action; }
2563
2564 void end(int result)
2565 {
2566 if(action && !action->isvalid()) result = VOTE_NO; // don't perform() invalid votes
2567 sendf(-1, 1, "ri2", SV_VOTERESULT, result);
2568 this->result = result;
2569 if(result == VOTE_YES)
2570 {
2571 if(valid_client(owner)) clients[owner]->lastvotecall = 0;
2572 if(action) action->perform();
2573 }
2574 loopv(clients) clients[i]->vote = VOTE_NEUTRAL;
2575 }
2576
2577 bool isvalid() { return valid_client(owner) && action != NULL && action->isvalid(); }
2578 bool isalive() { return servmillis - callmillis < 30*1000; }

Callers

nothing calls this directly

Calls 5

sendfFunction · 0.85
valid_clientFunction · 0.85
loopvFunction · 0.70
isvalidMethod · 0.45
performMethod · 0.45

Tested by

no test coverage detected