Read Open States from Excels (#1557)

* Make sure we never access PlayerOpenStateManager::map directly.

* Read OpenStates from excels.

* Add defaultState

* Replace hardcoded open states with the ones read from excels.

* Don't send change notify when unlocking on login.

* Add open state blacklist for default unlocks.

* Add a way to temporarily set open states for dev

* Remove old OpenState.java

* Fix UnlockAllCommand

* Change condType to an enum.
This commit is contained in:
GanyusLeftHorn
2022-07-24 09:12:07 +02:00
committed by GitHub
parent 89717f3c15
commit d0edd39465
10 changed files with 260 additions and 154 deletions

View File

@@ -4,10 +4,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import emu.grasscutter.game.props.OpenState;
import emu.grasscutter.net.proto.GetGachaInfoRspOuterClass.GetGachaInfoRsp;
import emu.grasscutter.net.proto.GetShopRspOuterClass.GetShopRsp;
import emu.grasscutter.net.proto.OpenStateUpdateNotifyOuterClass.OpenStateUpdateNotify;
public final class Dumpers {
public static void extractBanner(byte[] data) throws Exception {
@@ -19,15 +17,4 @@ public final class Dumpers {
GetShopRsp proto = GetShopRsp.parseFrom(data);
System.out.println(proto);
}
public static void dumpOpenStates(byte[] data) throws Exception {
OpenStateUpdateNotify proto = OpenStateUpdateNotify.parseFrom(data);
List<Integer> list = new ArrayList<>(proto.getOpenStateMap().keySet());
Collections.sort(list);
for (int key : list) {
System.out.println(OpenState.getTypeByValue(key) + " : " + key);
}
}
}