Commit 9cebd7be authored by Melledy's avatar Melledy Committed by GitHub
Browse files

Merge pull request #69 from Grasscutters/dev-fixes

Dev fixes
parents 85453c48 af1ecca9
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(GenshinPlayer player) { public PacketScenePlayerLocationNotify(GenshinScene scene) {
super(PacketOpcodes.ScenePlayerLocationNotify); super(PacketOpcodes.ScenePlayerLocationNotify);
ScenePlayerLocationNotify.Builder proto = ScenePlayerLocationNotify.newBuilder() ScenePlayerLocationNotify.Builder proto = ScenePlayerLocationNotify.newBuilder()
.setSceneId(player.getSceneId()); .setSceneId(scene.getId());
for (GenshinPlayer p : player.getWorld().getPlayers()) { for (GenshinPlayer p : scene.getPlayers()) {
proto.addPlayerLocList(p.getPlayerLocationInfo()); proto.addPlayerLocList(p.getPlayerLocationInfo());
} }
......
...@@ -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);
} }
} }
...@@ -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))
......
...@@ -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.getWorldPlayerLocationInfo());
} }
this.setData(proto); this.setData(proto);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment