diff --git a/src/server/packets/DressAvatarCsReq.ts b/src/server/packets/DressAvatarCsReq.ts new file mode 100644 index 0000000..d804bba --- /dev/null +++ b/src/server/packets/DressAvatarCsReq.ts @@ -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(); +} \ No newline at end of file