Implement SetLineupNameCsReq

Satisfying first try
This commit is contained in:
memetrollsXD 2022-08-02 04:11:04 +02:00
parent 936c6611bf
commit 18bfecef88
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

View 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);
}