admiral_stats_parser 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 572b0cd0b486cfa4acb50b5a15b06dcab604518c
|
|
4
|
+
data.tar.gz: 6171b97706b880ef9845d196de953bf22c851f39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 785ef0bd1d6edbb9de1f7a602ee662be850433761fc170976dc713dc62876fadf696bc053bea2ab2f994b5eb384670e0a1a54750884fe1beb35358510dea5058
|
|
7
|
+
data.tar.gz: 20a1a6a02b924c85ea298782d578461a3e55b93511a70d39bea2d3a1c9759a289e8895d1c29c3c20f4c6e240356c4e079c361e3ad6e7c0e7eea9932eb6cf577c
|
data/README.md
CHANGED
|
@@ -67,7 +67,8 @@ AdmiralStatsParser は、以下の API version をサポートしています。
|
|
|
67
67
|
| 9 | 2017-07-31 〜 2017-09-20 |
|
|
68
68
|
| 10 | 2017-09-21 〜 2018-01-31 |
|
|
69
69
|
| 11 | 2018-02-01 (VERSION A REVISION 3 のリリース日) 〜 2018-02-15 |
|
|
70
|
-
| 12 | 2018-02-16 (ケッコンカッコカリの実装日) 〜 |
|
|
70
|
+
| 12 | 2018-02-16 (ケッコンカッコカリの実装日) 〜 2018-04-18 |
|
|
71
|
+
| 13 | 2018-04-19 (第4回イベントの EO 開始日) 〜 |
|
|
71
72
|
|
|
72
73
|
各 API version でパースできる JSON の種類は以下の通りです。また、同じ情報でも、API version によって、含まれる情報量が異なる場合があります。その場合は Supported (1), Supported (2) のように記載して区別しています。
|
|
73
74
|
|
|
@@ -76,8 +77,8 @@ AdmiralStatsParser は、以下の API version をサポートしています。
|
|
|
76
77
|
| 1 | Supported (1) | Supported (1) | Supported (1) | Supported |
|
|
77
78
|
| 2 〜 6 | Supported (2) | Supported (2) | Supported (2) | Supported |
|
|
78
79
|
| 7 〜 10 | Supported (3) | Supported (3) | Supported (2) | Supported |
|
|
79
|
-
| 11
|
|
80
|
-
| 12
|
|
80
|
+
| 11 | Supported (3) | Supported (4) | Supported (2) | Supported |
|
|
81
|
+
| 12 〜 13 | Supported (3) | Supported (4) | Supported (3) | Supported |
|
|
81
82
|
|
|
82
83
|
| API version | 艦娘一覧 | 装備一覧 | イベント海域情報 |
|
|
83
84
|
|------------:|:-----|:-----|:-----|
|
|
@@ -89,12 +90,13 @@ AdmiralStatsParser は、以下の API version をサポートしています。
|
|
|
89
90
|
| 7 〜 8 | Supported (4) | Supported (1) | Supported (2) |
|
|
90
91
|
| 9 〜 11 | Supported (4) | Supported (2) | Supported (2) |
|
|
91
92
|
| 12 | Supported (5) | Supported (2) | Supported (2) |
|
|
93
|
+
| 13 | Supported (5) | Supported (2) | Supported (3) |
|
|
92
94
|
|
|
93
95
|
| API version | 改装設計図一覧 |
|
|
94
96
|
|------------:|:-----|
|
|
95
97
|
| 1 〜 6 | Unsupported |
|
|
96
98
|
| 7 | Supported (1) |
|
|
97
|
-
| 8 〜
|
|
99
|
+
| 8 〜 13 | Supported (2) |
|
|
98
100
|
|
|
99
101
|
## Development
|
|
100
102
|
|
|
@@ -18,7 +18,8 @@ class EventInfo
|
|
|
18
18
|
# ボス戦は "BOSS"
|
|
19
19
|
# 掃討戦は "SWEEP"
|
|
20
20
|
# 前段作戦の最終海域は "PERIOD_LAST"
|
|
21
|
-
#
|
|
21
|
+
# EO の最終戦は "BOSS_RAID_FINAL" (From API version 13)
|
|
22
|
+
# それ以外は "NORMAL" (EO も "NORMAL")
|
|
22
23
|
attr_accessor :area_kind
|
|
23
24
|
|
|
24
25
|
# 作戦時間(秒)
|
|
@@ -32,6 +33,9 @@ class EventInfo
|
|
|
32
33
|
# 出撃条件の有無(true ならある)
|
|
33
34
|
attr_accessor :sortie_limit
|
|
34
35
|
|
|
36
|
+
# 出撃条件の画像 (From API version 13)
|
|
37
|
+
attr_accessor :sortie_limit_img
|
|
38
|
+
|
|
35
39
|
# 海域画像のファイル名
|
|
36
40
|
attr_accessor :stage_image_name
|
|
37
41
|
|
|
@@ -85,8 +89,17 @@ class EventInfo
|
|
|
85
89
|
# 前段作戦か後段作戦か (From API version 7)
|
|
86
90
|
# 0: 前段作戦
|
|
87
91
|
# 1: 後段作戦
|
|
92
|
+
# 2: EO (From API version 13)
|
|
88
93
|
attr_accessor :period
|
|
89
94
|
|
|
95
|
+
# この EO のデータの表示箇所? (From API version 13)
|
|
96
|
+
# 乙・丙の EO の場合のみ "HEI"
|
|
97
|
+
# それ以外の場合はキー自体がない
|
|
98
|
+
attr_accessor :disp_add_level
|
|
99
|
+
|
|
100
|
+
# 出撃不可の艦種を表すアイコン (From API version 13)
|
|
101
|
+
attr_accessor :ng_unit_img
|
|
102
|
+
|
|
90
103
|
# 海域撃破ボーナス
|
|
91
104
|
class EventInfoReward
|
|
92
105
|
# 初回攻略時か2回目以降かを表すフラグ
|
|
@@ -105,6 +118,7 @@ class EventInfo
|
|
|
105
118
|
# "ROOM_ITEM_ICON": 家具コイン
|
|
106
119
|
# "ROOM_ITEM_MEISTER": 特注家具職人
|
|
107
120
|
# "EQUIP": 装備
|
|
121
|
+
# "TLOP_KOU_MEDAL": 甲種勲章 (From API version 13)
|
|
108
122
|
attr_accessor :kind
|
|
109
123
|
|
|
110
124
|
# 数値(戦果の場合はポイント数、家具コインの場合はコイン枚数)
|
|
@@ -44,6 +44,37 @@ class EventInfoParser
|
|
|
44
44
|
loop_count: Integer,
|
|
45
45
|
period: Integer,
|
|
46
46
|
},
|
|
47
|
+
3 => {
|
|
48
|
+
area_id: Integer,
|
|
49
|
+
area_sub_id: Integer,
|
|
50
|
+
level: String,
|
|
51
|
+
area_kind: String,
|
|
52
|
+
limit_sec: Integer,
|
|
53
|
+
require_gp: Integer,
|
|
54
|
+
sortie_limit: :boolean,
|
|
55
|
+
stage_image_name: String,
|
|
56
|
+
stage_mission_name: String,
|
|
57
|
+
stage_mission_info: String,
|
|
58
|
+
reward_list: :reward_list,
|
|
59
|
+
stage_drop_item_info: Array,
|
|
60
|
+
area_clear_state: String,
|
|
61
|
+
military_gauge_status: String,
|
|
62
|
+
ene_military_gauge_val: Integer,
|
|
63
|
+
military_gauge_left: Integer,
|
|
64
|
+
ene_military_gauge2d: String,
|
|
65
|
+
loop_count: Integer,
|
|
66
|
+
period: Integer,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
OPTIONAL_KEYS = {
|
|
71
|
+
1 => {},
|
|
72
|
+
2 => {},
|
|
73
|
+
3 => {
|
|
74
|
+
sortie_limit_img: String,
|
|
75
|
+
disp_add_level: String,
|
|
76
|
+
ng_unit_img: String,
|
|
77
|
+
}
|
|
47
78
|
}
|
|
48
79
|
|
|
49
80
|
REWARD_LIST_MANDATORY_KEYS = {
|
|
@@ -96,6 +127,19 @@ class EventInfoParser
|
|
|
96
127
|
result.instance_variable_set("@#{key.to_s}", items[camel_case_key])
|
|
97
128
|
end
|
|
98
129
|
|
|
130
|
+
OPTIONAL_KEYS[api_version].each do |key, key_class|
|
|
131
|
+
# キーが含まれなければ、処理をスキップ
|
|
132
|
+
camel_case_key = key.to_s.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
|
|
133
|
+
next unless items.include?(camel_case_key)
|
|
134
|
+
|
|
135
|
+
# 結果のクラスが合わなければエラー
|
|
136
|
+
unless items[camel_case_key].is_a?(key_class)
|
|
137
|
+
raise "Optional key #{key} is not class #{key_class}"
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
result.instance_variable_set("@#{key.to_s}", items[camel_case_key])
|
|
141
|
+
end
|
|
142
|
+
|
|
99
143
|
results << result
|
|
100
144
|
end
|
|
101
145
|
|
data/lib/admiral_stats_parser.rb
CHANGED
|
@@ -12,7 +12,7 @@ require 'admiral_stats_parser/parser/blueprint_list_info_parser'
|
|
|
12
12
|
module AdmiralStatsParser
|
|
13
13
|
# 最新の API バージョンを返します。
|
|
14
14
|
def self.get_latest_api_version
|
|
15
|
-
return
|
|
15
|
+
return 13
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
# エクスポート時刻を元に、API バージョンを推測して返します。
|
|
@@ -50,6 +50,9 @@ module AdmiralStatsParser
|
|
|
50
50
|
# version 12 の開始日
|
|
51
51
|
return 11 if exported_at < Time.parse('2018-02-16T07:00:00+0900')
|
|
52
52
|
|
|
53
|
+
# version 13 の開始日
|
|
54
|
+
return 12 if exported_at < Time.parse('2018-04-19T07:00:00+0900')
|
|
55
|
+
|
|
53
56
|
return self.get_latest_api_version
|
|
54
57
|
end
|
|
55
58
|
|
|
@@ -60,7 +63,7 @@ module AdmiralStatsParser
|
|
|
60
63
|
PersonalBasicInfoParser.parse(json, 1)
|
|
61
64
|
when 2..6
|
|
62
65
|
PersonalBasicInfoParser.parse(json, 2)
|
|
63
|
-
when 7..
|
|
66
|
+
when 7..13
|
|
64
67
|
PersonalBasicInfoParser.parse(json, 3)
|
|
65
68
|
else
|
|
66
69
|
raise 'unsupported API version'
|
|
@@ -76,7 +79,7 @@ module AdmiralStatsParser
|
|
|
76
79
|
AreaCaptureInfoParser.parse(json, 2)
|
|
77
80
|
when 7..10
|
|
78
81
|
AreaCaptureInfoParser.parse(json, 3)
|
|
79
|
-
when 11..
|
|
82
|
+
when 11..13
|
|
80
83
|
AreaCaptureInfoParser.parse(json, 4)
|
|
81
84
|
else
|
|
82
85
|
raise 'unsupported API version'
|
|
@@ -90,7 +93,7 @@ module AdmiralStatsParser
|
|
|
90
93
|
TcBookInfoParser.parse(json, 1)
|
|
91
94
|
when 2..11
|
|
92
95
|
TcBookInfoParser.parse(json, 2)
|
|
93
|
-
when 12
|
|
96
|
+
when 12..13
|
|
94
97
|
TcBookInfoParser.parse(json, 3)
|
|
95
98
|
else
|
|
96
99
|
raise 'unsupported API version'
|
|
@@ -100,7 +103,7 @@ module AdmiralStatsParser
|
|
|
100
103
|
# 装備図鑑をパースします。
|
|
101
104
|
def self.parse_equip_book_info(json, api_version)
|
|
102
105
|
case api_version
|
|
103
|
-
when 1..
|
|
106
|
+
when 1..13
|
|
104
107
|
EquipBookInfoParser.parse(json)
|
|
105
108
|
else
|
|
106
109
|
raise 'unsupported API version'
|
|
@@ -120,7 +123,7 @@ module AdmiralStatsParser
|
|
|
120
123
|
CharacterListInfoParser.parse(json, 3)
|
|
121
124
|
when 7..11
|
|
122
125
|
CharacterListInfoParser.parse(json, 4)
|
|
123
|
-
when 12
|
|
126
|
+
when 12..13
|
|
124
127
|
CharacterListInfoParser.parse(json, 5)
|
|
125
128
|
else
|
|
126
129
|
raise 'unsupported API version'
|
|
@@ -134,7 +137,7 @@ module AdmiralStatsParser
|
|
|
134
137
|
raise 'API version 1 does not support equip list info'
|
|
135
138
|
when 2..8
|
|
136
139
|
EquipListInfoParser.parse(json, 1)
|
|
137
|
-
when 9..
|
|
140
|
+
when 9..13
|
|
138
141
|
EquipListInfoParser.parse(json, 2)
|
|
139
142
|
else
|
|
140
143
|
raise 'unsupported API version'
|
|
@@ -146,7 +149,7 @@ module AdmiralStatsParser
|
|
|
146
149
|
case api_version
|
|
147
150
|
when 1..8
|
|
148
151
|
EquipListInfoParser.parse_max_slot_num(json, 1)
|
|
149
|
-
when 9..
|
|
152
|
+
when 9..13
|
|
150
153
|
EquipListInfoParser.parse_max_slot_num(json, 2)
|
|
151
154
|
else
|
|
152
155
|
raise 'unsupported API version'
|
|
@@ -162,6 +165,8 @@ module AdmiralStatsParser
|
|
|
162
165
|
EventInfoParser.parse(json, 1)
|
|
163
166
|
when 7..12
|
|
164
167
|
EventInfoParser.parse(json, 2)
|
|
168
|
+
when 13
|
|
169
|
+
EventInfoParser.parse(json, 3)
|
|
165
170
|
else
|
|
166
171
|
raise 'unsupported API version'
|
|
167
172
|
end
|
|
@@ -172,7 +177,7 @@ module AdmiralStatsParser
|
|
|
172
177
|
case api_version
|
|
173
178
|
when 1..3
|
|
174
179
|
raise "API version #{api_version} does not support event info"
|
|
175
|
-
when 4..
|
|
180
|
+
when 4..13
|
|
176
181
|
{
|
|
177
182
|
opened: EventInfoParser.opened?(event_info_list, level, period),
|
|
178
183
|
all_cleared: EventInfoParser.all_cleared?(event_info_list, level, period),
|
|
@@ -193,7 +198,7 @@ module AdmiralStatsParser
|
|
|
193
198
|
raise "API version #{api_version} does not support blueprint list info"
|
|
194
199
|
when 7
|
|
195
200
|
BlueprintListInfoParser.parse(json, 1)
|
|
196
|
-
when 8..
|
|
201
|
+
when 8..13
|
|
197
202
|
BlueprintListInfoParser.parse(json, 2)
|
|
198
203
|
else
|
|
199
204
|
raise 'unsupported API version'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: admiral_stats_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Masahiro Yoshizawa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|