MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / handleFlagUpdate

Function handleFlagUpdate

src/clientbase/playing.cpp:1300–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1298
1299
1300void handleFlagUpdate(void* msg, size_t len) {
1301 uint16_t count = 0;
1302 uint16_t flagIndex;
1303 if (len >= 2) {
1304 msg = nboUnpackUInt16(msg, count);
1305 }
1306
1307 size_t perFlagSize = 2 + 55;
1308
1309 if (len >= (2 + (perFlagSize * count))) {
1310 for (int i = 0; i < count; i++) {
1311 msg = nboUnpackUInt16(msg, flagIndex);
1312 Flag& flag = world->getFlag(int(flagIndex));
1313 msg = flag.unpack(msg);
1314 world->initFlag(int(flagIndex));
1315 }
1316 }
1317}
1318
1319
1320void handleTeamUpdate(void* msg, bool& checkScores) {

Callers 1

handleServerMessageFunction · 0.85

Calls 4

nboUnpackUInt16Function · 0.85
getFlagMethod · 0.80
initFlagMethod · 0.80
unpackMethod · 0.45

Tested by

no test coverage detected