| 1419 | } |
| 1420 | |
| 1421 | void CGameContext::PreInputClients(int ClientId, bool *pClients) |
| 1422 | { |
| 1423 | if(!pClients || !m_apPlayers[ClientId]) |
| 1424 | return; |
| 1425 | |
| 1426 | if(m_apPlayers[ClientId]->GetTeam() == TEAM_SPECTATORS || !m_apPlayers[ClientId]->GetCharacter() || m_apPlayers[ClientId]->IsAfk()) |
| 1427 | return; |
| 1428 | |
| 1429 | for(int Id = 0; Id < MAX_CLIENTS; Id++) |
| 1430 | { |
| 1431 | if(ClientId == Id) |
| 1432 | continue; |
| 1433 | |
| 1434 | CPlayer *pPlayer = m_apPlayers[Id]; |
| 1435 | if(!pPlayer) |
| 1436 | continue; |
| 1437 | |
| 1438 | if(Server()->GetClientVersion(Id) < VERSION_DDNET_PREINPUT) |
| 1439 | continue; |
| 1440 | |
| 1441 | if(pPlayer->GetTeam() == TEAM_SPECTATORS || GetDDRaceTeam(ClientId) != GetDDRaceTeam(Id) || pPlayer->IsAfk()) |
| 1442 | continue; |
| 1443 | |
| 1444 | CCharacter *pChr = pPlayer->GetCharacter(); |
| 1445 | if(!pChr) |
| 1446 | continue; |
| 1447 | |
| 1448 | if(!pChr->CanSnapCharacter(ClientId) || pChr->NetworkClipped(ClientId)) |
| 1449 | continue; |
| 1450 | |
| 1451 | pClients[Id] = true; |
| 1452 | } |
| 1453 | } |
| 1454 | |
| 1455 | // Server hooks |
| 1456 | void CGameContext::OnClientPrepareInput(int ClientId, void *pInput) |
no test coverage detected