In my current WebGL based game, everything appears to be working fine right up until the moment the player attempts to navigate away from the page, at which point I'm receiving the following error, which leads to a multitude of "unexpected abort" errors. I had originally thought that the issue stemmed from Unity's "preview" WebGL implementation, but closer inspection seems to point to an interrupted EndSessionRequest as being the root of the problem.
I've [removed] a few bits, but the gist of the error is:
"The connection to wss://gsp-aeu000-se02.gamesparks.net/ws/[removed]?deviceOS=WP8&deviceID=[removed]&SDK=?deviceOS=WP8&deviceID=[removed]&SDK= was interrupted while the page was loading." (Any idea why the deviceID & SDK bits are passed twice? *shrug*)
I presume the interruption is occurring because the EndSessionRequest is being sent off, but not returned before the user navigates to another web page. Is there some way that I can keep the navigation from taking place until a response is returned, gracefully closing the connection, or is there some other way that I should be handling this? Any advice would be greatly appreciated.
Best Answer
K
Kenneth Rougeau
said
over 7 years ago
For anyone curious, I managed to get rid of my giant cloudy window of JS Console errors (Chrome, Unity 5.1.2f WebGL build) and stop the EndSession request from being interrupted by adding the following code into the Start function of my connection manager script and adding an OnApplicationQuit function later to call EndSession manually. Seems to be working well now :)
For anyone curious, I managed to get rid of my giant cloudy window of JS Console errors (Chrome, Unity 5.1.2f WebGL build) and stop the EndSession request from being interrupted by adding the following code into the Start function of my connection manager script and adding an OnApplicationQuit function later to call EndSession manually. Seems to be working well now :)
For anyone curious, I managed to get rid of my giant cloudy window of JS Console errors (Chrome, Unity 5.1.2f WebGL build) and stop the EndSession request from being interrupted by adding the following code into the Start function of my connection manager script and adding an OnApplicationQuit function later to call EndSession manually. Seems to be working well now :)
Okay, so it looks like I need to make use of the Player Disconnected (and likely Connected) sections of the System specific Cloud Code area in order to somehow setup a graceful disconnect. Hopefully I can figure it out ;) I'll be poring over the documentation and trying a few experimental passes later today. With luck, I'll be able to figure out how to avoid the above interruption, as well as handle some additional disconnect logic, such as checking to see if the player was in the middle of a level when they closed the game, and then taking away a life if they were. Fun, fun.
As ever, any additional advice or information would be greatly appreciated since the existing documentation really doesn't supply much in the way of coding examples beyond JSON queries / responses.
K
Kenneth Rougeau
said
over 7 years ago
My apologies if this question came through several times. I was receiving errors from the site that made it look as though nothing had gone through.
Kenneth Rougeau
In my current WebGL based game, everything appears to be working fine right up until the moment the player attempts to navigate away from the page, at which point I'm receiving the following error, which leads to a multitude of "unexpected abort" errors. I had originally thought that the issue stemmed from Unity's "preview" WebGL implementation, but closer inspection seems to point to an interrupted EndSessionRequest as being the root of the problem.
I've [removed] a few bits, but the gist of the error is:
"The connection to wss://gsp-aeu000-se02.gamesparks.net/ws/[removed]?deviceOS=WP8&deviceID=[removed]&SDK=?deviceOS=WP8&deviceID=[removed]&SDK= was interrupted while the page was loading."
(Any idea why the deviceID & SDK bits are passed twice? *shrug*)
I presume the interruption is occurring because the EndSessionRequest is being sent off, but not returned before the user navigates to another web page. Is there some way that I can keep the navigation from taking place until a response is returned, gracefully closing the connection, or is there some other way that I should be handling this? Any advice would be greatly appreciated.
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstIrakli Geleishvili
Thanks for sharing the solution!
Kenneth Rougeau
Kenneth Rougeau
Kenneth Rougeau
Okay, so it looks like I need to make use of the Player Disconnected (and likely Connected) sections of the System specific Cloud Code area in order to somehow setup a graceful disconnect. Hopefully I can figure it out ;) I'll be poring over the documentation and trying a few experimental passes later today. With luck, I'll be able to figure out how to avoid the above interruption, as well as handle some additional disconnect logic, such as checking to see if the player was in the middle of a level when they closed the game, and then taking away a life if they were. Fun, fun.
As ever, any additional advice or information would be greatly appreciated since the existing documentation really doesn't supply much in the way of coding examples beyond JSON queries / responses.
Kenneth Rougeau
My apologies if this question came through several times. I was receiving errors from the site that made it look as though nothing had gone through.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics