| 258 | } |
| 259 | |
| 260 | void ServerControl::countPlayers(action act, bz_PlayerJoinPartEventData_V1* data) { |
| 261 | bz_APIIntList* playerList = bz_newIntList(); |
| 262 | bz_BasePlayerRecord* player; |
| 263 | ostringstream msg; |
| 264 | string str; |
| 265 | int numLines = 0; |
| 266 | int numObs = 0; |
| 267 | |
| 268 | bz_getPlayerIndexList(playerList); |
| 269 | |
| 270 | for (unsigned int i = 0; i < playerList->size(); i++) { |
| 271 | player = bz_getPlayerByIndex(playerList->get(i)); |
| 272 | if (player) { |
| 273 | if (act == join || (data && (player->playerID != data->playerID) && |
| 274 | (player->callsign != ""))) { |
| 275 | if (player->callsign != "") { |
| 276 | if (player->team == eObservers) { |
| 277 | numObs++; |
| 278 | } |
| 279 | numLines++; |
| 280 | } |
| 281 | } |
| 282 | bz_freePlayerRecord(player); |
| 283 | } |
| 284 | } |
| 285 | numPlayers = numLines; |
| 286 | numObservers = numObs; |
| 287 | bz_debugMessagef(2, "serverControl - %d total players, %d observers", numPlayers, numObservers); |
| 288 | bz_deleteIntList(playerList); |
| 289 | } |
| 290 | |
| 291 | void ServerControl::checkBanChanges(void) { |
| 292 | time_t mtime; |
nothing calls this directly
no test coverage detected