| 1755 | // c) no spect talk to players during 'match' |
| 1756 | |
| 1757 | void sendteamtext(char *text, int sender, int msgtype) |
| 1758 | { |
| 1759 | if(!valid_client(sender) || clients[sender]->team == TEAM_NUM) return; |
| 1760 | packetbuf p(MAXTRANS, ENET_PACKET_FLAG_RELIABLE); |
| 1761 | putint(p, msgtype); |
| 1762 | putint(p, sender); |
| 1763 | sendstring(text, p); |
| 1764 | ENetPacket *packet = p.finalize(); |
| 1765 | recordpacket(1, packet); |
| 1766 | int &st = clients[sender]->team; |
| 1767 | loopv(clients) |
| 1768 | { |
| 1769 | int &rt = clients[i]->team; |
| 1770 | if((rt == TEAM_SPECT && clients[i]->role == CR_ADMIN) || // spect-admin reads all |
| 1771 | (team_isactive(st) && st == team_group(rt)) || // player to own team + own spects |
| 1772 | (team_isspect(st) && team_isspect(rt)) || // spectator to other spectators |
| 1773 | (i == sender)) // "local" echo |
| 1774 | sendpacket(i, 1, packet); |
| 1775 | } |
| 1776 | } |
| 1777 | |
| 1778 | void sendvoicecomteam(int sound, int sender) |
| 1779 | { |
no test coverage detected