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
7fdf7498
Commit
7fdf7498
authored
Apr 29, 2022
by
omg-xtao
Committed by
GitHub
Apr 29, 2022
Browse files
Merge branch 'development' into tp
parents
eaed1aa0
4c487e22
Changes
67
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketGadgetInteractRsp.java
View file @
7fdf7498
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityGadget
;
import
emu.grasscutter.game.entity.Entity
Base
Gadget
;
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
;
...
@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
...
@@ -8,7 +8,7 @@ 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
(
EntityGadget
gadget
,
InteractType
interact
)
{
public
PacketGadgetInteractRsp
(
Entity
Base
Gadget
gadget
,
InteractType
interact
)
{
super
(
PacketOpcodes
.
GadgetInteractRsp
);
super
(
PacketOpcodes
.
GadgetInteractRsp
);
GadgetInteractRsp
proto
=
GadgetInteractRsp
.
newBuilder
()
GadgetInteractRsp
proto
=
GadgetInteractRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGadgetStateNotify.java
0 → 100644
View file @
7fdf7498
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityGadget
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GadgetStateNotifyOuterClass.GadgetStateNotify
;
public
class
PacketGadgetStateNotify
extends
BasePacket
{
public
PacketGadgetStateNotify
(
EntityGadget
gadget
,
int
newState
)
{
super
(
PacketOpcodes
.
GadgetStateNotify
);
GadgetStateNotify
proto
=
GadgetStateNotify
.
newBuilder
()
.
setGadgetEntityId
(
gadget
.
getId
())
.
setGadgetState
(
newState
)
.
setIsEnableInteract
(
true
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPathfindingEnterSceneRsp.java
View file @
7fdf7498
...
@@ -7,7 +7,5 @@ public class PacketPathfindingEnterSceneRsp extends BasePacket {
...
@@ -7,7 +7,5 @@ public class PacketPathfindingEnterSceneRsp extends BasePacket {
public
PacketPathfindingEnterSceneRsp
(
int
clientSequence
)
{
public
PacketPathfindingEnterSceneRsp
(
int
clientSequence
)
{
super
(
PacketOpcodes
.
PathfindingEnterSceneRsp
);
super
(
PacketOpcodes
.
PathfindingEnterSceneRsp
);
this
.
buildHeader
(
clientSequence
);
}
}
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterDungeonRsp.java
0 → 100644
View file @
7fdf7498
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerEnterDungeonRspOuterClass.PlayerEnterDungeonRsp
;
public
class
PacketPlayerEnterDungeonRsp
extends
BasePacket
{
public
PacketPlayerEnterDungeonRsp
(
int
pointId
,
int
dungeonId
)
{
super
(
PacketOpcodes
.
PlayerEnterDungeonRsp
);
PlayerEnterDungeonRsp
proto
=
PlayerEnterDungeonRsp
.
newBuilder
()
.
setPointId
(
pointId
)
.
setDungeonId
(
dungeonId
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketSelectWorktopOptionRsp.java
0 → 100644
View file @
7fdf7498
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SelectWorktopOptionRspOuterClass.SelectWorktopOptionRsp
;
public
class
PacketSelectWorktopOptionRsp
extends
BasePacket
{
public
PacketSelectWorktopOptionRsp
(
int
entityId
,
int
optionId
)
{
super
(
PacketOpcodes
.
SelectWorktopOptionRsp
);
SelectWorktopOptionRsp
proto
=
SelectWorktopOptionRsp
.
newBuilder
()
.
setGadgetEntityId
(
entityId
)
.
setOptionId
(
optionId
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketWorktopOptionNotify.java
0 → 100644
View file @
7fdf7498
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityGadget
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorktopOptionNotifyOuterClass.WorktopOptionNotify
;
public
class
PacketWorktopOptionNotify
extends
BasePacket
{
public
PacketWorktopOptionNotify
(
EntityGadget
gadget
)
{
super
(
PacketOpcodes
.
WorktopOptionNotify
);
WorktopOptionNotify
.
Builder
proto
=
WorktopOptionNotify
.
newBuilder
()
.
setGadgetEntityId
(
gadget
.
getId
());
if
(
gadget
.
getWorktopOptions
()
!=
null
)
{
proto
.
addAllOptionList
(
gadget
.
getWorktopOptions
());
}
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/utils/Utils.java
View file @
7fdf7498
...
@@ -67,6 +67,7 @@ public final class Utils {
...
@@ -67,6 +67,7 @@ public final class Utils {
private
static
final
char
[]
HEX_ARRAY
=
"0123456789abcdef"
.
toCharArray
();
private
static
final
char
[]
HEX_ARRAY
=
"0123456789abcdef"
.
toCharArray
();
public
static
String
bytesToHex
(
byte
[]
bytes
)
{
public
static
String
bytesToHex
(
byte
[]
bytes
)
{
if
(
bytes
==
null
)
return
""
;
char
[]
hexChars
=
new
char
[
bytes
.
length
*
2
];
char
[]
hexChars
=
new
char
[
bytes
.
length
*
2
];
for
(
int
j
=
0
;
j
<
bytes
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
bytes
.
length
;
j
++)
{
int
v
=
bytes
[
j
]
&
0xFF
;
int
v
=
bytes
[
j
]
&
0xFF
;
...
...
Prev
1
2
3
4
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