Quellcode durchsuchen

chore: fix protocol issue with adf

v0lp3 vor 4 Jahren
Ursprung
Commit
e4eaacfd94
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      src/backend.go

+ 6 - 1
src/backend.go

@@ -62,8 +62,13 @@ func sendRequest(socket net.Conn, resolution int, _mode string, adf bool) (int,
 	width, height := 0, 0
 	planeWidth, planeHeight := 0, 0
 	dpiX, dpiY := 0, 0
+	adfStatus := 0
 
-	fmt.Sscanf(offer[3:], "%d,%d,2,%d,%d,%d,%d", &dpiX, &dpiY, &planeWidth, &width, &planeHeight, &height)
+	fmt.Sscanf(offer[3:], "%d,%d,%d,%d,%d,%d,%d", &dpiX, &dpiY, &adfStatus, &planeWidth, &width, &planeHeight, &height)
+
+	if planeHeight == 0 {
+		planeHeight = 294
+	}
 
 	width = mmToPixels(planeWidth, dpiX)
 	height = mmToPixels(planeHeight, dpiY)