Revision 6570171b
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/scores/RubikScoresDownloader.java | ||
---|---|---|
285 | 285 |
|
286 | 286 |
private boolean network(String url) |
287 | 287 |
{ |
288 |
//android.util.Log.e("down", "url: "+url); |
|
289 |
|
|
290 | 288 |
try |
291 | 289 |
{ |
292 | 290 |
java.net.URL connectURL = new URL(url); |
... | ... | |
368 | 366 |
int numRuns = scores.getNumRuns(); |
369 | 367 |
int numPlay = scores.getNumPlays(); |
370 | 368 |
int deviceID= scores.getDeviceID(); |
371 |
String objlist = scores.getUnsubmittedObjlist(); |
|
372 |
String lvllist = scores.getUnsubmittedLevellist(); |
|
373 |
String timlist = scores.getUnsubmittedTimelist(); |
|
369 |
String reclist = scores.getRecordList("&o=","&l=","&t="); |
|
374 | 370 |
String country = scores.getCountry(); |
375 | 371 |
long epoch = System.currentTimeMillis(); |
376 | 372 |
String salt = "cuboid"; |
377 | 373 |
|
378 | 374 |
String url1="https://distorted.org/magic/cgi-bin/submit.cgi"; |
379 | 375 |
String url2 = "n="+name+"&v="+veri+"&r="+numRuns+"&p="+numPlay+"&i="+deviceID+"&e="+mVersion+"d"; |
380 |
url2 += "&o="+objlist+"&l="+lvllist+"&t="+timlist+"&c="+country+"&f="+epoch; |
|
381 |
url2 += "&oo="+ ObjectList.getObjectList()+"&min=0&max="+MAX_LEVEL+"&lo="+MAX_PLACES; |
|
382 |
url2 += "&h="+computeHash( url2, salt.getBytes() ); |
|
376 |
url2 += reclist+"&c="+country+"&f="+epoch+"&oo="+ ObjectList.getObjectList(); |
|
377 |
url2 += "&min=0&max="+MAX_LEVEL+"&lo="+MAX_PLACES+"&h="+computeHash( url2, salt.getBytes() ); |
|
383 | 378 |
|
384 | 379 |
return url1 + "?" + url2; |
385 | 380 |
} |
... | ... | |
479 | 474 |
} |
480 | 475 |
catch (PackageManager.NameNotFoundException e) |
481 | 476 |
{ |
482 |
mVersion = "1.1.2";
|
|
477 |
mVersion = "0.9.2";
|
|
483 | 478 |
} |
484 | 479 |
|
485 | 480 |
Thread networkThrd = new Thread(this); |
Also available in: Unified diff
Make the RubikScores class thread-safe.