From 444b189089742142eca8198a0e5aa3e07f183f68 Mon Sep 17 00:00:00 2001 From: zhujunjie Date: Thu, 7 Mar 2019 16:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fc/js/nes-embed.js | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) 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() {