diff --git a/fc/js/nes-embed.js b/fc/js/nes-embed.js index ec8ab0b..72f4f96 100644 --- a/fc/js/nes-embed.js +++ b/fc/js/nes-embed.js @@ -155,13 +155,11 @@ window.vm = { }; - -window.onload = function(){ +function startGame(){ var gameId = getParameter("id") - var path = "http://h5games-al.kingsome.cn/emulator-static/roms/" + gameId + ".nes" - // var path = "http://192.168.100.232:7008/roms/" + gameId + ".nes" - nes_load_url("screen", path) - vm.initCtrl() + var path = "../roms/" + gameId + ".nes" + nes_load_url("screen", path) + vm.initCtrl() if(netmode){ var roomId = getParameter("roomId") @@ -199,9 +197,36 @@ window.onload = function(){ },1000/60) } +} +function checkSession_id(res){ + try{ + if(JSON.parse(res.target.response).errcode==0){ + startGame(); + } + }catch(e){} +} +window.onload = function(){ + var account_id = getParameter("account_id") + var session_id = getParameter("session_id") + var url; + if(getParameter("version")==="product"){ + url = "https://login.kingsome.cn/webapp/index.php?c=Login&a=sessionAuth" + } + else{ + url = "https://login-test.kingsome.cn/webapp/index.php?c=Login&a=sessionAuth" + } + url += "&account_id="; + url += account_id; + url += "&session_id="; + url += session_id; + var ajax = new XMLHttpRequest(); + ajax.onload = checkSession_id; + ajax.open("GET", url, true); + ajax.send(null); } + var script_processor=null var audio_ctx = null function initAudioEvent() {