File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -147,13 +147,23 @@ def fetch_zzz_update():
147
147
if name_hash_id == "" or item_id == "" :
148
148
raise ValueError ("Failed to fetch name_hash_id and item_id" )
149
149
else :
150
- logger .info (f"Successfully fetched name_hash_id: { name_hash_id } and item_id: { item_id } from zzz" )
150
+ logger .info (f"Successfully fetched name_hash_id: [ { name_hash_id } ] and item_id: [ { item_id } ] from zzz" )
151
151
152
152
weapon_config_data = json .loads (httpx .get (target_host + weapon_config_file ).text )
153
153
key_name = list (weapon_config_data .keys ())
154
154
if len (key_name ) == 1 :
155
155
weapon_config_data = weapon_config_data [key_name [0 ]]
156
- logger .info (f"Successfully fetched { len (avatar_config_data ) + len (weapon_config_data )} items from zzz" )
156
+
157
+ # filter weapon items
158
+ def is_valid_weapon_item (name_hash_value : str ):
159
+ if name_hash_value .startswith ("Bangboo_Name_" ):
160
+ return True
161
+ if name_hash_value .startswith ("Item_Weapon_" ):
162
+ return True
163
+ return False
164
+ weapon_config_data = list (filter (lambda x : is_valid_weapon_item (x [name_hash_id ]), weapon_config_data ))
165
+
166
+ logger .info (f"Successfully fetched { len (avatar_config_data )} avatar items + { len (weapon_config_data )} weapon items from zzz" )
157
167
chs_dict = json .loads (httpx .get (target_host + "TextMap/TextMapTemplateTb.json" ).text )
158
168
cht_dict = json .loads (httpx .get (target_host + "TextMap/TextMap_CHTTemplateTb.json" ).text )
159
169
de_dict = json .loads (httpx .get (target_host + "TextMap/TextMap_DETemplateTb.json" ).text )
You can’t perform that action at this time.
0 commit comments