作者Akaz (Akaz)
看板KanColle
標題Re: [求助] 有人航海日誌正常的嗎
時間Fri Sep 25 18:29:25 2015
關於擴張版的問題,在 github 上已經有人提出 issue:
https://github.com/nekopanda/logbook/issues/38
在 logbook.internal.Ship.java 666行:
/** 改造最終艦のID */
public static int getCharId(ShipInfoDto shipinfo) {
int charId = shipinfo.getShipId();
int afterShipId = shipinfo.getAftershipid();
while (afterShipId != 0) {
charId = afterShipId;
afterShipId = Ship.get(String.valueOf(afterShipId)).getAftershipid();
}
return charId;
}
因為 翔鶴改二改造後 = 翔鶴改二甲
翔鶴改二甲改造後 = 翔鶴改二
造成了無窮迴圈,導致航海日誌擴張版無法正常運作。
(航海日誌原版沒有這樣的設計)
如果會自行編譯的板友可以稍微修改一下:
import java.util.Vector;
(中略)
/** 改造最終艦のID */
public static int getCharId(ShipInfoDto shipinfo) {
int charId = shipinfo.getShipId();
int afterShipId = shipinfo.getAftershipid();
Vector<Integer> seenId = new Vector<>();
while (afterShipId != 0) {
boolean seen = false;
for (int i : seenId) {
if (i == afterShipId) {
seen = true;
break;
}
}
if (seen)
break;
seenId.add (afterShipId);
charId = afterShipId;
afterShipId = Ship.get(String.valueOf(afterShipId)).getAftershipid();
}
return charId;
}
應該算是一個比較通用的暫時解法吧...
不過其實蠻無用的,會自行編譯的人應該都有辦法自己改...
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.169.188.176
※ 文章網址: https://www.ptt.cc/bbs/KanColle/M.1443176969.A.73C.html
推 tonekaini: 這ID 是學弟 09/25 18:30
推 Bread: 是tone的學弟應該是強者,我先跪一下 09/25 18:32
推 tonekaini: ↖(‧ω‧‵) 也是麵包的學弟啊 XDD 09/25 18:33
兩位是誰 (抖)
→ zxcvb123454: 作者更新了 09/25 18:46
作者用的是 issue 裡面的暫定更新 (排除翔鶴改二甲的 id)
如果沒有進一步修正的話 下一次實裝可以改回來的艦娘就會再爆炸一次XD
推 Carrarese: 感謝情報 09/25 18:50
推 twosheep0603: 居然是這麼神奇的bug 09/25 18:51
推 ian90911: 666 09/25 19:12
推 Shissoufubi: 竟然是這原因wwww 09/25 19:41
推 kira925: 居然是無窮迴圈XDDD 09/25 19:54
※ 編輯: Akaz (118.169.188.176), 09/25/2015 20:35:51