Dumpers.java 1.05 KB
Newer Older
Melledy's avatar
Melledy committed
1
2
3
4
5
6
7
8
9
10
11
package emu.grasscutter.tools;

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;

KingRainbow44's avatar
KingRainbow44 committed
12
public final class Dumpers {
Melledy's avatar
Melledy committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
	public static void extractBanner(byte[] data) throws Exception {
		GetGachaInfoRsp proto = GetGachaInfoRsp.parseFrom(data);
		System.out.println(proto);
	}
	
	public static void extractShop(byte[] data) throws Exception {
		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);
		}
	}
}