generated from nhcarrigan/template
fix: stamp lastSavedAt into game state blob on save
This commit is contained in:
@@ -367,6 +367,13 @@ gameRouter.post("/save", async (context) => {
|
|||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
|
// Stamp the authoritative save timestamp into the state blob so that on the
|
||||||
|
// next load the client reads the correct value from state.player.lastSavedAt.
|
||||||
|
stateToSave = {
|
||||||
|
...stateToSave,
|
||||||
|
player: { ...stateToSave.player, lastSavedAt: now },
|
||||||
|
};
|
||||||
|
|
||||||
await prisma.player.update({
|
await prisma.player.update({
|
||||||
where: { discordId },
|
where: { discordId },
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Reference in New Issue
Block a user