refactor and add requirements.txt

This commit is contained in:
Styrr 2022-03-11 17:42:50 +01:00
parent 18b3af3db2
commit 9641353ead
4 changed files with 25 additions and 18 deletions

View File

@ -21,17 +21,18 @@ from src.loose_loot import preprocess_looseloot, LooseLootProcessor
with open('config/config.yaml', 'r') as fin:
config = yaml.load(fin, Loader=yaml.FullLoader)
with open(f'config/{config["config"]["static"]["forced_static_yaml"]}', 'r') as fin:
FORCED_STATIC = yaml.load(fin, Loader=yaml.FullLoader)
with open(f'config/{config["config"]["static"]["forced_yaml"]}', 'r') as fin:
forced_static_yaml = yaml.load(fin, Loader=yaml.FullLoader)
with open(f'config/{config["config"]["static"]["forced_loose_yaml"]}', 'r') as fin:
STATIC_WEAPON_IDS = forced_static_yaml['static_weapon_ids']
FORCED_STATIC = forced_static_yaml['forced_items']
with open(f'config/{config["config"]["loose"]["forced_yaml"]}', 'r') as fin:
FORCED_LOOSE = yaml.load(fin, Loader=yaml.FullLoader)
with open(f'config/{config["server"]["map_directory_mapping_yaml"]}', 'r') as fin:
loose_loot_dir_map = yaml.load(fin, Loader=yaml.FullLoader)
STATIC_WEAPON_IDS = config["config"]["static"]["static_weapon_ids"]
tarkov_server_dir = Path(config["server"]["location"])
loot_dump_archive = Path(config["archives"]["target_folder"]) / config["archives"]["loot_filename"]
@ -93,7 +94,8 @@ def main():
archive_files = set(archive.getnames())
with futures.ProcessPoolExecutor() as executor:
print("Gathering dumps")
for result in list(tqdm(executor.map(parse_dumps, archive.read(archive_files).items()), total=len(archive_files))):
for result in list(
tqdm(executor.map(parse_dumps, archive.read(archive_files).items()), total=len(archive_files))):
if result is not None:
gather_loot_results.append(result)
# get the newest dump per map
@ -110,7 +112,6 @@ def main():
result["basic_info"]["fname"]
)
print(f"Reading dumps took {time.time() - time_start} seconds.")
dump_count = len(gather_loot_results)

View File

@ -13,7 +13,7 @@ tools:
server:
# SPT-AKI Server location (to store the generated json)
location: 'C:/GAMES/SPT_AKI_Dev/Server/'
# The map names in the loot dump do not directly corresond to the server database structure, this is the mapping
# The map names in the loot dump do not directly correspond to the server database structure, this is the mapping
map_directory_mapping_yaml: map_directory_mapping.yaml
archives:
@ -29,12 +29,9 @@ archives:
backup_file: 'D:/Games/SPT_Dev/map_dumps/12.12_unused/complete.7z'
config:
static:
# ids for static weapons
static_weapon_ids:
- 5d52cc5ba4b9367408500062
- 5cdeb229d7f00c000e7ce174
# we have a separate yaml that defined forced static loot per map
forced_static_yaml: forced_static.yaml
forced_yaml: forced_static.yaml
loose:
# known quest items per map for validation
forced_loose_yaml: forced_loose.yaml
forced_yaml: forced_loose.yaml
````

View File

@ -1,4 +1,10 @@
---
static_weapon_ids:
# ids for static weapons
- 5d52cc5ba4b9367408500062
- 5cdeb229d7f00c000e7ce174
forced_items:
Customs:
# unknown key
- containerId: custom_multiScene_00058

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
numpy~=1.20.3
py7zr~=0.18.0
pyyaml~=6.0