From 18bfecef887c31c844c36d16c7e9560592447c2d Mon Sep 17 00:00:00 2001 From: memetrollsXD Date: Tue, 2 Aug 2022 04:11:04 +0200 Subject: [PATCH] Implement SetLineupNameCsReq Satisfying first try --- src/server/packets/SetLineupNameCsReq.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/server/packets/SetLineupNameCsReq.ts diff --git a/src/server/packets/SetLineupNameCsReq.ts b/src/server/packets/SetLineupNameCsReq.ts new file mode 100644 index 0000000..5ad8966 --- /dev/null +++ b/src/server/packets/SetLineupNameCsReq.ts @@ -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); +} \ No newline at end of file