Remove room

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
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Remove room

Postby janheuninck » 03 May 2013, 21:47

Hi guys,

I'm trying to remove game rooms from the server within my room extension. This is the code I'm using:

Code: Select all

sfsApi.removeRoom(getParentRoom());


The destroy() function of the room extension gets called, but the room itself is not being removed: The SFSRoomManager never logged the "Room removed: {details}" event and the room still appears in the room list in the administration panel.

Any idea what I might be doing wrong?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Remove room

Postby Lapo » 04 May 2013, 07:19

The first requirement for removing a Room is that it is empty.
Also make sure that the Room has the isDynamic flag turned on, static Rooms are not removeable
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Remove room

Postby janheuninck » 04 May 2013, 14:50

The room is empty (1 of our own conditions to remove a room) and it is also marked as dynamic.

I'm firing the removeRoom event in the room extension itself, can this be the problem? (Room can't remove itself?)
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Remove room

Postby Lapo » 05 May 2013, 08:41

The room is empty (1 of our own conditions to remove a room) and it is also marked as dynamic.

Are you sure there's no error on the server side when you call the remove method?
Also I take it that you're using SFSApi.removeRoom(...), right?

I'm firing the removeRoom event in the room extension itself, can this be the problem? (Room can't remove itself?)

No no, you can do that.

See if you have server errors
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Remove room

Postby janheuninck » 06 May 2013, 17:38

Ok, got it to work. In the destroy function I was joining my game loop thread, without realizing that the destroy function was being called from within the game loop thread itself. This caused the thread to wait infinitely.

Topic can be closed :-)

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 71 guests