Add some threshold checking
This commit is contained in:
parent
df08031ba6
commit
e7ec1f7a5e
Binary file not shown.
@ -103,6 +103,8 @@ public class App
|
|||||||
{
|
{
|
||||||
public static Image paragraph;
|
public static Image paragraph;
|
||||||
final static int EVENT = 11;
|
final static int EVENT = 11;
|
||||||
|
public static int[] lastScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||||
|
public static int[] lastLowerTierScores = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||||
|
|
||||||
public static void main( String[] args ) throws IOException
|
public static void main( String[] args ) throws IOException
|
||||||
{
|
{
|
||||||
@ -403,9 +405,22 @@ public class App
|
|||||||
int[] ranks = new int[] {50,100,500,1000,2000,5000,10000,20000,30000,50000};
|
int[] ranks = new int[] {50,100,500,1000,2000,5000,10000,20000,30000,50000};
|
||||||
if (!error2) {
|
if (!error2) {
|
||||||
for (int j=0;j<10;j++) {
|
for (int j=0;j<10;j++) {
|
||||||
|
try {
|
||||||
|
//if (j>=1&&j<9&&Integer.parseInt(lowerTierScores[j])>Integer.parseInt(lowerTierScores[j+1])&&Integer.parseInt(lowerTierScores[j])<Integer.parseInt(lowerTierScores[j+1])) {
|
||||||
|
if (lastLowerTierScores[j]==0||(
|
||||||
|
StringUtils.isNumeric(lowerTierScores[j])&&
|
||||||
|
lastLowerTierScores[j]<Integer.parseInt(lowerTierScores[j]))) {
|
||||||
new Thread(
|
new Thread(
|
||||||
new SubmitThread(lowerTierNames[j],lowerTierDesc[j],lowerTierScores[j],EVENT,ranks[j]))
|
new SubmitThread(lowerTierNames[j],lowerTierDesc[j],lowerTierScores[j],EVENT,ranks[j]))
|
||||||
.start();
|
.start();
|
||||||
|
lastLowerTierScores[j]=Integer.parseInt(lowerTierScores[j]);
|
||||||
|
} else {
|
||||||
|
System.out.println("No update required for rank "+ranks[j]);
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("Cannot parse score for rank "+ranks[j]+".");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Cannot submit lower tier scores. Invalid array params.");
|
System.out.println("Cannot submit lower tier scores. Invalid array params.");
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user