Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
7d85c53e
Commit
7d85c53e
authored
May 04, 2022
by
gentlespoon
Committed by
Melledy
May 05, 2022
Browse files
Restrict to MP prop only.
parent
5c275c2e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerPropReq.java
View file @
7d85c53e
...
@@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.PacketOpcodes;
...
@@ -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 {
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment