Fix: debug mode, release mode

This commit is contained in:
2022-04-24 08:11:48 +09:00
parent 0245772031
commit ff38a7bac3
2 changed files with 266 additions and 84 deletions
+133 -42
View File
@@ -1,10 +1,21 @@
var LANGUAGE_KOREAN = "korean"; var LANGUAGE_KOREAN = "korean";
var LANGUAGE_ENGLISH = "english"; var LANGUAGE_ENGLISH = "english";
var MODE_RELEASE = "release"; var MODE_RELEASE = "release";
var MODE_DEBUG = "debug"; var MODE_DEBUG = "debug";
var runMode = MODE_DEBUG; var runMode = MODE_DEBUG;
function isTddMode() {
// console.log("debug mode ? " + runMode);
if(typeof(tddMode) === "undefined")
return false;
if(tddMode == true)
return true;
return false;
}
function isDebugMode() { function isDebugMode() {
// console.log("debug mode ? " + runMode); // console.log("debug mode ? " + runMode);
return runMode == MODE_DEBUG ? true : false; return runMode == MODE_DEBUG ? true : false;
@@ -21,88 +32,168 @@ var GAME_SCREEN_SIZE = { x: 1024, y: 768 }
var sessionStorageManager = new SessionStorageManager(); var sessionStorageManager = new SessionStorageManager();
{ {
// if(isDebugMode()) { if(isTddMode()) {
// sessionStorageManager.playerName = "부현율"; console.log("Running in TDD mode");
// sessionStorageManager.playerID = 8; } else {
// sessionStorageManager.playingAppID = 101; if(isDebugMode()) {
// sessionStorageManager.playingAppName = "space_invaders"; printSessionStorage();
// sessionStorageManager.score = 1000; }
// sessionStorageManager.highScore = 2000;
// }
console.log("maestroID : " + sessionStorageManager.maestroID); if(sessionStorageManager.getMaestroID() === null && !isLogin()) {
console.log("maestroAccountType : " + sessionStorageManager.maestroAccountType); goLogin();
console.log("playerName : " + sessionStorageManager.playerName); }
console.log("playerID : " + sessionStorageManager.playerID);
console.log("playerAccountType : " + sessionStorageManager.playerAccountType);
console.log("playingAppID : " + sessionStorageManager.playingAppID);
console.log("playingAppName : " + sessionStorageManager.playingAppName);
console.log("playingAppKoreanName : " + sessionStorageManager.playingAppKoreanName);
console.log("record : " + sessionStorageManager.record);
console.log("bestRecord : " + sessionStorageManager.bestRecord);
if(sessionStorageManager.maestroID === null && !isLogin()) {
goLogin();
} }
} }
function printSessionStorage() {
console.log("maestroName : " + sessionStorageManager.getMaestroName());
console.log("maestroID : " + sessionStorageManager.getMaestroID());
console.log("maestroAccountType : " + sessionStorageManager.getMaestroAccountType());
console.log("playerName : " + sessionStorageManager.getPlayerName());
console.log("playerID : " + sessionStorageManager.getPlayerID());
console.log("playerAccountType : " + sessionStorageManager.getPlayerAccountType());
console.log("playingAppID : " + sessionStorageManager.getPlayingAppID());
console.log("playingAppName : " + sessionStorageManager.getPlayingAppName());
console.log("playingAppKoreanName : " + sessionStorageManager.getPlayingAppKoreanName());
console.log("record : " + sessionStorageManager.getRecord());
console.log("appHighestRecord : " + sessionStorageManager.getAppHighestRecord());
console.log("writingID : " + sessionStorageManager.getWritingID());
console.log("appGroup : " + sessionStorageManager.getAppGroup());
console.log("language : " + sessionStorageManager.getLanguage());
}
function isLogin() { function isLogin() {
var filename = location.pathname.substring(location.pathname.lastIndexOf("/") + 1); var filename = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
// console.log(filename);
return filename === "login.html" ? true : false; if(filename === "login.html")
return true;
else if(filename === "license_timer.html")
return true;
return false;
} }
function goLogin() { function goLogin() {
location.href = "login.html"; location.href = "login.html";
} }
function isTypingGame() { function isTypingGameApp() {
if(sessionStorageManager.playingAppName === null) if(sessionStorageManager.getPlayingAppName() == null)
return false; return false;
if(sessionStorageManager.playingAppName.indexOf("typing") < 0) if(sessionStorageManager.getPlayingAppID === 200)
return true;
if(sessionStorageManager.getPlayingAppID < 50 || sessionStorageManager.getPlayingAppID > 100)
return false; return false;
return true; return true;
} }
function isTypingPracticeStage() {
var appName = sessionStorageManager.playingAppName;
if(appName.indexOf("practice_") > -1) function isMouseGameApp() {
if(sessionStorageManager.getPlayingAppName() == null)
return false;
if(sessionStorageManager.getPlayingAppID > 100)
return true; return true;
return false; return false;
} }
function isTypingTestStage() {
var appName = sessionStorageManager.playingAppName;
if(appName.indexOf("test_") > -1) function isTypingPracticeApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("practice_") > -1)
return true; return true;
return false; return false;
} }
function isTypingWordStage() { function isTypingTestApp() {
var appName = sessionStorageManager.playingAppName; if(sessionStorageManager.getPlayingAppName().indexOf("test_") > -1)
if((isTypingPracticeStage() || isTypingTestStage()) && appName.indexOf("_word") > -1)
return true; return true;
return false; return false;
} }
function isTypingSentenceStage() { function isTypingExamApp() {
var appName = sessionStorageManager.playingAppName; if(sessionStorageManager.getPlayingAppName() == "typing_exam")
if((isTypingPracticeStage() || isTypingTestStage()) && appName.indexOf("_sentence") > -1)
return true; return true;
return false; return false;
} }
function isEnglishTypingApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("english") > -1)
return true;
return false;
}
function isKoreanTypingApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("korean") > -1)
return true;
return false;
}
function isTypingWordApp() {
var appName = sessionStorageManager.getPlayingAppName();
if(appName.indexOf("_word") > -1)
return true;
// if((isTypingPracticeApp() || isTypingTestApp()) && appName.indexOf("_word") > -1)
// return true;
return false;
}
function isTypingSentenceApp() {
var appName = sessionStorageManager.getPlayingAppName();
if(appName.indexOf("_sentence") > -1)
return true;
// if((isTypingPracticeApp() || isTypingTestApp()) && appName.indexOf("_sentence") > -1)
// return true;
return false;
}
function isExperiencePlayerAccount() {
if(sessionStorageManager.getMaestroAccountType() == 100)
return true;
return false;
}
function isExperienceMaestroAccount() {
if(sessionStorageManager.getMaestroAccountType() == 101)
return true;
return false;
}
function getGameAppName() {
var appName = sessionStorageManager.getPlayingAppName();
if(isTypingPracticeApp())
return "typing_practice";
else if(isTypingTestApp())
return "typing_test";
else if(isTypingGameApp()) {
if(isKoreanTypingApp())
return appName.substring("typing_korean_".length);
else if(isEnglishTypingApp())
return appName.substring("typing_english_".length);
}
return appName;
}
var textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" }; var textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
+133 -42
View File
@@ -1,10 +1,21 @@
var LANGUAGE_KOREAN = "korean"; var LANGUAGE_KOREAN = "korean";
var LANGUAGE_ENGLISH = "english"; var LANGUAGE_ENGLISH = "english";
var MODE_RELEASE = "release"; var MODE_RELEASE = "release";
var MODE_DEBUG = "debug"; var MODE_DEBUG = "debug";
var runMode = MODE_RELEASE; var runMode = MODE_RELEASE;
function isTddMode() {
// console.log("debug mode ? " + runMode);
if(typeof(tddMode) === "undefined")
return false;
if(tddMode == true)
return true;
return false;
}
function isDebugMode() { function isDebugMode() {
// console.log("debug mode ? " + runMode); // console.log("debug mode ? " + runMode);
return runMode == MODE_DEBUG ? true : false; return runMode == MODE_DEBUG ? true : false;
@@ -21,88 +32,168 @@ var GAME_SCREEN_SIZE = { x: 1024, y: 768 }
var sessionStorageManager = new SessionStorageManager(); var sessionStorageManager = new SessionStorageManager();
{ {
// if(isDebugMode()) { if(isTddMode()) {
// sessionStorageManager.playerName = "부현율"; console.log("Running in TDD mode");
// sessionStorageManager.playerID = 8; } else {
// sessionStorageManager.playingAppID = 101; if(isDebugMode()) {
// sessionStorageManager.playingAppName = "space_invaders"; printSessionStorage();
// sessionStorageManager.score = 1000; }
// sessionStorageManager.highScore = 2000;
// }
console.log("maestroID : " + sessionStorageManager.maestroID); if(sessionStorageManager.getMaestroID() === null && !isLogin()) {
console.log("maestroAccountType : " + sessionStorageManager.maestroAccountType); goLogin();
console.log("playerName : " + sessionStorageManager.playerName); }
console.log("playerID : " + sessionStorageManager.playerID);
console.log("playerAccountType : " + sessionStorageManager.playerAccountType);
console.log("playingAppID : " + sessionStorageManager.playingAppID);
console.log("playingAppName : " + sessionStorageManager.playingAppName);
console.log("playingAppKoreanName : " + sessionStorageManager.playingAppKoreanName);
console.log("record : " + sessionStorageManager.record);
console.log("bestRecord : " + sessionStorageManager.bestRecord);
if(sessionStorageManager.maestroID === null && !isLogin()) {
goLogin();
} }
} }
function printSessionStorage() {
console.log("maestroName : " + sessionStorageManager.getMaestroName());
console.log("maestroID : " + sessionStorageManager.getMaestroID());
console.log("maestroAccountType : " + sessionStorageManager.getMaestroAccountType());
console.log("playerName : " + sessionStorageManager.getPlayerName());
console.log("playerID : " + sessionStorageManager.getPlayerID());
console.log("playerAccountType : " + sessionStorageManager.getPlayerAccountType());
console.log("playingAppID : " + sessionStorageManager.getPlayingAppID());
console.log("playingAppName : " + sessionStorageManager.getPlayingAppName());
console.log("playingAppKoreanName : " + sessionStorageManager.getPlayingAppKoreanName());
console.log("record : " + sessionStorageManager.getRecord());
console.log("appHighestRecord : " + sessionStorageManager.getAppHighestRecord());
console.log("writingID : " + sessionStorageManager.getWritingID());
console.log("appGroup : " + sessionStorageManager.getAppGroup());
console.log("language : " + sessionStorageManager.getLanguage());
}
function isLogin() { function isLogin() {
var filename = location.pathname.substring(location.pathname.lastIndexOf("/") + 1); var filename = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
// console.log(filename);
return filename === "login.html" ? true : false; if(filename === "login.html")
return true;
else if(filename === "license_timer.html")
return true;
return false;
} }
function goLogin() { function goLogin() {
location.href = "login.html"; location.href = "login.html";
} }
function isTypingGame() { function isTypingGameApp() {
if(sessionStorageManager.playingAppName === null) if(sessionStorageManager.getPlayingAppName() == null)
return false; return false;
if(sessionStorageManager.playingAppName.indexOf("typing") < 0) if(sessionStorageManager.getPlayingAppID === 200)
return true;
if(sessionStorageManager.getPlayingAppID < 50 || sessionStorageManager.getPlayingAppID > 100)
return false; return false;
return true; return true;
} }
function isTypingPracticeStage() {
var appName = sessionStorageManager.playingAppName;
if(appName.indexOf("practice_") > -1) function isMouseGameApp() {
if(sessionStorageManager.getPlayingAppName() == null)
return false;
if(sessionStorageManager.getPlayingAppID > 100)
return true; return true;
return false; return false;
} }
function isTypingTestStage() {
var appName = sessionStorageManager.playingAppName;
if(appName.indexOf("test_") > -1) function isTypingPracticeApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("practice_") > -1)
return true; return true;
return false; return false;
} }
function isTypingWordStage() { function isTypingTestApp() {
var appName = sessionStorageManager.playingAppName; if(sessionStorageManager.getPlayingAppName().indexOf("test_") > -1)
if((isTypingPracticeStage() || isTypingTestStage()) && appName.indexOf("_word") > -1)
return true; return true;
return false; return false;
} }
function isTypingSentenceStage() { function isTypingExamApp() {
var appName = sessionStorageManager.playingAppName; if(sessionStorageManager.getPlayingAppName() == "typing_exam")
if((isTypingPracticeStage() || isTypingTestStage()) && appName.indexOf("_sentence") > -1)
return true; return true;
return false; return false;
} }
function isEnglishTypingApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("english") > -1)
return true;
return false;
}
function isKoreanTypingApp() {
if(sessionStorageManager.getPlayingAppName().indexOf("korean") > -1)
return true;
return false;
}
function isTypingWordApp() {
var appName = sessionStorageManager.getPlayingAppName();
if(appName.indexOf("_word") > -1)
return true;
// if((isTypingPracticeApp() || isTypingTestApp()) && appName.indexOf("_word") > -1)
// return true;
return false;
}
function isTypingSentenceApp() {
var appName = sessionStorageManager.getPlayingAppName();
if(appName.indexOf("_sentence") > -1)
return true;
// if((isTypingPracticeApp() || isTypingTestApp()) && appName.indexOf("_sentence") > -1)
// return true;
return false;
}
function isExperiencePlayerAccount() {
if(sessionStorageManager.getMaestroAccountType() == 100)
return true;
return false;
}
function isExperienceMaestroAccount() {
if(sessionStorageManager.getMaestroAccountType() == 101)
return true;
return false;
}
function getGameAppName() {
var appName = sessionStorageManager.getPlayingAppName();
if(isTypingPracticeApp())
return "typing_practice";
else if(isTypingTestApp())
return "typing_test";
else if(isTypingGameApp()) {
if(isKoreanTypingApp())
return appName.substring("typing_korean_".length);
else if(isEnglishTypingApp())
return appName.substring("typing_english_".length);
}
return appName;
}
var textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" }; var textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };