[SOLVED] WebGL version not working but Windows version does

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
gg
Posts: 89
Joined: 19 Sep 2010, 21:16
Contact:

[SOLVED] WebGL version not working but Windows version does

Postby gg » 29 Jan 2017, 20:43

I have Unity 5.5.1f1 64bit
Downloaded the examples and set up the Tris source code in Unity and Eclipse.

From Eclipse I exported the extension name to LobbyExtension.jar
In Unity, I changed LobbyController.cs
from
private const string EXTENSION_ID = "tris";
to
private const string EXTENSION_ID = "LobbyExtension";

- I built to Windows and it works. (So the above change didn't break anything)
- I then built to WebGL (Target: Windows; Architecture: x84_64), and it cannot connect to SFS2X. It's asking if the server is even connected. It cannot connect to SFS2X even when running from Unity, not only from the html file
- I built to Windows again, and it works.

How can I make it run in WebGL?

Server.xml has
<socket address="0.0.0.0" port="9933" type="TCP"/>
<socket address="127.0.0.1" port="9933" type="UDP"/>

Same issue after I patched SFS2X to 12.2.2 - (not sure if my update to 12.2.2 was successful - see viewtopic.php?f=18&t=18944&p=83213#p83213 )

Extra question: is Unity supposed to take half an hour to export to WebGL?? How can I decrease that time?
Last edited by gg on 31 Jan 2017, 18:12, edited 4 times in total.
User avatar
Lapo
Site Admin
Posts: 21680
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: WebGL version not working but Windows version does

Postby Lapo » 30 Jan 2017, 09:45

Hi,
WebGL clients use websockets, you will need to turn the websocket listener in the SFS2X Admin.
Open Server Configurator > WebSockets, make sure it's active and restart the server if it wasn't.

Extra question: is Unity supposed to take half an hour to export to WebGL?? How can I decrease that time?

No, it can take a few minutes, depending on your hardware. Maybe if you have an older machine with a spinning hard drive and a small amount of RAM you could be waiting longer times... Make sure you don't have too many other open applications taking up resources.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 29 guests