Switching between pages, without disconnect possible

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

FrankBov
Posts: 10
Joined: 06 Aug 2014, 17:59

Switching between pages, without disconnect possible

Postby FrankBov » 02 Oct 2014, 14:33

In our game, we would like to switch pages (to prevent massive asset loads) between the "player hub" with stats and a list of available games and an actual game. In the player hub you login.

The actual game will be played in a different page. But I do not want to have the player login again. A dirty way would be to pass the login/username to the new page, but that would be really unsafe.
Are there any best practices (or any features) to support this?

In short what I would like to do:
player hub page -> start game -> reload webpage to game page -> automatically login to zone and join gameroom

Any help is welcome.

Kind regards,

Frank
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Switching between pages, without disconnect possible

Postby Lapo » 03 Oct 2014, 09:22

In short no.
If you change url you will kill all elements in the page including the connection object and everything else. This isn't different from plugin-base technologies were similiarly if you change page you kill the Flash/Unity player.

With HTML5 you can optimize asset loading without the need to change pages. You can load assets on demand (e.g. between levels, or only for visible areas) and unload them when necessary.
Take a look here, for example:
http://www.html5gamedevs.com/topic/7196 ... ng-assets/

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

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 13 guests