added MRT sds image
This commit is contained in:
@@ -327,9 +327,6 @@ router.post("/:id/validate-hpg", async (req, res) => {
|
||||
res.json({
|
||||
message: "HPG validierung gestartet",
|
||||
});
|
||||
console.log(
|
||||
`HPG Validation for ${user?.publicId} (${mission?.hpgSelectedMissionString}) started`,
|
||||
);
|
||||
io.to(`desktop:${activeAircraftinMission?.userId}`).emit("hpg-validation", {
|
||||
missionId: parseInt(id),
|
||||
userId: req.user?.id,
|
||||
|
||||
@@ -55,14 +55,35 @@ export const handleConnectPilot =
|
||||
}
|
||||
}
|
||||
|
||||
// Set "now" to 2 hours in the future
|
||||
const nowPlus2h = new Date();
|
||||
nowPlus2h.setHours(nowPlus2h.getHours() + 2);
|
||||
|
||||
// Generate a random position in Germany (approximate bounding box)
|
||||
function getRandomGermanPosition() {
|
||||
const minLat = 47.2701;
|
||||
const maxLat = 55.0581;
|
||||
const minLng = 5.8663;
|
||||
const maxLng = 15.0419;
|
||||
const lat = Math.random() * (maxLat - minLat) + minLat;
|
||||
const lng = Math.random() * (maxLng - minLng) + minLng;
|
||||
return { lat, lng };
|
||||
}
|
||||
|
||||
const randomPos =
|
||||
process.env.environment === "development" ? getRandomGermanPosition() : undefined;
|
||||
|
||||
const connectedAircraftEntry = await prisma.connectedAircraft.create({
|
||||
data: {
|
||||
publicUser: getPublicUser(user) as any,
|
||||
esimatedLogoutTime: parsedLogoffDate?.toISOString() || null,
|
||||
lastHeartbeat: new Date().toISOString(),
|
||||
userId: userId,
|
||||
loginTime: new Date().toISOString(),
|
||||
loginTime: nowPlus2h.toISOString(),
|
||||
stationId: parseInt(stationId),
|
||||
lastHeartbeat:
|
||||
process.env.environment === "development" ? nowPlus2h.toISOString() : undefined,
|
||||
posLat: randomPos?.lat,
|
||||
posLng: randomPos?.lng,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user