Full rewrite
- Removed csflow, as its basically not getting used when high optimization is needed - Fully rewrote radarflow dma logic. - Speed increase from 20hz to over 130 hz over pcileech, thanks to scatter reads and improved caching - Removed docs, because those were for csflow, which is now removed
This commit is contained in:
21
webradar/script.js
Normal file → Executable file
21
webradar/script.js
Normal file → Executable file
@@ -5,14 +5,16 @@ const enemyColor = "#ec040b"
|
||||
const bombColor = "#eda338"
|
||||
const textColor = "#d1d1d1"
|
||||
|
||||
// Should zoom or not
|
||||
// Settings
|
||||
shouldZoom = true
|
||||
drawStats = true
|
||||
|
||||
// Common
|
||||
canvas = null
|
||||
ctx = null
|
||||
|
||||
// radarflow specific
|
||||
freq = 0
|
||||
image = null
|
||||
map = null
|
||||
mapName = null
|
||||
@@ -32,6 +34,7 @@ if (location.protocol == 'https:') {
|
||||
} else {
|
||||
websocketAddr = `ws://${window.location.host}/ws`
|
||||
}
|
||||
//websocketAddr = "ws://localhost:8001/ws"
|
||||
|
||||
// Util functions
|
||||
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||
@@ -186,6 +189,16 @@ function render() {
|
||||
ctx.fillText("Disconnected", 1024/2, 1024/2);
|
||||
}
|
||||
}
|
||||
|
||||
if (drawStats) {
|
||||
ctx.font = "16px Arial";
|
||||
ctx.textAlign = "left"
|
||||
ctx.fillStyle = textColor
|
||||
ctx.lineWidth = 2;
|
||||
ctx.strokeStyle = "black"
|
||||
ctx.strokeText(`${freq} Hz`, 2, 18)
|
||||
ctx.fillText(`${freq} Hz`, 2, 18)
|
||||
}
|
||||
}
|
||||
|
||||
if (websocket != null) {
|
||||
@@ -355,6 +368,8 @@ function connect() {
|
||||
} else {
|
||||
let data = JSON.parse(event.data);
|
||||
|
||||
freq = data.freq;
|
||||
|
||||
if (data.ingame == false) {
|
||||
mapName = null
|
||||
entityData = null
|
||||
@@ -417,4 +432,8 @@ addEventListener("DOMContentLoaded", (e) => {
|
||||
|
||||
function toggleZoom() {
|
||||
shouldZoom = !shouldZoom
|
||||
}
|
||||
|
||||
function toggleStats() {
|
||||
drawStats = !drawStats
|
||||
}
|
||||
Reference in New Issue
Block a user