MCPcopy Index your code
hub / github.com/assaultcube/AC / getmap

Function getmap

source/src/client.cpp:648–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646COMMAND(sendmap, "s");
647
648void getmap(char *name, char *callback)
649{
650 if((!name || !*name)
651 || (curpeer && !strcmp(name, getclientmap())) )
652 {
653 conoutf("requesting map from server...");
654 packetbuf p(10, ENET_PACKET_FLAG_RELIABLE);
655 putint(p, SV_RECVMAP);
656 sendpackettoserv(2, p.finalize());
657 }
658 else
659 {
660 requirepackage(PCK_MAP, name);
661 if(downloadpackages(false))
662 {
663 if(callback && *callback) execute(callback);
664 conoutf("map %s installed successfully", name);
665 }
666 else conoutf("\f3map download failed");
667 }
668}
669COMMAND(getmap, "ss");
670
671void deleteservermap(char *mapname)

Callers 1

changemapservFunction · 0.85

Calls 8

getclientmapFunction · 0.85
putintFunction · 0.85
sendpackettoservFunction · 0.85
requirepackageFunction · 0.85
downloadpackagesFunction · 0.85
executeFunction · 0.85
finalizeMethod · 0.80
conoutfFunction · 0.70

Tested by

no test coverage detected