Skip to content

Commit

Permalink
Merge tag 'v2.0.5' of https://github.com/nekopanda/logbook
Browse files Browse the repository at this point in the history
  • Loading branch information
biikame committed Dec 11, 2015
2 parents 8902208 + 4f62d50 commit ce6a38c
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 24 deletions.
2 changes: 1 addition & 1 deletion main/logbook/constants/AppConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class AppConstants {
public static final String SUFFIX = "拡張版(赤)";

/** バージョン */
public static final String VERSION = "2.0.3.28";
public static final String VERSION = "2.0.5.29";

/** ホームページ */
public static final URI HOME_PAGE_URI = URI.create("http://nekopanda.blog.jp/");
Expand Down
2 changes: 2 additions & 0 deletions main/logbook/dto/MapCellDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ private String getNextKind() {
return "航空戦";
case 8:
return "船団護衛成功";
case 9:
return "揚陸地点";
}

return null;
Expand Down
20 changes: 10 additions & 10 deletions main/logbook/dto/ShipDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import logbook.constants.AppConstants;
import logbook.data.context.GlobalContext;
import logbook.internal.CondTiming;
import logbook.internal.ExpTable;
import logbook.util.JsonUtils;

import com.dyuproject.protostuff.Tag;
Expand Down Expand Up @@ -71,6 +70,10 @@ public final class ShipDto extends ShipBaseDto implements Comparable<ShipDto> {
@Tag(23)
private final int exp;

/** 次のレベルまで */
@Tag(29)
private final int nextexp;

/** 経験値ゲージの割合 */
@Tag(30)
private final float expraito;
Expand Down Expand Up @@ -124,8 +127,9 @@ public ShipDto(JsonObject object) {
this.bull = object.getJsonNumber("api_bull").intValue();
this.fuel = object.getJsonNumber("api_fuel").intValue();

this.exp = object.getJsonArray("api_exp").getJsonNumber(0).intValue();
this.expraito = object.getJsonArray("api_exp").getJsonNumber(2).longValue() / 100f;
this.exp = object.getJsonArray("api_exp").getInt(0);
this.nextexp = object.getJsonArray("api_exp").getInt(1);
this.expraito = object.getJsonArray("api_exp").getInt(2) / 100f;
this.nowhp = this.getParam().getHP();
this.maxhp = this.getMax().getHP();
this.slotnum = object.getJsonNumber("api_slotnum").intValue();
Expand Down Expand Up @@ -160,6 +164,7 @@ public ShipDto(int id, ShipInfoDto shipinfo, int[] slot) {
this.fuel = shipinfo.getMaxFuel();

this.exp = 0;
this.nextexp = 100;
this.expraito = 0;
this.nowhp = this.maxhp = this.getParam().getHP();

Expand Down Expand Up @@ -421,13 +426,8 @@ public int[] getOnSlot() {
* 次のレベルまでの経験値
* @return 次のレベルまでの経験値
*/
public Integer getNext() {
Integer nextLvExp = ExpTable.get().get(
Math.min(ExpTable.MAX_LEVEL, this.lv + 1));
if (nextLvExp != null) {
return nextLvExp - this.exp;
}
return null;
public int getNext() {
return this.nextexp;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions main/logbook/gui/CalcExpDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void createContents() {
GridData gdBeforelv = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdBeforelv.widthHint = 45;
this.beforelv.setLayoutData(gdBeforelv);
this.beforelv.setMaximum(150);
this.beforelv.setMaximum(ExpTable.MAX_LEVEL);
this.beforelv.setMinimum(1);
Label label2 = new Label(plan, SWT.NONE);
label2.setText("Lv");
Expand All @@ -150,7 +150,7 @@ private void createContents() {
GridData gdAfterlv = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdAfterlv.widthHint = 45;
this.afterlv.setLayoutData(gdAfterlv);
this.afterlv.setMaximum(150);
this.afterlv.setMaximum(ExpTable.MAX_LEVEL);
this.afterlv.setMinimum(1);
Label label5 = new Label(plan, SWT.NONE);
label5.setText("Lv");
Expand Down Expand Up @@ -307,7 +307,7 @@ public void preset() {
after = before + 1;
}
// 目標レベルが150を超える場合は150に設定
after = Math.min(after, 150);
after = Math.min(after, ExpTable.MAX_LEVEL);

String beforeexpstr = String.valueOf(ship.getExp());
String afterexpstr = String.valueOf(ExpTable.get().get(after));
Expand Down
5 changes: 3 additions & 2 deletions main/logbook/gui/CalcPracticeExpDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import logbook.dto.PracticeUserDetailDto;
import logbook.dto.ShipInfoDto;
import logbook.internal.ExpTable;
import logbook.internal.PracticeEvaluateExp;
import logbook.util.CalcPracticeExpUtils;

Expand Down Expand Up @@ -101,7 +102,7 @@ private void createContents() {
GridData gdFirstShipLevel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdFirstShipLevel.widthHint = 45;
this.firstShipLevel.setLayoutData(gdFirstShipLevel);
this.firstShipLevel.setMaximum(150);
this.firstShipLevel.setMaximum(ExpTable.MAX_LEVEL);
this.firstShipLevel.setMinimum(1);
this.firstShipLevel.setSelection(this.levels[0]);
new Label(practiceinfo, SWT.NONE).setText("Lv");
Expand All @@ -115,7 +116,7 @@ private void createContents() {
GridData gdsecondShipLevel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdsecondShipLevel.widthHint = 45;
this.secondShipLevel.setLayoutData(gdsecondShipLevel);
this.secondShipLevel.setMaximum(150);
this.secondShipLevel.setMaximum(ExpTable.MAX_LEVEL);
this.secondShipLevel.setMinimum(1);
this.secondShipLevel.setSelection(this.levels[1]);
new Label(practiceinfo, SWT.NONE).setText("Lv");
Expand Down
5 changes: 4 additions & 1 deletion main/logbook/gui/ItemTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ protected void createContents() {
public void widgetSelected(SelectionEvent e) {
StringBuilder sb = new StringBuilder();
for (TableItem item : ItemTable.this.table.getSelection()) {
sb.append("\"").append(item.getText(1)).append("\", ");
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(item.getText(1));
}
Clipboard clipboard = new Clipboard(Display.getDefault());
clipboard.setContents(new Object[] { sb.toString() }, new Transfer[] { TextTransfer.getInstance() });
Expand Down
10 changes: 8 additions & 2 deletions main/logbook/gui/ShipTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ public void widgetSelected(SelectionEvent e) {
public void widgetSelected(SelectionEvent e) {
StringBuilder sb = new StringBuilder();
for (TableItem item : ShipTable.this.table.getSelection()) {
sb.append(String.valueOf(((ShipDto) item.getData()).getId())).append(", ");
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(String.valueOf(((ShipDto) item.getData()).getId()));
}
Clipboard clipboard = new Clipboard(Display.getDefault());
clipboard.setContents(new Object[] { sb.toString() }, new Transfer[] { TextTransfer.getInstance() });
Expand All @@ -193,7 +196,10 @@ public void widgetSelected(SelectionEvent e) {
public void widgetSelected(SelectionEvent e) {
StringBuilder sb = new StringBuilder();
for (TableItem item : ShipTable.this.table.getSelection()) {
sb.append("\"").append(((ShipDto) item.getData()).getName()).append("\", ");
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(((ShipDto) item.getData()).getName());
}
Clipboard clipboard = new Clipboard(Display.getDefault());
clipboard.setContents(new Object[] { sb.toString() }, new Transfer[] { TextTransfer.getInstance() });
Expand Down
7 changes: 6 additions & 1 deletion main/logbook/internal/ExpTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class ExpTable {

public static final int MAX_LEVEL = 150;
public static final int MAX_LEVEL = 155;

/**
* 経験値テーブルプリセット値
Expand Down Expand Up @@ -170,6 +170,11 @@ public class ExpTable {
this.put(148, 3978000);
this.put(149, 4165000);
this.put(150, 4360000);
this.put(151, 4564000);
this.put(152, 4777000);
this.put(153, 4999000);
this.put(154, 5230000);
this.put(155, 5470000);
}
};

Expand Down
4 changes: 2 additions & 2 deletions main/logbook/server/proxy/DatabaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public void run() {
for (int retly = 0;; ++retly) {
String errorReason = null;
try {
// 20秒でタイムアウト
Request request = this.createRequest(data).timeout(20, TimeUnit.SECONDS);
// 60秒でタイムアウト
Request request = this.createRequest(data).timeout(60, TimeUnit.SECONDS);
ContentResponse response = request.send();
if (this.endRequested) {
return;
Expand Down
4 changes: 2 additions & 2 deletions main/logbook/util/CalcPracticeExpUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public class CalcPracticeExpUtils {
* @return 得られる経験値
*/
public static int getExp(int firstLevel, int secondLevel, double eval, boolean isFlagship, boolean isMvp) {
if ((firstLevel < 1) || (firstLevel > 150) || (secondLevel < 1) || (secondLevel > 150)) {
if ((firstLevel < 1) || (firstLevel > ExpTable.MAX_LEVEL) || (secondLevel < 1)
|| (secondLevel > ExpTable.MAX_LEVEL)) {
return 0;
}

Expand Down Expand Up @@ -58,4 +59,3 @@ public static void main(String[] args) {
}
}
}

0 comments on commit ce6a38c

Please sign in to comment.