public override void OnServerDisconnect(NetworkConnection conn)
    {
        base.OnServerDisconnect(conn);

        if (!this.isSinglePlayer)
        {
            MapMP mpMap = (MapMP)this.map;

            //TODO use the method in Map to get the connected player.
            for (int i = this.map.allPlayers.Count - 1; i >= 0; i--)
            {
                ConnectedPlayer connectedPlayer = this.map.allPlayers[i];
                if (connectedPlayer.getConnection().connectionId == conn.connectionId)
                {
                    mpMap.allPlayers.RemoveAt(i);
                    mpMap.savePlayer(connectedPlayer);
                    mpMap.availibleTeams.freeTeam(connectedPlayer.getTeam());
                    return;
                }
            }
        }
    }