Implement SetLineupNameCsReq
Satisfying first try
This commit is contained in:
parent
936c6611bf
commit
18bfecef88
18
src/server/packets/SetLineupNameCsReq.ts
Normal file
18
src/server/packets/SetLineupNameCsReq.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { SetLineupNameCsReq, SetLineupNameScRsp } from "../../data/proto/StarRail";
|
||||||
|
import Packet from "../kcp/Packet";
|
||||||
|
import Session from "../kcp/Session";
|
||||||
|
|
||||||
|
export default async function handle(session: Session, packet: Packet) {
|
||||||
|
const body = packet.body as SetLineupNameCsReq;
|
||||||
|
|
||||||
|
let curLineup = session.player.getCurLineup();
|
||||||
|
curLineup.name = body.name;
|
||||||
|
session.player.setCurLineup(curLineup);
|
||||||
|
session.player.save();
|
||||||
|
|
||||||
|
session.send("SetLineupNameScRsp", {
|
||||||
|
retcode: 0,
|
||||||
|
index: session.player.db.lineup.curIndex,
|
||||||
|
name: body.name
|
||||||
|
} as SetLineupNameScRsp);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user