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

Function sendpacket

source/src/server.cpp:431–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void sendpacket(int n, int chan, ENetPacket *packet, int exclude, bool demopacket)
432{
433 if(n<0)
434 {
435 recordpacket(chan, packet->data, (int)packet->dataLength);
436 loopv(clients) if(i!=exclude && (clients[i]->type!=ST_TCPIP || clients[i]->isauthed)) sendpacket(i, chan, packet, -1, demopacket);
437 return;
438 }
439 switch(clients[n]->type)
440 {
441 case ST_TCPIP:
442 {
443 enet_peer_send(clients[n]->peer, chan, packet);
444 break;
445 }
446
447 case ST_LOCAL:
448 localservertoclient(chan, packet->data, (int)packet->dataLength, demopacket);
449 break;
450 }
451}
452
453static bool reliablemessages = false;
454

Callers 15

loopvFunction · 0.85
sendfFunction · 0.85
listdemosFunction · 0.85
checkdemotransmissionsFunction · 0.85
readdemoFunction · 0.85
sendflaginfoFunction · 0.85
sendvoicecomteamFunction · 0.85
startgameFunction · 0.85
svoteFunction · 0.85
scallvoteFunction · 0.85
callvotepacketFunction · 0.85
senddisconnectedscoresFunction · 0.85

Calls 4

recordpacketFunction · 0.85
enet_peer_sendFunction · 0.85
loopvFunction · 0.70
localservertoclientFunction · 0.70

Tested by

no test coverage detected