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
717c2d1d
Commit
717c2d1d
authored
May 20, 2022
by
Akka
Committed by
Melledy
May 19, 2022
Browse files
Support Boss Chest
parent
54294698
Changes
24
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerGadgetInteractReq.java
View file @
717c2d1d
...
@@ -13,7 +13,7 @@ public class HandlerGadgetInteractReq extends PacketHandler {
...
@@ -13,7 +13,7 @@ public class HandlerGadgetInteractReq extends PacketHandler {
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
GadgetInteractReq
req
=
GadgetInteractReq
.
parseFrom
(
payload
);
GadgetInteractReq
req
=
GadgetInteractReq
.
parseFrom
(
payload
);
session
.
getPlayer
().
interactWith
(
req
.
getGadgetEntityId
());
session
.
getPlayer
().
interactWith
(
req
.
getGadgetEntityId
()
,
req
.
getOpType
()
);
}
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerGetInvestigationMonsterReq.java
0 → 100644
View file @
717c2d1d
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetInvestigationMonsterReqOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketGetInvestigationMonsterRsp
;
@Opcodes
(
PacketOpcodes
.
GetInvestigationMonsterReq
)
public
class
HandlerGetInvestigationMonsterReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
var
req
=
GetInvestigationMonsterReqOuterClass
.
GetInvestigationMonsterReq
.
parseFrom
(
payload
);
session
.
send
(
new
PacketGetInvestigationMonsterRsp
(
req
.
getCityIdListList
()));
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketGadgetInteractRsp.java
View file @
717c2d1d
...
@@ -4,20 +4,27 @@ import emu.grasscutter.game.entity.EntityBaseGadget;
...
@@ -4,20 +4,27 @@ import emu.grasscutter.game.entity.EntityBaseGadget;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp
;
import
emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp
;
import
emu.grasscutter.net.proto.InterOpTypeOuterClass
;
import
emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType
;
import
emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketGadgetInteractRsp
extends
BasePacket
{
public
class
PacketGadgetInteractRsp
extends
BasePacket
{
public
PacketGadgetInteractRsp
(
EntityBaseGadget
gadget
,
InteractType
interact
)
{
public
PacketGadgetInteractRsp
(
EntityBaseGadget
gadget
,
InteractType
interact
)
{
this
(
gadget
,
interact
,
null
);
}
public
PacketGadgetInteractRsp
(
EntityBaseGadget
gadget
,
InteractType
interact
,
InterOpTypeOuterClass
.
InterOpType
opType
)
{
super
(
PacketOpcodes
.
GadgetInteractRsp
);
super
(
PacketOpcodes
.
GadgetInteractRsp
);
GadgetInteractRsp
proto
=
GadgetInteractRsp
.
newBuilder
()
var
proto
=
GadgetInteractRsp
.
newBuilder
()
.
setGadgetEntityId
(
gadget
.
getId
())
.
setGadgetEntityId
(
gadget
.
getId
())
.
setInteractType
(
interact
)
.
setInteractType
(
interact
)
.
setGadgetId
(
gadget
.
getGadgetId
())
.
setGadgetId
(
gadget
.
getGadgetId
());
.
build
();
this
.
setData
(
proto
);
if
(
opType
!=
null
){
proto
.
setOpType
(
opType
);
}
this
.
setData
(
proto
.
build
());
}
}
public
PacketGadgetInteractRsp
()
{
public
PacketGadgetInteractRsp
()
{
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetInvestigationMonsterRsp.java
0 → 100644
View file @
717c2d1d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetActivityInfoRspOuterClass
;
import
java.util.List
;
public
class
PacketGetInvestigationMonsterRsp
extends
BasePacket
{
public
PacketGetInvestigationMonsterRsp
(
List
<
Integer
>
cityIdListList
)
{
super
(
PacketOpcodes
.
GetInvestigationMonsterRsp
);
var
resp
=
GetActivityInfoRspOuterClass
.
GetActivityInfoRsp
.
newBuilder
();
this
.
setData
(
resp
.
build
());
}
}
Prev
1
2
Next
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