没有Windows Azure的为我的HTML5游戏? [英] No windows azure for my html5 game?

查看:142
本文介绍了没有Windows Azure的为我的HTML5游戏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本地我的电脑上我已经创造了HTML5游戏(HTML + JavaScript的)。它摆在我的桌面上,并在Chrome中运行,编辑在记事本1 HTML文件。)

我想要做的是连接到Azure的,因为我想球员得分存储在我的游戏。正如我提到的,现在运行在镀铬,局部权(文件:///path/to/file.html),但在最后,我想释放这个游戏到Windows Phone和Android,在那里我可以把它包在PhoneGap的,如果可能产生的不良放弃它,如果我真的需要它。

所以,我有我的位置在桌面上的文件,并添加了链接MobileServices.Web-1.1.0.min.js,并调用

  VAR的客户=新WindowsAzure.MobileServiceClient('https://asd123.azure-mobile.net/','富');

当我运行它,我得到的errormessage的:

 登录只有从http支持://或https://开头的URL。请在Web服务器主机页面。

现在,我可以在IIS中运行,而这从我的桌面解决这个问题,但我不知道,当我推应用到设备上,像Windows Phone将会怎么样呢?将它的工作?或者,我会得到同样的问题在那里,因为我想在手机应用的HTML5不是一个网络服务器,并在网络服务器上运行的页面?


解决方案

我不认为这是可能的。

这可能与PhoneGap的工作,如果服务器是在web环境,但它不会出现,如果一个设备(我可以想象是使用PhoneGap的首要原因)托管工作。

它看起来像下面的行code prevents的任何电话或正在从上一个设备文件系统托管code提出:

<$p$p>if(n+=\"?completion_type=\"+a+\"&completion_origin=\"+en$c$cURIComponent(u),!(u&&(u.indexOf(\"http:\")===0||u.indexOf(\"https:\")===0))){c=\"Login仅从支持HTTP://或https://开头的URL。请承载您网页在Web服务器的住宅(丙类,NULL);返回}

如果我注释掉该行仍不能正常工作 - 我怀疑,因为在网络方面,它会打开另一扇窗,你可能无法在本机Web视图做

我会很高兴,如果有人能告诉我,我错了,或者我刚刚错过了简单的东西!否则,它会为我节省了大量的时间和试图得到这个工作在移动设备上,如果已经取得了它在快速启动清无奈地说。 :)

Locally on my computer I have created a game in HTML5 (html+javascript). Its one html file that lies on my desktop and runs in Chrome and edit in notepad :).

What I want to do is to connect to Azure as I want to store player score in my game. As I mentioned it runs in chrome, locally right now (file:///path/to/file.html) but in the end I want to release this game to Windows Phone and Android, where I might wrap it in Phonegap, if possible ill drop it if I dont really need it.

So, I have my file on the desktop here and added the link to MobileServices.Web-1.1.0.min.js, and call

var client = new WindowsAzure.MobileServiceClient('https://asd123.azure-mobile.net/', 'foo');

When I run this, I get the errormessage:

Login is only supported from http:// or Https:// URLs. Please host your page in a web server.

Now, I can solve this by running this in IIS rather from my desktop, but I then wonder, what will happen when I push the application onto a device, like Windows Phone? Would it work? Or would I get the same problem there, as I guess the phone HTML5 application is not an webserver and runs the page in a webserver?

解决方案

I don't think it's possible.

It may work with phonegap if hosted in a web context but it doesn't appear to work if hosted on a device (which I should imagine is the primary reason for using phonegap).

It looks like the following line of code prevents any calls being made from code that is hosted on a devices filesystem:

if(n+="?completion_type="+a+"&completion_origin="+encodeURIComponent(u),!(u&&(u.indexOf("http:")===0||u.indexOf("https:")===0))){c="Login is only supported from http:// or https:// URLs. Please host your page in a web server.",r(c,null);return}

If I comment out this line it still doesn't work - I suspect because in a web context it opens another window which you may not be able to do in a native Web View?

I'd be delighted if somebody were able to tell me that I was wrong or that I've just missed out something simple! Otherwise it would have saved me a lot of time and frustration of trying to get this working on mobile devices if it had been made clear in the quick starts. :)

这篇关于没有Windows Azure的为我的HTML5游戏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆