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

Function callvote

source/src/clientgame.cpp:1404–1450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1402votedisplayinfo *curvote = NULL, *calledvote = NULL;
1403
1404void callvote(int type, const char *arg1, const char *arg2, const char *arg3)
1405{
1406 if(calledvote) return;
1407 votedisplayinfo *v = newvotedisplayinfo(player1, type, arg1, arg2, arg3);
1408 if(v)
1409 {
1410 calledvote = v;
1411 packetbuf p(MAXTRANS, ENET_PACKET_FLAG_RELIABLE);
1412 putint(p, SV_CALLVOTE);
1413 putint(p, v->type);
1414 switch(v->type)
1415 {
1416 case SA_KICK:
1417 case SA_BAN:
1418 putint(p, atoi(arg1));
1419 sendstring(arg2, p);
1420 break;
1421 case SA_MAP:
1422 sendstring(arg1, p);
1423 putint(p, atoi(arg2));
1424 putint(p, atoi(arg3));
1425 break;
1426 case SA_SERVERDESC:
1427 sendstring(arg1, p);
1428 break;
1429 case SA_STOPDEMO:
1430 // compatibility
1431 break;
1432 case SA_REMBANS:
1433 case SA_SHUFFLETEAMS:
1434 break;
1435 case SA_FORCETEAM:
1436 putint(p, atoi(arg1));
1437 putint(p, atoi(arg2));
1438 break;
1439 case SA_PAUSE:
1440 putint(p, atoi(arg1));
1441 break;
1442 default:
1443 putint(p, atoi(arg1));
1444 break;
1445 }
1446 sendpackettoserv(1, p.finalize());
1447 exechook(HOOK_SP_MP, "onCallVote", "%d %d [%s] [%s]", type, player1->clientnum, arg1, arg2);
1448 }
1449 else conoutf("\f3invalid vote");
1450}
1451
1452void scallvote(int *type, const char *arg1, const char *arg2)
1453{

Callers 4

shiftgametimeFunction · 0.85
scallvoteFunction · 0.85
loopiFunction · 0.85
cmd_pauseFunction · 0.85

Calls 7

newvotedisplayinfoFunction · 0.85
putintFunction · 0.85
sendstringFunction · 0.85
sendpackettoservFunction · 0.85
exechookFunction · 0.85
finalizeMethod · 0.80
conoutfFunction · 0.70

Tested by

no test coverage detected