Ice9Coffee / LandosolRoster

兰德索尔花名册
GNU General Public License v3.0
15 stars 9 forks source link

疑似是愛梅斯新加入的暱稱導致程式報錯 #22

Closed negimiku1227 closed 1 year ago

negimiku1227 commented 1 year ago

昨日啟動PrincessStudio時,程式閃退並留下以下錯誤訊息

System.ArgumentException: An item with the same key has already been added. Key: 菲欧
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at PCRApi.Form.HORIZONTAL_BOX_OPPONENT.<>c__DisplayClass2_1.<.ctor>b__11(Object y) in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Form\HORIZONTAL\BOX_OPPONENT.cs:line 75
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at PCRApi.Form.HORIZONTAL_BOX_OPPONENT.<>c__DisplayClass2_0.<.ctor>b__3(KeyValuePair`2 x) in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Form\HORIZONTAL\BOX_OPPONENT.cs:line 75
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at PCRApi.Form.HORIZONTAL_BOX_OPPONENT..ctor() in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Form\HORIZONTAL\BOX_OPPONENT.cs:line 75
   at PCRApi.Form.PrincessStudio..ctor() in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Form\PrincessStudio.cs:line 58
   at PCRApi.Form.PrincessStudio.get_Instance() in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Form\PrincessStudio.cs:line 21
   at PCRApi.Program.Main(String[] args) in C:\Users\_\source\repos\PrincessStudio_JP\PCRApi\Program.cs:line 257

查看了_pcr_data.py,看到了一行

1230: ["爱梅斯", "アメス", "Amesu", "菲欧", "爱美斯", "艾美斯", "艾梅斯"],

以及

1901: ["菲欧", "フィオ", "Fio"],

想詢問是否是因此原因造成閃退,感謝

Ice9Coffee commented 1 year ago

报错确实是因为有重复的key,但不属于本项目的问题

negimiku1227 commented 1 year ago

瞭解了,那如果想要修正此問題 我應該在此條目提交pr,然後可能再麻煩您協助同步到原先HoshinoBot的 _pcr_data.py裡? (因目前使用的bot是使用該位置的暱稱表) 或是需要其他處理方式,還望您不吝指教

Ice9Coffee commented 1 year ago

HoshinoBot现在会每日自动拉取本仓库得数据。 本仓库数据不保证没有重复项。 你应当向PrincessStudio_JP\PCRApi汇报bug并在那边处理重复的词条。

cc004 commented 1 year ago

@krulci

negimiku1227 commented 1 year ago

後來回報PrincessStudio的作者後已更新程式,現已能解析 _pcr_data.py 的重複詞條 故暫已無透過pr編輯本條目的需求