roverquesting

This commit is contained in:
legop3
2026-03-27 16:08:04 -04:00
parent 998933f4c2
commit c220eb4022
14 changed files with 508 additions and 131 deletions
+12 -2
View File
@@ -135,11 +135,21 @@ function getPrivateSafety(record) {
}
function shouldApplyPrivateSafety(record, socket) {
if (!isPrivateRecord(record) || !isPrivateOpen(record)) return false;
if (!isPrivateRecord(record)) return false;
if (isLockdownAdmin(socket)) return false;
return true;
}
function shouldApplyPrivateSensorSafety(record) {
if (!isPrivateRecord(record)) return false;
const activeDrivers = turnService.getActiveDrivers();
const activeDriverId = activeDrivers?.[record.id];
if (!activeDriverId) return false;
const activeSocket = io.sockets.sockets.get(activeDriverId);
if (!activeSocket) return true;
return !isLockdownAdmin(activeSocket);
}
function isRoverVisibleToSocket(record, socket) {
if (!record) return false;
if (!isPrivateRecord(record)) return true;
@@ -639,7 +649,7 @@ function evaluatePrivateSafety(record, sensors) {
const currentBump = bump;
const currentCliff = cliff;
if (!isPrivateRecord(record) || !isPrivateOpen(record)) {
if (!shouldApplyPrivateSensorSafety(record)) {
state.blockedUntil = 0;
state.lastOvercurrent = currentOver;
state.lastBump = currentBump;