HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

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

Moderators: Lapo, Bax

duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 22 Mar 2018, 02:17

Hi,

My game have some lobby rooms in same zone. Every time i switch to new lobby, the system will unsubscribe room group from old lobby and also subscribe new room group. Then i back to old lobby but the game rooms still persist, although in fact these rooms be removed from the server.

Does anyone know how to solve this issue?

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

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Lapo » 22 Mar 2018, 09:16

Hi,
the persistence of a Room is not related with which groups you have subscribed/unsubscribed.

The life cycle of a Room is dictated by the type of Room (standard, game etc...) and can be overridden via the RoomRemoveMode if it was created on the server side.

The basic rules are that:
Standard Rooms are removed when the Room is empty and its creator has gone offline
Game Rooms are removed when the Room is empty

For all the details I'd recommend the docs here:
http://docs2x.smartfoxserver.com/Develo ... chitecture

See the "The Room advanced settings" section.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 22 Mar 2018, 09:44

Hi Lapo,

Everything on server working correctly. Rooms will automatically removed when the game are finished. The only issue i am facing are switching lobby.

For example:

1. Current user login and go to lobby A, subscribe group "lobbyA". At this time lobbyA have some game rooms(ex: game1,game2,game3) are running by other users.

2. Current user switch to lobby B, subscribe group "lobbyB" and unsubscribe lobbyA. After some mins i switch back to LobbyA. This time game1 are already finished from other users and they gone, the room are removed by server side already. But game1 was not be deleted from roomManager object.

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

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Lapo » 22 Mar 2018, 09:47

The fact that objects are still available in the RoomManager may be correct, but you obtain the list of Rooms from the SubscribeRoom event, you don't get them directly from the RoomManager.

In other words when you subscribe to a new Room Group you get the updated room list for the Group in the SFSEvent.ROOM_GROUP_SUBSCRIBE event.

Does this help?
Lapo

--

gotoAndPlay()

...addicted to flash games
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 22 Mar 2018, 10:03

Hi Lapo,

Yes i did this but the deleted rooms are still appear in ROOM_GROUP_SUBSCRIBE event. So i think its an issue with sfs html5 client api. I am using latest version.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Lapo » 22 Mar 2018, 15:49

You're getting deleted Rooms in the ROOM_GROUP_SUBSCRIBE event after they have been deleted?
Can you double check with the admin tool that they are really deleted?

I ask because this doesn't sound like it depends on the specific API (i.e. HTML5) as the Room list is sent by the server so it would be the same for all clients, regardless of the client side technology.

In any case we'll run a test to check this out.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 23 Mar 2018, 00:09

Hi Lapo,

I checked many time and i am sure the rooms are deleted at server side.

Thanks
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Bax » 24 Mar 2018, 11:20

We are testing this and you may have found a bug.
We need to further investigate; will let you know our findings soon.
Thank you.
Paolo Bax
The SmartFoxServer Team
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 26 Mar 2018, 05:57

Thank you Bax and Lapo :)
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Bax » 26 Mar 2018, 08:29

Issue found and (possibly) fixed. If you send us an email, we can send you a prerelease version of the API to check. Thank you.
Paolo Bax
The SmartFoxServer Team
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 26 Mar 2018, 08:50

Hi Bax,

You can send it to my profile email that i used to post to this forum.

Thanks
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 26 Mar 2018, 09:22

Hi Bax,

Could you please zip the file and send again?

Thanks
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby Bax » 26 Mar 2018, 09:30

duylinh013 wrote:Hi Bax,
Could you please zip the file and send again?
Thanks

Did it... did you receive it?
Paolo Bax
The SmartFoxServer Team
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 26 Mar 2018, 09:41

Hi Bax,

I got it and starting to test it right away

Thanks
duylinh013
Posts: 28
Joined: 28 Jul 2016, 01:40

Re: HTML5 client api, rooms not be removed after unsubscribeRoomGroup event

Postby duylinh013 » 26 Mar 2018, 10:44

Hi Bax,

My problem is fixed :). Thank you very much to your smartfox team.


Best Regards

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 37 guests