@@ -21,7 +21,7 @@ class HiRezGames extends API {
2121
2222 private final String devId ;
2323 private final String authKey ;
24- private String sessionId ;
24+ private String sessionId = "" ;
2525
2626 /**
2727 * Hi-Rez Studios API for Smite and Paladins games
@@ -74,6 +74,7 @@ private String getSignature(String method, String timestamp) {
7474 * @param args arguments in the correct order
7575 * @return data object in {@link JSONObject}
7676 */
77+ // TODO: testSession() is looping while he throwing StackOverflowError exception
7778 JSONObject catchData (String endpoint , String ... args ) {
7879 if (!sessionId .isEmpty ()) {
7980 JSONObject test = testSession ();
@@ -93,7 +94,10 @@ private void createSession() {
9394 String timestamp = getTimestamp ();
9495 String signature = getSignature ("createsession" , timestamp );
9596 JSONObject ses = getData (requestType .GET , "/createsessionJson/" + devId + "/" + signature + "/" + timestamp );
96- if (ses .getJSONObject ("data" ).getInt ("responseCode" ) == 200 && ses .getJSONObject ("content" ).getString ("ret_msg" ).equals ("Approved" )) sessionId = ses .getJSONObject ("content" ).getString ("session_id" );
97+ if (
98+ ses .getJSONObject ("data" ).getInt ("responseCode" ) == 200 &&
99+ ses .getJSONObject ("content" ).getString ("ret_msg" ).equals ("Approved" )
100+ ) sessionId = ses .getJSONObject ("content" ).getString ("session_id" );
97101 }
98102
99103 /**
0 commit comments