Make sure the last submitted is not the same!
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
80ab3f42fc
commit
b4d270698a
Binary file not shown.
BIN
sigPlace.jar
BIN
sigPlace.jar
Binary file not shown.
@ -105,6 +105,7 @@ public class sigPlace {
|
|||||||
try {
|
try {
|
||||||
Robot r = new Robot();
|
Robot r = new Robot();
|
||||||
Reader lastReader = null;
|
Reader lastReader = null;
|
||||||
|
Reader lastSubmittedReader = null;
|
||||||
int matches=0;
|
int matches=0;
|
||||||
final int EXPECTED_MATCHES=7;
|
final int EXPECTED_MATCHES=7;
|
||||||
boolean submitted=false;
|
boolean submitted=false;
|
||||||
@ -135,7 +136,7 @@ public class sigPlace {
|
|||||||
matches=0;
|
matches=0;
|
||||||
submitted=false;
|
submitted=false;
|
||||||
}
|
}
|
||||||
if (matches>=EXPECTED_MATCHES&&!submitted) {
|
if (matches>=EXPECTED_MATCHES&&!submitted&&!lastSubmittedReader.equals(result)) {
|
||||||
System.out.println("Data is reasonable, prepare for submitting...");
|
System.out.println("Data is reasonable, prepare for submitting...");
|
||||||
try {
|
try {
|
||||||
POSTRequest postRes = new POSTRequest("http://"+args[1]+"/uploadform.html",temp);
|
POSTRequest postRes = new POSTRequest("http://"+args[1]+"/uploadform.html",temp);
|
||||||
@ -144,6 +145,7 @@ public class sigPlace {
|
|||||||
playSound(Paths.get("ding.wav"));
|
playSound(Paths.get("ding.wav"));
|
||||||
System.out.println("Successful!");
|
System.out.println("Successful!");
|
||||||
submitted=true;
|
submitted=true;
|
||||||
|
lastSubmittedReader=result;
|
||||||
}
|
}
|
||||||
} catch (FailedResponseException e) {
|
} catch (FailedResponseException e) {
|
||||||
System.out.println("Failed! "+e.getMessage());
|
System.out.println("Failed! "+e.getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user