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

Function msgsizelookup

source/src/protocol.cpp:612–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610};
611
612int msgsizelookup(int msg)
613{
614 static int sizetable[SV_NUM] = { -1 };
615 if(sizetable[0] < 0)
616 {
617 memset(sizetable, -1, sizeof(sizetable));
618 for(const int *p = msgsizes; *p >= 0; p += 2) sizetable[p[0]] = p[1];
619 }
620 return msg >= 0 && msg < SV_NUM ? sizetable[msg] : -1;
621}
622
623static const int lastclactions[] = // actions for afk checking
624{

Callers 2

addmsgFunction · 0.85
processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected