mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 00:31:25 +10:00
fix: update last accessed client on push
This commit is contained in:
@ -39,7 +39,13 @@ export default defineClientEventHandler(
|
|||||||
if (!game)
|
if (!game)
|
||||||
throw createError({ statusCode: 400, statusMessage: "Invalid game ID" });
|
throw createError({ statusCode: 400, statusMessage: "Invalid game ID" });
|
||||||
|
|
||||||
await saveManager.pushSave(gameId, user.id, slotIndex, h3.node.req);
|
await saveManager.pushSave(
|
||||||
|
gameId,
|
||||||
|
user.id,
|
||||||
|
slotIndex,
|
||||||
|
h3.node.req,
|
||||||
|
client.id
|
||||||
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,8 @@ class SaveManager {
|
|||||||
gameId: string,
|
gameId: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
index: number,
|
index: number,
|
||||||
stream: IncomingMessage
|
stream: IncomingMessage,
|
||||||
|
clientId: string | undefined = undefined
|
||||||
) {
|
) {
|
||||||
const save = await prisma.saveSlot.findUnique({
|
const save = await prisma.saveSlot.findUnique({
|
||||||
where: {
|
where: {
|
||||||
@ -84,6 +85,7 @@ class SaveManager {
|
|||||||
historyChecksums: {
|
historyChecksums: {
|
||||||
push: hash,
|
push: hash,
|
||||||
},
|
},
|
||||||
|
...(clientId && { lastUsedClientId: clientId }),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user