mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-06-18 21:35:07 +08:00
🐛 修复BUG
This commit is contained in:
parent
1fd2e0aae3
commit
ff6ddeebd1
@ -11,17 +11,15 @@ daily_achi = {}
|
|||||||
|
|
||||||
@on_core_start
|
@on_core_start
|
||||||
async def load_data():
|
async def load_data():
|
||||||
global all_achi, daily_achi
|
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
path / 'all_achi.json', "r", encoding='UTF-8'
|
path / 'all_achi.json', "r", encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
all_achi = json.loads(await f.read())
|
all_achi.update(json.loads(await f.read()))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
path / 'daily_achi.json', "r", encoding='UTF-8'
|
path / 'daily_achi.json', "r", encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
daily_achi = json.loads(await f.read())
|
daily_achi.update(json.loads(await f.read()))
|
||||||
|
|
||||||
|
|
||||||
daily_template = '''任务:【{}】
|
daily_template = '''任务:【{}】
|
||||||
|
@ -52,8 +52,8 @@ mysData: Dict = {}
|
|||||||
propId2Name: Dict[str, str] = {}
|
propId2Name: Dict[str, str] = {}
|
||||||
Id2PropId: Dict[str, str] = {}
|
Id2PropId: Dict[str, str] = {}
|
||||||
artifactId2Piece: Dict[str, List[str]] = {}
|
artifactId2Piece: Dict[str, List[str]] = {}
|
||||||
skillId2Name: TS = TS(Name={}, Icon={})
|
skillId2Name: TS = {'Name': {}, 'Icon': {}}
|
||||||
talentId2Name: TS = TS(Name={}, Icon={})
|
talentId2Name: TS = {'Name': {}, 'Icon': {}}
|
||||||
weaponHash2Name: Dict[str, str] = {}
|
weaponHash2Name: Dict[str, str] = {}
|
||||||
weaponHash2Type: Dict[str, str] = {}
|
weaponHash2Type: Dict[str, str] = {}
|
||||||
alias_data: Dict[str, List[str]] = {}
|
alias_data: Dict[str, List[str]] = {}
|
||||||
@ -68,165 +68,172 @@ CharId2TalentIcon_data: Dict[str, List[str]] = {}
|
|||||||
|
|
||||||
@on_core_start
|
@on_core_start
|
||||||
async def load_map():
|
async def load_map():
|
||||||
global charList, weaponList, avatarId2Name, icon2Name
|
|
||||||
global artifact2attr, name2Icon, avatarName2Element
|
|
||||||
global avatarName2Weapon, mysData, talentId2Name
|
|
||||||
global propId2Name, Id2PropId, artifactId2Piece, skillId2Name
|
|
||||||
global weaponHash2Name, weaponHash2Type, alias_data, avatarId2Star_data
|
|
||||||
global enName_to_avatarId_data, ex_monster_data, monster2entry_data
|
|
||||||
global avatarId2SkillList_data, weaponId2Name_data, CharId2TalentIcon_data
|
|
||||||
logger.info('[GenshinUID MAP] 正在加载资源文件...')
|
logger.info('[GenshinUID MAP] 正在加载资源文件...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / charList_fileName, 'r', encoding='UTF-8'
|
MAP / charList_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
charList = msgjson.decode(await f.read(), type=Dict)
|
charList.update(msgjson.decode(await f.read(), type=Dict))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / weaponList_fileName, 'r', encoding='UTF-8'
|
MAP / weaponList_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
weaponList = msgjson.decode(await f.read(), type=Dict)
|
weaponList.update(msgjson.decode(await f.read(), type=Dict))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / avatarId2Name_fileName, 'r', encoding='UTF-8'
|
MAP / avatarId2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
avatarId2Name = msgjson.decode(await f.read(), type=Dict[str, str])
|
avatarId2Name.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / icon2Name_fileName, 'r', encoding='UTF-8'
|
MAP / icon2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
icon2Name = msgjson.decode(await f.read(), type=Dict[str, str])
|
icon2Name.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / artifact2attr_fileName, 'r', encoding='UTF-8'
|
MAP / artifact2attr_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
artifact2attr = msgjson.decode(await f.read(), type=Dict[str, str])
|
artifact2attr.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / icon2Name_fileName, 'r', encoding='UTF-8'
|
MAP / icon2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
icon2Name = msgjson.decode(await f.read(), type=Dict[str, str])
|
icon2Name.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / name2Icon_fileName, 'r', encoding='UTF-8'
|
MAP / name2Icon_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
name2Icon = msgjson.decode(await f.read(), type=Dict[str, str])
|
name2Icon.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / 'propId2Name_mapping.json', 'r', encoding='UTF-8'
|
MAP / 'propId2Name_mapping.json', 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
propId2Name = msgjson.decode(await f.read(), type=Dict[str, str])
|
propId2Name.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / 'Id2propId_mapping.json', 'r', encoding='UTF-8'
|
MAP / 'Id2propId_mapping.json', 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
Id2PropId = msgjson.decode(await f.read(), type=Dict[str, str])
|
Id2PropId.update(
|
||||||
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / weaponHash2Name_fileName, 'r', encoding='UTF-8'
|
MAP / weaponHash2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
weaponHash2Name = msgjson.decode(
|
weaponHash2Name.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / weaponHash2Type_fileName, 'r', encoding='UTF-8'
|
MAP / weaponHash2Type_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
weaponHash2Type = msgjson.decode(
|
weaponHash2Type.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / 'artifactId2Piece_mapping.json', 'r', encoding='UTF-8'
|
MAP / 'artifactId2Piece_mapping.json', 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
artifactId2Piece = msgjson.decode(
|
artifactId2Piece.update(
|
||||||
await f.read(), type=Dict[str, List[str]]
|
msgjson.decode(await f.read(), type=Dict[str, List[str]])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / skillId2Name_fileName, 'r', encoding='UTF-8'
|
MAP / skillId2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
skillId2Name = msgjson.decode(await f.read(), type=TS)
|
skillId2Name.update(msgjson.decode(await f.read(), type=TS))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / talentId2Name_fileName, 'r', encoding='UTF-8'
|
MAP / talentId2Name_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
talentId2Name = msgjson.decode(await f.read(), type=TS)
|
talentId2Name.update(msgjson.decode(await f.read(), type=TS))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / avatarName2Element_fileName, 'r', encoding='UTF-8'
|
MAP / avatarName2Element_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
avatarName2Element = msgjson.decode(
|
avatarName2Element.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / avatarName2Weapon_fileName, 'r', encoding='UTF-8'
|
MAP / avatarName2Weapon_fileName, 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
avatarName2Weapon = msgjson.decode(
|
avatarName2Weapon.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / 'char_alias.json', 'r', encoding='UTF-8'
|
MAP / 'char_alias.json', 'r', encoding='UTF-8'
|
||||||
) as f:
|
) as f:
|
||||||
alias_data = msgjson.decode(
|
alias_data.update(
|
||||||
await f.read(), type=Dict[str, List[str]]
|
msgjson.decode(await f.read(), type=Dict[str, List[str]])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / avatarId2Star_fileName, 'r', encoding='utf8'
|
MAP / avatarId2Star_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
avatarId2Star_data = msgjson.decode(
|
avatarId2Star_data.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / enName2Id_fileName, 'r', encoding='utf8'
|
MAP / enName2Id_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
enName_to_avatarId_data = msgjson.decode(
|
enName_to_avatarId_data.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / EXMonster_fileName, 'r', encoding='utf8'
|
MAP / EXMonster_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
ex_monster_data = msgjson.decode(
|
ex_monster_data.update(
|
||||||
await f.read(), type=Dict[str, Dict]
|
msgjson.decode(await f.read(), type=Dict[str, Dict])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / monster2entry_fileName, 'r', encoding='utf8'
|
MAP / monster2entry_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
monster2entry_data = msgjson.decode(
|
monster2entry_data.update(
|
||||||
await f.read(), type=Dict[str, Dict]
|
msgjson.decode(await f.read(), type=Dict[str, Dict])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / avatarId2SkillList_fileName, 'r', encoding='utf8'
|
MAP / avatarId2SkillList_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
avatarId2SkillList_data = msgjson.decode(
|
avatarId2SkillList_data.update(
|
||||||
await f.read(), type=Dict[str, Dict[str, str]]
|
msgjson.decode(await f.read(), type=Dict[str, Dict[str, str]])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / weaponId2Name_fileName, 'r', encoding='utf8'
|
MAP / weaponId2Name_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
weaponId2Name_data = msgjson.decode(
|
weaponId2Name_data.update(
|
||||||
await f.read(), type=Dict[str, str]
|
msgjson.decode(await f.read(), type=Dict[str, str])
|
||||||
)
|
)
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / mysData_fileName, 'r', encoding='utf8'
|
MAP / mysData_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
mysData = msgjson.decode(await f.read(), type=Dict)
|
mysData.update(msgjson.decode(await f.read(), type=Dict))
|
||||||
|
|
||||||
async with aiofiles.open(
|
async with aiofiles.open(
|
||||||
MAP / CharId2TalentIcon_fileName, 'r', encoding='utf8'
|
MAP / CharId2TalentIcon_fileName, 'r', encoding='utf8'
|
||||||
) as f:
|
) as f:
|
||||||
CharId2TalentIcon_data = msgjson.decode(
|
CharId2TalentIcon_data.update(
|
||||||
await f.read(), type=Dict[str, List[str]]
|
msgjson.decode(await f.read(), type=Dict[str, List[str]])
|
||||||
)
|
)
|
||||||
logger.success('[GenshinUID MAP] 资源文件加载完成')
|
logger.success('[GenshinUID MAP] 资源文件加载完成')
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user