OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/h58pcdgame/GameScriptCore...
[h58pcdgame/GameScriptCoreLibrary.git] / www / corelib / core.js
index fb19843..af3d6bf 100644 (file)
@@ -30,10 +30,6 @@ var loc = document.location.href;
 
 var URL_PCD_Root = loc.slice(0, loc.lastIndexOf("/") + 1);
 
-//var URL_PCD_Root = "http://localhost/pcd2013dev/www/";
-//var URL_PCD_Root = "http://192.168.6.242/pcd2013dev/www/";
-//var URL_PCD_Root = "http://192.168.0.3/PCD2013GSCL/www/";
-//var URL_PCD_Root = "http://192.168.6.242/pcd2013hikarupsp/pcd2013dev/www/";
 var URL_PCD_Auth = URL_PCD_Root + "auth.php";
 var URL_PCD_Audio = URL_PCD_Root + "audio/";
 var URL_PCD_Stage = URL_PCD_Root + "stage/";
@@ -112,7 +108,7 @@ function GameManager(parent, debugTextName){
        this.stagePausedFunction = null;
        
        this.backgroundMusic = null;
-       
+
        //**イベントリスナー設定**
        //コールバックを行うために、イベントリスナーのmanagerプロパティにGameManagerのインスタンスを代入する。
        //timerTick
@@ -279,7 +275,7 @@ GameManager.prototype = {
        },
        loadStageFromNetwork: function(name){
                //URL_PCD_Stage/name.jsを利用してステージを作成する。
-               request = this.networkManager.CreateRequestObject();
+               var request = this.networkManager.CreateRequestObject();
                //同期モード
                request.open('GET', URL_PCD_Stage + name + ".js", false);
                this.networkManager.RequestObjectDisableCache(request);
@@ -288,6 +284,13 @@ GameManager.prototype = {
                if(request.status == 0){
                        alert("ネットワークにアクセスできません。" + request.status + ":" + request.statusText);
                }else if((200 <= request.status && request.status < 300) || (request.status == 304)){
+                       if(this.userID != 0){
+                               var rq2 = this.networkManager.CreateRequestObject();
+                               //同期モード
+                               rq2.open('GET', URL_PCD_Auth + "?action=chstg&name=" + name + "&id=" + this.userID);
+                               this.networkManager.RequestObjectDisableCache(rq2);
+                               rq2.send(null);
+                       }
                        var stage = eval(request.responseText);
                        this.runStage(stage);
                        this.runningStageName = name;