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
b3db933a
Commit
b3db933a
authored
Apr 20, 2022
by
Melledy
Committed by
GitHub
Apr 20, 2022
Browse files
Merge pull request #41 from w4123/npctalk_patch
Try to implement NpcTalk packets
parents
105efe1d
716b6df2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerNpcTalkReq.java
0 → 100644
View file @
b3db933a
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.inventory.GenshinItem
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.NpcTalkReqOuterClass.NpcTalkReq
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketNpcTalkRsp
;
@Opcodes
(
PacketOpcodes
.
NpcTalkReq
)
public
class
HandlerNpcTalkReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
NpcTalkReq
req
=
NpcTalkReq
.
parseFrom
(
payload
);
session
.
send
(
new
PacketNpcTalkRsp
(
req
.
getNpcEntityId
(),
req
.
getTalkId
(),
req
.
getEntityId
()));
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketNpcTalkRsp.java
0 → 100644
View file @
b3db933a
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.NpcTalkRspOuterClass.NpcTalkRsp
;
public
class
PacketNpcTalkRsp
extends
GenshinPacket
{
public
PacketNpcTalkRsp
(
int
npcEntityId
,
int
curTalkId
,
int
entityId
)
{
super
(
PacketOpcodes
.
NpcTalkRsp
);
NpcTalkRsp
p
=
NpcTalkRsp
.
newBuilder
()
.
setNpcEntityId
(
npcEntityId
)
.
setCurTalkId
(
curTalkId
)
.
setEntityId
(
entityId
)
.
build
();
this
.
setData
(
p
);
}
}
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