Inventory items are now saved only if processing didn't fail. Receiving messages works, but there seems to be a problem with the POW check in some circumstances.

This commit is contained in:
2015-05-23 10:27:05 +02:00
parent 6b3b361aa3
commit b793526f2f
22 changed files with 82 additions and 73 deletions

View File

@ -206,7 +206,7 @@ public class Application {
private void messages() {
String command;
List<Plaintext> messages = ctx.messages().findMessages(Plaintext.Status.RECEIVED);
List<Plaintext> messages = ctx.messages().findMessages(Plaintext.Status.NEW);
do {
System.out.println();
int i = 0;
@ -230,7 +230,7 @@ public class Application {
return;
default:
try {
int index = Integer.parseInt(command);
int index = Integer.parseInt(command) - 1;
show(messages.get(index));
} catch (NumberFormatException | IndexOutOfBoundsException e) {
System.out.println("Unknown command. Please try again.");
@ -249,9 +249,9 @@ public class Application {
System.out.println();
String command;
do {
System.out.printf("r) reply");
System.out.println("r) reply");
System.out.println("d) delete");
System.out.printf("b) back");
System.out.println("b) back");
command = nextCommand();
switch (command) {
case "r":