This repository was archived by the owner on Nov 24, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
src/main/java/me/checkium/vhackapi Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class vHackAPI {
15
15
protected String password ;
16
16
protected String username ;
17
17
protected String userHash ;
18
+ private JSONObject stats = null ;
18
19
19
20
20
21
public Console getConsole () {
@@ -32,16 +33,23 @@ public SpywareManager getSpywareManager() {
32
33
}
33
34
34
35
public String getStats (Stats stat ) {
35
- try {
36
- TimeUnit .MILLISECONDS .sleep (200 );
37
- } catch (InterruptedException e1 ) {
36
+ if (stats == null ){
37
+ try {
38
+ TimeUnit .MILLISECONDS .sleep (200 );
39
+ } catch (InterruptedException e1 ) {
38
40
e1 .printStackTrace ();
41
+ }
42
+ stats = Utils .JSONRequest ("user::::pass::::uhash" , username + "::::" + password + "::::" + userHash , "vh_update.php" );
43
+ return json .getString (stat .toString ());
44
+ } else {
45
+ return json .getString (stat .toString ());
39
46
}
40
- JSONObject json = Utils .JSONRequest ("user::::pass::::uhash" , username + "::::" + password + "::::" + userHash , "vh_update.php" );
41
-
42
- return json .getString (stat .toString ());
43
47
}
44
48
49
+ public void refreshStats () {
50
+ stats = null ;
51
+ }
52
+
45
53
public PackageOpener getPackageOpener () {
46
54
PackageOpener packageOpener = new PackageOpener (username , password , userHash );
47
55
return packageOpener ;
You can’t perform that action at this time.
0 commit comments