added MRT sds image

This commit is contained in:
PxlLoewe
2025-06-07 00:34:30 -07:00
parent 6be3f70371
commit dd53110500
16 changed files with 1853 additions and 136 deletions

View File

@@ -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,
},
});