Change unlocked scenes from lists to sets

This commit is contained in:
AnimeGitB
2022-08-16 14:25:02 +09:30
parent c3450e8905
commit efa69c007d
7 changed files with 31 additions and 60 deletions

View File

@@ -1,7 +1,5 @@
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
@@ -17,7 +15,7 @@ public class PacketGetSceneAreaRsp extends BasePacket {
GetSceneAreaRsp p = GetSceneAreaRsp.newBuilder()
.setSceneId(sceneId)
.addAllAreaIdList(player.getUnlockedSceneAreas().getOrDefault(sceneId, List.of()))
.addAllAreaIdList(player.getUnlockedSceneAreas(sceneId))
.addCityInfoList(CityInfo.newBuilder().setCityId(1).setLevel(1).build())
.addCityInfoList(CityInfo.newBuilder().setCityId(2).setLevel(1).build())
.addCityInfoList(CityInfo.newBuilder().setCityId(3).setLevel(1).build())

View File

@@ -1,7 +1,5 @@
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.data.GameData;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
@@ -21,7 +19,7 @@ public class PacketGetScenePointRsp extends BasePacket {
p.addUnlockedPointList(i);
}
} else {
p.addAllUnlockedPointList(player.getUnlockedScenePoints().getOrDefault(sceneId, List.of()));
p.addAllUnlockedPointList(player.getUnlockedScenePoints(sceneId));
}
for (int i = 1; i < 9; i++) {

View File

@@ -1,7 +1,5 @@
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneAreaUnlockNotifyOuterClass.SceneAreaUnlockNotify;
@@ -17,7 +15,7 @@ public class PacketSceneAreaUnlockNotify extends BasePacket {
this.setData(p);
}
public PacketSceneAreaUnlockNotify(int sceneId, List<Integer> areaIds) {
public PacketSceneAreaUnlockNotify(int sceneId, Iterable<Integer> areaIds) {
super(PacketOpcodes.SceneAreaUnlockNotify);
SceneAreaUnlockNotify.Builder p = SceneAreaUnlockNotify.newBuilder()

View File

@@ -1,7 +1,5 @@
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ScenePointUnlockNotifyOuterClass.ScenePointUnlockNotify;
@@ -17,7 +15,7 @@ public class PacketScenePointUnlockNotify extends BasePacket {
this.setData(p);
}
public PacketScenePointUnlockNotify(int sceneId, List<Integer> pointIds) {
public PacketScenePointUnlockNotify(int sceneId, Iterable<Integer> pointIds) {
super(PacketOpcodes.ScenePointUnlockNotify);
ScenePointUnlockNotify.Builder p = ScenePointUnlockNotify.newBuilder()