Fix lineup index. (#38)
This commit is contained in:
parent
4738e7c44a
commit
77d6b6dcee
@ -22,8 +22,11 @@ export default async function handle(command: Command, session: Session) {
|
||||
|
||||
if (!planeID) return c.log("Usage: /scene <planeID>");
|
||||
|
||||
const db = Database.getInstance();
|
||||
await db.update('players',{_id:uid},{posData: { floorID: Number(planeID!.StartFloorID), planeID: Number(planeID!.PlaneID)}})
|
||||
Interface.target.player.db.posData = {
|
||||
floorID: Number(planeID!.StartFloorID),
|
||||
planeID: Number(planeID!.PlaneID),
|
||||
pos: Interface.target.player.db.posData.pos
|
||||
};
|
||||
await Interface.target.player.save()
|
||||
|
||||
//ty for tamilpp25 scene
|
||||
|
@ -16,7 +16,7 @@ export default async function handle(command: Command) {
|
||||
SRServer.getInstance().sessions.forEach(client => {
|
||||
possibleTargets.push({
|
||||
id: `${client.ctx.address}:${client.ctx.port}`,
|
||||
uid: Number(client.player.db._id),
|
||||
uid: client.player.uid,
|
||||
session: client
|
||||
});
|
||||
});
|
||||
|
@ -64,8 +64,6 @@ export default class Database {
|
||||
}
|
||||
return await _collection.insertOne(payload);
|
||||
} catch (e) {
|
||||
c.error("In set.")
|
||||
c.error(payload)
|
||||
c.error(e as Error);
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export default class Player {
|
||||
|
||||
return {
|
||||
...lineup,
|
||||
index: 0,
|
||||
index: index,
|
||||
avatarList: lineupAvatars
|
||||
}
|
||||
}
|
||||
@ -172,7 +172,7 @@ export default class Player {
|
||||
for (let i = 0; i < LINEUPS; i++) {
|
||||
const copy = {
|
||||
...baseLineup,
|
||||
index: 0,
|
||||
index: i,
|
||||
name: `Team ${i}`
|
||||
};
|
||||
dataObj.lineup.lineups[i] = copy;
|
||||
|
@ -36,7 +36,7 @@ export default async function handle(session: Session, packet: Packet) {
|
||||
session.player.setLineup(lineup);
|
||||
*/
|
||||
|
||||
session.player.save();
|
||||
await session.player.save();
|
||||
|
||||
session.send(SyncLineupNotify, {
|
||||
lineup: await session.player.getLineup(),
|
||||
|
Loading…
Reference in New Issue
Block a user