Add: maestro_info
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
class MaestroInfo {
|
||||
|
||||
constructor() {
|
||||
this.maestroID = sessionStorage.getItem("maestroID");
|
||||
this.maestroName = "";
|
||||
this.accountType = 0;
|
||||
this.playerCount = 0;
|
||||
}
|
||||
|
||||
loadMaestroInfo(onSuccess, onFail) {
|
||||
let self = this;
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/maestro/maestro_info.php",
|
||||
"maestro_id=" + this.maestroID,
|
||||
|
||||
(jsonData) => {
|
||||
self.maestroName = jsonData["name"];
|
||||
self.accountType = jsonData["accountType"];
|
||||
self.playerCount = jsonData["playerCount"];
|
||||
|
||||
onSuccess();
|
||||
},
|
||||
|
||||
(errorMessage, errorCode) => {
|
||||
onFail(errorMessage, errorCode);
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
getMaxPlayerCount() {
|
||||
switch(this.accountType) {
|
||||
case 1:
|
||||
return 20;
|
||||
case 2:
|
||||
return 50;
|
||||
case 3:
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
|
||||
getRegisteredPlayerCount() {
|
||||
return this.playerCount;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user