mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-11 01:42:52 +08:00
Restrict to MP prop only.
This commit is contained in:
parent
5c275c2e3c
commit
7d85c53e68
@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.PacketOpcodes;
|
|||||||
import emu.grasscutter.net.proto.PropValueOuterClass.PropValue;
|
import emu.grasscutter.net.proto.PropValueOuterClass.PropValue;
|
||||||
import emu.grasscutter.net.proto.SetPlayerPropReqOuterClass.SetPlayerPropReq;
|
import emu.grasscutter.net.proto.SetPlayerPropReqOuterClass.SetPlayerPropReq;
|
||||||
import emu.grasscutter.server.game.GameSession;
|
import emu.grasscutter.server.game.GameSession;
|
||||||
import emu.grasscutter.server.packet.send.PacketSetPlayerNameRsp;
|
|
||||||
import emu.grasscutter.server.packet.send.PacketSetPlayerPropRsp;
|
import emu.grasscutter.server.packet.send.PacketSetPlayerPropRsp;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -24,8 +23,12 @@ public class HandlerSetPlayerPropReq extends PacketHandler {
|
|||||||
Player player = session.getPlayer();
|
Player player = session.getPlayer();
|
||||||
List<PropValue> propList = req.getPropListList();
|
List<PropValue> propList = req.getPropListList();
|
||||||
for (int i = 0; i < propList.size(); i++) {
|
for (int i = 0; i < propList.size(); i++) {
|
||||||
if (!player.setProperty(PlayerProperty.getPropById(propList.get(i).getType()), (int)propList.get(i).getVal())) {
|
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));
|
session.send(new PacketSetPlayerPropRsp(1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.save();
|
player.save();
|
||||||
|
Loading…
Reference in New Issue
Block a user