Spaces:
Sleeping
Sleeping
test
Browse files- convex/world.ts +3 -2
convex/world.ts
CHANGED
@@ -142,7 +142,7 @@ export const joinWorld = mutation({
|
|
142 |
throw new ConvexError(`Invalid world ID: ${args.worldId}`);
|
143 |
}
|
144 |
|
145 |
-
const playerIds = [...world.
|
146 |
|
147 |
const playerDescriptions = await ctx.db
|
148 |
.query('playerDescriptions')
|
@@ -192,7 +192,8 @@ export const leaveWorld = mutation({
|
|
192 |
throw new Error(`Invalid world ID: ${args.worldId}`);
|
193 |
}
|
194 |
// const existingPlayer = world.players.find((p) => p.human === tokenIdentifier);
|
195 |
-
const existingPlayer = world.
|
|
|
196 |
if (!existingPlayer) {
|
197 |
return;
|
198 |
}
|
|
|
142 |
throw new ConvexError(`Invalid world ID: ${args.worldId}`);
|
143 |
}
|
144 |
|
145 |
+
const playerIds = [...world.players.values()].map(player => player.id)
|
146 |
|
147 |
const playerDescriptions = await ctx.db
|
148 |
.query('playerDescriptions')
|
|
|
192 |
throw new Error(`Invalid world ID: ${args.worldId}`);
|
193 |
}
|
194 |
// const existingPlayer = world.players.find((p) => p.human === tokenIdentifier);
|
195 |
+
const existingPlayer = world.players.find((p) => p.human === oauthToken);
|
196 |
+
console.log("existingPlayer :",existingPlayer)
|
197 |
if (!existingPlayer) {
|
198 |
return;
|
199 |
}
|