implement changing weapons

This commit is contained in:
memetrollsXD 2022-08-04 12:02:04 +02:00
parent 38b5d51be2
commit 212a03fb1b
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

View File

@ -0,0 +1,16 @@
import { DressAvatarCsReq, DressAvatarScRsp } from "../../data/proto/StarRail";
import Avatar from "../../db/Avatar";
import Packet from "../kcp/Packet";
import Session from "../kcp/Session";
export default async function handle(session: Session, packet: Packet) {
const body = packet.body as DressAvatarCsReq;
let avatar = await Avatar.loadAvatarForPlayer(session.player, body.baseAvatarId);
avatar.db.equipmentUniqueId = body.equipmentUniqueId;
await avatar.save();
session.send(DressAvatarScRsp, { retcode: 0 });
session.sync();
}