Add: requestTodayBestRecord, updateTodayBestRecord

This commit is contained in:
2018-06-05 16:32:57 +09:00
parent 5f53360871
commit feb95d461b
6 changed files with 219 additions and 35 deletions
+33
View File
@@ -352,6 +352,39 @@ class DBConnectManager {
xhr.send("AppID=" + appID);
}
updateTodayBestRecord(maestroID, userID, appID, record) {
let xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/update_best_record.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(
"MaestroID=" + maestroID
+ "&UserID=" + userID
+ "&AppID=" + appID
+ "&BestRecord=" + record
);
}
requestTodayBestRecord(maestroID, userID, appID, onSucceededListener, onFailedListener) {
let xhr = new XMLHttpRequest();
xhr.open("POST", this.phpPath + "server/record/request_best_record.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
let replyJSON = JSON.parse(xhr.responseText);
if(replyJSON != null && replyJSON["BestRecord"] != null)
onSucceededListener(replyJSON);
else
onFailedListener(replyJSON);
}
};
xhr.send(
"MaestroID=" + maestroID
+ "&UserID=" + userID
+ "&AppID=" + appID
);
}
loadTempPlayerHistory(historyRecordManager) {