Fix: DB user column -> player
This commit is contained in:
@@ -6,7 +6,7 @@ class DBConnectManager {
|
||||
this.phpPath = this.getPHPPath(this.directoryName);
|
||||
|
||||
this.maestroID = 0;
|
||||
this.playerUserID = 0;
|
||||
this.playerID = 0;
|
||||
this.appName = "";
|
||||
this.dateAndTime = null;
|
||||
}
|
||||
@@ -15,8 +15,8 @@ class DBConnectManager {
|
||||
this.maestroID = maestroID;
|
||||
}
|
||||
|
||||
setPlayerID(userID) {
|
||||
this.playerUserID = userID;
|
||||
setPlayerID(playerID) {
|
||||
this.playerID = playerID;
|
||||
}
|
||||
|
||||
setAppName(appName) {
|
||||
@@ -47,21 +47,21 @@ class DBConnectManager {
|
||||
return "../";
|
||||
}
|
||||
|
||||
requestCheckUserLogin(maestroName, userName, enterCode, onSucceededListener, onFailedListener) {
|
||||
requestCheckPlayerLogin(maestroName, playerName, enterCode, onSucceededListener, onFailedListener) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", this.phpPath + "server/user/login.php", true);
|
||||
xhr.open("POST", this.phpPath + "server/player/login.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["UserID"] != null)
|
||||
if(replyJSON != null && replyJSON["PlayerID"] != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
}
|
||||
};
|
||||
xhr.send("maestro_name=" + maestroName + "&name=" + userName + "&enter_code=" + enterCode);
|
||||
xhr.send("maestro_name=" + maestroName + "&name=" + playerName + "&enter_code=" + enterCode);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -182,7 +182,7 @@ class DBConnectManager {
|
||||
};
|
||||
let params = "MaestroID=" + sessionStorageManager.maestroID
|
||||
+ "&AppID=" + sessionStorageManager.playingAppID
|
||||
+ "&UserID=" + sessionStorageManager.playerUserID
|
||||
+ "&PlayerID=" + sessionStorageManager.playerID
|
||||
+ "&Date=" + date;
|
||||
xhr.send(params);
|
||||
}
|
||||
@@ -321,7 +321,7 @@ class DBConnectManager {
|
||||
for(let i = 0; i < count; i++) {
|
||||
let record = new RankingRecord(
|
||||
i + 1,
|
||||
replyJSON[i]["UserID"],
|
||||
replyJSON[i]["PlayerID"],
|
||||
replyJSON[i]["Name"],
|
||||
replyJSON[i]["HighScore"]
|
||||
);
|
||||
@@ -342,7 +342,7 @@ class DBConnectManager {
|
||||
if(xhr.readyState == 4 && xhr.status == 200) {
|
||||
let replyJSON = JSON.parse(xhr.responseText);
|
||||
|
||||
if(replyJSON != null && replyJSON["UserID"] != null)
|
||||
if(replyJSON != null && replyJSON["PlayerID"] != null)
|
||||
onSucceededListener(replyJSON);
|
||||
else
|
||||
onFailedListener(replyJSON);
|
||||
@@ -369,19 +369,19 @@ class DBConnectManager {
|
||||
xhr.send("AppID=" + appID);
|
||||
}
|
||||
|
||||
updateTodayBestRecord(maestroID, userID, appID, record) {
|
||||
updateTodayBestRecord(maestroID, playerID, 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
|
||||
+ "&PlayerID=" + playerID
|
||||
+ "&AppID=" + appID
|
||||
+ "&BestRecord=" + record
|
||||
);
|
||||
}
|
||||
|
||||
requestTodayBestRecord(maestroID, userID, appID, onSucceededListener, onFailedListener) {
|
||||
requestTodayBestRecord(maestroID, playerID, 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");
|
||||
@@ -397,7 +397,7 @@ class DBConnectManager {
|
||||
};
|
||||
xhr.send(
|
||||
"MaestroID=" + maestroID
|
||||
+ "&UserID=" + userID
|
||||
+ "&PlayerID=" + playerID
|
||||
+ "&AppID=" + appID
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user