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

Function handleAddPlayer

src/clientbase/playing.cpp:1259–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1257
1258
1259void handleAddPlayer(void* msg, bool& checkScores) {
1260 PlayerId id;
1261 msg = nboUnpackUInt8(msg, id);
1262
1263#if defined(FIXME) && defined(ROBOT)
1264 saveRobotInfo(id, msg);
1265#endif
1266
1267 if (id == myTank->getId()) {
1268 enteringServer(msg); // it's me! should be the end of updates
1269 }
1270 else {
1271 addPlayer(id, msg, entered);
1272 updateNumPlayers();
1273 checkScores = true;
1274
1275 if (myTank->getId() >= 200) {
1276 setTankFlags(); // update the tank flags when in replay mode.
1277 }
1278 }
1279
1280 const int index = lookupPlayerIndex(id);
1281 if ((index >= 0) || (index == -2)) {
1282 const Player* player = getPlayerByIndex(index);
1283 if (player) {
1284 eventHandler.PlayerAdded(*player);
1285 }
1286 }
1287}
1288
1289
1290void handleRemovePlayer(void* msg, bool& checkScores) {

Callers 1

handleServerMessageFunction · 0.85

Calls 10

nboUnpackUInt8Function · 0.85
saveRobotInfoFunction · 0.85
updateNumPlayersFunction · 0.85
setTankFlagsFunction · 0.85
lookupPlayerIndexFunction · 0.85
getIdMethod · 0.80
addPlayerFunction · 0.70
getPlayerByIndexFunction · 0.70
enteringServerFunction · 0.50
PlayerAddedMethod · 0.45

Tested by

no test coverage detected