Fix: DB user column -> player

This commit is contained in:
2018-07-04 21:54:29 +09:00
parent 81860d6800
commit dc87390b8c
26 changed files with 132 additions and 132 deletions
+14 -14
View File
@@ -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
);
}
+7 -7
View File
@@ -1,9 +1,9 @@
class RankingRecord {
constructor(rank, userID, userName, bestRecord) {
constructor(rank, playerID, playerName, bestRecord) {
this.rank = rank;
this.userID = userID;
this.userName = userName;
this.playerID = playerID;
this.playerName = playerName;
this.bestRecord = bestRecord;
}
}
@@ -36,12 +36,12 @@ class RankingRecordManager {
return this.rankingRecords[index].rank;
}
getUserIDAt(index) {
return this.rankingRecords[index].userID;
getPlayerIDAt(index) {
return this.rankingRecords[index].playerID;
}
getUserNameAt(index) {
return this.rankingRecords[index].userName;
getPlayerNameAt(index) {
return this.rankingRecords[index].playerName;
}
getBestRecordAt(index) {
+6 -6
View File
@@ -11,7 +11,7 @@ class SessionStorageManager {
return sessionStorage.removeItem(key);
}
// maestro user ID
// maestro ID
set maestroID(value) {
sessionStorage.setItem("maestroID", value);
}
@@ -27,12 +27,12 @@ class SessionStorageManager {
return sessionStorage.getItem("playerName");
}
// player user ID
set playerUserID(value) {
sessionStorage.setItem("playerUserID", value);
// player player ID
set playerID(value) {
sessionStorage.setItem("playerID", value);
}
get playerUserID() {
return sessionStorage.getItem("playerUserID");
get playerID() {
return sessionStorage.getItem("playerID");
}
// playing app id