Add: login error message

This commit is contained in:
2018-05-29 15:54:19 +09:00
parent a68d18df2d
commit dbc19572a7
2 changed files with 28 additions and 20 deletions
+26 -18
View File
@@ -8,29 +8,25 @@ class Login {
}
create() {
this.textStyle = { font: "bold 32px Arial", fill: "#fff", align: "right", boundsAlignH: "right", boundsAlignV: "middle" };
self = this;
sessionStorageManager.clear();
this.game.stage.backgroundColor = '#4d4d4d';
// let phaser = game.add.image(game.world.centerX, game.world.centerY, 'phaser');
// phaser.anchor.set(0.5);
// phaser.alpha = 0.1;
// game.stage.backgroundColor = '#4d4d4d';
this.textStyle = { font: "bold 32px Arial", fill: "#fff", align: "right", boundsAlignH: "right", boundsAlignV: "middle" };
let fullscreenButton = new FullscreenButton(this.game);
let textX = this.game.world.centerX - 360;
let textX = this.game.world.centerX - 320;
if(sessionStorageManager.maestroID === null)
this.makeMaestroNameText(textX, 240);
this.makeNameText(textX, 340);
this.makeEnterCodeText(textX, 400);
this.makeMaestroNameText(textX, 200);
this.makeNameText(textX, 300);
this.makeEnterCodeText(textX, 360);
this.inputTextName.canvasInput.focus();
this.makeButton();
this.makeStartButton(game.world.centerX, game.world.centerY + 100);
this.makeInfoText(0, 540);
}
makeMaestroNameText(x, y) {
@@ -44,7 +40,7 @@ class Login {
}
makeEnterCodeText(x, y) {
this.makeTextField(x, y, "생년월일 :");
this.makeTextField(x, y, "입장번호 :");
this.inputTextEnterCode = this.makeInputTypeText(x, y, "760621");
}
@@ -56,8 +52,6 @@ class Login {
}
makeInputTypeText(x, y, text) {
self = this;
let inputText = new InputTypeText(x + 420, y);
inputText.anchor.set(0.5);
inputText.canvasInput.value('');
@@ -73,14 +67,24 @@ class Login {
return inputText;
}
makeButton() {
makeStartButton(x, y) {
let setting = new RoundRectButtonSetting(200, 100);
setting.fontStyle.fontWeight = "bold";
let startButton = new RoundRectButton(setting, "시작", this.startMenu);
startButton.move(game.world.centerX, game.world.centerY + 140);
startButton.move(x, y);
}
makeInfoText(x, y) {
var timerTextStyle = { font: "30px Arial", fill: "#faa", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
this.infoText = game.add.text(0, 0, "", timerTextStyle)
.setTextBounds(x, y, game.world.width, 200);
// .setShadow(1, 1, 'rgba(0, 0, 0, 0.5)', 2);
this.infoText.stroke = "#333";
this.infoText.strokeThickness = 3;
}
startMenu() {
let maestroName = self.inputTextMaestroName.canvasInput._value;
sessionStorageManager.playerName = self.inputTextName.canvasInput._value;
@@ -109,6 +113,10 @@ class Login {
// show retry message
console.log('login failed, jsonData : ' + JSON.stringify(jsonData));
if(jsonData["ERROR"] !== null) {
self.infoText.text = jsonData["ERROR"];
}
}
}
+2 -2
View File
@@ -20,13 +20,13 @@ include "./../setup/connect_db.php";
$maestro_id = get_maestro_id($maestro_name);
if($maestro_id == null) {
send_error_message($replyJSON, "no maestro id");
send_error_message($replyJSON, "입력한 마에스트로 계정이 없습니다");
exit;
}
$replyJSON = get_login_data($maestro_id, $name, $enterCode);
if($replyJSON["UserID"] == null) {
send_error_message($replyJSON, "invalid username and entercode");
send_error_message($replyJSON, "입력한 이름/입장번호와 일치하는 계정이 없습니다");
exit;
}