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
3ca181e7
Commit
3ca181e7
authored
Apr 22, 2022
by
yarik0chka
Browse files
Implemented sitting
parent
12c6020b
Changes
5
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
View file @
3ca181e7
...
...
@@ -1034,6 +1034,8 @@ public class PacketOpcodes {
public
static
final
int
ShowTemplateReminderNotify
=
3164
;
public
static
final
int
SignInInfoReq
=
2510
;
public
static
final
int
SignInInfoRsp
=
2515
;
public
static
final
int
SitReq
=
354
;
public
static
final
int
SitRsp
=
335
;
public
static
final
int
SocialDataNotify
=
4063
;
public
static
final
int
SpringUseReq
=
1720
;
public
static
final
int
SpringUseRsp
=
1727
;
...
...
@@ -1208,5 +1210,4 @@ public class PacketOpcodes {
public
static
final
int
WorldRoutineChangeNotify
=
3548
;
public
static
final
int
WorldRoutineTypeCloseNotify
=
3513
;
public
static
final
int
WorldRoutineTypeRefreshNotify
=
3545
;
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/recv/HandleEvtAvatarSitDownNotify.java
0 → 100644
View file @
3ca181e7
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarSitDownNotifyOuterClass.EvtAvatarSitDownNotify
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEvtAvatarSitDownNotify
;
@Opcodes
(
PacketOpcodes
.
EvtAvatarSitDownNotify
)
public
class
HandleEvtAvatarSitDownNotify
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
EvtAvatarSitDownNotify
notify
=
EvtAvatarSitDownNotify
.
parseFrom
(
payload
);
session
.
send
(
new
PacketEvtAvatarSitDownNotify
(
notify
));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandleSitReq.java
0 → 100644
View file @
3ca181e7
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.SitReqOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketSitRsp
;
import
emu.grasscutter.utils.Position
;
@Opcodes
(
PacketOpcodes
.
SitReq
)
public
class
HandleSitReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
SitReqOuterClass
.
SitReq
req
=
SitReqOuterClass
.
SitReq
.
parseFrom
(
payload
);
float
x
=
req
.
getPosition
().
getX
();
float
y
=
req
.
getPosition
().
getY
();
float
z
=
req
.
getPosition
().
getZ
();
session
.
send
(
new
PacketSitRsp
(
req
.
getChairId
(),
new
Position
(
x
,
y
,
z
),
session
.
getPlayer
().
getTeamManager
().
getCurrentAvatarEntity
().
getId
()));
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarSitDownNotify.java
0 → 100644
View file @
3ca181e7
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarSitDownNotifyOuterClass.EvtAvatarSitDownNotify
;
public
class
PacketEvtAvatarSitDownNotify
extends
GenshinPacket
{
public
PacketEvtAvatarSitDownNotify
(
EvtAvatarSitDownNotify
notify
)
{
super
(
PacketOpcodes
.
EvtAvatarSitDownNotify
);
EvtAvatarSitDownNotify
proto
=
EvtAvatarSitDownNotify
.
newBuilder
()
.
setEntityId
(
notify
.
getEntityId
())
.
setPosition
(
notify
.
getPosition
())
.
setChairId
(
notify
.
getChairId
())
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketSitRsp.java
0 → 100644
View file @
3ca181e7
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SitRspOuterClass.SitRsp
;
import
emu.grasscutter.utils.Position
;
public
class
PacketSitRsp
extends
GenshinPacket
{
public
PacketSitRsp
(
long
chairId
,
Position
pos
,
int
EntityId
)
{
super
(
PacketOpcodes
.
SitRsp
);
SitRsp
proto
=
SitRsp
.
newBuilder
()
.
setEntityId
(
EntityId
)
.
setPosition
(
pos
.
toProto
())
.
setChairId
(
chairId
)
.
build
();
this
.
setData
(
proto
);
}
}
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