| 433 | } |
| 434 | |
| 435 | void IGameController::OnPlayerDisconnect(class CPlayer *pPlayer, const char *pReason) |
| 436 | { |
| 437 | pPlayer->OnDisconnect(); |
| 438 | int ClientId = pPlayer->GetCid(); |
| 439 | if(Server()->ClientIngame(ClientId)) |
| 440 | { |
| 441 | char aBuf[512]; |
| 442 | if(pReason && *pReason) |
| 443 | str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(ClientId), pReason); |
| 444 | else |
| 445 | str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(ClientId)); |
| 446 | GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::FLAG_SIX); |
| 447 | |
| 448 | str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", ClientId, Server()->ClientName(ClientId)); |
| 449 | GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "game", aBuf); |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | void IGameController::EndRound() |
| 454 | { |
no test coverage detected