Fix a few network issues
This commit is contained in:
+13
-2
@@ -18,14 +18,20 @@ func logProfilingInfo(handleEventsTime, renderTime, scaleTime, frameTime, frameC
|
||||
fmt.Printf("Average render time: %f ms\n", float64(renderTime)/floatFrame)
|
||||
fmt.Printf("Average scaling time: %f ms\n", float64(scaleTime)/floatFrame)
|
||||
fmt.Printf("Average frame time: %f ms\n", float64(frameTime)/floatFrame)
|
||||
|
||||
fmt.Print("\n")
|
||||
}
|
||||
|
||||
func logMapProfilingInfo(renderTime, scaleTime, frameTime, frameCount uint64) {
|
||||
func logMapProfilingInfo(renderTime, scaleTime, frameTime, totalGameLogicCatchUp, totalNormalGameLogic, totalTicking, totalRemotePlayerUpdate, tickCount, frameCount uint64) {
|
||||
floatFrame := float64(frameCount)
|
||||
floatTick := float64(tickCount)
|
||||
fmt.Printf("Average map render time: %f ms\n", float64(renderTime)/floatFrame)
|
||||
fmt.Printf("Average map scaling time: %f ms\n", float64(scaleTime)/floatFrame)
|
||||
fmt.Printf("Average full render time: %f ms\n", float64(frameTime)/floatFrame)
|
||||
fmt.Printf("Average total gamelogic catching up time: %f ms\n", float64(totalGameLogicCatchUp)/floatFrame)
|
||||
fmt.Printf("Average normal gamelogic time: %f ms\n", float64(totalNormalGameLogic)/floatFrame)
|
||||
fmt.Printf("Average ticking time: %f ms\n", float64(totalTicking)/floatTick)
|
||||
fmt.Printf("Average remote player update time: %f ms\n", float64(totalRemotePlayerUpdate)/floatTick)
|
||||
fmt.Print("\n")
|
||||
}
|
||||
|
||||
@@ -37,11 +43,16 @@ func resetProfilingCounters(handleEventsTime, renderTime, scaleTime, frameTime *
|
||||
*frameCount = 0
|
||||
}
|
||||
|
||||
func resetMapProfilingCounters(renderTime, scaleTime, frameTime *uint64, frameCount *uint64) {
|
||||
func resetMapProfilingCounters(renderTime, scaleTime, frameTime, totalGameLogicCatchUp, totalNormalGameLogic, totalTicking, totalRemotePlayerUpdate *uint64, frameCount, tickCount *uint64) {
|
||||
*renderTime = 0
|
||||
*scaleTime = 0
|
||||
*frameTime = 0
|
||||
*frameCount = 0
|
||||
*totalGameLogicCatchUp = 0
|
||||
*totalNormalGameLogic = 0
|
||||
*totalTicking = 0
|
||||
*totalRemotePlayerUpdate = 0
|
||||
*tickCount = 0
|
||||
}
|
||||
|
||||
func enforceFrameRate(frameStart uint64, targetFPS int) {
|
||||
|
||||
Reference in New Issue
Block a user