remove unused variable in scene.ts (#40)
This commit is contained in:
parent
77d6b6dcee
commit
1fb0f26796
@ -1,13 +1,11 @@
|
|||||||
import Logger from "../util/Logger";
|
import Logger from "../util/Logger";
|
||||||
import { ActorEntity } from "../game/entities/Actor";
|
import { ActorEntity } from "../game/entities/Actor";
|
||||||
import Interface, { Command } from "./Interface";
|
import Interface, { Command } from "./Interface";
|
||||||
import Database from "../db/Database";
|
|
||||||
import { GetCurSceneInfoScRsp } from "../data/proto/StarRail";
|
import { GetCurSceneInfoScRsp } from "../data/proto/StarRail";
|
||||||
import Session from "../server/kcp/Session";
|
|
||||||
import MazePlaneExcel from "../util/excel/MazePlaneExcel";
|
import MazePlaneExcel from "../util/excel/MazePlaneExcel";
|
||||||
const c = new Logger("/scene", "blue");
|
const c = new Logger("/scene", "blue");
|
||||||
|
|
||||||
export default async function handle(command: Command, session: Session) {
|
export default async function handle(command: Command) {
|
||||||
if (!Interface.target) {
|
if (!Interface.target) {
|
||||||
c.log("No target specified");
|
c.log("No target specified");
|
||||||
return;
|
return;
|
||||||
@ -23,8 +21,8 @@ export default async function handle(command: Command, session: Session) {
|
|||||||
if (!planeID) return c.log("Usage: /scene <planeID>");
|
if (!planeID) return c.log("Usage: /scene <planeID>");
|
||||||
|
|
||||||
Interface.target.player.db.posData = {
|
Interface.target.player.db.posData = {
|
||||||
floorID: Number(planeID!.StartFloorID),
|
floorID: planeID.StartFloorID,
|
||||||
planeID: Number(planeID!.PlaneID),
|
planeID: planeID.PlaneID,
|
||||||
pos: Interface.target.player.db.posData.pos
|
pos: Interface.target.player.db.posData.pos
|
||||||
};
|
};
|
||||||
await Interface.target.player.save()
|
await Interface.target.player.save()
|
||||||
@ -33,8 +31,8 @@ export default async function handle(command: Command, session: Session) {
|
|||||||
Interface.target.send(GetCurSceneInfoScRsp, {
|
Interface.target.send(GetCurSceneInfoScRsp, {
|
||||||
retcode: 0,
|
retcode: 0,
|
||||||
scene: {
|
scene: {
|
||||||
planeId: Number(planeID!.PlaneID),
|
planeId: planeID.PlaneID,
|
||||||
floorId: Number(planeID!.StartFloorID),
|
floorId: planeID.StartFloorID,
|
||||||
entityList: [
|
entityList: [
|
||||||
curAvatarEntity
|
curAvatarEntity
|
||||||
],
|
],
|
||||||
@ -48,4 +46,6 @@ export default async function handle(command: Command, session: Session) {
|
|||||||
Interface.target.player.scene.spawnEntity(curAvatarEntity, true);
|
Interface.target.player.scene.spawnEntity(curAvatarEntity, true);
|
||||||
|
|
||||||
Interface.target.sync();
|
Interface.target.sync();
|
||||||
|
|
||||||
|
c.log(`Scene set to PlaneID: ${planeID.PlaneID}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user