运行 html 版本的 playn

发布于 2024-12-26 05:44:18 字数 813 浏览 1 评论 0原文

我已经在eclipse上安装了playn(http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse),我加载了示例程序,它们加载了文件,java运行良好。但对于 html 我右键单击showcase-html>谷歌>编译 我没有收到任何错误:

Compiling module playn.showcase.Showcase
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
Linking into C:\Users\(my path)\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
   Link succeeded
   Compilation succeeded -- 12.208s

那么 运行为> Web 应用程序

我在开发选项卡中得到一个 url:

http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997

当我运行它时

,它会挂起我的浏览器:

http://127.0.0.1:8888/Showcase.html

它在弹出窗口上显示“GWT 模块可能需要(重新编译)”并且不加载任何内容。

知道可能出了什么问题吗?

I have playn installed on eclipse (http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse), i loaded the sample programs and they load file, the java one runs fine. But for html
I right click the showcase-html > google > compile
I don't get any errors:

Compiling module playn.showcase.Showcase
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
Linking into C:\Users\(my path)\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
   Link succeeded
   Compilation succeeded -- 12.208s

then
run as > web application

I get a url in the development tab:

http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997

when I run this it hangs my browser

when I run this:

http://127.0.0.1:8888/Showcase.html

it says "GWT MODULE MAY NEED TO BE (RECOMPILED)" on a popup and loads nothing.

Any idea what might be wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇妻 2025-01-02 05:44:18

我不建议使用 Eclipse 来编译和测试 PlayN 游戏的 HTML5 后端。
使用Java后端进行开发和测试,当需要构建HTML5版本时,使用Maven命令行来构建和测试它。它要可靠得多。

但是,如果您坚持在 Eclipse 中测试 HTML5 后端,则必须小心。上面所做的是首先将 Java 代码编译为 JavaScript(通过使用 Google -> Compile),然后使用 GWT devmode 存根覆盖已编译的 JavaScript(当您使用 Run as -> Web 应用程序)。

相反,您应该使用 Google ->编译,然后展开playn-showcase-html ->目标-> playn-showcase-html-1.0-SNAPSHOT 并右键单击 Showcase.html 并选择打开方式 ->网络浏览器。编辑:您需要在网络服务器中运行生成的代码以避免跨站点脚本问题。

您永远不想使用 GWT devmode(运行方式 -> Web 应用程序)来测试游戏的 HTML5 后端,因为 GWT devmode 对于运行 HTML5 游戏等高性能代码来说速度非常慢。

I don't recommend using Eclipse to compile and test the HTML5 backend of a PlayN game.
Develop and test using the Java backend, and when the time comes to build the HTML5 version, use the Maven command line to build and test it. It is far more reliable.

However, if you insist on testing the HTML5 backend in Eclipse, you have to be careful. What you've done above is to first compile the Java code to JavaScript (by using Google -> Compile) and then overwritten the compiled JavaScript with GWT devmode stubs (when you used Run as -> Web application).

Instead, you should use Google -> Compile, and then expand playn-showcase-html -> target -> playn-showcase-html-1.0-SNAPSHOT and right click on Showcase.html and select Open With -> Web Browser. EDIT: You'll need to run the generated code in a webserver to avoid crosssite scripting issues.

You never want to use GWT devmode (Run as -> Web application) to test the HTML5 backend of your game, because GWT devmode is pathologically slow for running high-performance code like an HTML5 game.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文