implement changing weapons
This commit is contained in:
parent
38b5d51be2
commit
212a03fb1b
16
src/server/packets/DressAvatarCsReq.ts
Normal file
16
src/server/packets/DressAvatarCsReq.ts
Normal 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();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user