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
9cebd7be
Commit
9cebd7be
authored
Apr 21, 2022
by
Melledy
Committed by
GitHub
Apr 21, 2022
Browse files
Merge pull request #69 from Grasscutters/dev-fixes
Dev fixes
parents
85453c48
af1ecca9
Changes
24
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketScenePlayerLocationNotify.java
View file @
9cebd7be
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.GenshinScene
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ScenePlayerLocationNotifyOuterClass.ScenePlayerLocationNotify
;
import
emu.grasscutter.net.proto.ScenePlayerLocationNotifyOuterClass.ScenePlayerLocationNotify
;
public
class
PacketScenePlayerLocationNotify
extends
GenshinPacket
{
public
class
PacketScenePlayerLocationNotify
extends
GenshinPacket
{
public
PacketScenePlayerLocationNotify
(
Genshin
Player
player
)
{
public
PacketScenePlayerLocationNotify
(
Genshin
Scene
scene
)
{
super
(
PacketOpcodes
.
ScenePlayerLocationNotify
);
super
(
PacketOpcodes
.
ScenePlayerLocationNotify
);
ScenePlayerLocationNotify
.
Builder
proto
=
ScenePlayerLocationNotify
.
newBuilder
()
ScenePlayerLocationNotify
.
Builder
proto
=
ScenePlayerLocationNotify
.
newBuilder
()
.
setSceneId
(
player
.
getScene
Id
());
.
setSceneId
(
scene
.
get
Id
());
for
(
GenshinPlayer
p
:
player
.
getWorld
()
.
getPlayers
())
{
for
(
GenshinPlayer
p
:
scene
.
getPlayers
())
{
proto
.
addPlayerLocList
(
p
.
getPlayerLocationInfo
());
proto
.
addPlayerLocList
(
p
.
getPlayerLocationInfo
());
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketSceneTransToPointRsp.java
View file @
9cebd7be
...
@@ -13,23 +13,22 @@ public class PacketSceneTransToPointRsp extends GenshinPacket {
...
@@ -13,23 +13,22 @@ public class PacketSceneTransToPointRsp extends GenshinPacket {
public
PacketSceneTransToPointRsp
(
GenshinPlayer
player
,
int
pointId
,
int
sceneId
)
{
public
PacketSceneTransToPointRsp
(
GenshinPlayer
player
,
int
pointId
,
int
sceneId
)
{
super
(
PacketOpcodes
.
SceneTransToPointRsp
);
super
(
PacketOpcodes
.
SceneTransToPointRsp
);
String
code
=
sceneId
+
"_"
+
pointId
;
SceneTransToPointRsp
proto
=
SceneTransToPointRsp
.
newBuilder
()
ScenePointEntry
scenePointEntry
=
GenshinData
.
getScenePointEntries
().
get
(
code
);
.
setRetcode
(
0
)
.
setPointId
(
pointId
)
float
x
=
scenePointEntry
.
getPointData
().
getTranPos
().
getX
();
.
setSceneId
(
sceneId
)
float
y
=
scenePointEntry
.
getPointData
().
getTranPos
().
getY
();
.
build
();
float
z
=
scenePointEntry
.
getPointData
().
getTranPos
().
getZ
();
player
.
getPos
().
set
(
new
Position
(
x
,
y
,
z
));
player
.
getWorld
().
forceTransferPlayerToScene
(
player
,
sceneId
,
player
.
getPos
());
this
.
setData
(
proto
);
}
SceneTransToPointRsp
proto
=
SceneTransToPointRsp
.
newBuilder
()
public
PacketSceneTransToPointRsp
()
{
.
setRetcode
(
0
)
super
(
PacketOpcodes
.
SceneTransToPointRsp
);
.
setPointId
(
pointId
)
.
setSceneId
(
sceneId
)
.
build
();
SceneTransToPointRsp
proto
=
SceneTransToPointRsp
.
newBuilder
()
.
setRetcode
(
1
)
// Internal server error
.
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketSceneUnlockInfoNotify.java
View file @
9cebd7be
...
@@ -13,7 +13,7 @@ public class PacketSceneUnlockInfoNotify extends GenshinPacket {
...
@@ -13,7 +13,7 @@ public class PacketSceneUnlockInfoNotify extends GenshinPacket {
SceneUnlockInfoNotify
proto
=
SceneUnlockInfoNotify
.
newBuilder
()
SceneUnlockInfoNotify
proto
=
SceneUnlockInfoNotify
.
newBuilder
()
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
1
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
1
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
3
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
3
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
4
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
4
)
.
addSceneTagIdList
(
106
).
addSceneTagIdList
(
109
)
)
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
5
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
5
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
6
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
6
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
7
))
.
addUnlockInfos
(
SceneUnlockInfo
.
newBuilder
().
setSceneId
(
7
))
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerLocationNotify.java
View file @
9cebd7be
...
@@ -14,7 +14,7 @@ public class PacketWorldPlayerLocationNotify extends GenshinPacket {
...
@@ -14,7 +14,7 @@ public class PacketWorldPlayerLocationNotify extends GenshinPacket {
WorldPlayerLocationNotify
.
Builder
proto
=
WorldPlayerLocationNotify
.
newBuilder
();
WorldPlayerLocationNotify
.
Builder
proto
=
WorldPlayerLocationNotify
.
newBuilder
();
for
(
GenshinPlayer
p
:
world
.
getPlayers
())
{
for
(
GenshinPlayer
p
:
world
.
getPlayers
())
{
proto
.
addPlayerLocList
(
p
.
getPlayerLocationInfo
());
proto
.
addPlayerLocList
(
p
.
get
World
PlayerLocationInfo
());
}
}
this
.
setData
(
proto
);
this
.
setData
(
proto
);
...
...
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