From 080ba33cc9a9262c42c3dfa28cfb254cde1f66b2 Mon Sep 17 00:00:00 2001 From: gentlespoon Date: Wed, 4 May 2022 23:50:08 -0700 Subject: [PATCH] Restrict to MP prop only. --- .../server/packet/recv/HandlerSetPlayerPropReq.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerPropReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerPropReq.java index bbe8647da..7f01392ad 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerPropReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerPropReq.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.PropValueOuterClass.PropValue; import emu.grasscutter.net.proto.SetPlayerPropReqOuterClass.SetPlayerPropReq; import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.PacketSetPlayerNameRsp; import emu.grasscutter.server.packet.send.PacketSetPlayerPropRsp; import java.util.ArrayList; @@ -24,8 +23,12 @@ public class HandlerSetPlayerPropReq extends PacketHandler { Player player = session.getPlayer(); List propList = req.getPropListList(); for (int i = 0; i < propList.size(); i++) { - if (!player.setProperty(PlayerProperty.getPropById(propList.get(i).getType()), (int)propList.get(i).getVal())) { - session.send(new PacketSetPlayerPropRsp(1)); + PlayerProperty prop = PlayerProperty.getPropById(propList.get(i).getType()); + if (prop == PlayerProperty.PROP_IS_MP_MODE_AVAILABLE) { + if (!player.setProperty(prop, (int)propList.get(i).getVal())) { + session.send(new PacketSetPlayerPropRsp(1)); + return; + } } } player.save();