mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
queue fixes and admin force improvements
This commit is contained in:
@@ -51,7 +51,16 @@ function createRoverLifecycle(deps) {
|
||||
}
|
||||
socketToRovers.get(socket.id).add(roverId);
|
||||
socket.join(record.room);
|
||||
turnService.driverAdded(roverId, socket.id, (force && isAdmin(socket)) || forceTurn);
|
||||
const adminForceControl = force && isAdmin(socket);
|
||||
turnService.driverAdded(roverId, socket.id, {
|
||||
/*
|
||||
`forceTurn` is used by private-rover approval to grant a user the next
|
||||
active slot, but it should not freeze the public turn queue. Only an
|
||||
explicit admin force-control request is a takeover that pauses rotation.
|
||||
*/
|
||||
force: adminForceControl || forceTurn,
|
||||
pauseQueue: adminForceControl,
|
||||
});
|
||||
socket.emit('controlGranted', { roverId });
|
||||
managerEvents.emit('driver', { socketId: socket.id, roverId, action: 'add' });
|
||||
sendAlert({
|
||||
|
||||
Reference in New Issue
Block a user