| 1402 | votedisplayinfo *curvote = NULL, *calledvote = NULL; |
| 1403 | |
| 1404 | void 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 | |
| 1452 | void scallvote(int *type, const char *arg1, const char *arg2) |
| 1453 | { |
no test coverage detected