关于扩张版的问题,在 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;
}
应该算是一个比较通用的暂时解法吧...
不过其实蛮无用的,会自行编译的人应该都有办法自己改...