示例#1
0
    def _update(self):
        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isPlaying and not replayCtrl.isBattleSimulation and replayCtrl.fps > 0:
            fps = BigWorld.getFPS()[1]
            fpsReplay = int(replayCtrl.fps)
            ping = replayCtrl.ping
            isLaggingNow = replayCtrl.isLaggingNow
        else:
            fpsReplay = -1
            isLaggingNow = BigWorld.statLagDetected()
            ping = BigWorld.statPing()
            fps = BigWorld.getFPS()[1]
            g_statistics.update()
            if replayCtrl.isRecording:
                replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
        try:
            ping = int(ping)
            fps = int(fps)
        except (ValueError, OverflowError):
            return

        if self._debugPanelUI is not None:
            self._debugPanelUI.updateDebugInfo(int(ping),
                                               int(fps),
                                               isLaggingNow,
                                               fpsReplay=fpsReplay)
        return
示例#2
0
    def __update(self):
        player = BigWorld.player()
        if player is None or not hasattr(player, 'playerVehicleID'):
            return
        else:
            fps = 0
            recordedFps = -1
            ping = 0
            isLaggingNow = False
            replayCtrl = BattleReplay.g_replayCtrl
            if replayCtrl.isPlaying and replayCtrl.fps > 0:
                fps = BigWorld.getFPS()[1]
                recordedFps = replayCtrl.fps
                ping = replayCtrl.ping
                isLaggingNow = replayCtrl.isLaggingNow
            else:
                isLaggingNow = player.filter.isLaggingNow
                if not isLaggingNow:
                    for v in BigWorld.entities.values():
                        if _isVehicleEntity(v):
                            if not v.isPlayer:
                                if v.isAlive() and isinstance(v.filter, BigWorld.WGVehicleFilter) and v.filter.isLaggingNow:
                                    isLaggingNow = True
                                    break

                ping = min(BigWorld.LatencyInfo().value[3] * 1000, 999)
                if ping < 999:
                    ping = max(1, ping - 500.0 * constants.SERVER_TICK_LENGTH)
                fpsInfo = BigWorld.getFPS()
                from helpers.statistics import g_statistics
                g_statistics.update(fpsInfo, ping, isLaggingNow)
                fps = fpsInfo[1]
                if replayCtrl.isRecording:
                    replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
            try:
                self.__performanceStats.updateDebugInfo(int(fps), int(ping), isLaggingNow, int(recordedFps))
            except:
                pass

            return
示例#3
0
    def _update(self):
        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isPlaying and replayCtrl.fps > 0:
            fps = BigWorld.getFPS()[1]
            fpsReplay = int(replayCtrl.fps)
            ping = replayCtrl.ping
            isLaggingNow = replayCtrl.isLaggingNow
        else:
            fpsReplay = -1
            player = BigWorld.player()
            isLaggingNow = player.filter.isLaggingNow if player is not None else False
            if not isLaggingNow:
                for vehicleID in self._visibleVehicles:
                    vehicle = BigWorld.entities[vehicleID]
                    if vehicle is not None and vehicle.isAlive():
                        try:
                            if vehicle.filter.isLagginNow:
                                isLaggingNow = True
                                break
                        except AttributeError:
                            pass

            avgLatency = BigWorld.LatencyInfo().value[3]
            if avgLatency:
                ping = min(avgLatency * 1000, 999)
                if ping < 999:
                    ping = max(1, ping - 500.0 * constants.SERVER_TICK_LENGTH)
            else:
                ping = 999
            fpsInfo = BigWorld.getFPS()
            g_statistics.update(fpsInfo, ping, isLaggingNow)
            fps = fpsInfo[1]
            if replayCtrl.isRecording:
                replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
        if self._debugPanelUI is not None:
            self._debugPanelUI.updateDebugInfo(int(ping),
                                               int(fps),
                                               isLaggingNow,
                                               fpsReplay=fpsReplay)
        return
示例#4
0
    def __update(self):
        player = BigWorld.player()
        if player is None or not hasattr(player, 'playerVehicleID'):
            return
        fps = 0
        recordedFps = -1
        ping = 0
        isLaggingNow = False
        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isPlaying and replayCtrl.fps > 0:
            fps = BigWorld.getFPS()[1]
            recordedFps = replayCtrl.fps
            ping = replayCtrl.ping
            isLaggingNow = replayCtrl.isLaggingNow
        else:
            isLaggingNow = player.filter.isLaggingNow
            if not isLaggingNow:
                for v in BigWorld.entities.values():
                    if _isVehicleEntity(v):
                        if not v.isPlayer:
                            if v.isAlive() and isinstance(v.filter, BigWorld.WGVehicleFilter) and v.filter.isLaggingNow:
                                isLaggingNow = True
                                break

            ping = min(BigWorld.LatencyInfo().value[3] * 1000, 999)
            if ping < 999:
                ping = max(1, ping - 500.0 * constants.SERVER_TICK_LENGTH)
            fpsInfo = BigWorld.getFPS()
            from helpers.statistics import g_statistics
            g_statistics.update(fpsInfo, ping, isLaggingNow)
            fps = fpsInfo[1]
            if replayCtrl.isRecording:
                replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
        try:
            self.__performanceStats.updateDebugInfo(int(fps), int(ping), isLaggingNow, int(recordedFps))
        except:
            pass
示例#5
0
    def _update(self):
        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isPlaying and replayCtrl.fps > 0:
            fps = BigWorld.getFPS()[1]
            fpsReplay = int(replayCtrl.fps)
            ping = replayCtrl.ping
            isLaggingNow = replayCtrl.isLaggingNow
        else:
            fpsReplay = -1
            player = BigWorld.player()
            isLaggingNow = player.filter.isLaggingNow if player is not None else False
            if not isLaggingNow:
                for vehicleID in self._visibleVehicles:
                    vehicle = BigWorld.entities[vehicleID]
                    if vehicle is not None and vehicle.isAlive():
                        try:
                            if vehicle.filter.isLagginNow:
                                isLaggingNow = True
                                break
                        except AttributeError:
                            pass

            avgLatency = BigWorld.LatencyInfo().value[3]
            if avgLatency:
                ping = min(avgLatency * 1000, 999)
                if ping < 999:
                    ping = max(1, ping - 500.0 * constants.SERVER_TICK_LENGTH)
            else:
                ping = 999
            fpsInfo = BigWorld.getFPS()
            g_statistics.update(fpsInfo, ping, isLaggingNow)
            fps = fpsInfo[1]
            if replayCtrl.isRecording:
                replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
        if self._debugPanelUI is not None:
            self._debugPanelUI.updateDebugInfo(int(ping), int(fps), isLaggingNow, fpsReplay=fpsReplay)
        return
示例#6
0
    def _update(self):
        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isPlaying and replayCtrl.fps > 0:
            fps = BigWorld.getFPS()[1]
            fpsReplay = int(replayCtrl.fps)
            ping = replayCtrl.ping
            isLaggingNow = replayCtrl.isLaggingNow
        else:
            fpsReplay = -1
            isLaggingNow = BigWorld.statLagDetected()
            ping = BigWorld.statPing()
            fps = BigWorld.getFPS()[1]
            g_statistics.update()
            if replayCtrl.isRecording:
                replayCtrl.setFpsPingLag(fps, ping, isLaggingNow)
        try:
            ping = int(ping)
            fps = int(fps)
        except (ValueError, OverflowError):
            return

        if self._debugPanelUI is not None:
            self._debugPanelUI.updateDebugInfo(int(ping), int(fps), isLaggingNow, fpsReplay=fpsReplay)
        return