Issue with Unity 5.4 and WebGL

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Issue with Unity 5.4 and WebGL

Postby iamallama » 15 Aug 2016, 03:02

I was having an issue with my build, random exceptions related to MMO variables (sorry I don't have that error anymore, but this is about something else). So I checked and was on version 1.6.3 of the client API. I updated it to the most recent 1.6.5 and now I can't even connect to the server. The error I was getting was:

Code: Select all

Error
    at jsStackTrace (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:1063:12)
    at stackTrace (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:1077:21)
    at blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:65:36
    at __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException?*)] (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2279520:2)
    at _Dictionary_2_get_Item_m3712646189_gshared (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:1733835:2)
    at _SFSRoomManager_GetRoomById_m2771480811 (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2706444:9)
    at _SFSRoomManager_ReplaceRoom_m2430389055 (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2440494:7)
    at Array._SFSRoomManager_ReplaceRoom_m1793880446 (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2882230:9)
    at __ZN21InterfaceFuncInvoker1IP12Il2CppObjectS1_E6InvokeEjP11Il2CppClassPvS1_ [undefined?_? InterfaceFuncInvoker1<Il2CppObject?S?*, undefined?1?>()] (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2528415:51)
    at _SystemController_PopulateRoomList_m139293013 (blob:http://localhost/5d004a02-5b8f-4fbd-ab42-e740290a3cde:2204386:4)


So to test, I...

  1. downloaded the windows installer for SFS2X and did a clean install (I didn't have the demo server files so this was easier)
  2. patched it to the most recent patch
  3. downloaded the Unity5 Examples and extracted out the mmo example (#7)
  4. updated the client API to 1.6.5
  5. made a development webgl build (a regular as well, but it shows cryptic errors)

And I'm getting pretty much the same error:

Code: Select all

Error
    at jsStackTrace (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1063:12)
    at stackTrace (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1077:21)
    at blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:65:36
    at __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException?*)] (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1526844:2)
    at _Dictionary_2_get_Item_m4277290203_gshared (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1232191:2)
    at _SFSRoomManager_GetRoomById_m2771480811 (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1735229:9)
    at _SFSRoomManager_ReplaceRoom_m2430389055 (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1603004:7)
    at Array._SFSRoomManager_ReplaceRoom_m1793880446 (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1823611:9)
    at __ZN21InterfaceFuncInvoker1IP12Il2CppObjectS1_E6InvokeEjP11Il2CppClassPvS1_ [undefined?_? InterfaceFuncInvoker1<Il2CppObject?S?*, undefined?1?>()] (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1649986:50)
    at _SystemController_PopulateRoomList_m139293013 (blob:http://localhost/9a88d67b-28ea-41a8-9180-ce8851765cfd:1491408:4)


The error is firing when trying to select a room. Now with my project, I was able to connect fine with client API 1.6.3 and a build from Unity 5.4, I was just getting other errors once inside the game. Now I can't even connect at all. I have no issues with windows standalone builds. Only the webgl. I didn't get to test this with a 5.3 version of Unity.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with Unity 5.4 and WebGL

Postby Lapo » 15 Aug 2016, 09:39

Hello,
just to make sure we're on the same page did you follow the "WebGL Build" instructions from our docs?
http://docs2x.smartfoxserver.com/Gettin ... harp#unity

Also did you turn on the websocket listener in SFS2X after the reinstall?

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Re: Issue with Unity 5.4 and WebGL

Postby iamallama » 15 Aug 2016, 14:35

Yes, I corrected the import settings when updating the plugin to a more recent version (that doc page needs updating as Unity has changed their import settings inspector). This is what it looks like in both projects: http://i.imgur.com/KaIkkp7.png

Here is the server log from when trying to connect. First load is me enabling WS and second is trying to connect with mmo demo project:

Code: Select all

14 Aug 2016 | 17:05:38,235 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Boot sequence starts...
14 Aug 2016 | 17:05:38,691 | INFO  | main | v2.core.SFSEventManager |     | AnonymousService-1 initialized
14 Aug 2016 | 17:05:38,718 | INFO  | main | vfs.impl.DefaultFileReplicator |     | Using "C:\Users\jonathan\AppData\Local\Temp\vfs_cache" as temporary files store.
14 Aug 2016 | 17:05:38,771 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | License loaded:

==========================================
LICENSE DETAILS
------------------------------------------
Type            : Community Edition
Max users       : 100
==========================================

14 Aug 2016 | 17:05:38,774 | INFO  | main | entities.managers.SFSBannedUserStorage |     | BanUserStorage initialized
14 Aug 2016 | 17:05:38,777 | INFO  | main | entities.managers.SFSBannedUserManager |     | No BannedUser data available, starting with a clean DB.
14 Aug 2016 | 17:05:38,784 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Protocol Type is: BINARY
14 Aug 2016 | 17:05:38,788 | INFO  | main | v2.config.DefaultConfigLoader |     | Loading: zones\BasicExamples.zone.xml
14 Aug 2016 | 17:05:38,821 | INFO  | main | entities.managers.SFSZoneManager |     |

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: BasicExamples
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

14 Aug 2016 | 17:05:38,855 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: BasicExamples }, [ Room: The Lobby, Id: 0, Group: default, isGame: false ]
14 Aug 2016 | 17:05:38,865 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: --=={{{ AdminZone }}}==-- }, [ Room: AdminRoom, Id: 1, Group: default, isGame: false ]
14 Aug 2016 | 17:05:38,876 | INFO  | main | v2.core.AdminToolService |     | AdminTool Service started
14 Aug 2016 | 17:05:39,042 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | Listening Sockets: { 0.0.0.0:9933, (Tcp) } { 127.0.0.1:9933, (Udp) }
14 Aug 2016 | 17:05:39,044 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | 
 _____ _____ _____    ___ __ __
|   __|   __|   __|  |_  |  |  |
|__   |   __|__   |  |  _|-   -|
|_____|__|  |_____|  |___|__|__|                                         
 _____ _____ _____ ____  __ __
| __  |   __|  _  |    \|  |  |
|    -|   __|     |  |  |_   _|
|__|__|_____|__|__|____/  |_| 
[ 2.11.1 ]

14 Aug 2016 | 17:05:39,047 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | SmartFoxServer 2X (2.11.1) READY!
14 Aug 2016 | 17:05:39,896 | WARN  | main | util.resource.FileResource |     | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
14 Aug 2016 | 17:05:40,001 | WARN  | main | util.resource.FileResource |     | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
14 Aug 2016 | 17:05:40,096 | WARN  | main | util.resource.FileResource |     | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
14 Aug 2016 | 17:05:41,482 | WARN  | main | util.resource.FileResource |     | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
14 Aug 2016 | 17:05:41,667 | INFO  | main | bluebox.v3.SessionFilter |     | BlueBox-2X Service (3.0.2) READY.
14 Aug 2016 | 17:05:41,689 | WARN  | main | util.resource.FileResource |     | bad alias for C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\__lib__\*: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
14 Aug 2016 | 17:06:15,791 | INFO  | Thread-0 | entities.managers.SFSZoneManager |     | BuddyList saveAll...
14 Aug 2016 | 17:06:15,791 | WARN  | SFS2X ShutdownHook | v2.core.SFSShutdownHook |     | SFS2X is shutting down. The process may take a few seconds...
14 Aug 2016 | 17:06:15,804 | INFO  | Thread-1 | entities.managers.SFSBannedUserManager |     | BanUser data saved.
14 Aug 2016 | 17:06:35,220 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Boot sequence starts...
14 Aug 2016 | 17:06:35,636 | INFO  | main | v2.core.SFSEventManager |     | AnonymousService-1 initialized
14 Aug 2016 | 17:06:35,659 | INFO  | main | vfs.impl.DefaultFileReplicator |     | Using "C:\Users\jonathan\AppData\Local\Temp\vfs_cache" as temporary files store.
14 Aug 2016 | 17:06:35,712 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | License loaded:

==========================================
LICENSE DETAILS
------------------------------------------
Type            : Community Edition
Max users       : 100
==========================================

14 Aug 2016 | 17:06:35,715 | INFO  | main | entities.managers.SFSBannedUserStorage |     | BanUserStorage initialized
14 Aug 2016 | 17:06:35,729 | INFO  | main | entities.managers.SFSBannedUserManager |     | BanUser data loaded: 0 records.
14 Aug 2016 | 17:06:35,735 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Protocol Type is: BINARY
14 Aug 2016 | 17:06:35,739 | INFO  | main | v2.config.DefaultConfigLoader |     | Loading: zones\BasicExamples.zone.xml
14 Aug 2016 | 17:06:35,763 | INFO  | main | entities.managers.SFSZoneManager |     |

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: BasicExamples
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

14 Aug 2016 | 17:06:35,795 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: BasicExamples }, [ Room: The Lobby, Id: 0, Group: default, isGame: false ]
14 Aug 2016 | 17:06:35,806 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: --=={{{ AdminZone }}}==-- }, [ Room: AdminRoom, Id: 1, Group: default, isGame: false ]
14 Aug 2016 | 17:06:35,816 | INFO  | main | v2.core.AdminToolService |     | AdminTool Service started
14 Aug 2016 | 17:06:36,713 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | Listening Sockets: { 0.0.0.0:9933, (Tcp) } { 127.0.0.1:9933, (Udp) }
14 Aug 2016 | 17:06:36,716 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | 
 _____ _____ _____    ___ __ __
|   __|   __|   __|  |_  |  |  |
|__   |   __|__   |  |  _|-   -|
|_____|__|  |_____|  |___|__|__|                                         
 _____ _____ _____ ____  __ __
| __  |   __|  _  |    \|  |  |
|    -|   __|     |  |  |_   _|
|__|__|_____|__|__|____/  |_| 
[ 2.11.1 ]

14 Aug 2016 | 17:06:36,719 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | SmartFoxServer 2X (2.11.1) READY!
14 Aug 2016 | 17:06:38,431 | INFO  | main | bluebox.v3.SessionFilter |     | BlueBox-2X Service (3.0.2) READY.
14 Aug 2016 | 17:12:30,168 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:65396 } on Server port: 9933 <---> 65396
14 Aug 2016 | 17:13:06,827 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:65396 }
14 Aug 2016 | 17:16:37,600 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 2, Type: DEFAULT, Logged: No, IP: 127.0.0.1:65422 } on Server port: 9933 <---> 65422
14 Aug 2016 | 17:16:37,644 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User login: { Zone: BasicExamples }, ( User Name: iamallama, Id: 0, Priv: 0, Sess: 127.0.0.1:65422 ) , Type: Unity
14 Aug 2016 | 17:16:37,685 | WARN  | SFSWorker:Sys:4 | v2.extensions.PythonExtension |     | Failed initializing Python Extension: pyTest -> java.io.FileNotFoundException: File 'extensions\pyTest\MMORoomDemo.py' does not exist
14 Aug 2016 | 17:16:37,687 | INFO  | SFSWorker:Sys:4 | entities.managers.SFSRoomManager |     | Room created: { Zone: BasicExamples }, [ MMORoom: UnityMMODemo, Id: 2, Group: default, AOI: (25.0, 1.0, 25.0) ]
14 Aug 2016 | 17:16:37,689 | INFO  | SFSWorker:Sys:4 | v2.api.SFSApi |     | Room joined: [ MMORoom: UnityMMODemo, Id: 2, Group: default, AOI: (25.0, 1.0, 25.0) ], { Zone: BasicExamples }, ( User Name: iamallama, Id: 0, Priv: 0, Sess: 127.0.0.1:65422 ) , asSpect: false
14 Aug 2016 | 17:16:53,381 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 2, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:65422 }
14 Aug 2016 | 17:16:53,383 | WARN  | SFSWorker:Sys:4 | v2.extensions.PythonExtension |     | Failed destroying Python Extension: pyTest -> java.lang.NullPointerException
14 Aug 2016 | 17:16:53,384 | INFO  | SFSWorker:Sys:4 | entities.managers.SFSRoomManager |     | Room removed: { Zone: BasicExamples }, [ MMORoom: UnityMMODemo, Id: 2, Group: default, AOI: (25.0, 1.0, 25.0) ], Duration: 15705
14 Aug 2016 | 17:16:53,385 | INFO  | SFSWorker:Sys:4 | v2.api.SFSApi |     | User disconnected: { Zone: BasicExamples }, ( User Name: iamallama, Id: 0, Priv: 0, Sess: 127.0.0.1:65422 ) , SessionLen: 15742, Type: Unity
14 Aug 2016 | 17:28:20,527 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 3, Type: DEFAULT, Logged: No, IP: 127.0.0.1:65534 } on Server port: 9933 <---> 65534
14 Aug 2016 | 17:28:20,540 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 3, Type: DEFAULT, Logged: No, IP: 127.0.0.1:65534 }
14 Aug 2016 | 17:28:20,562 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 4, Type: DEFAULT, Logged: No, IP: 127.0.0.1:49152 } on Server port: 9933 <---> 49152
14 Aug 2016 | 17:28:20,583 | INFO  | SFSWorker:Ext:2 | v2.api.SFSApi |     | User login: { Zone: --=={{{ AdminZone }}}==-- }, ( User Name: sfsadmin, Id: 1, Priv: 0, Sess: 127.0.0.1:49152 ) , Type: Flash PlugIn:WIN 22,0,0,209
14 Aug 2016 | 17:28:20,587 | INFO  | SFSWorker:Ext:2 | v2.api.SFSApi |     | Room joined: [ Room: AdminRoom, Id: 1, Group: default, isGame: false ], { Zone: --=={{{ AdminZone }}}==-- }, ( User Name: sfsadmin, Id: 1, Priv: 0, Sess: 127.0.0.1:49152 ) , asSpect: false
14 Aug 2016 | 17:29:15,228 | INFO  | SocketReader | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 4, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:49152 }
14 Aug 2016 | 17:29:15,232 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: --=={{{ AdminZone }}}==-- }, ( User Name: sfsadmin, Id: 1, Priv: 0, Sess: 127.0.0.1:49152 ) , SessionLen: 54649, Type: Flash PlugIn:WIN 22,0,0,209
14 Aug 2016 | 17:29:16,177 | INFO  | Thread-1 | entities.managers.SFSZoneManager |     | BuddyList saveAll...
14 Aug 2016 | 17:29:16,177 | WARN  | SFS2X ShutdownHook | v2.core.SFSShutdownHook |     | SFS2X is shutting down. The process may take a few seconds...
14 Aug 2016 | 17:29:16,180 | INFO  | Thread-2 | entities.managers.SFSBannedUserManager |     | BanUser data saved.
14 Aug 2016 | 17:29:19,918 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Boot sequence starts...
14 Aug 2016 | 17:29:20,294 | INFO  | main | v2.core.SFSEventManager |     | AnonymousService-1 initialized
14 Aug 2016 | 17:29:20,319 | INFO  | main | vfs.impl.DefaultFileReplicator |     | Using "C:\Users\jonathan\AppData\Local\Temp\vfs_cache" as temporary files store.
14 Aug 2016 | 17:29:20,373 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | License loaded:

==========================================
LICENSE DETAILS
------------------------------------------
Type            : Community Edition
Max users       : 100
==========================================

14 Aug 2016 | 17:29:20,377 | INFO  | main | entities.managers.SFSBannedUserStorage |     | BanUserStorage initialized
14 Aug 2016 | 17:29:20,407 | INFO  | main | entities.managers.SFSBannedUserManager |     | BanUser data loaded: 0 records.
14 Aug 2016 | 17:29:20,414 | INFO  | main | smartfoxserver.v2.SmartFoxServer |     | Protocol Type is: BINARY
14 Aug 2016 | 17:29:20,418 | INFO  | main | v2.config.DefaultConfigLoader |     | Loading: zones\BasicExamples.zone.xml
14 Aug 2016 | 17:29:20,443 | INFO  | main | entities.managers.SFSZoneManager |     |

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 >> Zone: BasicExamples
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

14 Aug 2016 | 17:29:20,476 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: BasicExamples }, [ Room: The Lobby, Id: 0, Group: default, isGame: false ]
14 Aug 2016 | 17:29:20,485 | INFO  | main | entities.managers.SFSRoomManager |     | Room created: { Zone: --=={{{ AdminZone }}}==-- }, [ Room: AdminRoom, Id: 1, Group: default, isGame: false ]
14 Aug 2016 | 17:29:20,495 | INFO  | main | v2.core.AdminToolService |     | AdminTool Service started
14 Aug 2016 | 17:29:20,717 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | Listening Sockets: { 0.0.0.0:9933, (Tcp) } { 127.0.0.1:9933, (Udp) } { 127.0.0.1:8888 (WebSocket) }
14 Aug 2016 | 17:29:20,720 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | 
 _____ _____ _____    ___ __ __
|   __|   __|   __|  |_  |  |  |
|__   |   __|__   |  |  _|-   -|
|_____|__|  |_____|  |___|__|__|                                         
 _____ _____ _____ ____  __ __
| __  |   __|  _  |    \|  |  |
|    -|   __|     |  |  |_   _|
|__|__|_____|__|__|____/  |_| 
[ 2.11.1 ]

14 Aug 2016 | 17:29:20,724 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | SmartFoxServer 2X (2.11.1) READY!
14 Aug 2016 | 17:29:22,224 | INFO  | main | bluebox.v3.SessionFilter |     | BlueBox-2X Service (3.0.2) READY.
14 Aug 2016 | 17:29:38,384 | INFO  | New I/O worker #1 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 1, Type: WEBSOCKET, Logged: No, IP: 127.0.0.1 } on Server port: 8888 <---> 49221
14 Aug 2016 | 17:29:38,535 | INFO  | SFSWorker:Sys:4 | v2.api.SFSApi |     | User login: { Zone: BasicExamples }, ( User Name: asdf, Id: 0, Priv: 0, Sess: 127.0.0.1:49221 ) , Type: Unity
14 Aug 2016 | 17:29:54,727 | INFO  | New I/O worker #1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 1, Type: WEBSOCKET, Logged: Yes, IP: 127.0.0.1:49221 }
14 Aug 2016 | 17:29:54,734 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: BasicExamples }, ( User Name: asdf, Id: 0, Priv: 0, Sess: 127.0.0.1:49221 ) , SessionLen: 16199, Type: Unity
14 Aug 2016 | 17:35:13,292 | INFO  | New I/O worker #2 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 2, Type: WEBSOCKET, Logged: No, IP: 127.0.0.1 } on Server port: 8888 <---> 49296
14 Aug 2016 | 17:35:13,388 | INFO  | SFSWorker:Sys:1 | v2.api.SFSApi |     | User login: { Zone: BasicExamples }, ( User Name: asdf, Id: 1, Priv: 0, Sess: 127.0.0.1:49296 ) , Type: Unity
14 Aug 2016 | 17:40:30,867 | INFO  | New I/O worker #2 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 2, Type: WEBSOCKET, Logged: Yes, IP: 127.0.0.1:49296 }
14 Aug 2016 | 17:40:30,867 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Terminated idle logged-in session: { Id: 2, Type: WEBSOCKET, Logged: Yes, IP: 127.0.0.1:49296 }
14 Aug 2016 | 17:40:30,870 | INFO  | SFSWorker:Sys:2 | v2.api.SFSApi |     | User disconnected: { Zone: BasicExamples }, ( User Name: asdf, Id: 1, Priv: 0, Sess: 127.0.0.1:49296 ) , SessionLen: 317483, Type: Unity
14 Aug 2016 | 17:55:20,742 | INFO  | pool-1-thread-1 | util.stats.CCULoggerTask |     | CCU stats: { Zone: --=={{{ AdminZone }}}==-- }, CCU: 0/0
14 Aug 2016 | 17:55:20,744 | INFO  | pool-1-thread-1 | util.stats.CCULoggerTask |     | CCU stats: { Zone: BasicExamples }, CCU: 0/1
14 Aug 2016 | 17:55:20,745 | INFO  | pool-1-thread-1 | util.stats.CCULoggerTask |     | CCU stats: CCU: 0/1


You can see that the user gets disconnect pretty immediately (a few MS later). Also, I've been working on my personal project for a little over the last 2 years without issue, using WS for most of that and more recently WSS.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with Unity 5.4 and WebGL

Postby Lapo » 15 Aug 2016, 16:39

Thanks. Just to make sure, these tests are done with standard WS, not WSS, right?
Lapo

--

gotoAndPlay()

...addicted to flash games
iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Re: Issue with Unity 5.4 and WebGL

Postby iamallama » 15 Aug 2016, 18:15

Yes, while developing locally I typically just use WS. My production stuff is over WSS when I first started seeing the error which is why I went as basic as possible just to make sure it wasn't something I was doing. Using my code over just WS locally followed by trying the demo with the updated C# plugin and a fresh install of the server. You can even see in the logs that only ports 9933 and 8888 are listening, not 8843. My code has two separate steps where it updates the UI, once showing connected and then a second showing "initializing" which is just joining the MMO room. Before that completes is when the exception is being thrown.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Issue with Unity 5.4 and WebGL

Postby Lapo » 16 Aug 2016, 07:27

By looking at your last logs it seems that the client is connecting successfully and then pauses for many seconds without sending a login request.

Finally the server removes the connection because the session has been idle.

Are you sure you're sending the login request? Also does your client receive the CONNECTION event with success=true parameter?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Re: Issue with Unity 5.4 and WebGL

Postby iamallama » 16 Aug 2016, 17:55

This was just the MMO demo from the basic examples with an updated plugin folder and a webgl build built with Unity 5.4 (most recent version). So whatever that does is what is happening. I haven't changed any of the code. Client connects, gets connection, attempts to join a room (not sure if it is MMO room only or regular also), client side throws exception related to some of the room join methods and freezes up due to the exception. A few seconds later the server disconnects due to idle (which the client is no longer connected and so should be expected).
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Issue with Unity 5.4 and WebGL

Postby Bax » 17 Aug 2016, 16:59

We further analyzed the issue with the MMORoomDemo example and these are our findings:

1) There's a server-side bug in Room creation when setting Unity in WebGL mode: the example stops after the login button is clicked, because no response is received from the server. The login is successful, but before moving to the Game scene, a Room creation request is sent to the server, which should fire a ROOM JOIN event in return. But a bug prevents this from happening. This occurs only in WebGL mode (both Unity Editor and the browser).
The workaround to this issue is to create the Room manually using the AdminTool's Zone Monitor module, entering the same settings used in the code (name, max users, AOI, map limits).
We added a an entry in our bug tracking system and we'll release a fix in the next SFS2X version (2.12, due soon).

2) With the workaround described before, we can run the example in the Unity Editor (WebGL mode) without issues. When generating the actual build and launching it in the browser (Firefox in our tests), the example freezes and a popup appears right after the login button is clicked, claiming that an exception occurred, but it's stack trace can't be seen because exception handling has been disabled for the build.
So we enabled the exceptions (testing both "Full" and "Explicitly Thrown Exceptions Only") and... no error occurs! The example runs as expected. In other words it seems that if we disable exceptions handling, an exception occurs; if we enable it, the exception doesn't occur anymore. Great!
Of course this is something that has to do with Unity inner working and we don't have control over it. Let's hope a patch will fix this soon. In any case as a workaround keep exceptions enabled.

Let us know if you can replicate the same scenario.
Paolo Bax
The SmartFoxServer Team
iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Re: Issue with Unity 5.4 and WebGL

Postby iamallama » 17 Aug 2016, 17:28

Thanks for looking at this. The only exception related changes I made was to turn on "development build" in the build dialog within Unity with whatever default settings they have setup for that. That is how I got the stack trace above. When I get home I'll enable full exceptions and build/test to see if I get the same results.
iamallama
Posts: 7
Joined: 15 Aug 2016, 02:37

Re: Issue with Unity 5.4 and WebGL

Postby iamallama » 18 Aug 2016, 02:31

Yea, I can confirm. While I didn't make the change #1 to fix the server side error, I did test with exceptions enabled and not. Exceptions disabled gives me a message about an exception that was thrown and can't be displayed while the developer console shows a stack trace saying:

Code: Select all

Error
    at jsStackTrace (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1063:12)
    at stackTrace (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1077:21)
    at blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:65:36
    at __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException?*)] (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1526857:2)
    at _Dictionary_2_get_Item_m4277290203_gshared (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1232202:2)
    at _SFSRoomManager_GetRoomById_m2771480811 (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1735242:9)
    at _SFSRoomManager_ReplaceRoom_m2430389055 (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1603017:7)
    at Array._SFSRoomManager_ReplaceRoom_m1793880446 (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1823624:9)
    at __ZN21InterfaceFuncInvoker1IP12Il2CppObjectS1_E6InvokeEjP11Il2CppClassPvS1_ [undefined?_? InterfaceFuncInvoker1<Il2CppObject?S?*, undefined?1?>()] (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1649999:50)
    at _SystemController_PopulateRoomList_m139293013 (blob:http://localhost/653f150e-a6d5-4715-a492-ec3f9bb7b2ee:1491421:4)


The server shows a connection but no server side errors and shortly after an idle disconnect.

With the exceptions enabled, I get no client side error message and the server shows the error about creating a room over WS.

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 21 guests