v1.2.0: planes.owner_id + ownership checks + per-player onboarding (ISS-108, ISS-109)
CI / build + unit + e2e (pull_request) Successful in 13m46s
CI / build + unit + e2e (pull_request) Successful in 13m46s
This commit is contained in:
@@ -21,3 +21,20 @@ export async function updateLocalPlayerEconomy(
|
||||
): Promise<void> {
|
||||
await inst.db.update(schema.players).set(patch).where(eq(schema.players.id, LOCAL_PLAYER.id));
|
||||
}
|
||||
|
||||
// v1.2.0 (ISS-109): per-player variants — the actions thread the session player's id through and
|
||||
// read/write THAT row instead of the local one; getLocalPlayer stays for the snapshot/engine until
|
||||
// per-player views land in a later multiplayer step.
|
||||
export async function getPlayer(inst: GameDb, id: string): Promise<schema.PlayerRow> {
|
||||
const [row] = await inst.db.select().from(schema.players).where(eq(schema.players.id, id));
|
||||
if (!row) throw new Error(`player ${id} missing`);
|
||||
return row;
|
||||
}
|
||||
|
||||
export async function updatePlayerEconomy(
|
||||
inst: GameDb,
|
||||
id: string,
|
||||
patch: { cash?: number; reputation?: number },
|
||||
): Promise<void> {
|
||||
await inst.db.update(schema.players).set(patch).where(eq(schema.players.id, id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user