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
58a5ad49
Commit
58a5ad49
authored
May 16, 2022
by
Elapse
Committed by
Melledy
May 16, 2022
Browse files
update opcodes, correct op names, and update relative codes
parent
87966b9e
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
View file @
58a5ad49
This diff is collapsed.
Click to expand it.
src/main/java/emu/grasscutter/server/packet/recv/HandlerVehicle
Spawn
Req.java
→
src/main/java/emu/grasscutter/server/packet/recv/Handler
Create
VehicleReq.java
View file @
58a5ad49
...
...
@@ -3,19 +3,19 @@ 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.Vehicle
Spawn
ReqOuterClass
;
import
emu.grasscutter.net.proto.
Create
VehicleReqOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketVehicle
Spawn
Rsp
;
import
emu.grasscutter.server.packet.send.Packet
Create
VehicleRsp
;
import
emu.grasscutter.utils.Position
;
@Opcodes
(
PacketOpcodes
.
Vehicle
Spawn
Req
)
public
class
HandlerVehicle
Spawn
Req
extends
PacketHandler
{
@Opcodes
(
PacketOpcodes
.
Create
VehicleReq
)
public
class
Handler
Create
VehicleReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
Vehicle
Spawn
ReqOuterClass
.
Vehicle
Spawn
Req
req
=
Vehicle
Spawn
ReqOuterClass
.
Vehicle
Spawn
Req
.
parseFrom
(
payload
);
session
.
send
(
new
PacketVehicle
Spawn
Rsp
(
session
.
getPlayer
(),
req
.
getVehicleId
(),
req
.
getPointId
(),
new
Position
(
req
.
getPos
()),
new
Position
(
req
.
getRot
())));
Create
VehicleReqOuterClass
.
Create
VehicleReq
req
=
Create
VehicleReqOuterClass
.
Create
VehicleReq
.
parseFrom
(
payload
);
session
.
send
(
new
Packet
Create
VehicleRsp
(
session
.
getPlayer
(),
req
.
getVehicleId
(),
req
.
getPointId
(),
new
Position
(
req
.
getPos
()),
new
Position
(
req
.
getRot
())));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneInitFinishReq.java
View file @
58a5ad49
...
...
@@ -9,12 +9,12 @@ import emu.grasscutter.server.game.GameSession;
import
emu.grasscutter.server.packet.send.PacketHostPlayerNotify
;
import
emu.grasscutter.server.packet.send.PacketPlayerEnterSceneInfoNotify
;
import
emu.grasscutter.server.packet.send.PacketPlayerGameTimeNotify
;
import
emu.grasscutter.server.packet.send.PacketPlayerWorldSceneInfoListNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneAreaWeatherNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneInitFinishRsp
;
import
emu.grasscutter.server.packet.send.PacketScenePlayerInfoNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneTeamUpdateNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneTimeNotify
;
import
emu.grasscutter.server.packet.send.PacketSceneUnlockInfoNotify
;
import
emu.grasscutter.server.packet.send.PacketServerTimeNotify
;
import
emu.grasscutter.server.packet.send.PacketSyncScenePlayTeamEntityNotify
;
import
emu.grasscutter.server.packet.send.PacketSyncTeamEntityNotify
;
...
...
@@ -30,7 +30,7 @@ public class HandlerSceneInitFinishReq extends PacketHandler {
session
.
send
(
new
PacketServerTimeNotify
());
session
.
send
(
new
PacketWorldPlayerInfoNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
PacketWorldDataNotify
(
session
.
getPlayer
().
getWorld
()));
session
.
send
(
new
Packet
SceneUnlockInfo
Notify
());
session
.
send
(
new
Packet
PlayerWorldSceneInfoList
Notify
());
session
.
send
(
new
BasePacket
(
PacketOpcodes
.
SceneForceUnlockNotify
));
session
.
send
(
new
PacketHostPlayerNotify
(
session
.
getPlayer
().
getWorld
()));
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketVehicle
Spawn
Rsp.java
→
src/main/java/emu/grasscutter/server/packet/send/Packet
Create
VehicleRsp.java
View file @
58a5ad49
...
...
@@ -10,7 +10,7 @@ import emu.grasscutter.net.packet.BasePacket;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.VehicleMemberOuterClass.VehicleMember
;
import
emu.grasscutter.net.proto.Vehicle
Spawn
RspOuterClass.Vehicle
Spawn
Rsp
;
import
emu.grasscutter.net.proto.
Create
VehicleRspOuterClass.
Create
VehicleRsp
;
import
emu.grasscutter.utils.Position
;
...
...
@@ -19,11 +19,11 @@ import java.util.List;
import
static
emu
.
grasscutter
.
net
.
proto
.
VehicleInteractTypeOuterClass
.
VehicleInteractType
.
VEHICLE_INTERACT_OUT
;
public
class
PacketVehicle
Spawn
Rsp
extends
BasePacket
{
public
class
Packet
Create
VehicleRsp
extends
BasePacket
{
public
PacketVehicle
Spawn
Rsp
(
Player
player
,
int
vehicleId
,
int
pointId
,
Position
pos
,
Position
rot
)
{
super
(
PacketOpcodes
.
Vehicle
Spawn
Rsp
);
Vehicle
Spawn
Rsp
.
Builder
proto
=
Vehicle
Spawn
Rsp
.
newBuilder
();
public
Packet
Create
VehicleRsp
(
Player
player
,
int
vehicleId
,
int
pointId
,
Position
pos
,
Position
rot
)
{
super
(
PacketOpcodes
.
Create
VehicleRsp
);
Create
VehicleRsp
.
Builder
proto
=
Create
VehicleRsp
.
newBuilder
();
// Eject vehicle members and Kill previous vehicles if there are any
List
<
GameEntity
>
previousVehicles
=
player
.
getScene
().
getEntities
().
values
().
stream
()
...
...
src/main/java/emu/grasscutter/server/packet/send/Packet
SceneUnlockInfo
Notify.java
→
src/main/java/emu/grasscutter/server/packet/send/Packet
PlayerWorldSceneInfoList
Notify.java
View file @
58a5ad49
...
...
@@ -2,15 +2,15 @@ package emu.grasscutter.server.packet.send;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.
SceneUnlockInfoNotifyOuterClass.SceneUnlockInfo
Notify
;
import
emu.grasscutter.net.proto.
PlayerWorldSceneInfoListNotifyOuterClass.PlayerWorldSceneInfoList
Notify
;
import
emu.grasscutter.net.proto.SceneUnlockInfoOuterClass.SceneUnlockInfo
;
public
class
Packet
SceneUnlockInfo
Notify
extends
BasePacket
{
public
class
Packet
PlayerWorldSceneInfoList
Notify
extends
BasePacket
{
public
Packet
SceneUnlockInfo
Notify
()
{
super
(
PacketOpcodes
.
SceneUnlockInfo
Notify
);
// Rename opcode later
public
Packet
PlayerWorldSceneInfoList
Notify
()
{
super
(
PacketOpcodes
.
PlayerWorldSceneInfoList
Notify
);
// Rename opcode later
SceneUnlockInfoNotify
proto
=
SceneUnlockInfo
Notify
.
newBuilder
()
PlayerWorldSceneInfoListNotify
proto
=
PlayerWorldSceneInfoList
Notify
.
newBuilder
()
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
1
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
3
).
addSceneTagIdList
(
102
).
addSceneTagIdList
(
113
).
addSceneTagIdList
(
117
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
4
).
addSceneTagIdList
(
106
).
addSceneTagIdList
(
109
))
...
...
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